vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint,
VAConfigAttrib *attrib_list, int num_attribs)
{
+ struct pipe_screen *pscreen;
int i;
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
+ pscreen = VL_VA_PSCREEN(ctx);
+
for (i = 0; i < num_attribs; ++i) {
unsigned int value;
if (entrypoint == VAEntrypointVLD) {
switch (attrib_list[i].type) {
case VAConfigAttribRTFormat:
value = VA_RT_FORMAT_YUV420;
+ if (pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P016,
+ ProfileToPipe(profile),
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM))
+ value |= VA_RT_FORMAT_YUV420_10BPP;
break;
default:
value = VA_ATTRIB_NOT_SUPPORTED;
switch (attrib_list[i].type) {
case VAConfigAttribRTFormat:
value = (VA_RT_FORMAT_YUV420 |
+ VA_RT_FORMAT_YUV420_10BPP |
VA_RT_FORMAT_RGB32);
break;
default:
vlVaConfig *config;
struct pipe_screen *pscreen;
enum pipe_video_profile p;
+ unsigned int supported_rt_formats;
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
if (profile == VAProfileNone && entrypoint == VAEntrypointVideoProc) {
config->entrypoint = VAEntrypointVideoProc;
config->profile = PIPE_VIDEO_PROFILE_UNKNOWN;
+ supported_rt_formats = VA_RT_FORMAT_YUV420 |
+ VA_RT_FORMAT_YUV420_10BPP |
+ VA_RT_FORMAT_RGB32;
for (int i = 0; i < num_attribs; i++) {
if (attrib_list[i].type == VAConfigAttribRTFormat) {
- if (attrib_list[i].value & (VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_RGB32)) {
+ if (attrib_list[i].value & supported_rt_formats) {
config->rt_format = attrib_list[i].value;
} else {
FREE(config);
/* Default value if not specified in the input attributes. */
if (!config->rt_format)
- config->rt_format = VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_RGB32;
+ config->rt_format = supported_rt_formats;
mtx_lock(&drv->mutex);
*config_id = handle_table_add(drv->htab, config);
}
config->profile = p;
+ supported_rt_formats = VA_RT_FORMAT_YUV420;
+ if (pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P016, p,
+ config->entrypoint))
+ supported_rt_formats |= VA_RT_FORMAT_YUV420_10BPP;
for (int i = 0; i <num_attribs ; i++) {
if (attrib_list[i].type == VAConfigAttribRateControl) {
config->rc = PIPE_H264_ENC_RATE_CONTROL_METHOD_DISABLE;
}
if (attrib_list[i].type == VAConfigAttribRTFormat) {
- if (attrib_list[i].value == VA_RT_FORMAT_YUV420) {
+ if (attrib_list[i].value & supported_rt_formats) {
config->rt_format = attrib_list[i].value;
} else {
FREE(config);
/* Default value if not specified in the input attributes. */
if (!config->rt_format)
- config->rt_format = VA_RT_FORMAT_YUV420;
+ config->rt_format = supported_rt_formats;
mtx_lock(&drv->mutex);
*config_id = handle_table_add(drv->htab, config);