r600/uvd: stop advertising MPEG4 on UVD 2.x chips v2
authorChristian König <christian.koenig@amd.com>
Fri, 26 Apr 2013 09:49:55 +0000 (11:49 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 26 Apr 2013 13:35:36 +0000 (15:35 +0200)
That is just not supported by the hardware.

v2: fix compare

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_uvd.c
src/gallium/drivers/radeon/radeon_uvd.c

index 5a0ea8407c5f1d39e8833c3ab61ba5e80c3b57b6..b0128928857a36242fddf4b2b6ef39c0afa35ebf 100644 (file)
@@ -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;
index 39fd82be1427c79cc6ee63630fb3a73284f43db1..33c85fc5454dfd63c59894ab64e20fa2e44b9924 100644 (file)
@@ -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
index c1de49787a063c55d686c1c97fab17fcbaa83ce9..c4c04a84b3d512e51076a9a21361ccdfdb221c15 100644 (file)
@@ -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);
+}
index 9d0e0a27386dbdf9fdd820b8da3bbed5832bcf0b..5a7eab683bdf07215a8b0ff2233e212e89c71bf4 100644 (file)
@@ -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;