From: Chris Wilson Subject: Re: [PATCH 30/35] drm/i915: Replace the ILK/SNB/IVB/HSW watermark code Date: Fri, 5 Jul 2013 10:37:08 +0100 Message-ID: <20130705093708.GF8451@cantiga.alporthouse.com> References: <1373014667-19484-1-git-send-email-ville.syrjala@linux.intel.com> <1373014667-19484-31-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from fireflyinternet.com (unknown [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id AD3CFE65E1 for ; Fri, 5 Jul 2013 02:37:14 -0700 (PDT) Received: from fireflyinternet.com (unverified [87.106.93.118]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 129467822-1500050 for ; Fri, 05 Jul 2013 10:37:09 +0100 Content-Disposition: inline In-Reply-To: <1373014667-19484-31-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Jul 05, 2013 at 11:57:42AM +0300, ville.syrjala@linux.intel.com wro= te: > From: Ville Syrj=E4l=E4 > = > There is a major problem with the watermark registers; they're not > double buffered. So we need to make sure we update them at the correct > time when messing about with planes. The correct time is the beginning > of vblank. > = > So when we determine that the watermarks need to updated hand in hand > with the next vblank, we store the pre-computed watermarks under > intel_crtc, and when the vblank happens, we promote the pending > watermarks to active status. > = > on HSW when the watermarks for any pipe change, we must merge the > watermarks from all pipes so that we can determine the correct LP1+ > watermark levels. For simplicity we follow the same codepaths for > pre-HSW hardware as well, but there all the LP1+ watermarks will be > disabled when multiple pipes are enabled. Once the watermarks are > merged we check them for validity, disabling any invalid levels. > = > Touching the watermark registers causes the hardware to re-evaluate the > watermarks, which expeds some power. So after merging the watermarks > we check which watermark registers actually need to be changed. And > finally we write the watermarks registers in the correct order. Yet you do not justify doing so from interrupt context. A simple way would be to set safe WM (min of current vs next) before the config change, then schedule an update outside of interrupt context after the vblank. I really want an explanation for why doing so in interrupt context is the only sane way. Real power numbers vs complexity please. -Chris -- = Chris Wilson, Intel Open Source Technology Centre