]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/xelp: Add AuxCCS invalidation to the indirect context workarounds
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tue, 24 Mar 2026 08:40:13 +0000 (08:40 +0000)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 24 Mar 2026 13:29:11 +0000 (09:29 -0400)
Following from the i915 reference implementation, we add the AuxCCS
invalidation to the indirect context workarounds page.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20260324084018.20353-8-tvrtko.ursulin@igalia.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_lrc.c

index dde3bcff3c225ddde726c011f7322b7880b35887..24f4c7210cfb247f7431aaddc43908088a66cd3a 100644 (file)
@@ -28,6 +28,7 @@
 #include "xe_map.h"
 #include "xe_memirq.h"
 #include "xe_mmio.h"
+#include "xe_ring_ops.h"
 #include "xe_sriov.h"
 #include "xe_trace_lrc.h"
 #include "xe_vm.h"
@@ -94,6 +95,9 @@ gt_engine_needs_indirect_ctx(struct xe_gt *gt, enum xe_engine_class class)
                                               class, NULL))
                return true;
 
+       if (gt->ring_ops[class]->emit_aux_table_inv)
+               return true;
+
        return false;
 }
 
@@ -1217,6 +1221,23 @@ static ssize_t setup_invalidate_state_cache_wa(struct xe_lrc *lrc,
        return cmd - batch;
 }
 
+static ssize_t setup_invalidate_auxccs_wa(struct xe_lrc *lrc,
+                                         struct xe_hw_engine *hwe,
+                                         u32 *batch, size_t max_len)
+{
+       struct xe_gt *gt = lrc->gt;
+       u32 *(*emit)(struct xe_gt *gt, u32 *cmd) =
+               gt->ring_ops[hwe->class]->emit_aux_table_inv;
+
+       if (!emit)
+               return 0;
+
+       if (xe_gt_WARN_ON(gt, max_len < 8))
+               return -ENOSPC;
+
+       return emit(gt, batch) - batch;
+}
+
 struct bo_setup {
        ssize_t (*setup)(struct xe_lrc *lrc, struct xe_hw_engine *hwe,
                         u32 *batch, size_t max_size);
@@ -1349,9 +1370,11 @@ setup_indirect_ctx(struct xe_lrc *lrc, struct xe_hw_engine *hwe)
 {
        static const struct bo_setup rcs_funcs[] = {
                { .setup = setup_timestamp_wa },
+               { .setup = setup_invalidate_auxccs_wa },
                { .setup = setup_configfs_mid_ctx_restore_bb },
        };
        static const struct bo_setup xcs_funcs[] = {
+               { .setup = setup_invalidate_auxccs_wa },
                { .setup = setup_configfs_mid_ctx_restore_bb },
        };
        struct bo_setup_state state = {