From: Nirmoy Das <nirmoy.das@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: thomas.hellstrom@intel.com, matthew.auld@intel.com,
chris.p.wilson@intel.com, nirmoy.das@intel.com
Subject: [Intel-gfx] [PATCH] drm/i915: individualize fences before adding
Date: Mon, 16 May 2022 17:51:08 +0200 [thread overview]
Message-ID: <20220516155108.2103-1-nirmoy.das@intel.com> (raw)
_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
v2: make sure to reserve fence slots before adding.
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 | 44 +++++++++++++++++++++------------
1 file changed, 28 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 4f6db539571a..b622e51bf132 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"
@@ -1833,28 +1834,39 @@ int _i915_vma_move_to_active(struct i915_vma *vma,
intel_frontbuffer_put(front);
}
- if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
- err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
- if (unlikely(err))
- return err;
- }
-
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) {
+ if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
+ err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
+ if (unlikely(err))
+ return err;
+ }
+
+ dma_resv_add_fence(vma->obj->base.resv, curr,
+ DMA_RESV_USAGE_WRITE);
+ }
obj->write_domain = I915_GEM_DOMAIN_RENDER;
obj->read_domains = 0;
}
} else {
- if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
- err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
- if (unlikely(err))
- return err;
- }
-
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) {
+ if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
+ err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
+ if (unlikely(err))
+ return err;
+ }
+
+
+ dma_resv_add_fence(vma->obj->base.resv, curr,
+ DMA_RESV_USAGE_READ);
+ }
obj->write_domain = 0;
}
}
--
2.35.1
next reply other threads:[~2022-05-16 15:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-16 15:51 Nirmoy Das [this message]
2022-05-16 16:30 ` [Intel-gfx] [PATCH] drm/i915: individualize fences before adding Das, Nirmoy
2022-05-16 19:08 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: individualize fences before adding (rev2) Patchwork
2022-05-16 23:36 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2022-05-13 11:37 [Intel-gfx] [PATCH] drm/i915: individualize fences before adding Nirmoy Das
2022-05-16 9:38 ` Hellstrom, Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220516155108.2103-1-nirmoy.das@intel.com \
--to=nirmoy.das@intel.com \
--cc=chris.p.wilson@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=thomas.hellstrom@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox