From c1cc79739a8745f2004917a2b170dba4124ef323 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sat, 7 Mar 2020 16:18:26 -0500 Subject: [PATCH] st/vdpau: avoid asserting on new VDP_YCBCR_* formats Depending on user's vdpau headers, not all of those defines may exist. Eventually we may want a private copy of these, but this is simple enough for now. Fixes asserts when running vdpauinfo which supports these recently added formats. Signed-off-by: Ilia Mirkin Part-of: --- .../state_trackers/vdpau/vdpau_private.h | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h index 420573b57ad..80bb5aee0fe 100644 --- a/src/gallium/state_trackers/vdpau/vdpau_private.h +++ b/src/gallium/state_trackers/vdpau/vdpau_private.h @@ -134,11 +134,30 @@ FormatYCBCRToPipe(VdpYCbCrFormat vdpau_format) return PIPE_FORMAT_R8G8B8A8_UNORM; case VDP_YCBCR_FORMAT_V8U8Y8A8: return PIPE_FORMAT_B8G8R8A8_UNORM; +#ifdef VDP_YCBCR_FORMAT_P010 + case VDP_YCBCR_FORMAT_P010: + return PIPE_FORMAT_P010; +#endif +#ifdef VDP_YCBCR_FORMAT_P016 + case VDP_YCBCR_FORMAT_P016: + return PIPE_FORMAT_P016; +#endif default: - assert(0); + /* NOTE: Can't be "unreachable", as it's quite reachable. */ + assert(!"unexpected VdpYCbCrFormat"); + /* fallthrough */ +#ifdef VDP_YCBCR_FORMAT_Y_UV_444 + case VDP_YCBCR_FORMAT_Y_UV_444: +#endif +#ifdef VDP_YCBCR_FORMAT_Y_U_V_444 + case VDP_YCBCR_FORMAT_Y_U_V_444: +#endif +#ifdef VDP_YCBCR_FORMAT_Y_U_V_444_16 + case VDP_YCBCR_FORMAT_Y_U_V_444_16: +#endif + return PIPE_FORMAT_NONE; } - return PIPE_FORMAT_NONE; } static inline VdpYCbCrFormat -- 2.30.2