From e3ac293daac1773631911182622b6732f68dc9f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Fri, 26 Apr 2013 11:49:55 +0200 Subject: [PATCH] r600/uvd: stop advertising MPEG4 on UVD 2.x chips v2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit That is just not supported by the hardware. v2: fix compare Signed-off-by: Christian König Reviewed-by: Alex Deucher --- src/gallium/drivers/r600/r600_pipe.c | 2 +- src/gallium/drivers/r600/r600_pipe.h | 3 +++ src/gallium/drivers/r600/r600_uvd.c | 14 ++++++++++++++ src/gallium/drivers/radeon/radeon_uvd.c | 1 - 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 5a0ea8407c5..b0128928857 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -1291,7 +1291,7 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws) rscreen->screen.get_driver_query_info = r600_get_driver_query_info; if (rscreen->info.has_uvd) { - rscreen->screen.get_video_param = ruvd_get_video_param; + rscreen->screen.get_video_param = r600_uvd_get_video_param; rscreen->screen.is_video_format_supported = ruvd_is_format_supported; } else { rscreen->screen.get_video_param = r600_get_video_param; diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 39fd82be142..33c85fc5454 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -902,6 +902,9 @@ struct pipe_video_decoder *r600_uvd_create_decoder(struct pipe_context *context, struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe, const struct pipe_video_buffer *tmpl); +int r600_uvd_get_video_param(struct pipe_screen *screen, + enum pipe_video_profile profile, + enum pipe_video_cap param); /* * Helpers for building command buffers diff --git a/src/gallium/drivers/r600/r600_uvd.c b/src/gallium/drivers/r600/r600_uvd.c index c1de49787a0..c4c04a84b3d 100644 --- a/src/gallium/drivers/r600/r600_uvd.c +++ b/src/gallium/drivers/r600/r600_uvd.c @@ -177,3 +177,17 @@ struct pipe_video_decoder *r600_uvd_create_decoder(struct pipe_context *context, width, height, max_references, expect_chunked_decode, ctx->ws, r600_uvd_set_dtb); } + +int r600_uvd_get_video_param(struct pipe_screen *screen, + enum pipe_video_profile profile, + enum pipe_video_cap param) +{ + struct r600_screen *rscreen = (struct r600_screen *)screen; + + /* No support for MPEG4 on UVD 2.x */ + if (param == PIPE_VIDEO_CAP_SUPPORTED && rscreen->family < CHIP_CEDAR && + u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG4) + return false; + + return ruvd_get_video_param(screen, profile, param); +} diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c index 9d0e0a27386..5a7eab683bd 100644 --- a/src/gallium/drivers/radeon/radeon_uvd.c +++ b/src/gallium/drivers/radeon/radeon_uvd.c @@ -1076,7 +1076,6 @@ int ruvd_get_video_param(struct pipe_screen *screen, switch (u_reduce_video_profile(profile)) { case PIPE_VIDEO_CODEC_MPEG12: case PIPE_VIDEO_CODEC_MPEG4: - /* TODO not all hw families support MPEG4 */ case PIPE_VIDEO_CODEC_MPEG4_AVC: case PIPE_VIDEO_CODEC_VC1: return true; -- 2.30.2