anv/video: create Motion Vector buffers for encoding too

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36211>
This commit is contained in:
Hyunjun Ko
2025-08-05 09:56:54 +02:00
committed by Marge Bot
parent 090d7e6582
commit 0453eb0c4b
+4 -2
View File
@@ -1334,11 +1334,13 @@ anv_video_get_image_mv_size(struct anv_device *device,
uint32_t size = 0;
for (unsigned i = 0; i < profile_list->profileCount; i++) {
if (profile_list->pProfiles[i].videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) {
if (profile_list->pProfiles[i].videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR ||
profile_list->pProfiles[i].videoCodecOperation == VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR) {
unsigned w_mb = DIV_ROUND_UP(image->vk.extent.width, ANV_MB_WIDTH);
unsigned h_mb = DIV_ROUND_UP(image->vk.extent.height, ANV_MB_HEIGHT);
size = w_mb * h_mb * 128;
} else if (profile_list->pProfiles[i].videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR) {
} else if (profile_list->pProfiles[i].videoCodecOperation == VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR ||
profile_list->pProfiles[i].videoCodecOperation == VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR) {
unsigned w_mb = DIV_ROUND_UP(image->vk.extent.width, 32);
unsigned h_mb = DIV_ROUND_UP(image->vk.extent.height, 32);
size = ALIGN(w_mb * h_mb, 2) << 6;