Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Allow specifying number of extra dwords at the end of wa bb emission

Indirect context setup will need more than one.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20250711160153.49833-6-tvrtko.ursulin@igalia.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

authored by

Tvrtko Ursulin and committed by
Lucas De Marchi
a3397b24 5ce511ad

+5 -3
+5 -3
drivers/gpu/drm/xe/xe_lrc.c
··· 984 984 struct xe_lrc *lrc; 985 985 struct xe_hw_engine *hwe; 986 986 size_t max_size; 987 + size_t reserve_dw; 987 988 unsigned int offset; 988 989 const struct bo_setup *funcs; 989 990 unsigned int num_funcs; ··· 1018 1017 remain -= len; 1019 1018 1020 1019 /* 1021 - * There should always be at least 1 additional dword for 1022 - * the end marker 1020 + * Caller has asked for at least reserve_dw to remain unused. 1023 1021 */ 1024 - if (len < 0 || xe_gt_WARN_ON(state->lrc->gt, remain < 1)) 1022 + if (len < 0 || 1023 + xe_gt_WARN_ON(state->lrc->gt, remain < state->reserve_dw)) 1025 1024 goto fail; 1026 1025 1027 1026 state->ptr += len; ··· 1055 1054 .lrc = lrc, 1056 1055 .hwe = hwe, 1057 1056 .max_size = LRC_WA_BB_SIZE, 1057 + .reserve_dw = 1, 1058 1058 .offset = __xe_lrc_wa_bb_offset(lrc), 1059 1059 .funcs = funcs, 1060 1060 .num_funcs = ARRAY_SIZE(funcs),