mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Re-send][PATCH] gpu/drm: remove drm_modeset_lock protection for drm_error
@ 2020-09-02 13:17 Bernard
  2020-09-03  8:45 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Bernard @ 2020-09-02 13:17 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, dri-devel, linux-kernel
  Cc: opensource.kernel, Bernard Zhao

In function drm_atomic_helper_shutdown, maybe there is no need
to protect DRM_ERROR log in DRM_MODESET_LOCK_ALL_BEGIN &
DRM_MODESET_LOCK_ALL_END. This change is to make code run a bit
fast.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 85d163f16801..8902fd6316fc 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3100,12 +3100,10 @@ void drm_atomic_helper_shutdown(struct drm_device *dev)
 	int ret;
 
 	DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
-
 	ret = drm_atomic_helper_disable_all(dev, &ctx);
+	DRM_MODESET_LOCK_ALL_END(ctx, ret);
 	if (ret)
 		DRM_ERROR("Disabling all crtc's during unload failed with %i\n", ret);
-
-	DRM_MODESET_LOCK_ALL_END(ctx, ret);
 }
 EXPORT_SYMBOL(drm_atomic_helper_shutdown);
 
-- 
2.17.1




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

* Re: [Re-send][PATCH] gpu/drm: remove drm_modeset_lock protection for drm_error
  2020-09-02 13:17 [Re-send][PATCH] gpu/drm: remove drm_modeset_lock protection for drm_error Bernard
@ 2020-09-03  8:45 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2020-09-03  8:45 UTC (permalink / raw)
  To: Bernard
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, dri-devel, linux-kernel,
	opensource.kernel

On Wed, Sep 02, 2020 at 09:17:02PM +0800, Bernard wrote:
> In function drm_atomic_helper_shutdown, maybe there is no need
> to protect DRM_ERROR log in DRM_MODESET_LOCK_ALL_BEGIN &
> DRM_MODESET_LOCK_ALL_END. This change is to make code run a bit
> fast.
> 
> Signed-off-by: Bernard Zhao <bernard@vivo.com>

This is only run at driver unload, so really no need to optimize anything
for speed. And I think this change makes the code less symmetric, so not
really worth it imo.

Similar with the via change, drm/via is very very legacy code where the
next step will be to just outright delete it all.

Thanks anyway for submitting the patches, in other places such a change
would indeed make sense I think.
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 85d163f16801..8902fd6316fc 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -3100,12 +3100,10 @@ void drm_atomic_helper_shutdown(struct drm_device *dev)
>  	int ret;
>  
>  	DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
> -
>  	ret = drm_atomic_helper_disable_all(dev, &ctx);
> +	DRM_MODESET_LOCK_ALL_END(ctx, ret);
>  	if (ret)
>  		DRM_ERROR("Disabling all crtc's during unload failed with %i\n", ret);
> -
> -	DRM_MODESET_LOCK_ALL_END(ctx, ret);
>  }
>  EXPORT_SYMBOL(drm_atomic_helper_shutdown);
>  
> -- 
> 2.17.1
> 
> 
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

end of thread, other threads:[~2020-09-03  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 13:17 [Re-send][PATCH] gpu/drm: remove drm_modeset_lock protection for drm_error Bernard
2020-09-03  8:45 ` Daniel Vetter

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

all inboxes | Powered by JetHome®