drm/i915: Pass dev_priv to IS_MOBILE()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 31 Oct 2016 20:37:14 +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-16-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/intel_display.c
drivers/gpu/drm/i915/intel_sdvo.c

index 60c937dce06f412ed465bcf68e4c71ffa0665cca..474c728a9073c0e76a93875239548852912d8ed2 100644 (file)
@@ -2749,7 +2749,7 @@ struct drm_i915_cmd_table {
 #define IS_SKYLAKE(dev_priv)   ((dev_priv)->info.is_skylake)
 #define IS_BROXTON(dev_priv)   ((dev_priv)->info.is_broxton)
 #define IS_KABYLAKE(dev_priv)  ((dev_priv)->info.is_kabylake)
-#define IS_MOBILE(dev)         (INTEL_INFO(dev)->is_mobile)
+#define IS_MOBILE(dev_priv)    ((dev_priv)->info.is_mobile)
 #define IS_HSW_EARLY_SDV(dev_priv) (IS_HASWELL(dev_priv) && \
                                    (INTEL_DEVID(dev_priv) & 0xFF00) == 0x0C00)
 #define IS_BDW_ULT(dev_priv)   (IS_BROADWELL(dev_priv) && \
index b670ae76317b901008f770a3a6f550d13990053c..50261c5445c633b1d6e88f45f39470627733980b 100644 (file)
@@ -15374,11 +15374,9 @@ static int intel_encoder_clones(struct intel_encoder *encoder)
        return index_mask;
 }
 
-static bool has_edp_a(struct drm_device *dev)
+static bool has_edp_a(struct drm_i915_private *dev_priv)
 {
-       struct drm_i915_private *dev_priv = to_i915(dev);
-
-       if (!IS_MOBILE(dev))
+       if (!IS_MOBILE(dev_priv))
                return false;
 
        if ((I915_READ(DP_A) & DP_DETECTED) == 0)
@@ -15518,7 +15516,7 @@ static void intel_setup_outputs(struct drm_device *dev)
                int found;
                dpd_is_edp = intel_dp_is_edp(dev, PORT_D);
 
-               if (has_edp_a(dev))
+               if (has_edp_a(dev_priv))
                        intel_dp_init(dev, DP_A, PORT_A);
 
                if (I915_READ(PCH_HDMIB) & SDVO_DETECTED) {
index 5d59a48e3249b684888d4a289504109a70bfa228..3990c805a5b5a639c44cb29598539d58d1e13c73 100644 (file)
@@ -2411,10 +2411,10 @@ static void
 intel_sdvo_add_hdmi_properties(struct intel_sdvo *intel_sdvo,
                               struct intel_sdvo_connector *connector)
 {
-       struct drm_device *dev = connector->base.base.dev;
+       struct drm_i915_private *dev_priv = to_i915(connector->base.base.dev);
 
        intel_attach_force_audio_property(&connector->base.base);
-       if (INTEL_INFO(dev)->gen >= 4 && IS_MOBILE(dev)) {
+       if (INTEL_GEN(dev_priv) >= 4 && IS_MOBILE(dev_priv)) {
                intel_attach_broadcast_rgb_property(&connector->base.base);
                intel_sdvo->color_range_auto = true;
        }