Commit 209db16d authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Greg Kroah-Hartman

drm/nouveau: Fix error handling in nv50_disp_atomic_commit

commit 813a7e16 upstream.

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: 839ca903 ("drm/nouveau/kms/nv50: transition to atomic interfaces internally")
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170711143314.2148-2-maarten.lankhorst@linux.intel.comReviewed-by: default avatarSean Paul <seanpaul@chromium.org>
[mlankhorst: Use if (ret) to remove the goto in success case.]
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a6034956
...@@ -4134,7 +4134,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, ...@@ -4134,7 +4134,7 @@ nv50_disp_atomic_commit(struct drm_device *dev,
if (!nonblock) { if (!nonblock) {
ret = drm_atomic_helper_wait_for_fences(dev, state, true); ret = drm_atomic_helper_wait_for_fences(dev, state, true);
if (ret) if (ret)
goto done; goto err_cleanup;
} }
for_each_plane_in_state(state, plane, plane_state, i) { for_each_plane_in_state(state, plane, plane_state, i) {
...@@ -4162,7 +4162,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, ...@@ -4162,7 +4162,7 @@ nv50_disp_atomic_commit(struct drm_device *dev,
if (crtc->state->enable) { if (crtc->state->enable) {
if (!drm->have_disp_power_ref) { if (!drm->have_disp_power_ref) {
drm->have_disp_power_ref = true; drm->have_disp_power_ref = true;
return ret; return 0;
} }
active = true; active = true;
break; break;
...@@ -4174,6 +4174,9 @@ nv50_disp_atomic_commit(struct drm_device *dev, ...@@ -4174,6 +4174,9 @@ nv50_disp_atomic_commit(struct drm_device *dev,
drm->have_disp_power_ref = false; drm->have_disp_power_ref = false;
} }
err_cleanup:
if (ret)
drm_atomic_helper_cleanup_planes(dev, state);
done: done:
pm_runtime_put_autosuspend(dev->dev); pm_runtime_put_autosuspend(dev->dev);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment