public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Only wait one vblank when disabling crc if the pipe is on
@ 2014-06-06  6:22 Daniel Vetter
  2014-06-06  8:57 ` Ville Syrjälä
  2014-06-06 17:18 ` Damien Lespiau
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Vetter @ 2014-06-06  6:22 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Otherwise we incur an unsightly WARNING. The mutex locking is a bit
overkill, but it curbs races and eventially we might grow a locking
check in the vblank wait code to make sure the right crtc lock is
held.

This is fallout from

commit 9393707190194eb8b42e412b444a03331db6862f
Author:     Jesse Barnes <jbarnes@virtuousgeek.org>
AuthorDate: Fri Apr 4 16:12:09 2014 -0700

    drm/i915: warn when a vblank wait times out

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79612
Tested-by: Guo Jinxian <jinxianx.guo@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 601caa88c092..cf94e9640627 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2927,11 +2927,16 @@ static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe,
 	/* real source -> none transition */
 	if (source == INTEL_PIPE_CRC_SOURCE_NONE) {
 		struct intel_pipe_crc_entry *entries;
+		struct intel_crtc *crtc =
+			crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
 
 		DRM_DEBUG_DRIVER("stopping CRCs for pipe %c\n",
 				 pipe_name(pipe));
 
-		intel_wait_for_vblank(dev, pipe);
+		mutex_lock(&crtc->base.mutex);
+		if (crtc->active)
+			intel_wait_for_vblank(dev, pipe);
+		mutex_unlock(&crtc->base.mutex);
 
 		spin_lock_irq(&pipe_crc->lock);
 		entries = pipe_crc->entries;
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-13 12:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06  6:22 [PATCH] drm/i915: Only wait one vblank when disabling crc if the pipe is on Daniel Vetter
2014-06-06  8:57 ` Ville Syrjälä
2014-06-06  9:36   ` Daniel Vetter
2014-06-06 17:18 ` Damien Lespiau
2014-06-06 17:40   ` Daniel Vetter
2014-06-13 12:08     ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox