summaryrefslogtreecommitdiff
path: root/src/radeon_glamor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/radeon_glamor.c')
-rw-r--r--src/radeon_glamor.c80
1 files changed, 2 insertions, 78 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);
}
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;