@@ -4091,7 +4091,7 @@ nv50_disp_atomic_commit(struct drm_devic
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) {
@@ -4119,7 +4119,7 @@ nv50_disp_atomic_commit(struct drm_devic
if (crtc->state->enable) {
if (!drm->have_disp_power_ref) {
drm->have_disp_power_ref = true;
- return ret;
+ return 0;
}
active = true;
break;
@@ -4131,6 +4131,9 @@ nv50_disp_atomic_commit(struct drm_devic
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;