diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c index b2c745acdd2..5679f3991d1 100644 --- a/src/gallium/frontends/va/surface.c +++ b/src/gallium/frontends/va/surface.c @@ -488,13 +488,6 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id, } } } - if (config->rt_format & VA_RT_FORMAT_YUV420) { - 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_NV12; - i++; - } if (config->rt_format & VA_RT_FORMAT_YUV420_10 || (config->rt_format & VA_RT_FORMAT_YUV420 && config->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE)) { @@ -509,29 +502,48 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id, attribs[i].value.value.i = VA_FOURCC_P016; i++; } - - if (config->rt_format & VA_RT_FORMAT_YUV400) { + if (config->profile == PIPE_VIDEO_PROFILE_AV1_MAIN && + config->entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) { 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; + attribs[i].value.value.i = VA_FOURCC_NV12; 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; + attribs[i].value.value.i = VA_FOURCC_P010; i++; - } + } else { + if (config->rt_format & VA_RT_FORMAT_YUV420) { + 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_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->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++; + } } attribs[i].type = VASurfaceAttribMemoryType;