drm/i915: Introduce i9xx_has_pps()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 18 Mar 2019 16:56:30 +0000 (18:56 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 20 Mar 2019 14:58:59 +0000 (16:58 +0200)
Add a small helper to determine if we have the panel power
sequencer or not. We'll make PNV an exceptional case so
that we can unset .is_mobile for the desktop variant.

Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190318165633.28924-3-ville.syrjala@linux.intel.com
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/intel_display.c

index 713d2651219ee06688293147879b236cd24aba14..01cdd6e745c3dd8820ef9f003e47a9fd51379fe6 100644 (file)
@@ -1442,6 +1442,14 @@ static void chv_enable_pll(struct intel_crtc *crtc,
        }
 }
 
+static bool i9xx_has_pps(struct drm_i915_private *dev_priv)
+{
+       if (IS_I830(dev_priv))
+               return false;
+
+       return IS_PINEVIEW(dev_priv) || IS_MOBILE(dev_priv);
+}
+
 static void i9xx_enable_pll(struct intel_crtc *crtc,
                            const struct intel_crtc_state *crtc_state)
 {
@@ -1453,7 +1461,7 @@ static void i9xx_enable_pll(struct intel_crtc *crtc,
        assert_pipe_disabled(dev_priv, crtc->pipe);
 
        /* PLL is protected by panel, make sure we can write it */
-       if (IS_MOBILE(dev_priv) && !IS_I830(dev_priv))
+       if (i9xx_has_pps(dev_priv))
                assert_panel_unlocked(dev_priv, crtc->pipe);
 
        /*