[PATCH] drm: fix page_flip error handling
Michel Dänzer
michel at daenzer.net
Tue Apr 17 22:51:55 PDT 2012
On Mit, 2012-04-18 at 13:47 +0900, Joonyoung Shim wrote:
> Free event and restore event_space only when page_flip->flags has
> DRM_MODE_PAGE_FLIP_EVENT if page_flip() is failed.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim at samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> ---
> drivers/gpu/drm/drm_crtc.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index d3aaeb6..c79870a 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -3335,10 +3335,12 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
>
> ret = crtc->funcs->page_flip(crtc, fb, e);
> if (ret) {
> - spin_lock_irqsave(&dev->event_lock, flags);
> - file_priv->event_space += sizeof e->event;
> - spin_unlock_irqrestore(&dev->event_lock, flags);
> - kfree(e);
> + if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
> + spin_lock_irqsave(&dev->event_lock, flags);
> + file_priv->event_space += sizeof e->event;
> + spin_unlock_irqrestore(&dev->event_lock, flags);
> + kfree(e);
> + }
> }
>
> out:
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Debian, X and DRI developer
More information about the dri-devel
mailing list