From: Iago Toral Quiroga Date: Thu, 29 Jun 2023 08:07:45 +0000 (+0200) Subject: v3dv: use div_round_up for division by block size X-Git-Tag: upstream/23.3.3~6334 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=599e76617daf3deebc2aa0237c16a671401b2e56;p=platform%2Fupstream%2Fmesa.git v3dv: use div_round_up for division by block size We always want to round up when we divide by the block size. Reviewed-by: Alejandro PiƱeiro Part-of: --- diff --git a/src/broadcom/vulkan/v3dv_meta_copy.c b/src/broadcom/vulkan/v3dv_meta_copy.c index 8e31cc7..1b953cb 100644 --- a/src/broadcom/vulkan/v3dv_meta_copy.c +++ b/src/broadcom/vulkan/v3dv_meta_copy.c @@ -703,8 +703,8 @@ gather_image_to_buffer_info(struct v3dv_cmd_buffer *cmd_buffer, vk_format_get_blockwidth(image->planes[plane].vk_format); uint32_t block_height = vk_format_get_blockheight(image->planes[plane].vk_format); - buf_width = buf_width / block_width; - buf_height = buf_height / block_height; + buf_width = DIV_ROUND_UP(buf_width, block_width); + buf_height = DIV_ROUND_UP(buf_height, block_height); out_info->src_format = src_format; out_info->dst_format = dst_format;