summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon
diff options
context:
space:
mode:
authorChristian König <[email protected]>2013-09-09 10:49:55 +0200
committerChristian König <[email protected]>2013-09-12 15:16:30 +0200
commit2487324591c1629492288a814e1d8a3046d37b15 (patch)
treebb43571548f04c376f4cd804014c140bbff147c4 /src/gallium/drivers/radeon
parent56be937d42b2f18fff072854122dbe5e0a95dd16 (diff)
radeon/uvd: move more logic into the common files
Move the code back into the common UVD files since we now have base structures for R600 and radeonsi. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r--src/gallium/drivers/radeon/radeon_uvd.c21
-rw-r--r--src/gallium/drivers/radeon/radeon_uvd.h1
2 files changed, 20 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c
index 981d5c5f326..518978eadf6 100644
--- a/src/gallium/drivers/radeon/radeon_uvd.c
+++ b/src/gallium/drivers/radeon/radeon_uvd.c
@@ -46,6 +46,7 @@
#include "vl/vl_mpeg12_decoder.h"
#include "../../winsys/radeon/drm/radeon_winsys.h"
+#include "r600_pipe_common.h"
#include "radeon_uvd.h"
#define RUVD_ERR(fmt, args...) \
@@ -818,9 +819,9 @@ static void ruvd_flush(struct pipe_video_codec *decoder)
*/
struct pipe_video_codec *ruvd_create_decoder(struct pipe_context *context,
const struct pipe_video_codec *templ,
- struct radeon_winsys* ws,
ruvd_set_dtb set_dtb)
{
+ struct radeon_winsys* ws = ((struct r600_common_context *)context)->ws;
unsigned dpb_size = calc_dpb_size(templ);
unsigned width = templ->width, height = templ->height;
unsigned bs_buf_size;
@@ -1082,6 +1083,24 @@ int ruvd_get_video_param(struct pipe_screen *screen,
enum pipe_video_entrypoint entrypoint,
enum pipe_video_cap param)
{
+ struct r600_common_screen *rscreen = (struct r600_common_screen *)screen;
+
+ /* UVD 2.x limits */
+ if (rscreen->family < CHIP_PALM) {
+ enum pipe_video_format codec = u_reduce_video_profile(profile);
+ switch (param) {
+ case PIPE_VIDEO_CAP_SUPPORTED:
+ /* no support for MPEG4 */
+ return codec != PIPE_VIDEO_FORMAT_MPEG4;
+ case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
+ case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
+ /* and MPEG2 only with shaders */
+ return codec != PIPE_VIDEO_FORMAT_MPEG12;
+ default:
+ break;
+ }
+ }
+
switch (param) {
case PIPE_VIDEO_CAP_SUPPORTED:
switch (u_reduce_video_profile(profile)) {
diff --git a/src/gallium/drivers/radeon/radeon_uvd.h b/src/gallium/drivers/radeon/radeon_uvd.h
index dedb3c7040d..b0135bac5d7 100644
--- a/src/gallium/drivers/radeon/radeon_uvd.h
+++ b/src/gallium/drivers/radeon/radeon_uvd.h
@@ -347,7 +347,6 @@ typedef struct radeon_winsys_cs_handle* (*ruvd_set_dtb)
/* create an UVD decode */
struct pipe_video_codec *ruvd_create_decoder(struct pipe_context *context,
const struct pipe_video_codec *templat,
- struct radeon_winsys* ws,
ruvd_set_dtb set_dtb);
/* join surfaces into the same buffer with identical tiling params