Skip to contentSkip to conversation

drm/i915: Only wait one vblank when disabling crc if the pipe is on

PATCH In review Daniel Vetter 5 participants 6 messages Jun 6, 2014 – Jun 13, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Only wait one vblank when disabling crc if the pipe is on

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 <[email protected]>
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

---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_debugfs.c +6 -1
index 601caa88c092..cf94e9640627 100644
@@ -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;
Signature · 1 line
2.0.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · 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 <[email protected]>
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

---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_debugfs.c +0 -0
index 601caa88c092..cf94e9640627 100644

drivers/gpu/drm/i915/i915_debugfs.c static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe, · line 2931

Quoted 5 lines
drivers/gpu/drm/i915/i915_debugfs.c +2 -0
@@ -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]);
                        ^^^^^^

What's that?

Otherwise:

Quoted 19 lines
drivers/gpu/drm/i915/i915_debugfs.c +4 -1
 		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;
Signature · 6 lines
2.0.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC
#2 lore raw
Quoted 35 lines · Ville Syrjälä
Quoted 27 lines · 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 <[email protected]>
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

---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_debugfs.c +0 -0
index 601caa88c092..cf94e9640627 100644

drivers/gpu/drm/i915/i915_debugfs.c static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe, · line 2931

Quoted 5 lines
drivers/gpu/drm/i915/i915_debugfs.c +2 -0
@@ -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]);
                        ^^^^^^
Quoted 1 line

What's that?

Oops. Luckily patch still worked, C rules are bendy enough ;-)

Quoted 3 lines

Otherwise:

Thanks,
-Daniel

Quoted 24 lines
Quoted 20 lines
drivers/gpu/drm/i915/i915_debugfs.c +4 -1
 		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;
Signature · 6 lines
2.0.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw
In reply to Daniel Vetter

drivers/gpu/drm/i915/i915_debugfs.c static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe, · line 2939

Quoted 4 lines · Daniel Vetter
drivers/gpu/drm/i915/i915_debugfs.c +4 -0
+		mutex_lock(&crtc->base.mutex);
+		if (crtc->active)
+			intel_wait_for_vblank(dev, pipe);
+		mutex_unlock(&crtc->base.mutex);

drivers/gpu/drm/i915/i915_debugfs.c: In function ‘pipe_crc_set_source’:
drivers/gpu/drm/i915/i915_debugfs.c:2932:3: warning: passing argument 1 of ‘mutex_lock’ from incompatible pointer type [enabled by default]
mutex_lock(&crtc->base.mutex);
^
In file included from include/linux/seq_file.h:7:0,

                 from drivers/gpu/drm/i915/i915_debugfs.c:29:
include/linux/mutex.h:158:13: note: expected ‘struct mutex *’ but argument is of type ‘struct drm_modeset_lock *’
 extern void mutex_lock(struct mutex *lock);
             ^
Signature · 5 lines
Damien
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 8 lines · Damien Lespiau

drivers/gpu/drm/i915/i915_debugfs.c static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe, · line 2939

Quoted 4 lines · Daniel Vetter
drivers/gpu/drm/i915/i915_debugfs.c +4 -0
+		mutex_lock(&crtc->base.mutex);
+		if (crtc->active)
+			intel_wait_for_vblank(dev, pipe);
+		mutex_unlock(&crtc->base.mutex);

drivers/gpu/drm/i915/i915_debugfs.c: In function ‘pipe_crc_set_source’:
drivers/gpu/drm/i915/i915_debugfs.c:2932:3: warning: passing argument 1 of ‘mutex_lock’ from incompatible pointer type [enabled by default]

Quoted 6 lines
   mutex_lock(&crtc->base.mutex);
   ^
In file included from include/linux/seq_file.h:7:0,
                 from drivers/gpu/drm/i915/i915_debugfs.c:29:

include/linux/mutex.h:158:13: note: expected ‘struct mutex *’ but argument is of type ‘struct drm_modeset_lock *’
extern void mutex_lock(struct mutex *lock);

Oh dang, rebase fail. Thanks for helping the blind, will fix asap. -Daniel

Quoted 4 lines
             ^
Signature · 1 line
Damien
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer Tested-by Guo Jinxian Reviewed-by Ville Syrjälä
#5 lore raw
Quoted 16 lines · Daniel Vetter
Quoted 8 lines · Damien Lespiau

drivers/gpu/drm/i915/i915_debugfs.c static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe, · line 2939

Quoted 4 lines · Daniel Vetter
drivers/gpu/drm/i915/i915_debugfs.c +4 -0
+		mutex_lock(&crtc->base.mutex);
+		if (crtc->active)
+			intel_wait_for_vblank(dev, pipe);
+		mutex_unlock(&crtc->base.mutex);

drivers/gpu/drm/i915/i915_debugfs.c: In function ‘pipe_crc_set_source’:
drivers/gpu/drm/i915/i915_debugfs.c:2932:3: warning: passing argument 1 of ‘mutex_lock’ from incompatible pointer type [enabled by default]

Quoted 6 lines
   mutex_lock(&crtc->base.mutex);
   ^
In file included from include/linux/seq_file.h:7:0,
                 from drivers/gpu/drm/i915/i915_debugfs.c:29:

include/linux/mutex.h:158:13: note: expected ‘struct mutex *’ but argument is of type ‘struct drm_modeset_lock *’
extern void mutex_lock(struct mutex *lock);

Quoted 1 line

Oh dang, rebase fail. Thanks for helping the blind, will fix asap.

drivers/gpu/drm/i915/i915_debugfs.c: In function ‘pipe_crc_set_source’:
drivers/gpu/drm/i915/i915_debugfs.c:2932:3: warning: passing argument 1 of ‘mutex_lock’ from incompatible pointer type [enabled by default]
mutex_lock(&crtc->base.mutex);
^
In file included from include/linux/seq_file.h:7:0,

                 from drivers/gpu/drm/i915/i915_debugfs.c:29:
include/linux/mutex.h:158:13: note: expected ‘struct mutex *’ but argument is of type ‘struct drm_modeset_lock *’
 extern void mutex_lock(struct mutex *lock);
             ^

drivers/gpu/drm/i915/i915_debugfs.c:2935:3: warning: passing argument 1 of ‘mutex_unlock’ from incompatible pointer type [enabled by default]
mutex_unlock(&crtc->base.mutex);
^
In file included from include/linux/seq_file.h:7:0,

                 from drivers/gpu/drm/i915/i915_debugfs.c:29:
include/linux/mutex.h:175:13: note: expected ‘struct mutex *’ but argument is of type ‘struct drm_modeset_lock *’
 extern void mutex_unlock(struct mutex *lock);
             ^

33b1879a1038d87d82cd4de82ebedd95ee88e529 is the first bad commit commit 33b1879a1038d87d82cd4de82ebedd95ee88e529

Author: Daniel Vetter <[email protected]>
Date:   Fri Jun 6 08:22:08 2014 +0200

drm/i915: Only wait one vblank when disabling crc if the pipe is on

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 <[email protected]>
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

:040000 040000 ec8ee719363b4eb6f1d90950605694bbe1bb2cf3 b3d5f21458cc6ba201e73a5effb003edadb644f5 M drivers

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx