From: Imre Deak <imre.deak@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, Blubberbub@protonmail.com,
stable@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH v2 1/4] drm/i915: Don't clobber M/N values during fastset check
Date: Tue, 18 Jun 2019 15:19:17 +0300 [thread overview]
Message-ID: <20190618121917.GB3733@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20190613092459.GV5942@intel.com>
On Thu, Jun 13, 2019 at 12:24:59PM +0300, Ville Syrjälä wrote:
> On Wed, Jun 12, 2019 at 08:24:23PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > We're now calling intel_pipe_config_compare(..., true) uncoditionally
> > which means we're always going clobber the calculated M/N values with
> > the old values if the fuzzy M/N check passes. That causes problems
> > because the fuzzy check allows for a huge difference in the values.
> >
> > I'm actually tempted to just make the M/N checks exact, but that might
> > prevent fastboot from kicking in when people want it. So for now let's
> > overwrite the computed values with the old values only if decide to skip
> > the modeset.
> >
> > v2: Copy has_drrs along with M/N M2/N2 values
> >
> > Cc: stable@vger.kernel.org
> > Cc: Blubberbub@protonmail.com
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Hans de Goede <hdegoede@redhat.com>
> > Tested-by: Blubberbub@protonmail.com
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110782
> > Fixes: d19f958db23c ("drm/i915: Enable fastset for non-boot modesets.")
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Looks like also
> https://bugs.freedesktop.org/show_bug.cgi?id=110675
Ok, the copying from old-state to new-state is needed to keep HW/SW
state verification later pass, but we want to preserve the calculated
state if we'll need to reprogram everything based on that. Makes sense:
Reviewed-by: Imre Deak <imre.deak@intel.com>
>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 36 +++++++++++++++++++++-------
> > 1 file changed, 28 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 1b1ddb48ca7a..3d8ed1cf0ab7 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -12299,9 +12299,6 @@ intel_compare_link_m_n(const struct intel_link_m_n *m_n,
> > m2_n2->gmch_m, m2_n2->gmch_n, !adjust) &&
> > intel_compare_m_n(m_n->link_m, m_n->link_n,
> > m2_n2->link_m, m2_n2->link_n, !adjust)) {
> > - if (adjust)
> > - *m2_n2 = *m_n;
> > -
> > return true;
> > }
> >
> > @@ -13433,6 +13430,33 @@ static int calc_watermark_data(struct intel_atomic_state *state)
> > return 0;
> > }
> >
> > +static void intel_crtc_check_fastset(struct intel_crtc_state *old_crtc_state,
> > + struct intel_crtc_state *new_crtc_state)
> > +{
> > + struct drm_i915_private *dev_priv =
> > + to_i915(new_crtc_state->base.crtc->dev);
> > +
> > + if (!intel_pipe_config_compare(dev_priv, old_crtc_state,
> > + new_crtc_state, true))
> > + return;
> > +
> > + new_crtc_state->base.mode_changed = false;
> > + new_crtc_state->update_pipe = true;
> > +
> > + /*
> > + * If we're not doing the full modeset we want to
> > + * keep the current M/N values as they may be
> > + * sufficiently different to the computed values
> > + * to cause problems.
> > + *
> > + * FIXME: should really copy more fuzzy state here
> > + */
> > + new_crtc_state->fdi_m_n = old_crtc_state->fdi_m_n;
> > + new_crtc_state->dp_m_n = old_crtc_state->dp_m_n;
> > + new_crtc_state->dp_m2_n2 = old_crtc_state->dp_m2_n2;
> > + new_crtc_state->has_drrs = old_crtc_state->has_drrs;
> > +}
> > +
> > /**
> > * intel_atomic_check - validate state object
> > * @dev: drm device
> > @@ -13474,11 +13498,7 @@ static int intel_atomic_check(struct drm_device *dev,
> > if (ret)
> > goto fail;
> >
> > - if (intel_pipe_config_compare(dev_priv, old_crtc_state,
> > - new_crtc_state, true)) {
> > - new_crtc_state->base.mode_changed = false;
> > - new_crtc_state->update_pipe = true;
> > - }
> > + intel_crtc_check_fastset(old_crtc_state, new_crtc_state);
> >
> > if (needs_modeset(&new_crtc_state->base))
> > any_ms = true;
> > --
> > 2.21.0
>
> --
> Ville Syrjälä
> Intel
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-06-18 12:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 13:07 [PATCH 1/4] drm/i915: Don't clobber M/N values during fastset check Ville Syrjala
2019-06-12 13:07 ` [PATCH 2/4] drm/i915: Constify intel_pipe_config_compare() Ville Syrjala
2019-06-18 12:25 ` Imre Deak
2019-06-12 13:08 ` [PATCH 3/4] drm/i915: Make pipe_config_err() vs. fastset less confusing Ville Syrjala
2019-06-12 15:43 ` Imre Deak
2019-06-12 13:08 ` [PATCH 4/4] drm/i915: Drop the _INCOMPLETE for has_infoframe Ville Syrjala
2019-06-18 12:34 ` Imre Deak
2019-06-18 12:55 ` Ville Syrjälä
2019-06-18 13:28 ` Imre Deak
2019-06-12 13:15 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915: Don't clobber M/N values during fastset check Patchwork
2019-06-12 13:52 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-06-12 17:24 ` [PATCH v2 1/4] " Ville Syrjala
2019-06-13 9:24 ` Ville Syrjälä
2019-06-18 12:19 ` Imre Deak [this message]
2019-06-15 22:16 ` Sasha Levin
2019-06-12 18:35 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2,1/4] drm/i915: Don't clobber M/N values during fastset check (rev2) Patchwork
2019-06-12 19:06 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-14 13:14 ` ✓ Fi.CI.IGT: " Patchwork
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=20190618121917.GB3733@ideak-desk.fi.intel.com \
--to=imre.deak@intel.com \
--cc=Blubberbub@protonmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
--cc=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox