[Intel-gfx] [PATCH 21/26] drm/i915: Pass dev_priv to rest of IS_FOO() macros for the old platforms

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Mon Oct 31 20:37:20 UTC 2016


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Unify our approach to things by passing around dev_priv instead of dev.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h        | 8 ++++----
 drivers/gpu/drm/i915/i915_gem_stolen.c | 4 ++--
 drivers/gpu/drm/i915/intel_pm.c        | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index bb170f32dce0..c142fd07a7a3 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2716,12 +2716,12 @@ struct drm_i915_cmd_table {
 
 #define IS_I830(dev_priv)	(INTEL_DEVID(dev_priv) == 0x3577)
 #define IS_845G(dev_priv)	(INTEL_DEVID(dev_priv) == 0x2562)
-#define IS_I85X(dev)		(INTEL_INFO(dev)->is_i85x)
+#define IS_I85X(dev_priv)	((dev_priv)->info.is_i85x)
 #define IS_I865G(dev_priv)	(INTEL_DEVID(dev_priv) == 0x2572)
-#define IS_I915G(dev)		(INTEL_INFO(dev)->is_i915g)
+#define IS_I915G(dev_priv)	((dev_priv)->info.is_i915g)
 #define IS_I915GM(dev_priv)	(INTEL_DEVID(dev_priv) == 0x2592)
 #define IS_I945G(dev_priv)	(INTEL_DEVID(dev_priv) == 0x2772)
-#define IS_I945GM(dev)		(INTEL_INFO(dev)->is_i945gm)
+#define IS_I945GM(dev_priv)	((dev_priv)->info.is_i945gm)
 #define IS_BROADWATER(dev_priv)	((dev_priv)->info.is_broadwater)
 #define IS_CRESTLINE(dev_priv)	((dev_priv)->info.is_crestline)
 #define IS_GM45(dev_priv)	(INTEL_DEVID(dev_priv) == 0x2A42)
@@ -2729,7 +2729,7 @@ struct drm_i915_cmd_table {
 #define IS_PINEVIEW_G(dev_priv)	(INTEL_DEVID(dev_priv) == 0xa001)
 #define IS_PINEVIEW_M(dev_priv)	(INTEL_DEVID(dev_priv) == 0xa011)
 #define IS_PINEVIEW(dev_priv)	((dev_priv)->info.is_pineview)
-#define IS_G33(dev)		(INTEL_INFO(dev)->is_g33)
+#define IS_G33(dev_priv)	((dev_priv)->info.is_g33)
 #define IS_IRONLAKE_M(dev_priv)	(INTEL_DEVID(dev_priv) == 0x0046)
 #define IS_IVYBRIDGE(dev_priv)	((dev_priv)->info.is_ivybridge)
 #define IS_IVB_GT1(dev_priv)	(INTEL_DEVID(dev_priv) == 0x0156 || \
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 1a63ffa4d189..3725a1d3b254 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -109,7 +109,7 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev)
 	 *
 	 */
 	base = 0;
-	if (INTEL_INFO(dev)->gen >= 3) {
+	if (INTEL_GEN(dev_priv) >= 3) {
 		u32 bsm;
 
 		pci_read_config_dword(pdev, INTEL_BSM, &bsm);
@@ -138,7 +138,7 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev)
 					 I865_TOUD, &toud);
 
 		base = (toud << 16) + tseg_size;
-	} else if (IS_I85X(dev)) {
+	} else if (IS_I85X(dev_priv)) {
 		u32 tseg_size = 0;
 		u32 tom;
 		u8 tmp;
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 4cdfd881ab05..70c2aa6b9ac0 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -1529,7 +1529,7 @@ static void i9xx_update_wm(struct intel_crtc *unused_crtc)
 	int planea_wm, planeb_wm;
 	struct intel_crtc *crtc, *enabled = NULL;
 
-	if (IS_I945GM(dev))
+	if (IS_I945GM(dev_priv))
 		wm_info = &i945_wm_info;
 	else if (!IS_GEN2(dev_priv))
 		wm_info = &i915_wm_info;
-- 
2.7.4



More information about the Intel-gfx mailing list