winsys/amdgpu: represent IB_MAX_SUBMIT_DWORDS in bytes

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27060>
This commit is contained in:
Marek Olšák 2024-01-07 17:00:35 -05:00 committed by Marge Bot
parent a008a7dcdf
commit fd1e36a044
2 changed files with 4 additions and 4 deletions

View file

@ -793,8 +793,8 @@ 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(main_ib->max_ib_size_dw),
IB_MAX_SUBMIT_DWORDS));
MIN2(4 * util_next_power_of_two(main_ib->max_ib_size_dw),
IB_MAX_SUBMIT_BYTES));
}
main_ib->max_ib_size_dw = main_ib->max_ib_size_dw - main_ib->max_ib_size_dw / 32;
@ -1074,7 +1074,7 @@ static bool amdgpu_cs_check_space(struct radeon_cmdbuf *rcs, unsigned dw)
unsigned projected_size_dw = rcs->prev_dw + rcs->current.cdw + dw;
if (projected_size_dw > IB_MAX_SUBMIT_DWORDS)
if (projected_size_dw * 4 > IB_MAX_SUBMIT_BYTES)
return false;
if (rcs->current.max_dw - rcs->current.cdw >= dw)

View file

@ -16,7 +16,7 @@
* waiting for buffers and fences. Proof:
* http://www.phoronix.com/scan.php?page=article&item=mesa-111-si&num=1
*/
#define IB_MAX_SUBMIT_DWORDS (20 * 1024)
#define IB_MAX_SUBMIT_BYTES (80 * 1024)
struct amdgpu_ctx {
struct pipe_reference reference;