summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va
diff options
context:
space:
mode:
authorMark Thompson <[email protected]>2016-10-12 23:52:01 +0100
committerChristian König <[email protected]>2016-10-14 11:57:25 +0200
commit8a931c83bafbf768ffa520af32740df4c5a765e9 (patch)
tree063975280ee703c5e54eadcbf0ed97d72e3c5e3c /src/gallium/state_trackers/va
parent0c94ed0987fd948a7ff4bef401e25319171917c4 (diff)
st/va: Return more useful config attributes
The encoder attributes are needed for a user of the encoder to be able to configure it sensibly without internal knowledge. Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va')
-rw-r--r--src/gallium/state_trackers/va/config.c47
1 files changed, 38 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/va/config.c b/src/gallium/state_trackers/va/config.c
index 405231685d3..72f68baf3df 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -115,16 +115,45 @@ vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint en
for (i = 0; i < num_attribs; ++i) {
unsigned int value;
- switch (attrib_list[i].type) {
- case VAConfigAttribRTFormat:
- value = VA_RT_FORMAT_YUV420;
- break;
- case VAConfigAttribRateControl:
- value = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR;
- break;
- default:
+ if (entrypoint == VAEntrypointVLD) {
+ switch (attrib_list[i].type) {
+ case VAConfigAttribRTFormat:
+ value = VA_RT_FORMAT_YUV420;
+ break;
+ default:
+ value = VA_ATTRIB_NOT_SUPPORTED;
+ break;
+ }
+ } else if (entrypoint == VAEntrypointEncSlice) {
+ switch (attrib_list[i].type) {
+ case VAConfigAttribRTFormat:
+ value = VA_RT_FORMAT_YUV420;
+ break;
+ case VAConfigAttribRateControl:
+ value = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR;
+ break;
+ case VAConfigAttribEncPackedHeaders:
+ value = 0;
+ break;
+ case VAConfigAttribEncMaxRefFrames:
+ value = 1;
+ break;
+ default:
+ value = VA_ATTRIB_NOT_SUPPORTED;
+ break;
+ }
+ } else if (entrypoint == VAEntrypointVideoProc) {
+ switch (attrib_list[i].type) {
+ case VAConfigAttribRTFormat:
+ value = (VA_RT_FORMAT_YUV420 |
+ VA_RT_FORMAT_RGB32);
+ break;
+ default:
+ value = VA_ATTRIB_NOT_SUPPORTED;
+ break;
+ }
+ } else {
value = VA_ATTRIB_NOT_SUPPORTED;
- break;
}
attrib_list[i].value = value;
}