All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Don't do pre plane update on disabled crtcs
Date: Wed, 20 Jan 2016 13:11:06 +0200	[thread overview]
Message-ID: <20160120111106.GB23290@intel.com> (raw)
In-Reply-To: <569F34AB.2070409@linux.intel.com>

On Wed, Jan 20, 2016 at 08:18:03AM +0100, Maarten Lankhorst wrote:
> Op 19-01-16 om 20:22 schreef Ville Syrjälä:
> > On Mon, Jan 18, 2016 at 11:23:21AM +0100, Maarten Lankhorst wrote:
> >> Op 14-01-16 om 17:52 schreef Ville Syrjälä:
> >>> On Thu, Jan 14, 2016 at 06:32:10PM +0200, Mika Kuoppala wrote:
> >>>> CI/Bat got following (shortened) trace on byt and also
> >>>> on bsw:
> >>>>
> >>>> ------------[ cut here ]-----------
> >>>> Unclaimed register detected before reading register 0x186500
> >>>> Call Trace:
> >>>>  __unclaimed_reg_debug+0x68/0x80 [i915]
> >>>> vlv_read32+0x2de/0x370 [i915]
> >>>> intel_set_memory_cxsr+0x87/0x1a0 [i915]
> >>>> intel_pre_plane_update+0xb3/0xf0 [i915]
> >>>> intel_atomic_commit+0x3b5/0x17c0 [i915]
> >>>> ...
> >>>> ---[ end trace 6387a0ad001bb39f ]---
> >>>>
> >>>> Fix this by limiting pre plane update only to active crtcs.
> >>>>
> >>>> References: https://bugs.freedesktop.org/show_bug.cgi?id=93698
> >>>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> >>>> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> >>>> ---
> >>>>  drivers/gpu/drm/i915/intel_display.c | 3 +--
> >>>>  1 file changed, 1 insertion(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> >>>> index aa24f79d85bf..a134a698d97d 100644
> >>>> --- a/drivers/gpu/drm/i915/intel_display.c
> >>>> +++ b/drivers/gpu/drm/i915/intel_display.c
> >>>> @@ -13580,9 +13580,8 @@ static int intel_atomic_commit(struct drm_device *dev,
> >>>>  		if (!needs_modeset(crtc->state))
> >>>>  			continue;
> >>>>  
> >>>> -		intel_pre_plane_update(intel_crtc);
> >>>> -
> >>>>  		if (crtc_state->active) {
> >>>> +			intel_pre_plane_update(intel_crtc);
> >>> I think you'll want to deal with the other one too (the one in the crtc
> >>> enable/plane update path). Actually I think the plane update stuff
> >>> should be split into a separate loop from the crtc_enable stuff, but
> >>> that's a separate topic.
> >>>
> >>> Hmm. And there's a post_plane_update there that looks a bit too
> >>> lonely as well. Something really should be done to make this code
> >>> less convoluted. A modeset/plane update shouldn't be this hard to
> >>> get right.
> >>>
> >>>
> >> I understand the idea from this comment, but nothing in pre_plane_update should run when crtc was not active. What function is called that does?
> > Staring at the code a bit. I would assume it's due to
> > intel_plane_atomic_calc_changes() setting 'pipe_config->disable_cxsr = true'
> > when the plane gets either turned off or on.
> >
> > This sort of stuff makes me wish again that we had a separate atomic state
> > for the disable case. Using the same state flag for both the disable
> > and enable phases of the operation is very confusing. Would be even
> > more confusing if we required that flag to have different values for the
> > disable and enable phases.
> But cxsr_allowed still needs to be false. Maybe this?
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 5abe97c1a944..bfdf02f7436b 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -4830,7 +4830,8 @@ static void intel_pre_plane_update(struct intel_crtc *crtc)
>  
>  	if (pipe_config->disable_cxsr) {
>  		crtc->wm.cxsr_allowed = false;
> -		intel_set_memory_cxsr(dev_priv, false);
> +		if (!needs_modeset(&pipe_config->base))
> +			intel_set_memory_cxsr(dev_priv, false);

Hmm. Yeah, I suppose that could work. I fear thinking about it is going
to give me a headache. Would really need nice two-stage wm programming
for gmch platforms as well to handle it properly.

>  	}
>  
>  	/*

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-20 11:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 16:32 [PATCH] drm/i915: Don't do pre plane update on disabled crtcs Mika Kuoppala
2016-01-14 16:52 ` Ville Syrjälä
2016-01-18 10:23   ` Maarten Lankhorst
2016-01-19 19:10     ` Mika Kuoppala
2016-01-19 19:22     ` Ville Syrjälä
2016-01-20  7:18       ` Maarten Lankhorst
2016-01-20 11:11         ` Ville Syrjälä [this message]
2016-01-25 11:41           ` Maarten Lankhorst
2016-01-14 17:20 ` ✗ warning: Fi.CI.BAT Patchwork
2016-01-15 22:40 ` [PATCH] drm/i915: Don't do pre plane update on disabled crtcs Matt Roper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160120111106.GB23290@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.