From 81ae033b949953ef0c43edef3d0eb12e4741ee2e Mon Sep 17 00:00:00 2001 From: Sil Vilerino Date: Mon, 29 Aug 2022 12:42:41 -0400 Subject: [PATCH] gallium/va: vaDeriveImage to check PIPE_VIDEO_SUPPORTS_CONTIGUOUS_PLANES_MAP vaDeriveImage should check if the underlying gallium driver can map contiguous planes before skipping with disallowlist. Fixes: a585d95803ca38d42b893603a85bf6442a54838a ("radeonsi/vcn: WA 10bit encoding crash in vaapi") Reviewed-by: Ruijing Dong Part-of: --- src/gallium/frontends/va/image.c | 9 ++++++--- src/gallium/include/pipe/p_video_enums.h | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gallium/frontends/va/image.c b/src/gallium/frontends/va/image.c index 19d0f69..0255cf5 100644 --- a/src/gallium/frontends/va/image.c +++ b/src/gallium/frontends/va/image.c @@ -256,9 +256,12 @@ vlVaDeriveImage(VADriverContextP ctx, VASurfaceID surface, VAImage *image) PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE)) return VA_STATUS_ERROR_OPERATION_FAILED; } else { - for (i = 0; i < ARRAY_SIZE(derive_progressive_disallowlist); i++) - if ((strcmp(derive_progressive_disallowlist[i], proc) == 0)) - return VA_STATUS_ERROR_OPERATION_FAILED; + if(!screen->get_video_param(screen, PIPE_VIDEO_PROFILE_UNKNOWN, + PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_SUPPORTS_CONTIGUOUS_PLANES_MAP)) + for (i = 0; i < ARRAY_SIZE(derive_progressive_disallowlist); i++) + if ((strcmp(derive_progressive_disallowlist[i], proc) == 0)) + return VA_STATUS_ERROR_OPERATION_FAILED; } surfaces = surf->buffer->get_surfaces(surf->buffer); diff --git a/src/gallium/include/pipe/p_video_enums.h b/src/gallium/include/pipe/p_video_enums.h index 7589fb5..b7b29b7 100644 --- a/src/gallium/include/pipe/p_video_enums.h +++ b/src/gallium/include/pipe/p_video_enums.h @@ -106,6 +106,10 @@ enum pipe_video_cap PIPE_VIDEO_CAP_VPP_MIN_OUTPUT_WIDTH = 24, PIPE_VIDEO_CAP_VPP_MIN_OUTPUT_HEIGHT = 25, PIPE_VIDEO_CAP_ENC_QUALITY_LEVEL = 26, + /* If true, when mapping planar textures like NV12 or P016 the mapped buffer contains + all the planes contiguously. This allows for use with some frontends functions that + require this like vaDeriveImage */ + PIPE_VIDEO_SUPPORTS_CONTIGUOUS_PLANES_MAP = 27, }; /* To be used with PIPE_VIDEO_CAP_VPP_ORIENTATION_MODES and for VPP state*/ -- 2.7.4