On Tue, Mar 19, 2019 at 01:24:16PM +0000, Tvrtko Ursulin wrote: > > On 18/03/2019 16:56, Ville Syrjala wrote: > > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > > > > Make the code self-documenting by introducing i9xx_has_pfit(). > > Also make PNV an exceptional case so that we can unset > > .is_mobile for the desktop variant. > > > > Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxxxxx> > > Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > > --- > > drivers/gpu/drm/i915/intel_display.c | 12 ++++++++++-- > > 1 file changed, 10 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > > index 61acbaf2af75..0ddd83dbd768 100644 > > --- a/drivers/gpu/drm/i915/intel_display.c > > +++ b/drivers/gpu/drm/i915/intel_display.c > > @@ -7961,14 +7961,22 @@ static int vlv_crtc_compute_clock(struct intel_crtc *crtc, > > return 0; > > } > > > > +static bool i9xx_has_pfit(struct drm_i915_private *dev_priv) > > +{ > > + if (IS_I830(dev_priv)) > > + return false; > > + > > + return IS_GEN(dev_priv, 4) || > > Shouldn't this be INTEL_GEN() >= 4 || ... ? Or even this check alone as > first in the function. Doh. I had it as >=4 initially, but then decided that ilk+ aren't relevant here and tweaked it to gen4 only. Which means I totally forgot about vlv/chv. v2 coming up. > > > + IS_PINEVIEW(dev_priv) || IS_MOBILE(dev_priv); > > +} > > + > > static void i9xx_get_pfit_config(struct intel_crtc *crtc, > > struct intel_crtc_state *pipe_config) > > { > > struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); > > u32 tmp; > > > > - if (INTEL_GEN(dev_priv) <= 3 && > > - (IS_I830(dev_priv) || !IS_MOBILE(dev_priv))) > > + if (!i9xx_has_pfit(dev_priv)) > > return; > > > > tmp = I915_READ(PFIT_CONTROL); > > > > Regards, > > Tvrtko -- Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx