Simon Ser
2021-Jan-14 21:44 UTC
[Nouveau] [PATCH] 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. Signed-off-by: Simon Ser <contact at emersion.fr> Cc: Ben Skeggs <bskeggs at redhat.com> Cc: Lyude Paul <lyude at redhat.com> Cc: Ilia Mirkin <imirkin at alum.mit.edu> --- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c index 0356474ad6f6..60aabb1bc095 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -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); } -- 2.30.0
Lyude Paul
2021-Jan-15 21:00 UTC
[Nouveau] [PATCH] drm/nouveau/dispnv50: cleanup on nv50_head_atom_get failure
Reviewed-by: Lyude Paul <lyude at redhat.com> On Thu, 2021-01-14 at 22:44 +0100, Simon Ser wrote:> When nv50_head_atom_get fails, we need to un-do everything we've > done so far: release the fence and unpin the BO. > > Signed-off-by: Simon Ser <contact at emersion.fr> > Cc: Ben Skeggs <bskeggs at redhat.com> > Cc: Lyude Paul <lyude at redhat.com> > Cc: Ilia Mirkin <imirkin at alum.mit.edu> > --- > ?drivers/gpu/drm/nouveau/dispnv50/wndw.c | 6 +++++- > ?1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c > b/drivers/gpu/drm/nouveau/dispnv50/wndw.c > index 0356474ad6f6..60aabb1bc095 100644 > --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c > +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c > @@ -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); > ????????}-- 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!