From: Imre Deak <imre.deak@intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 11/12] drm/i915: Accurately initialize fifo underrun state on gmch platforms
Date: Wed, 14 May 2014 22:39:48 +0300 [thread overview]
Message-ID: <1400096388.2896.41.camel@ideak-mobl> (raw)
In-Reply-To: <1400093477-3217-14-git-send-email-daniel.vetter@ffwll.ch>
On Wed, 2014-05-14 at 20:51 +0200, Daniel Vetter wrote:
> We don't have hardware based disable bits on gmch platforms, so need
> to block spurious underrun reports in software. Which means that we
> _must_ start out with fifo underrun reporting disabled everywhere.
>
> This is in big contrast to ilk/hsw/cpt where there's only _one_
> disable bit for all platforms and hence we must allow underrun
> reporting on disabled pipes. Otherwise nothing really works,
> especially the CRC support since that's key'ed off the same irq
> disable bit.
>
> This allows us to ditch the fifo underrun reporting hack from the vlv
> runtime pm code and unexport the internal function from i915_irq.c
> again. Yay!
>
> v2: Keep the display irq disabling, spotted by Imre.
>
> Cc: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/i915/i915_irq.c | 4 ++--
> drivers/gpu/drm/i915/intel_display.c | 9 ++++++++-
> drivers/gpu/drm/i915/intel_drv.h | 2 --
> drivers/gpu/drm/i915/intel_pm.c | 6 ------
> 4 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index afa55199b829..a502faae0d0b 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -415,8 +415,8 @@ static void cpt_set_fifo_underrun_reporting(struct drm_device *dev,
> *
> * Returns the previous state of underrun reporting.
> */
> -bool __intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev,
> - enum pipe pipe, bool enable)
> +static bool __intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev,
> + enum pipe pipe, bool enable)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
> struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index d4abaa4bf2f4..e78003ac71a0 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11510,11 +11510,18 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
> encoder->base.crtc = NULL;
> }
> }
> - if (crtc->active) {
> +
> + if (crtc->active || IS_VALLEYVIEW(dev) || INTEL_INFO(dev)->gen < 5) {
> /*
> * We start out with underrun reporting disabled to avoid races.
> * For correct bookkeeping mark this on active crtcs.
> *
> + * Also on gmch platforms we dont have any hardware bits to
> + * disable the underrun reporting. Which means we need to start
> + * out with underrun reporting disabled also on inactive pipes,
> + * since otherwise we'll complain about the garbage we read when
> + * e.g. coming up after runtime pm.
> + *
> * No protection against concurrent access is required - at
> * worst a fifo underrun happens which also sets this to false.
> */
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index b885df150910..d3fa5e0a13bd 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -642,8 +642,6 @@ hdmi_to_dig_port(struct intel_hdmi *intel_hdmi)
> /* i915_irq.c */
> bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev,
> enum pipe pipe, bool enable);
> -bool __intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev,
> - enum pipe pipe, bool enable);
> bool intel_set_pch_fifo_underrun_reporting(struct drm_device *dev,
> enum transcoder pch_transcoder,
> bool enable);
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 45fa43f16bb3..08d5d4c16fdf 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -5605,15 +5605,9 @@ static void vlv_display_power_well_enable(struct drm_i915_private *dev_priv,
> static void vlv_display_power_well_disable(struct drm_i915_private *dev_priv,
> struct i915_power_well *power_well)
> {
> - struct drm_device *dev = dev_priv->dev;
> - enum pipe pipe;
> -
> WARN_ON_ONCE(power_well->data != PUNIT_POWER_WELL_DISP2D);
>
> spin_lock_irq(&dev_priv->irq_lock);
> - for_each_pipe(pipe)
> - __intel_set_cpu_fifo_underrun_reporting(dev, pipe, false);
> -
As we discussed on IRC, something like the following could be added to
the commit log:
Originally the purpose of disabling the reporting on vlv was to prevent
spurious underflow reports when the power well is turned off and the
pipestat register containing the underflow flag will read 0xffffffff.
After the change in intel_sanitize_crtc() to disable the reporting for
all pipes initially, it's guaranteed that reporting is disabled for all
pipes by the time we call vlv_display_power_well_disable(), so there is
no need to disable it there explicitly.
Reviewed-by: Imre Deak <imre.deak@intel.com>
> valleyview_disable_display_irqs(dev_priv);
> spin_unlock_irq(&dev_priv->irq_lock);
>
next prev parent reply other threads:[~2014-05-14 19:39 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-14 18:51 [PATCH 00/12] irq vblank handling rework Daniel Vetter
2014-05-14 18:51 ` [PATCH 01/12] drm: Use correct spinlock flavor in drm_vblank_get() Daniel Vetter
2014-05-21 11:08 ` Thierry Reding
2014-05-14 18:51 ` [PATCH 02/12] drm: Make the vblank disable timer per-crtc Daniel Vetter
2014-05-21 11:17 ` Thierry Reding
2014-05-21 12:10 ` Daniel Vetter
2014-05-14 18:51 ` [PATCH 03/12] drm: Make blocking vblank wait return when the vblank interrupts get disabled Daniel Vetter
2014-05-21 11:20 ` Thierry Reding
2014-05-21 11:24 ` Thierry Reding
2014-05-14 18:51 ` [PATCH 04/12] drm: Add drm_vblank_on() Daniel Vetter
2014-05-14 18:55 ` Daniel Vetter
2014-05-21 11:32 ` Thierry Reding
2014-05-21 12:15 ` Daniel Vetter
2014-05-14 18:51 ` [PATCH 05/12] drm/i915: Remove drm_vblank_pre/post_modeset calls Daniel Vetter
2014-05-21 11:40 ` Thierry Reding
2014-05-14 18:51 ` [PATCH 06/12] drm/doc: Discourage usage of MODESET_CTL ioctl Daniel Vetter
2014-05-15 4:27 ` Michel Dänzer
2014-05-15 13:00 ` [PATCH] " Daniel Vetter
2014-05-15 20:36 ` Laurent Pinchart
2014-05-14 18:51 ` [PATCH 07/12] drm/irq: kerneldoc polish Daniel Vetter
2014-05-15 4:44 ` Michel Dänzer
2014-05-15 9:55 ` Daniel Vetter
2014-05-15 7:21 ` Thierry Reding
2014-05-15 13:00 ` [PATCH] " Daniel Vetter
2014-05-14 18:51 ` [PATCH 08/12] drm/irq: Add kms-native crtc interface functions Daniel Vetter
2014-05-15 7:34 ` Thierry Reding
2014-05-15 10:10 ` Daniel Vetter
2014-05-15 10:42 ` Thierry Reding
2014-05-15 11:11 ` Daniel Vetter
2014-05-15 13:34 ` [PATCH 1/2] " Daniel Vetter
2014-05-15 13:34 ` [PATCH 2/2] drm/i915: Use new kms-native vblank functions Daniel Vetter
2014-05-14 18:51 ` [PATCH 09/12] drm/i915: rip our vblank reset hacks for runtime PM Daniel Vetter
2014-05-20 12:03 ` [Intel-gfx] " Ville Syrjälä
2014-05-20 13:38 ` Daniel Vetter
2014-05-20 14:03 ` Ville Syrjälä
2014-05-20 14:20 ` Daniel Vetter
2014-05-20 15:17 ` Daniel Vetter
2014-05-21 12:49 ` Thierry Reding
2014-05-14 18:51 ` [PATCH 09/12] drm/irq: Lack of interrupt support in drm_vblank_on|off Daniel Vetter
2014-05-21 12:49 ` Thierry Reding
2014-05-14 18:51 ` [PATCH 10/12] drm/i915: Accurately initialize fifo underrun state on gmch platforms Daniel Vetter
2014-05-14 18:51 ` [PATCH 10/12] drm/i915: rip our vblank reset hacks for runtime PM Daniel Vetter
2014-05-14 18:51 ` [PATCH 11/12] drm/i915: Accurately initialize fifo underrun state on gmch platforms Daniel Vetter
2014-05-14 19:39 ` Imre Deak [this message]
2014-05-14 18:51 ` [PATCH 11/12] [RFC] drm/irq: More robustness in drm_vblank_on|off Daniel Vetter
2014-05-21 12:53 ` Thierry Reding
2014-05-21 13:11 ` Daniel Vetter
2014-05-14 18:51 ` [PATCH 12/12] [RFC] drm/crtc-helper: Enforce sane vblank counter semantics Daniel Vetter
2014-05-21 8:26 ` [PATCH 00/12] irq vblank handling rework Ville Syrjälä
2014-05-21 8:35 ` Daniel Vetter
2014-05-21 8:58 ` Ville Syrjälä
2014-05-21 12:55 ` Thierry Reding
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=1400096388.2896.41.camel@ideak-mobl \
--to=imre.deak@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--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