frontends/va/postproc: Convert destination when deinterlacing

When the VAAPI deinterlacing filter is chained with other VAAPI
post-processing filters, the image might get deinterlaced multiple
times, as the filters after the deinterlacing filter might still see an
interlaced buffer.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6803>
This commit is contained in:
Thong Thai
2020-09-21 13:56:05 -04:00
committed by Marge Bot
parent 49465babdb
commit f09456361c
+16 -1
View File
@@ -287,7 +287,7 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex
VARectangle def_src_region, def_dst_region;
const VARectangle *src_region, *dst_region;
VAProcPipelineParameterBuffer *param;
struct pipe_video_buffer *src;
struct pipe_video_buffer *src, *dst;
vlVaSurface *src_surface, *dst_surface;
unsigned i;
@@ -309,6 +309,21 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex
return VA_STATUS_ERROR_INVALID_SURFACE;
src = src_surface->buffer;
dst = dst_surface->buffer;
/* convert the destination buffer to progressive if we're deinterlacing
otherwise we might end up deinterlacing twice */
if (param->num_filters && dst->interlaced) {
vlVaSurface *surf;
surf = dst_surface;
surf->templat.interlaced = false;
dst->destroy(dst);
if (vlVaHandleSurfaceAllocate(drv, surf, &surf->templat) != VA_STATUS_SUCCESS)
return VA_STATUS_ERROR_ALLOCATION_FAILED;
dst = context->target = surf->buffer;
}
for (i = 0; i < param->num_filters; i++) {
vlVaBuffer *buf = handle_table_get(drv->htab, param->filters[i]);