All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Steven Rostedt <rostedt@goodmis.org>
Subject: [Intel-gfx] [PATCH 2/4] drm/i915: Don't try to query the frame counter for disabled pipes
Date: Thu,  4 Mar 2021 19:04:19 +0200	[thread overview]
Message-ID: <20210304170421.10901-3-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20210304170421.10901-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

For platforms/outputs without hardware frame counters we can't
call drm_crtc_accurate_vblank_count() when the vblank support is
disabled or we just get a WARN due to the crtc timings
(vblank->hwmode) being considered invalid. Note that until the
pipe in question has been enabled and drm_crtc_set_max_vblank_count()
has been called on it we would also take this path on platforms
which have a working frame counter. So getting the WARN is rather
likely on any platform unless you always boot with lots of displays
plugged in.

Also even on hardware with a working frame counter we may not be
able to read the actual frame counter register on disabled pipes
due the relevant power well being disabled. Ie. would just result
in the unclaimed reg spew.

So let's just avoid all this an directly report zero in case
the pipe is disabled.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_crtc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index fd8a66cece80..34ff40852a37 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -41,6 +41,9 @@ u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)
 	struct drm_device *dev = crtc->base.dev;
 	struct drm_vblank_crtc *vblank = &dev->vblank[drm_crtc_index(&crtc->base)];
 
+	if (!crtc->active)
+		return 0;
+
 	if (!vblank->max_vblank_count)
 		return (u32)drm_crtc_accurate_vblank_count(&crtc->base);
 
-- 
2.26.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2021-03-04 17:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 17:04 [Intel-gfx] [PATCH 0/4] drm/i915: Silence pipe tracepoint WARNs Ville Syrjala
2021-03-04 17:04 ` [Intel-gfx] [PATCH 1/4] drm/i915: Move pipe enable/disable tracepoints to intel_crtc_vblank_{on, off}() Ville Syrjala
2021-03-04 17:04 ` Ville Syrjala [this message]
2021-03-04 17:04 ` [Intel-gfx] [PATCH 3/4] drm/i915: Return zero as the scanline counter for disabled pipes Ville Syrjala
2021-03-04 17:04 ` [Intel-gfx] [PATCH 4/4] drm/i915: Fix DSI TE max_vblank_count handling Ville Syrjala
2021-03-04 17:43 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Silence pipe tracepoint WARNs Patchwork
2021-03-04 19:20 ` [Intel-gfx] [PATCH 0/4] " Steven Rostedt
2021-03-05 15:38   ` Ville Syrjälä
2021-03-04 23:51 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork
2021-03-05  8:45 ` [Intel-gfx] [PATCH 0/4] " Jani Nikula

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=20210304170421.10901-3-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rostedt@goodmis.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 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.