[Mesa-dev] [PATCH] r600/uvd: stop advertising MPEG4 on UVD 2.x chips
Christian König
deathsimple at vodafone.de
Fri Apr 26 02:51:00 PDT 2013
From: Christian König <christian.koenig at amd.com>
That is just not supported by the hardware.
Signed-off-by: Christian König <christian.koenig at amd.com>
---
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 5a0ea84..b012892 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 39fd82b..33c85fc 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 c1de497..e5d405b 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 9d0e0a2..5a7eab6 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;
--
1.7.9.5
More information about the mesa-dev
mailing list