mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
drm/xe: Track number of written dwords from workaround batch buffer emission
Indirect context setup will need to get to the number of written dwords. Lets add it as an output parameter so it can be accessed from the finish helper regardless of whether code is writing directly or via an shadow buffer. 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-5-tvrtko.ursulin@igalia.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
This commit is contained in:
committed by
Lucas De Marchi
parent
1ec31d355c
commit
5ce511ad2b
@@ -991,6 +991,7 @@ struct bo_setup_state {
|
||||
/* State: */
|
||||
u32 *buffer;
|
||||
u32 *ptr;
|
||||
unsigned int written;
|
||||
};
|
||||
|
||||
static int setup_bo(struct bo_setup_state *state)
|
||||
@@ -1023,6 +1024,7 @@ static int setup_bo(struct bo_setup_state *state)
|
||||
goto fail;
|
||||
|
||||
state->ptr += len;
|
||||
state->written += len;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1039,7 +1041,7 @@ static void finish_bo(struct bo_setup_state *state)
|
||||
|
||||
xe_map_memcpy_to(gt_to_xe(state->lrc->gt), &state->lrc->bo->vmap,
|
||||
state->offset, state->buffer,
|
||||
(state->ptr - state->buffer) * sizeof(u32));
|
||||
state->written * sizeof(u32));
|
||||
kfree(state->buffer);
|
||||
}
|
||||
|
||||
@@ -1063,6 +1065,7 @@ static int setup_wa_bb(struct xe_lrc *lrc, struct xe_hw_engine *hwe)
|
||||
return ret;
|
||||
|
||||
*state.ptr++ = MI_BATCH_BUFFER_END;
|
||||
state.written++;
|
||||
|
||||
finish_bo(&state);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user