summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/vdpau/surface.c7
-rw-r--r--src/gallium/state_trackers/xorg/xvmc/surface.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c
index 206a8397e9f..60cbbed2769 100644
--- a/src/gallium/state_trackers/vdpau/surface.c
+++ b/src/gallium/state_trackers/vdpau/surface.c
@@ -74,7 +74,12 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
p_surf->device = dev;
memset(&tmpl, 0, sizeof(tmpl));
- tmpl.buffer_format = PIPE_FORMAT_YV12;
+ tmpl.buffer_format = dev->context->pipe->screen->get_video_param
+ (
+ dev->context->pipe->screen,
+ PIPE_VIDEO_PROFILE_UNKNOWN,
+ PIPE_VIDEO_CAP_PREFERED_FORMAT
+ );
tmpl.chroma_format = ChromaToPipe(chroma_type);
tmpl.width = width;
tmpl.height = height;
diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c
index 06a3eb963ad..f1c32714cc6 100644
--- a/src/gallium/state_trackers/xorg/xvmc/surface.c
+++ b/src/gallium/state_trackers/xorg/xvmc/surface.c
@@ -175,7 +175,12 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac
return BadAlloc;
memset(&tmpl, 0, sizeof(tmpl));
- tmpl.buffer_format = PIPE_FORMAT_NV12;
+ tmpl.buffer_format = pipe->screen->get_video_param
+ (
+ pipe->screen,
+ PIPE_VIDEO_PROFILE_MPEG2_MAIN,
+ PIPE_VIDEO_CAP_PREFERED_FORMAT
+ );
tmpl.chroma_format = context_priv->decoder->chroma_format;
tmpl.width = context_priv->decoder->width;
tmpl.height = context_priv->decoder->height;