diff options
author | Maarten Lankhorst <[email protected]> | 2017-07-11 16:33:03 +0200 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2017-07-26 13:22:40 +0200 |
commit | 813a7e1604eaad1c2792d37d402e1b48b8d0eb3f (patch) | |
tree | 7b5d4d1f32f75b980119e5010e94eea19fd46eaf | |
parent | e1923ab3d01ef600dbde84ee29822980e816ee79 (diff) |
drm/nouveau: Fix error handling in nv50_disp_atomic_commit
Make it more clear that post commit return ret is really return 0,
and add a missing drm_atomic_helper_cleanup_planes when
drm_atomic_helper_wait_for_fences fails.
Fixes: 839ca903f12e ("drm/nouveau/kms/nv50: transition to atomic interfaces internally")
Cc: Ben Skeggs <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: <[email protected]> # v4.10+
Signed-off-by: Maarten Lankhorst <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Sean Paul <[email protected]>
[mlankhorst: Use if (ret) to remove the goto in success case.]
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 5f71e304022e..c1e7307a2538 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -4120,7 +4120,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, if (!nonblock) { ret = drm_atomic_helper_wait_for_fences(dev, state, true); if (ret) - goto done; + goto err_cleanup; } for_each_plane_in_state(state, plane, plane_state, i) { @@ -4148,7 +4148,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, if (crtc->state->enable) { if (!drm->have_disp_power_ref) { drm->have_disp_power_ref = true; - return ret; + return 0; } active = true; break; @@ -4160,6 +4160,9 @@ nv50_disp_atomic_commit(struct drm_device *dev, drm->have_disp_power_ref = false; } +err_cleanup: + if (ret) + drm_atomic_helper_cleanup_planes(dev, state); done: pm_runtime_put_autosuspend(dev->dev); return ret; |