summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_pipe.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2013-04-03 10:18:35 +0200
committerChristian König <[email protected]>2013-04-11 17:10:28 +0200
commit5b2855bfe79bfc3995969f2bf775d89b1bc1808a (patch)
tree5da3383f7c400cc037b6dbaa1695bbdf24b09563 /src/gallium/drivers/r600/r600_pipe.c
parentf91e4d2c9d714bb7d667956cd93f216c18a434f4 (diff)
radeon/uvd: add UVD implementation v5
Just everything you need for UVD with r600g and radeonsi. v2: move UVD code to radeon subdir, clean up build system additions, remove an unused SI function, disable tiling on SI for now. v3: some minor indentation fix and rebased v4: dpb size calculation fixed v5: implement proper fall-back in case the kernel doesn't support UVD, based on patches from Andreas Boll but cleaned up a bit more. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_pipe.c')
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index ec83c45c83e..3f36e636605 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -37,6 +37,7 @@
#include "util/u_math.h"
#include "vl/vl_decoder.h"
#include "vl/vl_video_buffer.h"
+#include "radeon/radeon_uvd.h"
#include "os/os_time.h"
static const struct debug_named_value debug_options[] = {
@@ -379,8 +380,13 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
r600_init_context_resource_functions(rctx);
r600_init_surface_functions(rctx);
- rctx->context.create_video_decoder = vl_create_decoder;
- rctx->context.create_video_buffer = vl_video_buffer_create;
+ if (rscreen->info.has_uvd) {
+ rctx->context.create_video_decoder = r600_uvd_create_decoder;
+ rctx->context.create_video_buffer = r600_video_buffer_create;
+ } else {
+ rctx->context.create_video_decoder = vl_create_decoder;
+ rctx->context.create_video_buffer = vl_video_buffer_create;
+ }
r600_init_common_state_functions(rctx);
@@ -1257,7 +1263,6 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
rscreen->screen.get_param = r600_get_param;
rscreen->screen.get_shader_param = r600_get_shader_param;
rscreen->screen.get_paramf = r600_get_paramf;
- rscreen->screen.get_video_param = r600_get_video_param;
rscreen->screen.get_compute_param = r600_get_compute_param;
rscreen->screen.get_timestamp = r600_get_timestamp;
@@ -1268,12 +1273,20 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
rscreen->screen.is_format_supported = r600_is_format_supported;
rscreen->dma_blit = &r600_dma_blit;
}
- rscreen->screen.is_video_format_supported = vl_video_buffer_is_format_supported;
rscreen->screen.context_create = r600_create_context;
rscreen->screen.fence_reference = r600_fence_reference;
rscreen->screen.fence_signalled = r600_fence_signalled;
rscreen->screen.fence_finish = r600_fence_finish;
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.is_video_format_supported = ruvd_is_format_supported;
+ } else {
+ rscreen->screen.get_video_param = r600_get_video_param;
+ rscreen->screen.is_video_format_supported = vl_video_buffer_is_format_supported;
+ }
+
r600_init_screen_resource_functions(&rscreen->screen);
util_format_s3tc_init();