From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 06/10] drm/i915: check the power down well on assert_pipe() Date: Tue, 22 Jan 2013 14:04:09 +0100 Message-ID: <20130122130409.GK31870@phenom.ffwll.local> References: <1358540953-3979-1-git-send-email-przanoni@gmail.com> <1358540953-3979-7-git-send-email-przanoni@gmail.com> <20130121134548.GC9135@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E413E5C24 for ; Tue, 22 Jan 2013 05:02:04 -0800 (PST) Received: by mail-wg0-f54.google.com with SMTP id fg15so4340638wgb.33 for ; Tue, 22 Jan 2013 05:02:04 -0800 (PST) Content-Disposition: inline In-Reply-To: <20130121134548.GC9135@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 =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Mon, Jan 21, 2013 at 03:45:48PM +0200, Ville Syrj=E4l=E4 wrote: > On Fri, Jan 18, 2013 at 06:29:08PM -0200, Paulo Zanoni wrote: > > From: Paulo Zanoni > > = > > If the power well is disabled, we should not try to read its > > registers, otherwise we'll get "unclaimed register" messages. > > = > > Signed-off-by: Paulo Zanoni > > --- > > drivers/gpu/drm/i915/intel_display.c | 12 +++++++++--- > > 1 file changed, 9 insertions(+), 3 deletions(-) > > = > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i91= 5/intel_display.c > > index a7fb7e1..921b020 100644 > > --- a/drivers/gpu/drm/i915/intel_display.c > > +++ b/drivers/gpu/drm/i915/intel_display.c > > @@ -1214,9 +1214,15 @@ void assert_pipe(struct drm_i915_private *dev_pr= iv, > > if (pipe =3D=3D PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) > > state =3D true; > > = > > - reg =3D PIPECONF(cpu_transcoder); > > - val =3D I915_READ(reg); > > - cur_state =3D !!(val & PIPECONF_ENABLE); > > + if (cpu_transcoder =3D=3D TRANSCODER_EDP || > > + (I915_READ(HSW_PWR_WELL_DRIVER) & HSW_PWR_WELL_STATE)) { > = > Should that also check HSW_PWR_WELL_ENABLE? KVMR might have the well > enabled, while the driver has it disabled. But KVMR might have already > disabled the well, and it might get disabled just after this check, > and then you would hit the unclaimed register issue again. The important matter is to not read registers in the power well if it's off, for which checking just one of the three bits is enough. If the kvm keeps the power well on, we just avoid checking the pipe state if we don't need the power well, but otherwise no side effect. Otoh just one set bit makes sure that the power well is on and we can read the regs). So looks good to me. -Daniel > = > > + reg =3D PIPECONF(cpu_transcoder); > > + val =3D I915_READ(reg); > > + cur_state =3D !!(val & PIPECONF_ENABLE); > > + } else { > > + cur_state =3D false; > > + } > > + > > WARN(cur_state !=3D state, > > "pipe %c assertion failure (expected %s, current %s)\n", > > pipe_name(pipe), state_string(state), state_string(cur_state)); > > -- = > > 1.7.10.4 > > = > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx > = > -- = > Ville Syrj=E4l=E4 > Intel OTC > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch