aboutsummaryrefslogtreecommitdiff
path: root/shared-core/i915_dma.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-07-30 16:26:51 +1000
committerDave Airlie <airlied@redhat.com>2008-07-30 16:26:59 +1000
commit02b09d271c60d13fbb738c7053429a3b816397db (patch)
tree4904a228c425a7f1ac37e9cc96c038d8fe3246eb /shared-core/i915_dma.c
parent90b90c65dc78648ddded5eff7628749182c73295 (diff)
i915: add version checks for opregion on old kernels
Diffstat (limited to 'shared-core/i915_dma.c')
-rw-r--r--shared-core/i915_dma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index e57580fe..47f1f463 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -1038,8 +1038,10 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
intel_init_chipset_flush_compat(dev);
#endif
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)
intel_opregion_init(dev);
#endif
+#endif
I915_WRITE16(HWSTAM, 0xeffe);
I915_WRITE16(IMR, 0x0);
@@ -1097,8 +1099,10 @@ int i915_driver_unload(struct drm_device *dev)
drm_rmmap(dev, dev_priv->mmio_map);
#ifdef __linux__
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)
intel_opregion_free(dev);
#endif
+#endif
drm_free(dev->dev_private, sizeof(drm_i915_private_t),
DRM_MEM_DRIVER);