Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915: individualize fences before adding
@ 2022-05-13 11:37 Nirmoy Das
  2022-05-13 14:54 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
  2022-05-16  9:38 ` [Intel-gfx] [PATCH] " Hellstrom, Thomas
  0 siblings, 2 replies; 4+ messages in thread
From: Nirmoy Das @ 2022-05-13 11:37 UTC (permalink / raw)
  To: intel-gfx; +Cc: thomas.hellstrom, matthew.auld

_i915_vma_move_to_active() can receive > 1 fence for
multiple batch buffer submission so make sure to
individualize fences before adding to dma_resv obj

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5614
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 4f6db539571a..f987fc1264c0 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -23,6 +23,7 @@
  */
 
 #include <linux/sched/mm.h>
+#include <linux/dma-fence-array.h>
 #include <drm/drm_gem.h>
 
 #include "display/intel_frontbuffer.h"
@@ -1840,8 +1841,12 @@ int _i915_vma_move_to_active(struct i915_vma *vma,
 		}
 
 		if (fence) {
-			dma_resv_add_fence(vma->obj->base.resv, fence,
-					   DMA_RESV_USAGE_WRITE);
+			int idx;
+			struct dma_fence *curr;
+
+			dma_fence_array_for_each(curr, idx, fence)
+				dma_resv_add_fence(vma->obj->base.resv, curr,
+						   DMA_RESV_USAGE_WRITE);
 			obj->write_domain = I915_GEM_DOMAIN_RENDER;
 			obj->read_domains = 0;
 		}
@@ -1853,8 +1858,12 @@ int _i915_vma_move_to_active(struct i915_vma *vma,
 		}
 
 		if (fence) {
-			dma_resv_add_fence(vma->obj->base.resv, fence,
-					   DMA_RESV_USAGE_READ);
+			int idx;
+			struct dma_fence *curr;
+
+			dma_fence_array_for_each(curr, idx, fence)
+				dma_resv_add_fence(vma->obj->base.resv, curr,
+						   DMA_RESV_USAGE_READ);
 			obj->write_domain = 0;
 		}
 	}
-- 
2.35.1


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

end of thread, other threads:[~2022-05-16 10:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-13 11:37 [Intel-gfx] [PATCH] drm/i915: individualize fences before adding Nirmoy Das
2022-05-13 14:54 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2022-05-16 10:57   ` Das, Nirmoy
2022-05-16  9:38 ` [Intel-gfx] [PATCH] " Hellstrom, Thomas

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