Module: Mesa
Branch: main
Commit: 76b7e393542c5cde9699f94ac5be7b09ccf2d0c2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=76b7e393542c5cde9699f94ac5be7b09ccf2d0c2

Author: Krunal Patel <[email protected]>
Date:   Tue Dec 28 01:54:44 2021 +0530

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 
<[email protected]>
Reviewed-by: Leo Liu <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14313>

---

 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;

Reply via email to