frontends/va: Also treat PRI/TRC_RESERVED0 as unspecified

PIPE_VIDEO_VPP_PRI_RESERVED0 and PIPE_VIDEO_VPP_TRC_RESERVED0 have value 0,
and this is what we will get from apps that doesn't set primaries and transfer
characteristics at all.

Fixes: a284bff8ad ("frontends/va: Set color properties when not using explicit color standard")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38892>
This commit is contained in:
David Rosca 2025-12-10 17:51:27 +01:00 committed by Marge Bot
parent 081c5bc6a5
commit 1395d806ba

View file

@ -659,10 +659,12 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex
&vpp.in_transfer_characteristics, &vpp.in_matrix_coefficients);
}
if (vpp.in_color_primaries == PIPE_VIDEO_VPP_PRI_UNSPECIFIED)
if (vpp.in_color_primaries == PIPE_VIDEO_VPP_PRI_RESERVED0 ||
vpp.in_color_primaries == PIPE_VIDEO_VPP_PRI_UNSPECIFIED)
vpp.in_color_primaries = PIPE_VIDEO_VPP_PRI_BT709;
if (vpp.in_transfer_characteristics == PIPE_VIDEO_VPP_TRC_UNSPECIFIED)
if (vpp.in_transfer_characteristics == PIPE_VIDEO_VPP_TRC_RESERVED0 ||
vpp.in_transfer_characteristics == PIPE_VIDEO_VPP_TRC_UNSPECIFIED)
vpp.in_transfer_characteristics = PIPE_VIDEO_VPP_TRC_GAMMA22;
if (vpp.in_matrix_coefficients == PIPE_VIDEO_VPP_MCF_UNSPECIFIED ||
@ -706,10 +708,12 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex
&vpp.out_transfer_characteristics, &vpp.out_matrix_coefficients);
}
if (vpp.out_color_primaries == PIPE_VIDEO_VPP_PRI_UNSPECIFIED)
if (vpp.out_color_primaries == PIPE_VIDEO_VPP_PRI_RESERVED0 ||
vpp.out_color_primaries == PIPE_VIDEO_VPP_PRI_UNSPECIFIED)
vpp.out_color_primaries = PIPE_VIDEO_VPP_PRI_BT709;
if (vpp.out_transfer_characteristics == PIPE_VIDEO_VPP_TRC_UNSPECIFIED)
if (vpp.out_transfer_characteristics == PIPE_VIDEO_VPP_TRC_RESERVED0 ||
vpp.out_transfer_characteristics == PIPE_VIDEO_VPP_TRC_UNSPECIFIED)
vpp.out_transfer_characteristics = PIPE_VIDEO_VPP_TRC_GAMMA22;
if (vpp.out_matrix_coefficients == PIPE_VIDEO_VPP_MCF_UNSPECIFIED ||