diff options
author | Dave Airlie <airlied@redhat.com> | 2013-09-23 07:57:15 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-09-30 08:57:40 -0400 |
commit | 2d791370dfc5570eb74d7a1fb3baf4d4c8ecf243 (patch) | |
tree | 1a641ca523728d62be15c69955e513071842fd09 | |
parent | cbb99f659ee7b18ded0008a606e41ded38c1a194 (diff) |
radeon: use glamor Xv support if present.
This creates adaptors using glamor if possible.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/radeon_glamor.c | 5 | ||||
-rw-r--r-- | src/radeon_glamor.h | 4 | ||||
-rw-r--r-- | src/radeon_kms.c | 2 | ||||
-rw-r--r-- | src/radeon_video.c | 9 |
4 files changed, 18 insertions, 2 deletions
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c index 7f00d5b0..bd731a86 100644 --- a/src/radeon_glamor.c +++ b/src/radeon_glamor.c @@ -355,3 +355,8 @@ radeon_glamor_flush(ScrnInfoPtr pScrn) if (info->use_glamor) glamor_block_handler(pScrn->pScreen); } + +XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt) +{ + return glamor_xv_init(pScreen, num_adapt); +} diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h index cb76ff4f..67584002 100644 --- a/src/radeon_glamor.h +++ b/src/radeon_glamor.h @@ -27,6 +27,7 @@ #ifndef RADEON_GLAMOR_H #define RADEON_GLAMOR_H +#include "xf86xv.h" #ifdef USE_GLAMOR #include "radeon_surface.h" @@ -43,6 +44,8 @@ void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst); Bool radeon_glamor_pixmap_is_offscreen(PixmapPtr pixmap); +XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt); + struct radeon_pixmap { struct radeon_surface surface; struct radeon_bo *bo; @@ -88,6 +91,7 @@ static inline Bool radeon_glamor_pixmap_is_offscreen(PixmapPtr pixmap) { return static inline struct radeon_pixmap *radeon_get_pixmap_private(PixmapPtr pixmap) { return NULL; } +static inline XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen) { return NULL } #endif #endif /* RADEON_GLAMOR_H */ diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 9708dc75..255906b8 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -1321,7 +1321,7 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL) */ /* xf86DiDGAInit(pScreen, info->LinearAddr + pScrn->fbOffset); */ #endif - if (!info->use_glamor && info->r600_shadow_fb == FALSE) { + if (info->r600_shadow_fb == FALSE) { /* Init Xv */ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "Initializing Xv\n"); diff --git a/src/radeon_video.c b/src/radeon_video.c index 56cd9abd..5349d113 100644 --- a/src/radeon_video.c +++ b/src/radeon_video.c @@ -165,7 +165,14 @@ void RADEONInitVideo(ScreenPtr pScreen) memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr)); adaptors = newAdaptors; - if ((info->ChipFamily < CHIP_FAMILY_RS400) + if (info->use_glamor) { + texturedAdaptor = radeon_glamor_xv_init(pScreen, 16); + if (texturedAdaptor != NULL) { + adaptors[num_adaptors++] = texturedAdaptor; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Set up textured video (glamor)\n"); + } else + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to set up textured video (glamor)\n"); + } else if ((info->ChipFamily < CHIP_FAMILY_RS400) || (info->directRenderingEnabled) ) { texturedAdaptor = RADEONSetupImageTexturedVideo(pScreen); |