diff options
author | Leo Liu <[email protected]> | 2017-10-01 21:27:20 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2017-10-04 09:22:33 -0400 |
commit | 0fa950ecd38d5025bb2393bbcb96a73152764cf4 (patch) | |
tree | b9f8813f238f89efd486a3fd44f915d7cf3ebf01 /src/gallium | |
parent | 327480d10f2dab52de28e9a84609fac81c2034c5 (diff) |
st/va: don't re-allocate interlaced buffer with pakced format
It caused corruption, when vlVaPutImage putting raw data to the fields
v2: add RGB formats since it got uploaded here as well
Cc: [email protected]
Cc: Andy Furniss <[email protected]>
Tested-by: Andy Furniss <[email protected]>
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/va/image.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c index f87de8e5c4e..86ae8685802 100644 --- a/src/gallium/state_trackers/va/image.c +++ b/src/gallium/state_trackers/va/image.c @@ -487,10 +487,13 @@ 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 || + format == PIPE_FORMAT_B8G8R8A8_UNORM || format == PIPE_FORMAT_B8G8R8X8_UNORM || + format == PIPE_FORMAT_R8G8B8A8_UNORM || format == PIPE_FORMAT_R8G8B8X8_UNORM) + surf->templat.interlaced = false; + tmp_buf = drv->pipe->create_video_buffer(drv->pipe, &surf->templat); if (!tmp_buf) { mtx_unlock(&drv->mutex); @@ -499,7 +502,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); |