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>
(cherry picked from commit 8eb84f8854)
This commit is contained in:
David Rosca 2025-09-02 17:56:56 +02:00 committed by Eric Engestrom
parent 09043aba63
commit c6aed295dc
2 changed files with 5 additions and 5 deletions

View file

@ -6334,7 +6334,7 @@
"description": "radeonsi/vcn: Fix calculating QP map region dimensions",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -206,10 +206,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);
}
}
}