drm/atmel-hlcdc: Handle drm_atomic_helper_swap_state failure
drm_atomic_helper_swap_state() will be changed to interruptible waiting in the next few commits, so all drivers have to be changed to handling failure. Atmel tracks pending commits through dc->commit.pending, so it can ignore the changes by setting stall = false. We never return failure in this case, so make failure a BUG_ON. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170711143314.2148-5-maarten.lankhorst@linux.intel.com Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
committed by
Daniel Vetter
parent
8572636e45
commit
f4d41d930e
@@ -539,14 +539,13 @@ static int atmel_hlcdc_dc_atomic_commit(struct drm_device *dev,
|
|||||||
dc->commit.pending = true;
|
dc->commit.pending = true;
|
||||||
spin_unlock(&dc->commit.wait.lock);
|
spin_unlock(&dc->commit.wait.lock);
|
||||||
|
|
||||||
if (ret) {
|
if (ret)
|
||||||
kfree(commit);
|
goto err_free;
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Swap the state, this is the point of no return. */
|
/* We have our own synchronization through the commit lock. */
|
||||||
drm_atomic_helper_swap_state(state, true);
|
BUG_ON(drm_atomic_helper_swap_state(state, false) < 0);
|
||||||
|
|
||||||
|
/* Swap state succeeded, this is the point of no return. */
|
||||||
drm_atomic_state_get(state);
|
drm_atomic_state_get(state);
|
||||||
if (async)
|
if (async)
|
||||||
queue_work(dc->wq, &commit->work);
|
queue_work(dc->wq, &commit->work);
|
||||||
@@ -555,6 +554,8 @@ static int atmel_hlcdc_dc_atomic_commit(struct drm_device *dev,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_free:
|
||||||
|
kfree(commit);
|
||||||
error:
|
error:
|
||||||
drm_atomic_helper_cleanup_planes(dev, state);
|
drm_atomic_helper_cleanup_planes(dev, state);
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user