[Intel-gfx] [PATCH] drm: Fix locking gotcha in page_flip ioctl

Harry Wentland harry.wentland at amd.com
Thu Mar 30 21:26:25 UTC 2017


Reviewed-by: Harry Wentland <harry.wentland at amd.com>

Harry


On 2017-03-30 04:48 PM, Daniel Vetter wrote:
> We want to lock the primary plane, not the cursor (which might be
> optional). Real bad case of copy-paste fail, unfortunately our CI
> didn't catch that because i915 does have a cursor plane.
>
> Cc: Eric Anholt <eric at anholt.net>
> Reported-by: Eric Anholt <eric at anholt.net>
> Fixes: 29dc0d1de182 ("drm: Roll out acquire context for the page_flip ioctl")
> Cc: Harry Wentland <harry.wentland at amd.com>
> Cc: Daniel Vetter <daniel.vetter at intel.com>
> Cc: Jani Nikula <jani.nikula at linux.intel.com>
> Cc: Sean Paul <seanpaul at chromium.org>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  drivers/gpu/drm/drm_plane.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index 3a6de27bafed..838ca742a28b 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -871,7 +871,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
>  	ret = drm_modeset_lock(&crtc->mutex, &ctx);
>  	if (ret)
>  		goto out;
> -	ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx);
> +	ret = drm_modeset_lock(&crtc->primary->mutex, &ctx);
>  	if (ret)
>  		goto out;
>
>


More information about the Intel-gfx mailing list