drm/i915: Use for_each_pipe in intel_display_crc_init
Subsystems (2)
PATCH 1/2 drm/i915: Use for_each_pipe in intel_display_crc_init
We have a nice macro, so use it.
Signed-off-by Daniel Vetter <[email protected]>
--- drivers/gpu/drm/i915/i915_debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -3
@@ -3099,10 +3099,10 @@ static const struct i915_debugfs_files {void intel_display_crc_init (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private; -int i; +enum pipe pipe; -for (i =0 ; i <INTEL_INFO (dev)->num_pipes; i++) { -struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[i]; +for_each_pipe (pipe) { +struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[pipe]; pipe_crc->opened = false;spin_lock_init (&pipe_crc->lock);
Signature · 1 line
1.8.1.4
PATCH 2/2 drm/i915: Reject opening of pipe crc files for invalid pipes
We don't init the lock nor set up all the other state. And it doesn't make sense anyway.
This appeases lockdep when running the igt/drv_debugfs_reader test.
Signed-off-by Daniel Vetter <[email protected]>
--- drivers/gpu/drm/i915/i915_debugfs.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +3 -0
@@ -1856,6 +1856,9 @@ static int i915_pipe_crc_open(struct inode *inode, struct file *filep)struct drm_i915_private *dev_priv = info->dev->dev_private;struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[info->pipe]; +if (info->pipe >=INTEL_INFO (info->dev)->num_pipes) +return -ENODEV ; +spin_lock_irq (&pipe_crc->lock);if (pipe_crc->opened) {
Signature · 1 line
1.8.1.4
Quoted 3 lines · Daniel Vetter
We have a nice macro, so use it.
Signed-off-by Daniel Vetter <[email protected]>
For both patches:
Reviewed-by Damien Lespiau <[email protected]>
Signature · 1 line
Damien
Quoted 8 lines · Damien Lespiau
Quoted 3 lines · Daniel Vetter
We have a nice macro, so use it.
Signed-off-by Daniel Vetter <[email protected]>For both patches:
Reviewed-by Damien Lespiau <[email protected]>
Thanks for the review, both merged to dinq.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch