Skip to content

Commit a3397b2

Browse files
Tvrtko Ursulinlucasdemarchi
authored andcommitted
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 <[email protected]> Cc: Lucas De Marchi <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 5ce511a commit a3397b2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/gpu/drm/xe/xe_lrc.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ struct bo_setup_state {
984984
struct xe_lrc *lrc;
985985
struct xe_hw_engine *hwe;
986986
size_t max_size;
987+
size_t reserve_dw;
987988
unsigned int offset;
988989
const struct bo_setup *funcs;
989990
unsigned int num_funcs;
@@ -1017,10 +1018,10 @@ static int setup_bo(struct bo_setup_state *state)
10171018
remain -= len;
10181019

10191020
/*
1020-
* There should always be at least 1 additional dword for
1021-
* the end marker
1021+
* Caller has asked for at least reserve_dw to remain unused.
10221022
*/
1023-
if (len < 0 || xe_gt_WARN_ON(state->lrc->gt, remain < 1))
1023+
if (len < 0 ||
1024+
xe_gt_WARN_ON(state->lrc->gt, remain < state->reserve_dw))
10241025
goto fail;
10251026

10261027
state->ptr += len;
@@ -1054,6 +1055,7 @@ static int setup_wa_bb(struct xe_lrc *lrc, struct xe_hw_engine *hwe)
10541055
.lrc = lrc,
10551056
.hwe = hwe,
10561057
.max_size = LRC_WA_BB_SIZE,
1058+
.reserve_dw = 1,
10571059
.offset = __xe_lrc_wa_bb_offset(lrc),
10581060
.funcs = funcs,
10591061
.num_funcs = ARRAY_SIZE(funcs),

0 commit comments

Comments
 (0)