AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/nouveau: wait for moving fence after pinning
@ 2021-06-21 13:03 Christian König
  2021-06-21 13:03 ` [PATCH 2/3] drm/radeon: " Christian König
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Christian König @ 2021-06-21 13:03 UTC (permalink / raw)
  To: dri-devel, daniel.vetter, nouveau, amd-gfx

We actually need to wait for the moving fence after pinning
the BO to make sure that the pin is completed.

Signed-off-by: Christian König <christian.koenig@amd.com>
CC: stable@kernel.org
---
 drivers/gpu/drm/nouveau/nouveau_prime.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c
index 347488685f74..591738545eba 100644
--- a/drivers/gpu/drm/nouveau/nouveau_prime.c
+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
@@ -93,7 +93,13 @@ int nouveau_gem_prime_pin(struct drm_gem_object *obj)
 	if (ret)
 		return -EINVAL;
 
-	return 0;
+	if (nvbo->bo.moving) {
+		ret = dma_fence_wait(nvbo->bo.moving, true);
+		if (ret)
+			nouveau_bo_unpin(nvbo);
+	}
+
+	return ret;
 }
 
 void nouveau_gem_prime_unpin(struct drm_gem_object *obj)
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2021-06-22  9:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-21 13:03 [PATCH 1/3] drm/nouveau: wait for moving fence after pinning Christian König
2021-06-21 13:03 ` [PATCH 2/3] drm/radeon: " Christian König
2021-06-21 14:55   ` Daniel Vetter
2021-06-21 13:03 ` [PATCH 3/3] drm/amdgpu: " Christian König
2021-06-21 14:56   ` Daniel Vetter
2021-06-21 14:54 ` [PATCH 1/3] drm/nouveau: " Daniel Vetter
2021-06-21 15:49   ` Christian König
2021-06-21 15:53     ` Daniel Vetter
2021-06-22  9:20       ` Daniel Vetter
2021-06-22  9:29         ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox