[Intel-xe] [PATCH 23/26] drm/xe: Add xe_hw_fence_signal helper
Matthew Brost
matthew.brost at intel.com
Thu Oct 26 04:02:10 UTC 2023
This help implement cpu binds in run_job by having a helper to signal
the cpu bind job's fence.
Signed-off-by: Matthew Brost <matthw.brost at intel.com>
---
drivers/gpu/drm/xe/xe_hw_fence.c | 8 ++++++++
drivers/gpu/drm/xe/xe_hw_fence.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_hw_fence.c b/drivers/gpu/drm/xe/xe_hw_fence.c
index a6094c81f2ad..d53124587076 100644
--- a/drivers/gpu/drm/xe/xe_hw_fence.c
+++ b/drivers/gpu/drm/xe/xe_hw_fence.c
@@ -208,6 +208,14 @@ static struct xe_hw_fence *to_xe_hw_fence(struct dma_fence *fence)
return container_of(fence, struct xe_hw_fence, dma);
}
+void xe_hw_fence_signal(struct dma_fence *dma_fence)
+{
+ struct xe_hw_fence *fence = to_xe_hw_fence(dma_fence);
+ struct xe_device *xe = gt_to_xe(fence->ctx->gt);
+
+ xe_map_wr(xe, &fence->seqno_map, 0, u32, dma_fence->seqno);
+}
+
struct xe_hw_fence *xe_hw_fence_create(struct xe_hw_fence_ctx *ctx,
struct iosys_map seqno_map)
{
diff --git a/drivers/gpu/drm/xe/xe_hw_fence.h b/drivers/gpu/drm/xe/xe_hw_fence.h
index cfe5fd603787..faa0d7fb9ce9 100644
--- a/drivers/gpu/drm/xe/xe_hw_fence.h
+++ b/drivers/gpu/drm/xe/xe_hw_fence.h
@@ -26,5 +26,6 @@ void xe_hw_fence_ctx_finish(struct xe_hw_fence_ctx *ctx);
struct xe_hw_fence *xe_hw_fence_create(struct xe_hw_fence_ctx *ctx,
struct iosys_map seqno_map);
+void xe_hw_fence_signal(struct dma_fence *fence);
#endif
--
2.34.1
More information about the Intel-xe
mailing list