diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2016-10-13 06:02:55 -0400 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2016-10-14 07:23:19 -0400 |
commit | 6772ffe0235937414e6ab2de0f44adb1cb794408 (patch) | |
tree | 78b952ea49fcf98297dbb8231a0c1b9f9a4ac3c0 /drivers/gpu/drm/i915 | |
parent | 49cff963dd14ecc4520ad094afa258cbeee4bb23 (diff) |
drm/i915: Make HAS_RUNTIME_PM only take dev_priv
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>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_runtime_pm.c | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 8c3d4761dfa0..8183743ef422 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -2285,7 +2285,7 @@ static int intel_runtime_suspend(struct device *kdev) | |||
2285 | if (WARN_ON_ONCE(!(dev_priv->rps.enabled && intel_enable_rc6()))) | 2285 | if (WARN_ON_ONCE(!(dev_priv->rps.enabled && intel_enable_rc6()))) |
2286 | return -ENODEV; | 2286 | return -ENODEV; |
2287 | 2287 | ||
2288 | if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev))) | 2288 | if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev_priv))) |
2289 | return -ENODEV; | 2289 | return -ENODEV; |
2290 | 2290 | ||
2291 | DRM_DEBUG_KMS("Suspending device\n"); | 2291 | DRM_DEBUG_KMS("Suspending device\n"); |
@@ -2389,7 +2389,7 @@ static int intel_runtime_resume(struct device *kdev) | |||
2389 | struct drm_i915_private *dev_priv = to_i915(dev); | 2389 | struct drm_i915_private *dev_priv = to_i915(dev); |
2390 | int ret = 0; | 2390 | int ret = 0; |
2391 | 2391 | ||
2392 | if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev))) | 2392 | if (WARN_ON_ONCE(!HAS_RUNTIME_PM(dev_priv))) |
2393 | return -ENODEV; | 2393 | return -ENODEV; |
2394 | 2394 | ||
2395 | DRM_DEBUG_KMS("Resuming device\n"); | 2395 | DRM_DEBUG_KMS("Resuming device\n"); |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 04f4a4f7dbd0..2cad4d74109c 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -2814,12 +2814,12 @@ struct drm_i915_cmd_table { | |||
2814 | #define HAS_DDI(dev_priv) ((dev_priv)->info.has_ddi) | 2814 | #define HAS_DDI(dev_priv) ((dev_priv)->info.has_ddi) |
2815 | #define HAS_FPGA_DBG_UNCLAIMED(dev) (INTEL_INFO(dev)->has_fpga_dbg) | 2815 | #define HAS_FPGA_DBG_UNCLAIMED(dev) (INTEL_INFO(dev)->has_fpga_dbg) |
2816 | #define HAS_PSR(dev) (INTEL_INFO(dev)->has_psr) | 2816 | #define HAS_PSR(dev) (INTEL_INFO(dev)->has_psr) |
2817 | #define HAS_RUNTIME_PM(dev) (INTEL_INFO(dev)->has_runtime_pm) | ||
2818 | #define HAS_RC6(dev) (INTEL_INFO(dev)->has_rc6) | 2817 | #define HAS_RC6(dev) (INTEL_INFO(dev)->has_rc6) |
2819 | #define HAS_RC6p(dev) (INTEL_INFO(dev)->has_rc6p) | 2818 | #define HAS_RC6p(dev) (INTEL_INFO(dev)->has_rc6p) |
2820 | 2819 | ||
2821 | #define HAS_CSR(dev) (INTEL_INFO(dev)->has_csr) | 2820 | #define HAS_CSR(dev) (INTEL_INFO(dev)->has_csr) |
2822 | 2821 | ||
2822 | #define HAS_RUNTIME_PM(dev_priv) ((dev_priv)->info.has_runtime_pm) | ||
2823 | /* | 2823 | /* |
2824 | * For now, anything with a GuC requires uCode loading, and then supports | 2824 | * For now, anything with a GuC requires uCode loading, and then supports |
2825 | * command submission once loaded. But these are logically independent | 2825 | * command submission once loaded. But these are logically independent |
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index 6c11168facd6..ed1faf14f777 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c | |||
@@ -2758,7 +2758,6 @@ void intel_runtime_pm_put(struct drm_i915_private *dev_priv) | |||
2758 | void intel_runtime_pm_enable(struct drm_i915_private *dev_priv) | 2758 | void intel_runtime_pm_enable(struct drm_i915_private *dev_priv) |
2759 | { | 2759 | { |
2760 | struct pci_dev *pdev = dev_priv->drm.pdev; | 2760 | struct pci_dev *pdev = dev_priv->drm.pdev; |
2761 | struct drm_device *dev = &dev_priv->drm; | ||
2762 | struct device *kdev = &pdev->dev; | 2761 | struct device *kdev = &pdev->dev; |
2763 | 2762 | ||
2764 | pm_runtime_set_autosuspend_delay(kdev, 10000); /* 10s */ | 2763 | pm_runtime_set_autosuspend_delay(kdev, 10000); /* 10s */ |
@@ -2770,7 +2769,7 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv) | |||
2770 | * so the driver's own RPM reference tracking asserts also work on | 2769 | * so the driver's own RPM reference tracking asserts also work on |
2771 | * platforms without RPM support. | 2770 | * platforms without RPM support. |
2772 | */ | 2771 | */ |
2773 | if (!HAS_RUNTIME_PM(dev)) { | 2772 | if (!HAS_RUNTIME_PM(dev_priv)) { |
2774 | pm_runtime_dont_use_autosuspend(kdev); | 2773 | pm_runtime_dont_use_autosuspend(kdev); |
2775 | pm_runtime_get_sync(kdev); | 2774 | pm_runtime_get_sync(kdev); |
2776 | } else { | 2775 | } else { |