[v2,6/9] drm/i915: Use drm_modeset_lock_all() in debugfs display info
diff mbox series

Message ID 20191129185434.25549-7-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • drm/i915: i915_display_info cleanup
Related show

Commit Message

Ville Syrjälä Nov. 29, 2019, 6:54 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Make out life easier by just grabbing all modeset locks around
the display_info dump.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Ramalingam C Dec. 2, 2019, 3:05 p.m. UTC | #1
On 2019-11-29 at 20:54:31 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Make out life easier by just grabbing all modeset locks around
> the display_info dump.
> 
Looks good to me.

Reviewed-by: Ramalingam C <ramalingam.c@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 11f3f91befb9..3bf7d4e2f940 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2667,23 +2667,22 @@ static int i915_display_info(struct seq_file *m, void *unused)
>  
>  	wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
>  
> +	drm_modeset_lock_all(dev);
> +
>  	seq_printf(m, "CRTC info\n");
>  	seq_printf(m, "---------\n");
> -	for_each_intel_crtc(dev, crtc) {
> -		drm_modeset_lock(&crtc->base.mutex, NULL);
> +	for_each_intel_crtc(dev, crtc)
>  		intel_crtc_info(m, crtc);
> -		drm_modeset_unlock(&crtc->base.mutex);
> -	}
>  
>  	seq_printf(m, "\n");
>  	seq_printf(m, "Connector info\n");
>  	seq_printf(m, "--------------\n");
> -	mutex_lock(&dev->mode_config.mutex);
>  	drm_connector_list_iter_begin(dev, &conn_iter);
>  	drm_for_each_connector_iter(connector, &conn_iter)
>  		intel_connector_info(m, connector);
>  	drm_connector_list_iter_end(&conn_iter);
> -	mutex_unlock(&dev->mode_config.mutex);
> +
> +	drm_modeset_unlock_all(dev);
>  
>  	intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
>  
> -- 
> 2.23.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 11f3f91befb9..3bf7d4e2f940 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2667,23 +2667,22 @@  static int i915_display_info(struct seq_file *m, void *unused)
 
 	wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
 
+	drm_modeset_lock_all(dev);
+
 	seq_printf(m, "CRTC info\n");
 	seq_printf(m, "---------\n");
-	for_each_intel_crtc(dev, crtc) {
-		drm_modeset_lock(&crtc->base.mutex, NULL);
+	for_each_intel_crtc(dev, crtc)
 		intel_crtc_info(m, crtc);
-		drm_modeset_unlock(&crtc->base.mutex);
-	}
 
 	seq_printf(m, "\n");
 	seq_printf(m, "Connector info\n");
 	seq_printf(m, "--------------\n");
-	mutex_lock(&dev->mode_config.mutex);
 	drm_connector_list_iter_begin(dev, &conn_iter);
 	drm_for_each_connector_iter(connector, &conn_iter)
 		intel_connector_info(m, connector);
 	drm_connector_list_iter_end(&conn_iter);
-	mutex_unlock(&dev->mode_config.mutex);
+
+	drm_modeset_unlock_all(dev);
 
 	intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);