From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Roper Subject: Re: [PATCH 3/6] drm/i915/skl: Actually reuse wm values when pipes don't change Date: Wed, 20 Jul 2016 16:26:50 -0700 Message-ID: <20160720232650.GD1579@intel.com> References: <1469048403-32016-1-git-send-email-cpaul@redhat.com> <1469048403-32016-4-git-send-email-cpaul@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1469048403-32016-4-git-send-email-cpaul@redhat.com> Sender: stable-owner@vger.kernel.org To: Lyude Cc: intel-gfx@lists.freedesktop.org, stable@vger.kernel.org, Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Daniel Vetter , Radhakrishna Sripada , Jani Nikula , David Airlie , "open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...), linux-kernel@vger.kernel.org (open list)" List-Id: intel-gfx@lists.freedesktop.org On Wed, Jul 20, 2016 at 04:59:59PM -0400, Lyude wrote: > Up until now we've actually been making the mistake of leaving the > watermark results for each pipe completely blank in skl_compute_wm() > when they haven't changed, fix this. Should this be moved before patch #1? With the existing code we don't try to re-write watermark registers if they aren't changing, so leaving them at zero should be safe. I think we want to make this change befor= e we start re-writing non-dirty watermarks. Alternatively, we could just add the dirty bit test to the appropriate places in patch #1 and not worry about copying over the unchanged values. Matt >=20 > Fixes: 734fa01f3a17 ("drm/i915/gen9: Calculate watermarks during atom= ic 'check' (v2)") > Cc: stable@vger.kernel.org > Cc: Ville Syrj=E4l=E4 > Cc: Daniel Vetter > Cc: Radhakrishna Sripada > Cc: Hans de Goede > Cc: Matt Roper > Signed-off-by: Lyude > --- > drivers/gpu/drm/i915/intel_pm.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/i= ntel_pm.c > index b7d4af1..788db86 100644 > --- a/drivers/gpu/drm/i915/intel_pm.c > +++ b/drivers/gpu/drm/i915/intel_pm.c > @@ -3987,10 +3987,13 @@ skl_copy_wm_for_pipe(struct skl_wm_values *ds= t, > static int > skl_compute_wm(struct drm_atomic_state *state) > { > + struct drm_device *dev =3D state->dev; > + struct drm_i915_private *dev_priv =3D to_i915(dev); > struct drm_crtc *crtc; > struct drm_crtc_state *cstate; > struct intel_atomic_state *intel_state =3D to_intel_atomic_state(st= ate); > struct skl_wm_values *results =3D &intel_state->wm_results; > + struct skl_wm_values *hw_wm =3D &dev_priv->wm.skl_hw; > struct skl_pipe_wm *pipe_wm; > bool changed =3D false; > int ret, i; > @@ -4039,12 +4042,14 @@ skl_compute_wm(struct drm_atomic_state *state= ) > if (changed) > results->dirty_pipes |=3D drm_crtc_mask(crtc); > =20 > - if ((results->dirty_pipes & drm_crtc_mask(crtc)) =3D=3D 0) > + if ((results->dirty_pipes & drm_crtc_mask(crtc)) =3D=3D 0) { > /* This pipe's WM's did not change */ > + skl_copy_wm_for_pipe(results, hw_wm, intel_crtc->pipe); > continue; > + } > =20 > intel_cstate->update_wm_pre =3D true; > - skl_compute_wm_results(crtc->dev, pipe_wm, results, intel_crtc); > + skl_compute_wm_results(dev, pipe_wm, results, intel_crtc); > } > =20 > return 0; > --=20 > 2.7.4 >=20 --=20 Matt Roper Graphics Software Engineer IoTG Platform Enabling & Development Intel Corporation (916) 356-2795