aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/surface.c
diff options
context:
space:
mode:
authorThong Thai <[email protected]>2019-12-18 11:31:28 -0500
committerMarge Bot <[email protected]>2020-01-03 16:30:22 +0000
commit68881af4351898871ae443e9949fada631461f01 (patch)
treed2683fc7be35f8be13e859113a8ae859bede2854 /src/gallium/state_trackers/va/surface.c
parentf3569f215d0f46006ce34485d526c5ad56c463bb (diff)
st/va: Add support for P010, used for 10-bit videos
Signed-off-by: Thong Thai <[email protected]> Reviewed-by: Leo Liu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3153>
Diffstat (limited to 'src/gallium/state_trackers/va/surface.c')
-rw-r--r--src/gallium/state_trackers/va/surface.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 391eab65e69..47c6f9b06c9 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -754,18 +754,28 @@ vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int format,
memset(&templat, 0, sizeof(templat));
- templat.buffer_format = pscreen->get_video_param(
- pscreen,
- PIPE_VIDEO_PROFILE_UNKNOWN,
- PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
- PIPE_VIDEO_CAP_PREFERED_FORMAT
- );
- templat.interlaced = pscreen->get_video_param(
- pscreen,
- PIPE_VIDEO_PROFILE_UNKNOWN,
- PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
- PIPE_VIDEO_CAP_PREFERS_INTERLACED
- );
+ if (format == VA_RT_FORMAT_YUV420_10BPP)
+ {
+ templat.buffer_format = PIPE_FORMAT_P010;
+ templat.interlaced = false;
+ }
+ else
+ {
+ templat.buffer_format = pscreen->get_video_param(
+ pscreen,
+ PIPE_VIDEO_PROFILE_UNKNOWN,
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+ PIPE_VIDEO_CAP_PREFERED_FORMAT
+ );
+ templat.interlaced = pscreen->get_video_param(
+ pscreen,
+ PIPE_VIDEO_PROFILE_UNKNOWN,
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+ PIPE_VIDEO_CAP_PREFERS_INTERLACED
+ );
+ }
+
+
if (expected_fourcc) {
enum pipe_format expected_format = VaFourccToPipeFormat(expected_fourcc);