[Intel-gfx] [PATCH] drm/i915: replacing drm_modeset_lock_all for DRM_MODESET_LOCK_ALL_*

Jani Nikula jani.nikula at linux.intel.com
Tue Oct 12 07:45:53 UTC 2021


On Sun, 10 Oct 2021, Maíra Canal <maira.canal at usp.br> wrote:
> As requested in GPU Driver Developers Guide TODO list, replaces all
> drm_lock boilerplates for DRM_MODESET_LOCK_ALL_* helpers.

Please see [1].

Also, all i915 patches must be Cc'd to intel-gfx mailing list. Please
see MAINTAINERS file.


BR,
Jani.


[1] https://lore.kernel.org/r/20211007193755.29579-1-greenfoo@u92.eu


>
> Signed-off-by: Maíra Canal <maira.canal at usp.br>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 17f44ffea586..71b7ff7b7dea 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -13466,22 +13466,13 @@ void intel_display_resume(struct drm_device *dev)
>  	if (state)
>  		state->acquire_ctx = &ctx;
>  
> -	drm_modeset_acquire_init(&ctx, 0);
> -
> -	while (1) {
> -		ret = drm_modeset_lock_all_ctx(dev, &ctx);
> -		if (ret != -EDEADLK)
> -			break;
> -
> -		drm_modeset_backoff(&ctx);
> -	}
> +	DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
>  
>  	if (!ret)
>  		ret = __intel_display_resume(dev, state, &ctx);
>  
>  	intel_enable_ipc(dev_priv);
> -	drm_modeset_drop_locks(&ctx);
> -	drm_modeset_acquire_fini(&ctx);
> +	DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
>  
>  	if (ret)
>  		drm_err(&dev_priv->drm,

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list