[Mesa-dev] [PATCH 1/2] st/va: don't re-allocate interlaced buffer with pakced YUV format

Andy Furniss adf.lists at gmail.com
Sun Oct 1 23:03:09 UTC 2017


Tested-by: Andy Furniss <adf.lists at gmail.com>

Leo Liu wrote:
> It caused corruption, when vlVaPutImage putting YUV to the fields
> 
> Cc: mesa-stable at lists.freedesktop.org
> Cc: Andy Furniss <adf.lists at gmail.com>
> ---
>   src/gallium/state_trackers/va/image.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c
> index f87de8e5c4..84990d8a3d 100644
> --- a/src/gallium/state_trackers/va/image.c
> +++ b/src/gallium/state_trackers/va/image.c
> @@ -487,10 +487,11 @@ vlVaPutImage(VADriverContextP ctx, VASurfaceID surface, VAImageID image,
>            ((format != PIPE_FORMAT_YV12) || (surf->buffer->buffer_format != PIPE_FORMAT_NV12)) &&
>            ((format != PIPE_FORMAT_IYUV) || (surf->buffer->buffer_format != PIPE_FORMAT_NV12))) {
>         struct pipe_video_buffer *tmp_buf;
> -      struct pipe_video_buffer templat = surf->templat;
>   
> -      templat.buffer_format = format;
> -      tmp_buf = drv->pipe->create_video_buffer(drv->pipe, &templat);
> +      surf->templat.buffer_format = format;
> +      if (format == PIPE_FORMAT_YUYV || format == PIPE_FORMAT_UYVY)
> +         surf->templat.interlaced = false;
> +      tmp_buf = drv->pipe->create_video_buffer(drv->pipe, &surf->templat);
>   
>         if (!tmp_buf) {
>            mtx_unlock(&drv->mutex);
> @@ -499,7 +500,6 @@ vlVaPutImage(VADriverContextP ctx, VASurfaceID surface, VAImageID image,
>   
>         surf->buffer->destroy(surf->buffer);
>         surf->buffer = tmp_buf;
> -      surf->templat.buffer_format = format;
>      }
>   
>      views = surf->buffer->get_sampler_view_planes(surf->buffer);
> 



More information about the mesa-dev mailing list