[Mesa-dev] [PATCH] st/vdpau: allow progressive video surface with interop

Christian König christian.koenig at amd.com
Mon May 7 09:10:57 UTC 2018


Am 02.05.2018 um 16:51 schrieb Leo Liu:
> mpv now interop with video surface instead of output surface previously,
> so it fails with "vlVdpVideoSurfaceDMABuf", this's fine for Mesa GL, since
> the code path will fall back to "vlVdpVideoSurfaceGallium", but this's
> not the case for others
>
> Signed-off-by: Leo Liu <leo.liu at amd.com>
> Cc: Christian König <christian.koenig at amd.com>
> Cc: "18.1 18.0" <mesa-stable at lists.freedesktop.org>

That won't work correctly.

The NV_VDPAU_interop extension we implement with that needs interlaced 
layout or otherwise can't correctly work with the surfaces.

It's probably pure coincident that you don't get a messed up picture 
with that.

Christian.

> ---
>   src/gallium/state_trackers/vdpau/surface.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c
> index 012d303641..d63e761350 100644
> --- a/src/gallium/state_trackers/vdpau/surface.c
> +++ b/src/gallium/state_trackers/vdpau/surface.c
> @@ -513,12 +513,15 @@ VdpStatus vlVdpVideoSurfaceDMABuf(VdpVideoSurface surface,
>      }
>   
>      /* Check if surface match interop requirements */
> -   if (p_surf->video_buffer == NULL || !p_surf->video_buffer->interlaced ||
> +   if (p_surf->video_buffer == NULL ||
>          p_surf->video_buffer->buffer_format != PIPE_FORMAT_NV12) {
>         mtx_unlock(&p_surf->device->mutex);
>         return VDP_STATUS_NO_IMPLEMENTATION;
>      }
>   
> +   if (!p_surf->video_buffer->interlaced)
> +      plane >>= 1;
> +
>      surf = p_surf->video_buffer->get_surfaces(p_surf->video_buffer)[plane];
>      if (!surf) {
>         mtx_unlock(&p_surf->device->mutex);



More information about the mesa-dev mailing list