From: Ilia Mirkin Date: Sat, 7 Mar 2020 21:18:26 +0000 (-0500) Subject: st/vdpau: avoid asserting on new VDP_YCBCR_* formats X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1cc79739a8745f2004917a2b170dba4124ef323;p=mesa.git 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: --- 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