radeonsi/vcn: Fix calculating QP map region dimensions
It needs to be aligned to block size otherwise it would skip last row/column on resolutions like 1080p. Cc: mesa-stable Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37143>
This commit is contained in:
@@ -205,10 +205,10 @@ static void radeon_vcn_enc_get_roi_param(struct radeon_encoder *enc,
|
||||
} else
|
||||
map->qp_delta = region->qp_value;
|
||||
|
||||
map->x_in_unit = CLAMP((region->x / block_length), 0, width_in_block - 1);
|
||||
map->y_in_unit = CLAMP((region->y / block_length), 0, height_in_block - 1);
|
||||
map->width_in_unit = CLAMP((region->width / block_length), 0, width_in_block);
|
||||
map->height_in_unit = CLAMP((region->height / block_length), 0, width_in_block);
|
||||
map->x_in_unit = MIN2(DIV_ROUND_UP(region->x, block_length), width_in_block - 1);
|
||||
map->y_in_unit = MIN2(DIV_ROUND_UP(region->y, block_length), height_in_block - 1);
|
||||
map->width_in_unit = MIN2(DIV_ROUND_UP(region->width, block_length), width_in_block);
|
||||
map->height_in_unit = MIN2(DIV_ROUND_UP(region->height, block_length), width_in_block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user