From a15cbabb8b546fa063cfb6f528dd67ee0037079b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Mon, 15 Jul 2013 08:31:25 -0600 Subject: [PATCH] vl: add entrypoint to get_video_param MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- src/gallium/auxiliary/vl/vl_decoder.c | 4 +++- src/gallium/auxiliary/vl/vl_decoder.h | 3 ++- src/gallium/auxiliary/vl/vl_video_buffer.c | 1 + src/gallium/drivers/ilo/ilo_screen.c | 3 ++- src/gallium/drivers/nouveau/nouveau_video.c | 3 ++- .../drivers/nouveau/nouveau_vp3_video.c | 1 + .../drivers/nouveau/nouveau_vp3_video.h | 1 + src/gallium/drivers/nv50/nv50_context.h | 1 + src/gallium/drivers/nv50/nv84_video.c | 1 + src/gallium/drivers/r300/r300_screen.c | 3 ++- src/gallium/drivers/r600/r600_pipe.c | 3 ++- src/gallium/drivers/r600/r600_pipe.h | 1 + src/gallium/drivers/r600/r600_uvd.c | 3 ++- src/gallium/drivers/radeon/radeon_uvd.c | 1 + src/gallium/drivers/radeon/radeon_uvd.h | 1 + src/gallium/drivers/radeonsi/radeonsi_pipe.c | 3 ++- src/gallium/drivers/softpipe/sp_screen.c | 3 ++- src/gallium/include/pipe/p_screen.h | 1 + src/gallium/state_trackers/vdpau/decode.c | 13 +++++++++---- src/gallium/state_trackers/vdpau/mixer.c | 4 ++-- src/gallium/state_trackers/vdpau/query.c | 18 ++++++++++++------ src/gallium/state_trackers/vdpau/surface.c | 2 ++ src/gallium/state_trackers/xvmc/subpicture.c | 1 + src/gallium/state_trackers/xvmc/surface.c | 6 ++++-- 24 files changed, 58 insertions(+), 23 deletions(-) diff --git a/src/gallium/auxiliary/vl/vl_decoder.c b/src/gallium/auxiliary/vl/vl_decoder.c index f19834fb3d5..b325b8c61bb 100644 --- a/src/gallium/auxiliary/vl/vl_decoder.c +++ b/src/gallium/auxiliary/vl/vl_decoder.c @@ -33,7 +33,8 @@ #include "vl_mpeg12_decoder.h" bool -vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile) +vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint) { assert(screen); switch (u_reduce_video_profile(profile)) { @@ -74,6 +75,7 @@ vl_create_decoder(struct pipe_context *pipe, ( pipe->screen, templat->profile, + templat->entrypoint, PIPE_VIDEO_CAP_NPOT_TEXTURES ); diff --git a/src/gallium/auxiliary/vl/vl_decoder.h b/src/gallium/auxiliary/vl/vl_decoder.h index 124315f073f..0c216dfb8a8 100644 --- a/src/gallium/auxiliary/vl/vl_decoder.h +++ b/src/gallium/auxiliary/vl/vl_decoder.h @@ -35,7 +35,8 @@ * check if a given profile is supported with shader based decoding */ bool -vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile); +vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint); /** * get the maximum supported level for the given profile with shader based decoding diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c index 16c7649388b..d81c1815abf 100644 --- a/src/gallium/auxiliary/vl/vl_video_buffer.c +++ b/src/gallium/auxiliary/vl/vl_video_buffer.c @@ -406,6 +406,7 @@ vl_video_buffer_create(struct pipe_context *pipe, ( pipe->screen, PIPE_VIDEO_PROFILE_UNKNOWN, + PIPE_VIDEO_ENTRYPOINT_UNKNOWN, PIPE_VIDEO_CAP_NPOT_TEXTURES ); diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c index 5f97226bb82..9f3235ce4ce 100644 --- a/src/gallium/drivers/ilo/ilo_screen.c +++ b/src/gallium/drivers/ilo/ilo_screen.c @@ -152,11 +152,12 @@ ilo_get_shader_param(struct pipe_screen *screen, unsigned shader, static int ilo_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: - return vl_profile_supported(screen, profile); + return vl_profile_supported(screen, profile, entrypoint); case PIPE_VIDEO_CAP_NPOT_TEXTURES: return 1; case PIPE_VIDEO_CAP_MAX_WIDTH: diff --git a/src/gallium/drivers/nouveau/nouveau_video.c b/src/gallium/drivers/nouveau/nouveau_video.c index 67b67392bbc..8e08cab4b2d 100644 --- a/src/gallium/drivers/nouveau/nouveau_video.c +++ b/src/gallium/drivers/nouveau/nouveau_video.c @@ -834,11 +834,12 @@ error: static int nouveau_screen_get_video_param(struct pipe_screen *pscreen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: - return vl_profile_supported(pscreen, profile); + return vl_profile_supported(pscreen, profile, entrypoint); case PIPE_VIDEO_CAP_NPOT_TEXTURES: return 1; case PIPE_VIDEO_CAP_MAX_WIDTH: diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.c b/src/gallium/drivers/nouveau/nouveau_vp3_video.c index be0e6b3fafd..1659c5f7e72 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video.c +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.c @@ -353,6 +353,7 @@ nouveau_vp3_load_firmware(struct nouveau_vp3_decoder *dec, int nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { int chipset = nouveau_screen(pscreen)->device->chipset; diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.h b/src/gallium/drivers/nouveau/nouveau_vp3_video.h index 177f0a851d0..8aedfd08da2 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video.h +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.h @@ -220,6 +220,7 @@ nouveau_vp3_vp_caps(struct nouveau_vp3_decoder *dec, union pipe_desc desc, int nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param); boolean diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index f89a55110cf..3600f70a29c 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -301,6 +301,7 @@ nv84_video_buffer_create(struct pipe_context *pipe, int nv84_screen_get_video_param(struct pipe_screen *pscreen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param); boolean diff --git a/src/gallium/drivers/nv50/nv84_video.c b/src/gallium/drivers/nv50/nv84_video.c index 7759979b499..e7c715c8ef6 100644 --- a/src/gallium/drivers/nv50/nv84_video.c +++ b/src/gallium/drivers/nv50/nv84_video.c @@ -744,6 +744,7 @@ error: int nv84_screen_get_video_param(struct pipe_screen *pscreen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { switch (param) { diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 25ff2863892..5a388970c9b 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -341,11 +341,12 @@ static float r300_get_paramf(struct pipe_screen* pscreen, static int r300_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: - return vl_profile_supported(screen, profile); + return vl_profile_supported(screen, profile, entrypoint); case PIPE_VIDEO_CAP_NPOT_TEXTURES: return 0; case PIPE_VIDEO_CAP_MAX_WIDTH: diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index c8fb547a30a..2be5910fcb2 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -777,11 +777,12 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e static int r600_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: - return vl_profile_supported(screen, profile); + return vl_profile_supported(screen, profile, entrypoint); case PIPE_VIDEO_CAP_NPOT_TEXTURES: return 1; case PIPE_VIDEO_CAP_MAX_WIDTH: diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 743f9abf6ab..21d68c9387b 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -898,6 +898,7 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe, int r600_uvd_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param); /* diff --git a/src/gallium/drivers/r600/r600_uvd.c b/src/gallium/drivers/r600/r600_uvd.c index 8fb58614ad2..bfdc4f1e5f5 100644 --- a/src/gallium/drivers/r600/r600_uvd.c +++ b/src/gallium/drivers/r600/r600_uvd.c @@ -174,6 +174,7 @@ struct pipe_video_codec *r600_uvd_create_decoder(struct pipe_context *context, int r600_uvd_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { struct r600_screen *rscreen = (struct r600_screen *)screen; @@ -194,5 +195,5 @@ int r600_uvd_get_video_param(struct pipe_screen *screen, } } - return ruvd_get_video_param(screen, profile, param); + return ruvd_get_video_param(screen, profile, entrypoint, param); } diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c index ed4e4fc8f3d..86f4c5592fb 100644 --- a/src/gallium/drivers/radeon/radeon_uvd.c +++ b/src/gallium/drivers/radeon/radeon_uvd.c @@ -1075,6 +1075,7 @@ void ruvd_set_dt_surfaces(struct ruvd_msg *msg, struct radeon_surface *luma, int ruvd_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { switch (param) { diff --git a/src/gallium/drivers/radeon/radeon_uvd.h b/src/gallium/drivers/radeon/radeon_uvd.h index 89a10c8fe91..8c1ab79e1f8 100644 --- a/src/gallium/drivers/radeon/radeon_uvd.h +++ b/src/gallium/drivers/radeon/radeon_uvd.h @@ -363,6 +363,7 @@ void ruvd_set_dt_surfaces(struct ruvd_msg *msg, struct radeon_surface *luma, /* returns supported codecs and other parameters */ int ruvd_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param); /* the hardware only supports NV12 */ diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c b/src/gallium/drivers/radeonsi/radeonsi_pipe.c index b491672e128..4d243483952 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c +++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c @@ -540,11 +540,12 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e static int r600_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: - return vl_profile_supported(screen, profile); + return vl_profile_supported(screen, profile, entrypoint); case PIPE_VIDEO_CAP_NPOT_TEXTURES: return 1; case PIPE_VIDEO_CAP_MAX_WIDTH: diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index f6acdc872d2..4762ac312ff 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -249,11 +249,12 @@ softpipe_get_paramf(struct pipe_screen *screen, enum pipe_capf param) static int softpipe_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { switch (param) { case PIPE_VIDEO_CAP_SUPPORTED: - return vl_profile_supported(screen, profile); + return vl_profile_supported(screen, profile, entrypoint); case PIPE_VIDEO_CAP_NPOT_TEXTURES: return 0; case PIPE_VIDEO_CAP_MAX_WIDTH: diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index c487e8ec8a4..f4907366706 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -94,6 +94,7 @@ struct pipe_screen { */ int (*get_video_param)( struct pipe_screen *, enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param ); /** diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c index 09927c564e8..f25a0eb8c49 100644 --- a/src/gallium/state_trackers/vdpau/decode.c +++ b/src/gallium/state_trackers/vdpau/decode.c @@ -76,6 +76,7 @@ vlVdpDecoderCreate(VdpDevice device, ( screen, templat.profile, + PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_SUPPORTED ); if (!supported) { @@ -459,8 +460,10 @@ vlVdpDecoderRender(VdpDecoder decoder, pipe_mutex_lock(vlsurf->device->mutex); - buffer_support[0] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE); - buffer_support[1] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_SUPPORTS_INTERLACED); + buffer_support[0] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE); + buffer_support[1] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_SUPPORTS_INTERLACED); if (vlsurf->video_buffer == NULL || !screen->is_video_format_supported(screen, vlsurf->video_buffer->buffer_format, dec->profile) || @@ -471,10 +474,12 @@ vlVdpDecoderRender(VdpDecoder decoder, vlsurf->video_buffer->destroy(vlsurf->video_buffer); /* set the buffer format to the prefered one */ - vlsurf->templat.buffer_format = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_PREFERED_FORMAT); + vlsurf->templat.buffer_format = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_PREFERED_FORMAT); /* also set interlacing to decoders preferences */ - vlsurf->templat.interlaced = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_PREFERS_INTERLACED); + vlsurf->templat.interlaced = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_PREFERS_INTERLACED); /* and recreate the video buffer */ vlsurf->video_buffer = dec->context->create_video_buffer(dec->context, &vlsurf->templat); diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c index 26db5c8bd8b..18439a78f4a 100644 --- a/src/gallium/state_trackers/vdpau/mixer.c +++ b/src/gallium/state_trackers/vdpau/mixer.c @@ -132,8 +132,8 @@ vlVdpVideoMixerCreate(VdpDevice device, VDPAU_MSG(VDPAU_WARN, "[VDPAU] Max layers > 4 not supported\n", vmixer->max_layers); goto no_params; } - max_width = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_WIDTH); - max_height = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_HEIGHT); + max_width = screen->get_video_param(screen, prof, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_MAX_WIDTH); + max_height = screen->get_video_param(screen, prof, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_MAX_HEIGHT); if (vmixer->video_width < 48 || vmixer->video_width > max_width) { VDPAU_MSG(VDPAU_WARN, "[VDPAU] 48 < %u < %u not valid for width\n", vmixer->video_width, max_width); diff --git a/src/gallium/state_trackers/vdpau/query.c b/src/gallium/state_trackers/vdpau/query.c index a6b34c719b7..fff7d6ba55b 100644 --- a/src/gallium/state_trackers/vdpau/query.c +++ b/src/gallium/state_trackers/vdpau/query.c @@ -178,11 +178,15 @@ vlVdpDecoderQueryCapabilities(VdpDevice device, VdpDecoderProfile profile, } pipe_mutex_lock(dev->mutex); - *is_supported = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_SUPPORTED); + *is_supported = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_SUPPORTED); if (*is_supported) { - *max_width = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_MAX_WIDTH); - *max_height = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_MAX_HEIGHT); - *max_level = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_MAX_LEVEL); + *max_width = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_MAX_WIDTH); + *max_height = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_MAX_HEIGHT); + *max_level = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_MAX_LEVEL); *max_macroblocks = (*max_width/16)*(*max_height/16); } else { *max_width = 0; @@ -512,11 +516,13 @@ vlVdpVideoMixerQueryParameterValueRange(VdpDevice device, VdpVideoMixerParameter switch (parameter) { case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH: *(uint32_t*)min_value = 48; - *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_WIDTH); + *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_MAX_WIDTH); break; case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT: *(uint32_t*)min_value = 48; - *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_HEIGHT); + *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_MAX_HEIGHT); break; case VDP_VIDEO_MIXER_PARAMETER_LAYERS: diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c index bd11fc3cdec..a26f9b6bb49 100644 --- a/src/gallium/state_trackers/vdpau/surface.c +++ b/src/gallium/state_trackers/vdpau/surface.c @@ -75,6 +75,7 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type, ( pipe->screen, PIPE_VIDEO_PROFILE_UNKNOWN, + PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_PREFERED_FORMAT ); p_surf->templat.chroma_format = ChromaToPipe(chroma_type); @@ -84,6 +85,7 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type, ( pipe->screen, PIPE_VIDEO_PROFILE_UNKNOWN, + PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_PREFERS_INTERLACED ); p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat); diff --git a/src/gallium/state_trackers/xvmc/subpicture.c b/src/gallium/state_trackers/xvmc/subpicture.c index 51fcf78e8f1..e38f6f7c7f8 100644 --- a/src/gallium/state_trackers/xvmc/subpicture.c +++ b/src/gallium/state_trackers/xvmc/subpicture.c @@ -227,6 +227,7 @@ Status XvMCCreateSubpicture(Display *dpy, XvMCContext *context, XvMCSubpicture * tex_templ.last_level = 0; if (pipe->screen->get_video_param(pipe->screen, PIPE_VIDEO_PROFILE_UNKNOWN, + PIPE_VIDEO_ENTRYPOINT_UNKNOWN, PIPE_VIDEO_CAP_NPOT_TEXTURES)) { tex_templ.width0 = width; tex_templ.height0 = height; diff --git a/src/gallium/state_trackers/xvmc/surface.c b/src/gallium/state_trackers/xvmc/surface.c index db32142a7e6..2e67612f690 100644 --- a/src/gallium/state_trackers/xvmc/surface.c +++ b/src/gallium/state_trackers/xvmc/surface.c @@ -177,7 +177,8 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac tmpl.buffer_format = pipe->screen->get_video_param ( pipe->screen, - PIPE_VIDEO_PROFILE_MPEG2_MAIN, + context_priv->decoder->profile, + context_priv->decoder->entrypoint, PIPE_VIDEO_CAP_PREFERED_FORMAT ); tmpl.chroma_format = context_priv->decoder->chroma_format; @@ -186,7 +187,8 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac tmpl.interlaced = pipe->screen->get_video_param ( pipe->screen, - PIPE_VIDEO_PROFILE_MPEG2_MAIN, + context_priv->decoder->profile, + context_priv->decoder->entrypoint, PIPE_VIDEO_CAP_PREFERS_INTERLACED ); -- 2.30.2