diff mbox

[07/19] drm/tegra: Don't use modeset_lock_crtc

Message ID 20170322215058.8671-8-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter March 22, 2017, 9:50 p.m. UTC
Yes the help text is unhelpful, but atomic drivers should never use
this. Just grab the lock without context or anything.

Also an aside: Checking ->active like this doesn't protect against
nonblocking commits, this is rather bogus.

Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/tegra/dc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Daniel Vetter March 27, 2017, 3:50 p.m. UTC | #1
On Wed, Mar 22, 2017 at 10:50:46PM +0100, Daniel Vetter wrote:
> Yes the help text is unhelpful, but atomic drivers should never use
> this. Just grab the lock without context or anything.
> 
> Also an aside: Checking ->active like this doesn't protect against
> nonblocking commits, this is rather bogus.
> 
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Applied to drm-misc with Thierry's irc-ack.
-Daniel

> ---
>  drivers/gpu/drm/tegra/dc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index 0db5d5a8d3b9..95b373f739f2 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -1382,7 +1382,7 @@ static int tegra_dc_show_regs(struct seq_file *s, void *data)
>  	struct tegra_dc *dc = node->info_ent->data;
>  	int err = 0;
>  
> -	drm_modeset_lock_crtc(&dc->base, NULL);
> +	drm_modeset_lock(&dc->base.mutex, NULL);
>  
>  	if (!dc->base.state->active) {
>  		err = -EBUSY;
> @@ -1609,7 +1609,7 @@ static int tegra_dc_show_regs(struct seq_file *s, void *data)
>  #undef DUMP_REG
>  
>  unlock:
> -	drm_modeset_unlock_crtc(&dc->base);
> +	drm_modeset_unlock(&dc->base.mutex);
>  	return err;
>  }
>  
> @@ -1620,7 +1620,7 @@ static int tegra_dc_show_crc(struct seq_file *s, void *data)
>  	int err = 0;
>  	u32 value;
>  
> -	drm_modeset_lock_crtc(&dc->base, NULL);
> +	drm_modeset_lock(&dc->base.mutex, NULL);
>  
>  	if (!dc->base.state->active) {
>  		err = -EBUSY;
> @@ -1640,7 +1640,7 @@ static int tegra_dc_show_crc(struct seq_file *s, void *data)
>  	tegra_dc_writel(dc, 0, DC_COM_CRC_CONTROL);
>  
>  unlock:
> -	drm_modeset_unlock_crtc(&dc->base);
> +	drm_modeset_unlock(&dc->base.mutex);
>  	return err;
>  }
>  
> -- 
> 2.11.0
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 0db5d5a8d3b9..95b373f739f2 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1382,7 +1382,7 @@  static int tegra_dc_show_regs(struct seq_file *s, void *data)
 	struct tegra_dc *dc = node->info_ent->data;
 	int err = 0;
 
-	drm_modeset_lock_crtc(&dc->base, NULL);
+	drm_modeset_lock(&dc->base.mutex, NULL);
 
 	if (!dc->base.state->active) {
 		err = -EBUSY;
@@ -1609,7 +1609,7 @@  static int tegra_dc_show_regs(struct seq_file *s, void *data)
 #undef DUMP_REG
 
 unlock:
-	drm_modeset_unlock_crtc(&dc->base);
+	drm_modeset_unlock(&dc->base.mutex);
 	return err;
 }
 
@@ -1620,7 +1620,7 @@  static int tegra_dc_show_crc(struct seq_file *s, void *data)
 	int err = 0;
 	u32 value;
 
-	drm_modeset_lock_crtc(&dc->base, NULL);
+	drm_modeset_lock(&dc->base.mutex, NULL);
 
 	if (!dc->base.state->active) {
 		err = -EBUSY;
@@ -1640,7 +1640,7 @@  static int tegra_dc_show_crc(struct seq_file *s, void *data)
 	tegra_dc_writel(dc, 0, DC_COM_CRC_CONTROL);
 
 unlock:
-	drm_modeset_unlock_crtc(&dc->base);
+	drm_modeset_unlock(&dc->base.mutex);
 	return err;
 }