radeonsi: Use DIV_ROUND_UP instead of ALIGN_POT

DIV_ROUND_UP is the correct replacement for ALIGN_TO.

Fixes: ba83c1e2
Signed-off-by: David Rosca <nowrep@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24127>
This commit is contained in:
David Rosca
2023-07-13 09:14:00 +02:00
committed by Marge Bot
parent 6d312c6160
commit d408ae88db
2 changed files with 6 additions and 6 deletions

View File

@@ -719,10 +719,10 @@ static int setup_dpb(struct radeon_encoder *enc)
offset = 0;
if (enc_pic->quality_modes.pre_encode_mode) {
uint32_t pre_size = ALIGN_POT((aligned_width >> 2), rec_alignment) *
ALIGN_POT((aligned_height >> 2), rec_alignment);
uint32_t full_size = ALIGN_POT(aligned_width, rec_alignment) *
ALIGN_POT(aligned_height, rec_alignment);
uint32_t pre_size = DIV_ROUND_UP((aligned_width >> 2), rec_alignment) *
DIV_ROUND_UP((aligned_height >> 2), rec_alignment);
uint32_t full_size = DIV_ROUND_UP(aligned_width, rec_alignment) *
DIV_ROUND_UP(aligned_height, rec_alignment);
pre_size = align(pre_size, 4);
full_size = align(full_size, 4);
@@ -1168,7 +1168,7 @@ static void radeon_enc_av1_bs_copy_end(struct radeon_encoder *enc, uint32_t bits
{
assert(bits > 0);
/* it must be dword aligned at the end */
*enc->enc_pic.copy_start = ALIGN_POT(bits, 32) * 4 + 12;
*enc->enc_pic.copy_start = DIV_ROUND_UP(bits, 32) * 4 + 12;
*(enc->enc_pic.copy_start + 2) = bits;
}

View File

@@ -177,7 +177,7 @@
#define RENCODE_COLOR_SPACE_YUV 0
#define PIPE_ALIGN_IN_BLOCK_SIZE(value, alignment) ALIGN_POT(value, alignment)
#define PIPE_ALIGN_IN_BLOCK_SIZE(value, alignment) DIV_ROUND_UP(value, alignment)
#define RADEON_ENC_CS(value) (enc->cs.current.buf[enc->cs.current.cdw++] = (value))
#define RADEON_ENC_BEGIN(cmd) \