nouveau.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/dispnv50: cleanup on nv50_head_atom_get failure
@ 2021-01-14 21:44 Simon Ser
       [not found] ` <20210114214406.77976-1-contact-sV0wSBM+kKVWj0EZb7rXcA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Ser @ 2021-01-14 21:44 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Ben Skeggs

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-sV0wSBM+kKVWj0EZb7rXcA@public.gmane.org>
Cc: Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Lyude Paul <lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/nouveau/dispnv50: cleanup on nv50_head_atom_get failure
       [not found] ` <20210114214406.77976-1-contact-sV0wSBM+kKVWj0EZb7rXcA@public.gmane.org>
@ 2021-01-15 21:00   ` Lyude Paul
  0 siblings, 0 replies; 2+ messages in thread
From: Lyude Paul @ 2021-01-15 21:00 UTC (permalink / raw)
  To: Simon Ser, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Ben Skeggs

Reviewed-by: Lyude Paul <lyude@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@emersion.fr>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: Lyude Paul <lyude@redhat.com>
> Cc: Ilia Mirkin <imirkin@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!

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-15 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 21:44 [PATCH] drm/nouveau/dispnv50: cleanup on nv50_head_atom_get failure Simon Ser
     [not found] ` <20210114214406.77976-1-contact-sV0wSBM+kKVWj0EZb7rXcA@public.gmane.org>
2021-01-15 21:00   ` Lyude Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).