[Mesa-dev] [PATCH] st/va:Aligned image width and height to 16.

Sharma, Deepak Deepak.Sharma at amd.com
Tue Oct 2 01:47:27 UTC 2018


From: suresh guttula <suresh.guttula at amd.com>

In case of decoding of resolution like 40x24, while allocating surface
video buffer is always aligned with macroblock width/height which is 16. 
But when application tries to get data after decoding through vaCreateImage 
/vaGetImage, image width/height aligned with 2 and result a smaller image
buffer which causes the memory stomping issue.

Signed-off-by: suresh guttula <suresh.guttula at amd.com>
---
 src/gallium/state_trackers/va/image.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c
index 3f892c9..2fc47b7 100644
--- a/src/gallium/state_trackers/va/image.c
+++ b/src/gallium/state_trackers/va/image.c
@@ -123,8 +123,8 @@ vlVaCreateImage(VADriverContextP ctx, VAImageFormat *format, int width, int heig
    img->format = *format;
    img->width = width;
    img->height = height;
-   w = align(width, 2);
-   h = align(height, 2);
+   w = align(width, 16);
+   h = align(height, 16);
 
    switch (format->fourcc) {
    case VA_FOURCC('N','V','1','2'):
-- 
2.7.4



More information about the mesa-dev mailing list