drm/nouveau/dispnv50: cleanup on nv50_head_atom_get failure
Subsystems (3)
PATCH 1/1 drm/nouveau/dispnv50: cleanup on nv50_head_atom_get failure
When nv50_head_atom_get fails, we need to un-do everything we've done so far: release the fence and unpin the BO.
--- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/dispnv50/wndw.c +5 -1
@@ -562,8 +562,12 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state)if (wndw->func->prepare) { asyh =nv50_head_atom_get (asyw->state.state, asyw->state.crtc); -if (IS_ERR (asyh)) +if (IS_ERR (asyh)) { +dma_fence_put (asyw->state.fence); + asyw->state.fence =NULL ; +nouveau_bo_unpin (nvbo);return PTR_ERR (asyh); + } wndw->func->prepare (wndw, asyh, asyw); }
Signature · 1 line
2.30.0
A message that is not in the archive (sent off-list or not yet received): 20210114214406.77976-1-contact-sV0wSBM+kKVWj0EZb7rXcA@public.gmane.org
Lyude Paul
Reviewed-byQuoted 32 lines · Simon Ser
When
nv50_head_atom_getfails, we need to un-do everything we've done so far: release the fence and unpin the BO.Signed-off-by Simon Ser <[email protected]>Cc Ben Skeggs <[email protected]>Cc Lyude Paul <[email protected]>Cc Ilia Mirkin <[email protected]>---
drivers/gpu/drm/nouveau/dispnv50/wndw.c | 6 +++++-1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/nouveau/dispnv50/wndw.c +0
-0@@ -562,8 +562,12 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state)
if (wndw->func->prepare) {
asyh = nv50_head_atom_get(asyw->state.state, asyw-Quoted 1 line
state.crtc);
- if (
IS_ERR(asyh))
+ if (IS_ERR(asyh)) {
+ dma_fence_put(asyw->state.fence); + asyw->state.fence = NULL; + nouveau_bo_unpin(nvbo); returnPTR_ERR(asyh);
+ }
wndw->func->prepare(wndw, asyh, asyw); }
Signature · 13 lines
Sincerely, Lyude Paul (she/her) Software Engineer at Red Hat Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've asked me a question, are waiting for a review/merge on a patch, etc. and I haven't responded in a while, please feel free to send me another email to check on my status. I don't bite! _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau