From: Matt Roper <matthew.d.roper@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915/gen9: Initialize intel_state->active_crtcs during WM sanitization
Date: Fri, 17 Jun 2016 14:00:02 -0700 [thread overview]
Message-ID: <20160617210002.GE14404@intel.com> (raw)
In-Reply-To: <20160613144949.GF1338@phenom.ffwll.local>
On Mon, Jun 13, 2016 at 04:49:49PM +0200, Daniel Vetter wrote:
> On Thu, Jun 09, 2016 at 03:14:53PM -0700, Matt Roper wrote:
> > intel_state->active_crtcs is usually only initialized when doing a
> > modeset. During our first atomic commit after boot, we're effectively
> > faking a modeset to sanitize the DDB/wm setup, so ensure that this field
> > gets initialized before use.
> >
> > Reported-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_pm.c | 11 ++++++++++-
> > 1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 658a756..0cd38ca 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -3896,9 +3896,18 @@ skl_compute_ddb(struct drm_atomic_state *state)
> > * pretend that all pipes switched active status so that we'll
> > * ensure a full DDB recompute.
> > */
> > - if (dev_priv->wm.distrust_bios_wm)
> > + if (dev_priv->wm.distrust_bios_wm) {
> > intel_state->active_pipe_changes = ~0;
> >
> > + /*
> > + * We usually only initialize intel_state->active_crtcs if we
> > + * we're doing a modeset; make sure this field is always
> > + * initialized during the sanitization process that happens
> > + * on the first commit too.
> > + */
> > + intel_state->active_crtcs = dev_priv->active_crtcs;
> > + }
>
> Can't we move input sanitization out of this? Imo mixing up atomic
> check/compute config code with hw state restoring is way too fragile.
Handling this at readout time is tricky since we don't actually
reconstruct things like framebuffers until much later in the process.
Also, if I remember correctly, we don't actually read out sufficient
hardware state on any platform right now (e.g., non-primary planes
aren't read, gen9 plane scalers and such are never read, etc.). So to
truly sanitize properly/safely, we need to run through a real atomic
commit to make sure that our sanitized values actually match how the
hardware is programmed. I decided to do the sanitization steps as part
of the first real commit rather than trigger an extra "modeset" on
driver boot, but I can look at the other approach if you think it's
better.
Long term we should probably try harder to read out more complete
hardware state, but for now I figured it was better to get a short-term
fix since there are real regressions (as reported by Tvrtko) and I might
not have time to do a more complicated hw-readout rework series for a
little while.
>
> Also, why exactly do we have active_crtcs? Seems to just be duplicated
> state that can get out of sync, we have too many of those already ...
> -Daniel
I think it would be harder to reconstruct this information without the
active_crtcs field. You'd have to grab the CRTC state (and related
locks) for CRTC's that weren't actually part of the current commit.
Technically we have to do that anyway on gen9 for DDB allocation
reasons, but I don't think that's the case for other platforms iirc.
Matt
>
> > +
> > /*
> > * If the modeset changes which CRTC's are active, we need to
> > * recompute the DDB allocation for *all* active pipes, even
> > --
> > 2.1.4
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
--
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-06-17 21:00 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-09 22:14 [PATCH 0/3] SKL watermark fixes for !fbcon Matt Roper
2016-06-09 22:14 ` [PATCH 1/3] drm/i915/gen9: Initialize intel_state->active_crtcs during WM sanitization Matt Roper
2016-06-13 8:59 ` Maarten Lankhorst
2016-06-13 9:02 ` Maarten Lankhorst
2016-06-13 14:49 ` Daniel Vetter
2016-06-17 21:00 ` Matt Roper [this message]
2016-06-20 12:44 ` Daniel Vetter
2016-06-09 22:14 ` [PATCH 2/3] drm/i915/gen9: Compute data rates for all planes on first commit Matt Roper
2016-06-13 9:04 ` Maarten Lankhorst
2016-06-13 14:50 ` Daniel Vetter
2016-06-17 21:03 ` Matt Roper
2016-06-20 12:47 ` Daniel Vetter
2016-06-09 22:14 ` [PATCH 3/3] drm/i915/gen9: Drop invalid WARN() during data rate calculation Matt Roper
2016-06-13 9:33 ` Maarten Lankhorst
2016-06-13 9:38 ` [PATCH i-g-t] kms_universal_plane: Add testcase for when no plane is visible on the crtc Maarten Lankhorst
2016-06-17 21:25 ` [PATCH 3/3] drm/i915/gen9: Drop invalid WARN() during data rate calculation Matt Roper
2016-06-10 6:24 ` ✗ Ro.CI.BAT: failure for SKL watermark fixes for !fbcon Patchwork
2016-06-10 14:20 ` Matt Roper
2016-06-10 7:28 ` [PATCH 0/3] " Jani Nikula
2016-06-10 14:17 ` Matt Roper
2016-06-10 8:48 ` Tvrtko Ursulin
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=20160617210002.GE14404@intel.com \
--to=matthew.d.roper@intel.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox