From ad02e21ad208279047b0f747d15df3a52992c920 Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Tue, 11 Apr 2023 10:39:53 +0900 Subject: [PATCH] anv/image: get width/height for each plane of a surface for video decoding. This is especially for p010 format, which isn't supported for YCbCr conversion yet. Signed-off-by: Hyunjun Ko Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_image.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 267f783db10..377c7dd656b 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -861,6 +861,14 @@ add_primary_surface(struct anv_device *device, assert(plane < ycbcr_info->n_planes); width /= ycbcr_info->planes[plane].denominator_scales[0]; height /= ycbcr_info->planes[plane].denominator_scales[1]; + } else if (isl_usage & ISL_SURF_USAGE_VIDEO_DECODE_BIT) { + /* To get proper width/height for P010 format, + * that isn't supported for YCbCr conversion yet + */ + width = util_format_get_plane_width( + vk_format_to_pipe_format(image->vk.format), plane, width); + height = util_format_get_plane_height( + vk_format_to_pipe_format(image->vk.format), plane, height); } ok = isl_surf_init(&device->isl_dev, &anv_surf->isl,