diff options
author | Thomas Hellström <thomas.hellstrom@linux.intel.com> | 2023-03-09 19:20:20 +0300 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-20 02:30:13 +0300 |
commit | 7c51050b3b0799f5d74331a7eb81a7066d520731 (patch) | |
tree | a8f43681ea3425112ee321a02a3214c475207575 /drivers/gpu/drm/xe/xe_hw_fence.c | |
parent | 8eb7ad99ae66b4244a1239bfa8723d1a06beddb9 (diff) | |
download | linux-7c51050b3b0799f5d74331a7eb81a7066d520731.tar.xz |
drm/xe: Use a define to set initial seqno for fences
Also for HW fences, write the initial seqno - 1 to the HW completed
seqno to initialize.
v2:
- Use __dma_fence_is_later() to compare hw fence seqnos. (Matthew Auld)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_hw_fence.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_hw_fence.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/xe_hw_fence.c b/drivers/gpu/drm/xe/xe_hw_fence.c index e56ca2867545..ffe1a3992ef5 100644 --- a/drivers/gpu/drm/xe/xe_hw_fence.c +++ b/drivers/gpu/drm/xe/xe_hw_fence.c @@ -129,7 +129,7 @@ void xe_hw_fence_ctx_init(struct xe_hw_fence_ctx *ctx, struct xe_gt *gt, ctx->gt = gt; ctx->irq = irq; ctx->dma_fence_ctx = dma_fence_context_alloc(1); - ctx->next_seqno = 1; + ctx->next_seqno = XE_FENCE_INITIAL_SEQNO; sprintf(ctx->name, "%s", name); } @@ -165,7 +165,7 @@ static bool xe_hw_fence_signaled(struct dma_fence *dma_fence) u32 seqno = xe_map_rd(xe, &fence->seqno_map, 0, u32); return dma_fence->error || - (s32)fence->dma.seqno <= (s32)seqno; + !__dma_fence_is_later(dma_fence->seqno, seqno, dma_fence->ops); } static bool xe_hw_fence_enable_signaling(struct dma_fence *dma_fence) |