From 76b7e393542c5cde9699f94ac5be7b09ccf2d0c2 Mon Sep 17 00:00:00 2001 From: Krunal Patel Date: Tue, 28 Dec 2021 01:36:44 +0530 Subject: [PATCH] frontends/va: use un-padded width/height in ExportSurfaceHandle Issue: VADRMPRIMESurfaceDescriptor width and height are rounded up to macroblock size (16). Rootcause: surf->buffer's width/height are rounded up to macroblock size (16), so they shouldn't be used here. Fix: Using surf->templ's width/height instead fixes incorrect surface dimensions being sent via VADRMPRIMESurfaceDescriptor. Signed-off-by: Krunal Patel Reviewed-by: Leo Liu Part-of: --- src/gallium/frontends/va/surface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c index 8c772d5544a..2714430f4bf 100644 --- a/src/gallium/frontends/va/surface.c +++ b/src/gallium/frontends/va/surface.c @@ -1260,8 +1260,8 @@ vlVaExportSurfaceHandle(VADriverContextP ctx, usage |= PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE; desc->fourcc = PipeFormatToVaFourcc(surf->buffer->buffer_format); - desc->width = surf->buffer->width; - desc->height = surf->buffer->height; + desc->width = surf->templat.width; + desc->height = surf->templat.height; for (p = 0; p < VL_MAX_SURFACES; p++) { struct winsys_handle whandle;