i915: add version checks for opregion on old kernels
authorDave Airlie <airlied@redhat.com>
Wed, 30 Jul 2008 06:26:51 +0000 (16:26 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 30 Jul 2008 06:26:59 +0000 (16:26 +1000)
linux-core/i915_opregion.c
shared-core/i915_dma.c

index e691571..fdd4987 100644 (file)
@@ -32,6 +32,7 @@
 #include "i915_drm.h"
 #include "i915_drv.h"
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)
 #define PCI_ASLE 0xe4
 #define PCI_ASLS 0xfc
 
@@ -384,3 +385,4 @@ void intel_opregion_free(struct drm_device *dev)
        
        opregion->enabled = 0;
 }
+#endif
index e57580f..47f1f46 100644 (file)
@@ -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);