From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH v3 3/4] drm/i915: Skip CURBASE write when nothing changed Date: Mon, 15 Sep 2014 16:36:38 +0300 Message-ID: <20140915133638.GG12416@intel.com> References: <1410530426-4905-1-git-send-email-ville.syrjala@linux.intel.com> <1410544415-3059-1-git-send-email-ville.syrjala@linux.intel.com> <1410544415-3059-3-git-send-email-ville.syrjala@linux.intel.com> <20140913162010.GP16043@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D54A6E14C for ; Mon, 15 Sep 2014 06:36:57 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140913162010.GP16043@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sat, Sep 13, 2014 at 05:20:10PM +0100, Chris Wilson wrote: > On Fri, Sep 12, 2014 at 08:53:34PM +0300, ville.syrjala@linux.intel.com w= rote: > > From: Ville Syrj=E4l=E4 > > = > > Only write CURBASE when something about the cursor changed. Also > > eliminate the unnecessary posting read after writing CURCNTR. > > = > > Signed-off-by: Ville Syrj=E4l=E4 > > --- > > drivers/gpu/drm/i915/intel_display.c | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > = > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i91= 5/intel_display.c > > index 82c0ad1..60c1aa4 100644 > > --- a/drivers/gpu/drm/i915/intel_display.c > > +++ b/drivers/gpu/drm/i915/intel_display.c > > @@ -8322,16 +8322,18 @@ static void i9xx_update_cursor(struct drm_crtc = *crtc, u32 base) > > cntl |=3D CURSOR_PIPE_CSC_ENABLE; > > } > > = > > - if (intel_crtc->cursor_cntl !=3D cntl) { > > + if (intel_crtc->cursor_cntl !=3D cntl) > > I915_WRITE(CURCNTR(pipe), cntl); > > - POSTING_READ(CURCNTR(pipe)); > > - intel_crtc->cursor_cntl =3D cntl; > > - } > > + > > + if (intel_crtc->cursor_cntl =3D=3D cntl && > > + intel_crtc->cursor_base =3D=3D base) > > + return; > = > I'd vote for doing this first and then > = > I915_WRITE(CURCNTR(pipe), cntl); > = > unconditionally along with the CURBASE flush. So you want to write all the cursor registers unconditionally when anything changes? Would work for CURCNTR, but it would also make CUR_FBC_CTL stand out like a sore thumb since it can't be written uncoditionally. > = > > /* and commit changes on next vblank */ > > I915_WRITE(CURBASE(pipe), base); > > POSTING_READ(CURBASE(pipe)); > > = > > + intel_crtc->cursor_cntl =3D cntl; > > intel_crtc->cursor_base =3D base; > > } > = > -- = > Chris Wilson, Intel Open Source Technology Centre -- = Ville Syrj=E4l=E4 Intel OTC