drm/i915: Pass dev_priv to rest of IS_FOO() macros for the old platforms
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 31 Oct 2016 20:37:20 +0000 (22:37 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 1 Nov 2016 14:40:38 +0000 (16:40 +0200)
Unify our approach to things by passing around dev_priv instead of dev.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1477946245-14134-22-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem_stolen.c
drivers/gpu/drm/i915/intel_pm.c

index 888ddf8fbeeb00ebb69a95e9e5691606c6ad91e6..63672c3c1118fbd2fa04249a3b8244f4494a1c71 100644 (file)
@@ -2723,12 +2723,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)
@@ -2736,7 +2736,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 || \
index 1a63ffa4d1899f0397b3395a00d9529c7a982a27..3725a1d3b254c91baf59d8cb3d9fd19ea508a74b 100644 (file)
@@ -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;
index afd3babc4a9d9193296a146887aa07e40671a099..7199f853b3a05cc726ff7d037fd5e39bc3833d1e 100644 (file)
@@ -1530,7 +1530,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;