Well that's the complete wrong place for that. The stride of the surface is determined by addrlib. That one should handle aligning the parameters.
Christian. Am 02.10.2018 20:38 schrieb "Sharma, Deepak" <[email protected]>: Christian, the issue which trying to address here is vlvaGetImage doesn’t use width/height passed to function. box.width is calculated from surface and that will end up in wrong stride for dst buffer for said resolution. So was thinking to use aligned width/height for vaCreateImage as well as surface. But as you said that depends on codec , So I think either we can use width/height aligned based on codec or use passed width/height in vlvaGetImage to fix this issue. Thanks, Deepak -----Original Message----- From: Christian König <[email protected]> Sent: Tuesday, October 2, 2018 3:42 AM To: Sharma, Deepak <[email protected]>; [email protected] Cc: Guttula, Suresh <[email protected]> Subject: Re: [Mesa-dev] [PATCH] st/va:Aligned image width and height to 16. Am 02.10.2018 um 03:47 schrieb Sharma, Deepak: > From: suresh guttula <[email protected]> > > 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. Well NAK. It depends on the codec if the picture needs to be aligned to 16 or not. For example VC-1 would created decoding errors with that. Regards, Christian. > > Signed-off-by: suresh guttula <[email protected]> > --- > 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'):
_______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
