drm/i915: unify switcheroo and legacy suspend/resume handlers
authorImre Deak <imre.deak@intel.com>
Thu, 23 Oct 2014 16:23:27 +0000 (19:23 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 24 Oct 2014 14:34:21 +0000 (16:34 +0200)
By now we handle switcheroo and legacy suspend/resume the same way, so
no need to keep separate functions for them.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h

index 1b398070b2304db1be2a0fe4a22ce43a81462687..9a7353302b3f9a09e44a63c65dfbb2c68a9f240d 100644 (file)
@@ -1275,12 +1275,12 @@ static void i915_switcheroo_set_state(struct pci_dev *pdev, enum vga_switcheroo_
                dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
                /* i915 resume handler doesn't set to D0 */
                pci_set_power_state(dev->pdev, PCI_D0);
-               i915_resume(dev);
+               i915_resume_legacy(dev);
                dev->switch_power_state = DRM_SWITCH_POWER_ON;
        } else {
                pr_err("switched off\n");
                dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
-               i915_suspend(dev, pmm);
+               i915_suspend_legacy(dev, pmm);
                dev->switch_power_state = DRM_SWITCH_POWER_OFF;
        }
 }
index 808f6591317a00464a8f723a5bad1b2188dc3de2..bce58d395b28c9896cfaf12dd49e3d9d3e83df55 100644 (file)
@@ -649,7 +649,7 @@ static int i915_drm_suspend_late(struct drm_device *drm_dev)
        return 0;
 }
 
-int i915_suspend(struct drm_device *dev, pm_message_t state)
+int i915_suspend_legacy(struct drm_device *dev, pm_message_t state)
 {
        int error;
 
@@ -771,7 +771,7 @@ static int i915_drm_resume_early(struct drm_device *dev)
        return ret;
 }
 
-static int i915_resume_legacy(struct drm_device *dev)
+int i915_resume_legacy(struct drm_device *dev)
 {
        int ret;
 
@@ -785,11 +785,6 @@ static int i915_resume_legacy(struct drm_device *dev)
        return i915_drm_resume(dev);
 }
 
-int i915_resume(struct drm_device *dev)
-{
-       return i915_resume_legacy(dev);
-}
-
 /**
  * i915_reset - reset chip after a hang
  * @dev: drm device to reset
@@ -1592,7 +1587,7 @@ static struct drm_driver driver = {
        .set_busid = drm_pci_set_busid,
 
        /* Used in place of i915_pm_ops for non-DRIVER_MODESET */
-       .suspend = i915_suspend,
+       .suspend = i915_suspend_legacy,
        .resume = i915_resume_legacy,
 
        .device_is_agp = i915_driver_device_is_agp,
index 3212d62c3c64c130f2ae08724e6d72759618eef8..059330c7027a85b3df7fee89175bda0f480ec55b 100644 (file)
@@ -2221,8 +2221,8 @@ struct drm_i915_cmd_table {
 extern const struct drm_ioctl_desc i915_ioctls[];
 extern int i915_max_ioctl;
 
-extern int i915_suspend(struct drm_device *dev, pm_message_t state);
-extern int i915_resume(struct drm_device *dev);
+extern int i915_suspend_legacy(struct drm_device *dev, pm_message_t state);
+extern int i915_resume_legacy(struct drm_device *dev);
 extern int i915_master_create(struct drm_device *dev, struct drm_master *master);
 extern void i915_master_destroy(struct drm_device *dev, struct drm_master *master);