frontend/va: Remove duplicate code in format support checking/reporting.
authorSil Vilerino <sivileri@microsoft.com>
Wed, 22 Feb 2023 13:44:26 +0000 (08:44 -0500)
committerSil Vilerino <sivileri@microsoft.com>
Fri, 24 Feb 2023 18:46:38 +0000 (13:46 -0500)
commitee129301a9ebc50376a2d7bc7d08993b744dda24
treeb9377dfcd645e94c0f95086d21d87f5299e22f0f
parent1a6865eae3ae79f3d65bac17499169097f6d6dd5
frontend/va: Remove duplicate code in format support checking/reporting.

In config.c there are multiple copies of the code checking for VA_FORMAT_RT_*, this can lead
to confusion and is hard to maintain without knowing to change the code in all the places.

This commit extracts out the duplicated code into a function that checks format support
for a given profile and entrypoint, then this function is called from several places that
had the copies of this code in vlVaCreateConfig/vlVaGetConfigAttributes.

Please also note that after this change, all entrypoints/profiles will be checked for all
formats in the pipe_screen: YUV420/YUV420_10/YUV422/RGB32/YUV400/YUV444

Acked-by: Ruijing Dong <ruijing.dong@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21466>
src/gallium/frontends/va/config.c