Merge branch 'gpu-switcher' of /ssd/git//linux-2.6 into drm-next-stage
[safe/jmp/linux-2.6] / drivers / gpu / drm / i915 / i915_drv.c
index 94e74a4..1b2e954 100644 (file)
@@ -49,6 +49,7 @@ unsigned int i915_lvds_downclock = 0;
 module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400);
 
 static struct drm_driver driver;
+extern int intel_agp_enabled;
 
 #define INTEL_VGA_DEVICE(id, info) {           \
        .class = PCI_CLASS_DISPLAY_VGA << 8,    \
@@ -138,13 +139,11 @@ const static struct intel_device_info intel_ironlake_m_info = {
 
 const static struct intel_device_info intel_sandybridge_d_info = {
        .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1,
-       .has_pipe_cxsr = 1,
        .has_hotplug = 1,
 };
 
 const static struct intel_device_info intel_sandybridge_m_info = {
-       .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1,
-       .has_pipe_cxsr = 1,
+       .is_i965g = 1, .is_mobile = 1, .is_i9xx = 1, .need_gfx_hws = 1,
        .has_hotplug = 1,
 };
 
@@ -215,7 +214,7 @@ static int i915_drm_freeze(struct drm_device *dev)
        return 0;
 }
 
-static int i915_suspend(struct drm_device *dev, pm_message_t state)
+int i915_suspend(struct drm_device *dev, pm_message_t state)
 {
        int error;
 
@@ -269,7 +268,7 @@ static int i915_drm_thaw(struct drm_device *dev)
        return error;
 }
 
-static int i915_resume(struct drm_device *dev)
+int i915_resume(struct drm_device *dev)
 {
        if (pci_enable_device(dev->pdev))
                return -EIO;
@@ -560,6 +559,11 @@ static struct drm_driver driver = {
 
 static int __init i915_init(void)
 {
+       if (!intel_agp_enabled) {
+               DRM_ERROR("drm/i915 can't work without intel_agp module!\n");
+               return -ENODEV;
+       }
+
        driver.num_ioctls = i915_max_ioctl;
 
        i915_gem_shrinker_init();