frontends/va: Use YUV400 YUY2 444P for JPEG only

Since these formats are only for JPEG, and not all the backend driver
supports these format. Eg radeonsi does, virgl doesn't, they should
be used only for JPEG profile.

Fixes d2c0ff1caf (frontends/va: add support for yuv400 and yuv444)

Signed-off-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19787>
This commit is contained in:
Leo Liu
2022-11-16 09:50:14 -05:00
committed by Marge Bot
parent 62356e71f4
commit 9bd11f6523
+24 -20
View File
@@ -522,27 +522,31 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id,
attribs[i].value.value.i = VA_FOURCC_NV12;
i++;
}
if (config->rt_format & VA_RT_FORMAT_YUV400) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
attribs[i].value.value.i = VA_FOURCC_Y800;
i++;
}
if (config->rt_format & VA_RT_FORMAT_YUV422) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
attribs[i].value.value.i = VA_FOURCC_YUY2;
i++;
}
if (config->rt_format & VA_RT_FORMAT_YUV444) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
attribs[i].value.value.i = VA_FOURCC_444P;
i++;
if (config->profile == PIPE_VIDEO_PROFILE_JPEG_BASELINE) {
if (config->rt_format & VA_RT_FORMAT_YUV400) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
attribs[i].value.value.i = VA_FOURCC_Y800;
i++;
}
if (config->rt_format & VA_RT_FORMAT_YUV422) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
attribs[i].value.value.i = VA_FOURCC_YUY2;
i++;
}
if (config->rt_format & VA_RT_FORMAT_YUV444) {
attribs[i].type = VASurfaceAttribPixelFormat;
attribs[i].value.type = VAGenericValueTypeInteger;
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
attribs[i].value.value.i = VA_FOURCC_444P;
i++;
}
}
}