summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorMark Thompson <[email protected]>2016-10-12 23:53:01 +0100
committerChristian König <[email protected]>2016-10-14 11:57:44 +0200
commite0604eed9f0cd6e65dde0e2d96c031b8db2c4fe5 (patch)
treef7e2afa96b371b342a23dac9715d7730be5f5095 /src/gallium/state_trackers
parente7c7ef36250d17dfcde3504aeafe7de7088479ba (diff)
st/va: Return surface formats depending on config chroma format
This makes the supported format actually match the configuration, and allows the user to observe that NV12 is supported for video processing where previously they couldn't (though it did always work if they blindly tried to use it anyway). Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/va/surface.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 173e7d91ac6..5e929803b01 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -419,11 +419,19 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id,
/* vlVaCreateConfig returns PIPE_VIDEO_PROFILE_UNKNOWN
* only for VAEntrypointVideoProc. */
if (config->profile == PIPE_VIDEO_PROFILE_UNKNOWN) {
- for (j = 0; j < ARRAY_SIZE(vpp_surface_formats); ++j) {
+ if (config->rt_format == VA_RT_FORMAT_RGB32) {
+ for (j = 0; j < ARRAY_SIZE(vpp_surface_formats); ++j) {
+ 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 = PipeFormatToVaFourcc(vpp_surface_formats[j]);
+ 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 = PipeFormatToVaFourcc(vpp_surface_formats[j]);
+ attribs[i].value.value.i = VA_FOURCC_NV12;
i++;
}
} else {