diff options
Diffstat (limited to 'src/gallium/state_trackers/va/image.c')
-rw-r--r-- | src/gallium/state_trackers/va/image.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c index 1a0712c9761..0a54a90cb4c 100644 --- a/src/gallium/state_trackers/va/image.c +++ b/src/gallium/state_trackers/va/image.c @@ -279,6 +279,9 @@ vlVaDeriveImage(VADriverContextP ctx, VASurfaceID surface, VAImage *image) img->pitches[0] = stride > 0 ? stride : w * 4; assert(img->pitches[0] >= (w * 4)); break; + + case VA_FOURCC('P','0','1','0'): + case VA_FOURCC('P','0','1','6'): case VA_FOURCC('N','V','1','2'): if (surf->buffer->interlaced) { struct pipe_video_buffer *new_buffer; @@ -449,13 +452,20 @@ vlVaGetImage(VADriverContextP ctx, VASurfaceID surface, int x, int y, return VA_STATUS_ERROR_OPERATION_FAILED; } + if (format != surf->buffer->buffer_format) { /* support NV12 to YV12 and IYUV conversion now only */ if ((format == PIPE_FORMAT_YV12 && - surf->buffer->buffer_format == PIPE_FORMAT_NV12) || - (format == PIPE_FORMAT_IYUV && - surf->buffer->buffer_format == PIPE_FORMAT_NV12)) + surf->buffer->buffer_format == PIPE_FORMAT_NV12) || + (format == PIPE_FORMAT_IYUV && + surf->buffer->buffer_format == PIPE_FORMAT_NV12)) convert = true; + else if (format == PIPE_FORMAT_NV12 && + (surf->buffer->buffer_format == PIPE_FORMAT_P010 || + surf->buffer->buffer_format == PIPE_FORMAT_P016)) { + mtx_unlock(&drv->mutex); + return VA_STATUS_ERROR_OPERATION_FAILED; + } else { mtx_unlock(&drv->mutex); return VA_STATUS_ERROR_OPERATION_FAILED; |