From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org Cc: Mika Kahola <mika.kahola@intel.com>, bruno.pagani@ens-lyon.org, Daniel J Blueman <daniel.blueman@gmail.com>, Paul Bolle <pebolle@tiscali.nl>, Joseph Yasi <joe.yasi@gmail.com>, stable@vger.kernel.org Subject: Re: [PATCH] drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things Date: Tue, 1 Nov 2016 09:57:43 +0100 [thread overview] Message-ID: <1354f7bd-a473-f941-cd79-d1fc7259fa38@linux.intel.com> (raw) In-Reply-To: <1477673960-3274-1-git-send-email-ville.syrjala@linux.intel.com> Op 28-10-16 om 18:59 schreef ville.syrjala@linux.intel.com: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > When we end up not recomputing the cdclk, we need to populate > intel_state->cdclk with the "atomic_cdclk_freq" instead of the > current cdclk_freq. When no pipes are active, the actual cdclk_freq > may be lower than what the configuration of the planes and > pipes would require from the point of view of the software state. > > intel_state->dev_cdclk is the computed actual cdclk in such cases, > so let's populate that with the current cdclk value. Although basically > nothing should ever use dev_cdclk for any checks and whatnot. > > This fixes bogus WARNS from skl_max_scale() which is trying to check > the plane software state against the cdclk frequency. So any time > it got called during DPMS off for instance, we might have tripped > the warn if the current mode would have required a higher than > minimum cdclk. > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > Cc: Mika Kahola <mika.kahola@intel.com> > Cc: bruno.pagani@ens-lyon.org > Cc: Daniel J Blueman <daniel.blueman@gmail.com> > Cc: Paul Bolle <pebolle@tiscali.nl> > Cc: Joseph Yasi <joe.yasi@gmail.com> > Tested-by: Paul Bolle <pebolle@tiscali.nl> > Tested-by: Joseph Yasi <joe.yasi@gmail.com> > Cc: stable@vger.kernel.org > Fixes: 1a617b77658e ("drm/i915: Keep track of the cdclk as if all crtc's were active.") > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98214 > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/i915/intel_display.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 895b3dc50e3f..f010e154e33e 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -14040,8 +14040,10 @@ static int intel_modeset_checks(struct drm_atomic_state *state) > > DRM_DEBUG_KMS("New cdclk calculated to be atomic %u, actual %u\n", > intel_state->cdclk, intel_state->dev_cdclk); > - } else > + } else { > to_intel_atomic_state(state)->cdclk = dev_priv->atomic_cdclk_freq; > + to_intel_atomic_state(state)->dev_cdclk = dev_priv->cdclk_freq; > + } This shouldn't be required in this case, but might as well do so since it doesn't hurt either. > intel_modeset_clear_plls(state); > > @@ -14142,8 +14144,10 @@ static int intel_atomic_check(struct drm_device *dev, > > if (ret) > return ret; > - } else > - intel_state->cdclk = dev_priv->cdclk_freq; > + } else { > + intel_state->cdclk = dev_priv->atomic_cdclk_freq; > + intel_state->dev_cdclk = dev_priv->cdclk_freq; > + } We shouldn't rely on dev_cdclk being valid for the !modeset case. Best to keep it zero there, the global cdclk can't be changed and the non-modeset case shouldn't rely on the current setting. Otherwise looks sane, I have a similar patch in my tree. I didn't submit it yet but the fix was similar. Except for the dev_cdclk stuff. With the last dev_cdclk assignment removed: Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
WARNING: multiple messages have this Message-ID (diff)
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org Cc: bruno.pagani@ens-lyon.org, Daniel J Blueman <daniel.blueman@gmail.com>, Paul Bolle <pebolle@tiscali.nl>, stable@vger.kernel.org, Joseph Yasi <joe.yasi@gmail.com> Subject: Re: [PATCH] drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things Date: Tue, 1 Nov 2016 09:57:43 +0100 [thread overview] Message-ID: <1354f7bd-a473-f941-cd79-d1fc7259fa38@linux.intel.com> (raw) In-Reply-To: <1477673960-3274-1-git-send-email-ville.syrjala@linux.intel.com> Op 28-10-16 om 18:59 schreef ville.syrjala@linux.intel.com: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > When we end up not recomputing the cdclk, we need to populate > intel_state->cdclk with the "atomic_cdclk_freq" instead of the > current cdclk_freq. When no pipes are active, the actual cdclk_freq > may be lower than what the configuration of the planes and > pipes would require from the point of view of the software state. > > intel_state->dev_cdclk is the computed actual cdclk in such cases, > so let's populate that with the current cdclk value. Although basically > nothing should ever use dev_cdclk for any checks and whatnot. > > This fixes bogus WARNS from skl_max_scale() which is trying to check > the plane software state against the cdclk frequency. So any time > it got called during DPMS off for instance, we might have tripped > the warn if the current mode would have required a higher than > minimum cdclk. > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > Cc: Mika Kahola <mika.kahola@intel.com> > Cc: bruno.pagani@ens-lyon.org > Cc: Daniel J Blueman <daniel.blueman@gmail.com> > Cc: Paul Bolle <pebolle@tiscali.nl> > Cc: Joseph Yasi <joe.yasi@gmail.com> > Tested-by: Paul Bolle <pebolle@tiscali.nl> > Tested-by: Joseph Yasi <joe.yasi@gmail.com> > Cc: stable@vger.kernel.org > Fixes: 1a617b77658e ("drm/i915: Keep track of the cdclk as if all crtc's were active.") > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98214 > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/i915/intel_display.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 895b3dc50e3f..f010e154e33e 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -14040,8 +14040,10 @@ static int intel_modeset_checks(struct drm_atomic_state *state) > > DRM_DEBUG_KMS("New cdclk calculated to be atomic %u, actual %u\n", > intel_state->cdclk, intel_state->dev_cdclk); > - } else > + } else { > to_intel_atomic_state(state)->cdclk = dev_priv->atomic_cdclk_freq; > + to_intel_atomic_state(state)->dev_cdclk = dev_priv->cdclk_freq; > + } This shouldn't be required in this case, but might as well do so since it doesn't hurt either. > intel_modeset_clear_plls(state); > > @@ -14142,8 +14144,10 @@ static int intel_atomic_check(struct drm_device *dev, > > if (ret) > return ret; > - } else > - intel_state->cdclk = dev_priv->cdclk_freq; > + } else { > + intel_state->cdclk = dev_priv->atomic_cdclk_freq; > + intel_state->dev_cdclk = dev_priv->cdclk_freq; > + } We shouldn't rely on dev_cdclk being valid for the !modeset case. Best to keep it zero there, the global cdclk can't be changed and the non-modeset case shouldn't rely on the current setting. Otherwise looks sane, I have a similar patch in my tree. I didn't submit it yet but the fix was similar. Except for the dev_cdclk stuff. With the last dev_cdclk assignment removed: Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-11-01 8:57 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-10-28 16:59 [PATCH] drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things ville.syrjala 2016-10-28 16:59 ` ville.syrjala 2016-10-28 17:15 ` ✓ Fi.CI.BAT: success for " Patchwork 2016-10-28 21:05 ` [PATCH] " Paul Bolle 2016-10-28 21:05 ` Paul Bolle 2016-10-28 21:30 ` Ville Syrjälä 2016-10-28 21:30 ` Ville Syrjälä 2016-10-28 21:38 ` Paul Bolle 2016-10-28 21:38 ` Paul Bolle 2016-10-28 22:01 ` Ville Syrjälä 2016-10-28 22:01 ` Ville Syrjälä 2016-11-01 8:57 ` Maarten Lankhorst [this message] 2016-11-01 8:57 ` Maarten Lankhorst 2016-11-01 9:07 ` Paul Bolle 2016-11-01 12:41 ` Ville Syrjälä 2016-11-01 12:41 ` Ville Syrjälä 2016-11-01 12:40 ` Ville Syrjälä 2016-11-01 12:40 ` Ville Syrjälä 2016-11-01 12:53 ` Ville Syrjälä 2016-11-01 12:53 ` Ville Syrjälä
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=1354f7bd-a473-f941-cd79-d1fc7259fa38@linux.intel.com \ --to=maarten.lankhorst@linux.intel.com \ --cc=bruno.pagani@ens-lyon.org \ --cc=daniel.blueman@gmail.com \ --cc=intel-gfx@lists.freedesktop.org \ --cc=joe.yasi@gmail.com \ --cc=mika.kahola@intel.com \ --cc=pebolle@tiscali.nl \ --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: linkBe 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.