drm/i915: Make HAS_RUNTIME_PM only take dev_priv
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 13 Oct 2016 10:02:55 +0000 (11:02 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fri, 14 Oct 2016 11:23:19 +0000 (12:23 +0100)
Saves 960 bytes of .rodata strings.

v2: Add parantheses around dev_priv. (Ville Syrjala)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Jani Nikula <jani.nikula@linux.intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_runtime_pm.c

index 8c3d4761dfa0df767e7b6461c29b361dbc60c0e8..8183743ef422684e5ad49459d0a1ede0a6cfbdc8 100644 (file)
@@ -2285,7 +2285,7 @@ static int intel_runtime_suspend(struct device *kdev)
        if (WARN_ON_ONCE(!(dev_priv->rps.enabled && intel_enable_rc6())))
                return -ENODEV;
 
-       if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev)))
+       if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev_priv)))
                return -ENODEV;
 
        DRM_DEBUG_KMS("Suspending device\n");
@@ -2389,7 +2389,7 @@ static int intel_runtime_resume(struct device *kdev)
        struct drm_i915_private *dev_priv = to_i915(dev);
        int ret = 0;
 
-       if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev)))
+       if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev_priv)))
                return -ENODEV;
 
        DRM_DEBUG_KMS("Resuming device\n");
index 04f4a4f7dbd0b09f430bec461b6c68bfd9006fa2..2cad4d74109c419ddc9f3cf1aae0de5fdb3c8c97 100644 (file)
@@ -2814,12 +2814,12 @@ struct drm_i915_cmd_table {
 #define HAS_DDI(dev_priv)      ((dev_priv)->info.has_ddi)
 #define HAS_FPGA_DBG_UNCLAIMED(dev)    (INTEL_INFO(dev)->has_fpga_dbg)
 #define HAS_PSR(dev)           (INTEL_INFO(dev)->has_psr)
-#define HAS_RUNTIME_PM(dev)    (INTEL_INFO(dev)->has_runtime_pm)
 #define HAS_RC6(dev)           (INTEL_INFO(dev)->has_rc6)
 #define HAS_RC6p(dev)          (INTEL_INFO(dev)->has_rc6p)
 
 #define HAS_CSR(dev)   (INTEL_INFO(dev)->has_csr)
 
+#define HAS_RUNTIME_PM(dev_priv) ((dev_priv)->info.has_runtime_pm)
 /*
  * For now, anything with a GuC requires uCode loading, and then supports
  * command submission once loaded. But these are logically independent
index 6c11168facd63c7fd18eeb64e49abfa283e9c87a..ed1faf14f777167b1073fccb73b133153e870b10 100644 (file)
@@ -2758,7 +2758,6 @@ void intel_runtime_pm_put(struct drm_i915_private *dev_priv)
 void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
 {
        struct pci_dev *pdev = dev_priv->drm.pdev;
-       struct drm_device *dev = &dev_priv->drm;
        struct device *kdev = &pdev->dev;
 
        pm_runtime_set_autosuspend_delay(kdev, 10000); /* 10s */
@@ -2770,7 +2769,7 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
         * so the driver's own RPM reference tracking asserts also work on
         * platforms without RPM support.
         */
-       if (!HAS_RUNTIME_PM(dev)) {
+       if (!HAS_RUNTIME_PM(dev_priv)) {
                pm_runtime_dont_use_autosuspend(kdev);
                pm_runtime_get_sync(kdev);
        } else {