#include "xe_device.h"
#include "xe_gt.h"
+#include "xe_hw_fence.h"
#include "xe_lrc.h"
#include "xe_macros.h"
#include "xe_migrate.h"
if (xe_engine_is_parallel(e)) {
e->parallel.composite_fence_ctx = dma_fence_context_alloc(1);
- e->parallel.composite_fence_seqno = 1;
+ e->parallel.composite_fence_seqno = XE_FENCE_INITIAL_SEQNO;
}
if (e->flags & ENGINE_FLAG_VM) {
e->bind.fence_ctx = dma_fence_context_alloc(1);
- e->bind.fence_seqno = 1;
+ e->bind.fence_seqno = XE_FENCE_INITIAL_SEQNO;
}
for (i = 0; i < width; ++i) {
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);
}
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)
#include "xe_hw_fence_types.h"
+#define XE_FENCE_INITIAL_SEQNO 1
+
int xe_hw_fence_module_init(void);
void xe_hw_fence_module_exit(void);
arb_enable = MI_ARB_ON_OFF | MI_ARB_ENABLE;
xe_lrc_write_ring(lrc, &arb_enable, sizeof(arb_enable));
+ map = __xe_lrc_seqno_map(lrc);
+ xe_map_write32(lrc_to_xe(lrc), &map, lrc->fence_ctx.next_seqno - 1);
+
return 0;
err_lrc_finish: