radv: Fix radeon_enc_code_ue with values over 2^16

This ports this fixes from radeonsi:

138ba42a87 ("radeonsi/vcn: Fix radeon_enc_code_ue with values over 2^16")

Cc: mesa-stable
Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31135>
This commit is contained in:
Dave Airlie
2024-09-10 05:18:17 +10:00
parent e0157abec6
commit e89f4a48fd

View File

@@ -382,7 +382,7 @@ radv_enc_flush_headers(struct radv_cmd_buffer *cmd_buffer)
static void
radv_enc_code_ue(struct radv_cmd_buffer *cmd_buffer, unsigned int value)
{
int x = -1;
unsigned int x = 0;
unsigned int ue_code = value + 1;
value += 1;
@@ -390,9 +390,9 @@ radv_enc_code_ue(struct radv_cmd_buffer *cmd_buffer, unsigned int value)
value = (value >> 1);
x += 1;
}
unsigned int ue_length = (x << 1) + 1;
radv_enc_code_fixed_bits(cmd_buffer, ue_code, ue_length);
if (x > 1)
radv_enc_code_fixed_bits(cmd_buffer, 0, x - 1);
radv_enc_code_fixed_bits(cmd_buffer, ue_code, x);
}
static void