mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +02:00
winsys/amdgpu: add _dw to max_ib_size variable for code readability
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
This commit is contained in:
parent
5147e9a26e
commit
0f117efe39
2 changed files with 9 additions and 9 deletions
|
|
@ -858,9 +858,9 @@ static bool amdgpu_ib_new_buffer(struct amdgpu_winsys *ws,
|
|||
* INDIRECT_BUFFER packet.
|
||||
*/
|
||||
if (cs->has_chaining)
|
||||
buffer_size = 4 * util_next_power_of_two(ib->max_ib_size);
|
||||
buffer_size = 4 * util_next_power_of_two(ib->max_ib_size_dw);
|
||||
else
|
||||
buffer_size = 4 * util_next_power_of_two(4 * ib->max_ib_size);
|
||||
buffer_size = 4 * util_next_power_of_two(4 * ib->max_ib_size_dw);
|
||||
|
||||
const unsigned min_size = MAX2(ib->max_check_space_size, 8 * 1024 * 4);
|
||||
const unsigned max_size = 512 * 1024 * 4;
|
||||
|
|
@ -929,11 +929,11 @@ static bool amdgpu_get_new_ib(struct amdgpu_winsys *ws,
|
|||
|
||||
if (!cs->has_chaining) {
|
||||
ib_size = MAX2(ib_size,
|
||||
4 * MIN2(util_next_power_of_two(ib->max_ib_size),
|
||||
4 * MIN2(util_next_power_of_two(ib->max_ib_size_dw),
|
||||
IB_MAX_SUBMIT_DWORDS));
|
||||
}
|
||||
|
||||
ib->max_ib_size = ib->max_ib_size - ib->max_ib_size / 32;
|
||||
ib->max_ib_size_dw = ib->max_ib_size_dw - ib->max_ib_size_dw / 32;
|
||||
|
||||
rcs->prev_dw = 0;
|
||||
rcs->num_prev = 0;
|
||||
|
|
@ -985,7 +985,7 @@ static void amdgpu_ib_finalize(struct amdgpu_winsys *ws, struct radeon_cmdbuf *r
|
|||
amdgpu_set_ib_size(rcs, ib);
|
||||
ib->used_ib_space += rcs->current.cdw * 4;
|
||||
ib->used_ib_space = align(ib->used_ib_space, ws->info.ip[ip_type].ib_alignment);
|
||||
ib->max_ib_size = MAX2(ib->max_ib_size, rcs->prev_dw + rcs->current.cdw);
|
||||
ib->max_ib_size_dw = MAX2(ib->max_ib_size_dw, rcs->prev_dw + rcs->current.cdw);
|
||||
}
|
||||
|
||||
static bool amdgpu_init_cs_context(struct amdgpu_winsys *ws,
|
||||
|
|
@ -1233,9 +1233,9 @@ static bool amdgpu_cs_check_space(struct radeon_cmdbuf *rcs, unsigned dw)
|
|||
assert(rcs->current.cdw <= rcs->current.max_dw);
|
||||
|
||||
/* 125% of the size for IB epilog. */
|
||||
unsigned requested_size = rcs->prev_dw + rcs->current.cdw + dw;
|
||||
unsigned requested_size_dw = rcs->prev_dw + rcs->current.cdw + dw;
|
||||
|
||||
if (requested_size > IB_MAX_SUBMIT_DWORDS)
|
||||
if (requested_size_dw > IB_MAX_SUBMIT_DWORDS)
|
||||
return false;
|
||||
|
||||
if (rcs->current.max_dw - rcs->current.cdw >= dw)
|
||||
|
|
@ -1246,7 +1246,7 @@ static bool amdgpu_cs_check_space(struct radeon_cmdbuf *rcs, unsigned dw)
|
|||
unsigned safe_byte_size = need_byte_size + need_byte_size / 4;
|
||||
ib->max_check_space_size = MAX2(ib->max_check_space_size,
|
||||
safe_byte_size);
|
||||
ib->max_ib_size = MAX2(ib->max_ib_size, requested_size);
|
||||
ib->max_ib_size_dw = MAX2(ib->max_ib_size_dw, requested_size_dw);
|
||||
|
||||
if (!cs->has_chaining)
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ struct amdgpu_ib {
|
|||
*/
|
||||
unsigned max_check_space_size;
|
||||
|
||||
unsigned max_ib_size;
|
||||
unsigned max_ib_size_dw;
|
||||
uint32_t *ptr_ib_size;
|
||||
bool ptr_ib_size_inside_ib;
|
||||
enum ib_type ib_type;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue