aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Thompson <[email protected]>2016-10-12 23:52:30 +0100
committerChristian König <[email protected]>2016-10-14 11:57:40 +0200
commite7c7ef36250d17dfcde3504aeafe7de7088479ba (patch)
tree66939ae1b134c8298691673a32c2d042ff18f02c
parent8a931c83bafbf768ffa520af32740df4c5a765e9 (diff)
st/va: Save surface chroma format in config
Both YUV420 and RGB32 configurations are supported, so we need to be able to distinguish which is being used. Reviewed-by: Christian König <[email protected]>
-rw-r--r--src/gallium/state_trackers/va/config.c20
-rw-r--r--src/gallium/state_trackers/va/va_private.h1
2 files changed, 20 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/va/config.c b/src/gallium/state_trackers/va/config.c
index 72f68baf3df..2f96eb6cedf 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -185,6 +185,16 @@ vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoin
if (profile == VAProfileNone && entrypoint == VAEntrypointVideoProc) {
config->entrypoint = VAEntrypointVideoProc;
config->profile = PIPE_VIDEO_PROFILE_UNKNOWN;
+ 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)) {
+ config->rt_format = attrib_list[i].value;
+ } else {
+ FREE(config);
+ return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
+ }
+ }
+ }
pipe_mutex_lock(drv->mutex);
*config_id = handle_table_add(drv->htab, config);
pipe_mutex_unlock(drv->mutex);
@@ -236,6 +246,14 @@ vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoin
else
config->rc = PIPE_H264_ENC_RATE_CONTROL_METHOD_DISABLE;
}
+ if (attrib_list[i].type == VAConfigAttribRTFormat) {
+ if (attrib_list[i].value == VA_RT_FORMAT_YUV420) {
+ config->rt_format = attrib_list[i].value;
+ } else {
+ FREE(config);
+ return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
+ }
+ }
}
pipe_mutex_lock(drv->mutex);
@@ -306,7 +324,7 @@ vlVaQueryConfigAttributes(VADriverContextP ctx, VAConfigID config_id, VAProfile
*num_attribs = 1;
attrib_list[0].type = VAConfigAttribRTFormat;
- attrib_list[0].value = VA_RT_FORMAT_YUV420;
+ attrib_list[0].value = config->rt_format;
return VA_STATUS_SUCCESS;
}
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h
index e9ccdbf7263..7562e14a7e1 100644
--- a/src/gallium/state_trackers/va/va_private.h
+++ b/src/gallium/state_trackers/va/va_private.h
@@ -250,6 +250,7 @@ typedef struct {
enum pipe_video_profile profile;
enum pipe_video_entrypoint entrypoint;
enum pipe_h264_enc_rate_control_method rc;
+ unsigned int rt_format;
} vlVaConfig;
typedef struct {