summaryrefslogtreecommitdiff
path: root/src/radeon_glamor.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2012-12-27 12:13:57 +0100
committerMichel Dänzer <michel@daenzer.net>2012-12-27 11:55:58 +0100
commita60d2152e928a7011fc7c44a885a34c3cdd4f0fe (patch)
treef3009720432d4cf55923f4b03cfae1e89ff93d7e /src/radeon_glamor.c
parent04ebe14fe775d18b534e89b50b90ee293ae1910e (diff)
glamor: Enable full 2D acceleration for SI as well.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src/radeon_glamor.c')
-rw-r--r--src/radeon_glamor.c86
1 files changed, 5 insertions, 81 deletions
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 99bc6665..c232cc22 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -144,83 +144,18 @@ Bool radeon_glamor_pixmap_is_offscreen(PixmapPtr pixmap)
return priv && priv->bo;
}
-Bool radeon_glamor_prepare_access(PixmapPtr pixmap, glamor_access_t access)
-{
- ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
- RADEONInfoPtr info = RADEONPTR(scrn);
- struct radeon_bo *bo;
- int ret;
-
- if (access == GLAMOR_GPU_ACCESS_RW || access == GLAMOR_GPU_ACCESS_RO) {
- if (info->ChipFamily < CHIP_FAMILY_TAHITI)
- return TRUE;
-
- return info->accel_state->force;
- }
-
- bo = radeon_get_pixmap_bo(pixmap);
- if (bo) {
- /* When falling back to swrast, flush all pending operations */
- if (info->ChipFamily < CHIP_FAMILY_TAHITI)
- radeon_glamor_flush(scrn);
-
- ret = radeon_bo_map(bo, 1);
- if (ret) {
- xf86DrvMsg(scrn->scrnIndex, X_WARNING,
- "%s: bo map (tiling_flags %d, access %d) failed: %s\n",
- __FUNCTION__,
- radeon_get_pixmap_private(pixmap)->tiling_flags,
- access,
- strerror(-ret));
- return FALSE;
- }
-
- pixmap->devPrivate.ptr = bo->ptr;
- }
-
- return TRUE;
-}
-
-void
-radeon_glamor_finish_access(PixmapPtr pixmap, glamor_access_t access)
-{
- struct radeon_bo *bo;
-
- switch(access) {
- case GLAMOR_GPU_ACCESS_RW:
- case GLAMOR_GPU_ACCESS_RO:
- break;
- case GLAMOR_CPU_ACCESS_RO:
- case GLAMOR_CPU_ACCESS_RW:
- bo = radeon_get_pixmap_bo(pixmap);
- if (bo) {
- radeon_bo_unmap(bo);
- pixmap->devPrivate.ptr = NULL;
- }
- break;
- default:
- ErrorF("Invalid access mode %d\n", access);
- }
-
- return;
-}
-
static PixmapPtr
radeon_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
unsigned usage)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
- RADEONInfoPtr info = RADEONPTR(scrn);
struct radeon_pixmap *priv;
PixmapPtr pixmap, new_pixmap = NULL;
if (!(usage & RADEON_CREATE_PIXMAP_DRI2)) {
- if (info->ChipFamily < CHIP_FAMILY_TAHITI) {
- pixmap = glamor_create_pixmap(screen, w, h, depth, usage);
- if (pixmap)
- return pixmap;
- } else
- return fbCreatePixmap(screen, w, h, depth, usage);
+ pixmap = glamor_create_pixmap(screen, w, h, depth, usage);
+ if (pixmap)
+ return pixmap;
}
if (w > 32767 || h > 32767)
@@ -304,13 +239,9 @@ Bool
radeon_glamor_init(ScreenPtr screen)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
- RADEONInfoPtr info = RADEONPTR(scrn);
- unsigned int glamor_init_flags = GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_EGL_SCREEN;
- if (info->ChipFamily < CHIP_FAMILY_TAHITI)
- glamor_init_flags |= GLAMOR_USE_SCREEN | GLAMOR_USE_PICTURE_SCREEN;
-
- if (!glamor_init(screen, glamor_init_flags)) {
+ if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_EGL_SCREEN |
+ GLAMOR_USE_SCREEN | GLAMOR_USE_PICTURE_SCREEN)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to initialize glamor.\n");
return FALSE;
@@ -329,13 +260,6 @@ radeon_glamor_init(ScreenPtr screen)
#endif
return FALSE;
- if (!(glamor_init_flags & GLAMOR_USE_SCREEN) &&
- !glamor_screen_init(screen)) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "GLAMOR initialization failed\n");
- return FALSE;
- }
-
screen->CreatePixmap = radeon_glamor_create_pixmap;
screen->DestroyPixmap = radeon_glamor_destroy_pixmap;