vdpau: remove bogus assert
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Sun, 8 Mar 2020 08:01:42 +0000 (09:01 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 11 Mar 2020 08:17:07 +0000 (08:17 +0000)
The assert introduced by 24f2b0a8560 triggers when an application
requests a chroma_type that's different to the one from the
PIPE_VIDEO_CAP_PREFERED_FORMAT (before this change the chroma_type
was set but ignored).

So restore this behavior and ignore the chroma_type.

Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Fixes: 24f2b0a8560 ("gallium/video: remove pipe_video_buffer.chroma_format")
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4104>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4104>

src/gallium/state_trackers/vdpau/surface.c

index 1f1b0b3ef683b7c61ea2fd5c1025f669049bc0bf..4158e6bcfe6902ea42d88333523a70ae02817099 100644 (file)
@@ -82,6 +82,7 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
 
    mtx_lock(&dev->mutex);
    memset(&p_surf->templat, 0, sizeof(p_surf->templat));
+   /* TODO: buffer_format should be selected to match chroma_type */
    p_surf->templat.buffer_format = pipe->screen->get_video_param
    (
       pipe->screen,
@@ -89,7 +90,6 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
       PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
       PIPE_VIDEO_CAP_PREFERED_FORMAT
    );
-   assert(pipe_format_to_chroma_format(p_surf->templat.buffer_format) == ChromaToPipe(chroma_type));
    p_surf->templat.width = width;
    p_surf->templat.height = height;
    p_surf->templat.interlaced = pipe->screen->get_video_param