Maarten Lankhorst
2017-Jul-11 14:33 UTC
[Nouveau] [PATCH v2 01/12] 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 <bskeggs at redhat.com>
Cc: dri-devel at lists.freedesktop.org
Cc: nouveau at lists.freedesktop.org
Cc: <stable at vger.kernel.org> # v4.10+
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
drivers/gpu/drm/nouveau/nv50_display.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c
b/drivers/gpu/drm/nouveau/nv50_display.c
index 42a85c14aea0..8fb55b96c40f 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -4119,7 +4119,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) {
@@ -4147,7 +4147,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;
@@ -4158,7 +4158,10 @@ nv50_disp_atomic_commit(struct drm_device *dev,
pm_runtime_put_autosuspend(dev->dev);
drm->have_disp_power_ref = false;
}
+ goto done;
+err_cleanup:
+ drm_atomic_helper_cleanup_planes(dev, state);
done:
pm_runtime_put_autosuspend(dev->dev);
return ret;
--
2.11.0
Daniel Vetter
2017-Jul-14 14:28 UTC
[Nouveau] [Intel-gfx] [PATCH v2 01/12] drm/nouveau: Fix error handling in nv50_disp_atomic_commit
On Tue, Jul 11, 2017 at 04:33:03PM +0200, Maarten Lankhorst wrote:> 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 <bskeggs at redhat.com> > Cc: dri-devel at lists.freedesktop.org > Cc: nouveau at lists.freedesktop.org > Cc: <stable at vger.kernel.org> # v4.10+ > Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com> > --- > drivers/gpu/drm/nouveau/nv50_display.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c > index 42a85c14aea0..8fb55b96c40f 100644 > --- a/drivers/gpu/drm/nouveau/nv50_display.c > +++ b/drivers/gpu/drm/nouveau/nv50_display.c > @@ -4119,7 +4119,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) { > @@ -4147,7 +4147,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; > @@ -4158,7 +4158,10 @@ nv50_disp_atomic_commit(struct drm_device *dev, > pm_runtime_put_autosuspend(dev->dev); > drm->have_disp_power_ref = false; > } > + goto done; >A bit convoluted, I prefer to wrap these in if (ret) to make them only run for the failure case. Either way: Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>> +err_cleanup: > + drm_atomic_helper_cleanup_planes(dev, state); > done: > pm_runtime_put_autosuspend(dev->dev); > return ret; > -- > 2.11.0 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx-- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Possibly Parallel Threads
- [PATCH 01/12] drm/nouveau: Fix error handling in nv50_disp_atomic_commit
- [PATCH 4.12 35/43] drm/nouveau: Fix error handling in nv50_disp_atomic_commit
- [PATCH 1/2] drm/atomic: Change drm_atomic_helper_swap_state to return an error.
- [PATCH 4.13 39/47] drm/nouveau: Fix error handling in nv50_disp_atomic_commit
- [PATCH v2 2/3] drm/nouveau: Fix runtime PM leak in nv50_disp_atomic_commit()