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:
@@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user