Subversion Repositories Kolibri OS

Rev

Rev 2330 | Rev 4104 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2330 Rev 3031
Line 23... Line 23...
23
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
 * SOFTWARE.
24
 * SOFTWARE.
25
 *
25
 *
26
 */
26
 */
Line -... Line 27...
-
 
27
 
-
 
28
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27
 
29
 
28
//#include 
30
//#include 
29
//#include 
31
//#include 
30
//#include 
32
//#include 
-
 
33
#include 
-
 
34
 
31
#include 
35
 
32
#include "drmP.h"
36
#include 
33
#include "i915_drm.h"
37
#include 
34
#include "i915_drv.h"
38
#include "i915_drv.h"
Line 35... Line 39...
35
#include "intel_drv.h"
39
#include "intel_drv.h"
36
 
40
 
Line 146... Line 150...
146
#define ACPI_LVDS_OUTPUT (4<<8)
150
#define ACPI_LVDS_OUTPUT (4<<8)
Line 147... Line 151...
147
 
151
 
148
#ifdef CONFIG_ACPI
152
#ifdef CONFIG_ACPI
Line 149... Line -...
149
#endif
-
 
150
 
-
 
151
static inline int pci_read_config_dword(struct pci_dev *dev, int where,
-
 
152
                    u32 *val)
-
 
153
{
-
 
154
    *val = PciRead32(dev->busnr, dev->devfn, where);
-
 
155
    return 1;
-
 
156
}
153
#endif
157
 
154
 
158
int intel_opregion_setup(struct drm_device *dev)
155
int intel_opregion_setup(struct drm_device *dev)
159
{
156
{
160
	struct drm_i915_private *dev_priv = dev->dev_private;
157
	struct drm_i915_private *dev_priv = dev->dev_private;
161
	struct intel_opregion *opregion = &dev_priv->opregion;
158
	struct intel_opregion *opregion = &dev_priv->opregion;
-
 
159
	void __iomem *base;
162
	void *base;
160
	u32 asls, mboxes;
Line 163... Line 161...
163
	u32 asls, mboxes;
161
	char buf[sizeof(OPREGION_SIGNATURE)];
164
	int err = 0;
162
	int err = 0;
165
 
163
 
Line 172... Line 170...
172
 
170
 
173
    base = ioremap(asls, OPREGION_SIZE);
171
    base = ioremap(asls, OPREGION_SIZE);
174
	if (!base)
172
	if (!base)
Line -... Line 173...
-
 
173
		return -ENOMEM;
-
 
174
 
175
		return -ENOMEM;
175
	memcpy(buf, base, sizeof(buf));
176
 
176
 
177
	if (memcmp(base, OPREGION_SIGNATURE, 16)) {
177
	if (memcmp(buf, OPREGION_SIGNATURE, 16)) {
178
		DRM_DEBUG_DRIVER("opregion signature mismatch\n");
178
		DRM_DEBUG_DRIVER("opregion signature mismatch\n");
179
		err = -EINVAL;
179
		err = -EINVAL;
180
		goto err_out;
180
		goto err_out;
181
	}
181
	}
Line 182... Line 182...
182
	opregion->header = base;
182
	opregion->header = base;
Line 183... Line 183...
183
	opregion->vbt = base + OPREGION_VBT_OFFSET;
183
	opregion->vbt = base + OPREGION_VBT_OFFSET;
184
 
184
 
185
	opregion->lid_state = base + ACPI_CLID;
185
	opregion->lid_state = base + ACPI_CLID;
186
 
186
 
187
	mboxes = opregion->header->mboxes;
187
	mboxes = ioread32(&opregion->header->mboxes);