summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-08-05 16:12:16 +0200
committerMaarten Maathuis <madman2003@gmail.com>2009-08-06 23:48:14 +0200
commite8ac2ed5dc4c2ac0a5e1e1f371f94c15b1c729dd (patch)
treed65f416d213077ad2594d8b182b6d34db2afc2dd
parent9d2a7128d3e66b8c076a714d69f84bcad49391b9 (diff)
exa: implement exaMoveInPixmap for "mixed"
- This can be used to force creation of driver pixmap. - Not for 1 or 4 bpp. - Driver can still fail (driver) pixmap creation.
-rw-r--r--exa/exa.c32
-rw-r--r--exa/exa.h2
-rw-r--r--exa/exa_migration_classic.c4
-rw-r--r--exa/exa_migration_mixed.c13
-rw-r--r--exa/exa_priv.h11
5 files changed, 59 insertions, 3 deletions
diff --git a/exa/exa.c b/exa/exa.c
index fd9ba9001..32a1c3ebc 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -1059,12 +1059,16 @@ exaDriverInit (ScreenPtr pScreen,
wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_mixed);
pExaScr->do_migration = exaDoMigration_mixed;
pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_mixed;
+ pExaScr->do_move_in_pixmap = exaMoveInPixmap_mixed;
+ pExaScr->do_move_out_pixmap = NULL;
} else {
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_driver);
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_driver);
wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_driver);
pExaScr->do_migration = NULL;
pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_driver;
+ pExaScr->do_move_in_pixmap = NULL;
+ pExaScr->do_move_out_pixmap = NULL;
}
} else {
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_classic);
@@ -1072,6 +1076,8 @@ exaDriverInit (ScreenPtr pScreen,
wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_classic);
pExaScr->do_migration = exaDoMigration_classic;
pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_classic;
+ pExaScr->do_move_in_pixmap = exaMoveInPixmap_classic;
+ pExaScr->do_move_out_pixmap = exaMoveOutPixmap_classic;
}
if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) {
LogMessage(X_INFO, "EXA(%d): Offscreen pixmap area of %lu bytes\n",
@@ -1188,3 +1194,29 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
if (pExaScr->do_migration)
(*pExaScr->do_migration)(pixmaps, npixmaps, can_accel);
}
+
+void
+exaMoveInPixmap (PixmapPtr pPixmap)
+{
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ExaScreenPriv(pScreen);
+
+ if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS))
+ return;
+
+ if (pExaScr->do_move_in_pixmap)
+ (*pExaScr->do_move_in_pixmap)(pPixmap);
+}
+
+void
+exaMoveOutPixmap (PixmapPtr pPixmap)
+{
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ExaScreenPriv(pScreen);
+
+ if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS))
+ return;
+
+ if (pExaScr->do_move_out_pixmap)
+ (*pExaScr->do_move_out_pixmap)(pPixmap);
+}
diff --git a/exa/exa.h b/exa/exa.h
index 40ac1ddba..46d12b729 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -815,7 +815,7 @@ exaEnableDisableFBAccess (int index, Bool enable);
extern _X_EXPORT Bool
exaDrawableIsOffscreen (DrawablePtr pDrawable);
-/* in exa_migration.c */
+/* in exa.c */
extern _X_EXPORT void
exaMoveInPixmap (PixmapPtr pPixmap);
diff --git a/exa/exa_migration_classic.c b/exa/exa_migration_classic.c
index 83559593f..d8e1e86da 100644
--- a/exa/exa_migration_classic.c
+++ b/exa/exa_migration_classic.c
@@ -366,7 +366,7 @@ exaDoMoveInPixmap (ExaMigrationPtr migrate)
}
void
-exaMoveInPixmap (PixmapPtr pPixmap)
+exaMoveInPixmap_classic (PixmapPtr pPixmap)
{
static ExaMigrationRec migrate = { .as_dst = FALSE, .as_src = TRUE,
.pReg = NULL };
@@ -407,7 +407,7 @@ exaDoMoveOutPixmap (ExaMigrationPtr migrate)
}
void
-exaMoveOutPixmap (PixmapPtr pPixmap)
+exaMoveOutPixmap_classic (PixmapPtr pPixmap)
{
static ExaMigrationRec migrate = { .as_dst = FALSE, .as_src = TRUE,
.pReg = NULL };
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index 24bdafbd6..771c2c342 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -170,3 +170,16 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
exaCreateDriverPixmap_mixed(pPixmap);
}
}
+
+void
+exaMoveInPixmap_mixed(PixmapPtr pPixmap)
+{
+ ExaMigrationRec pixmaps[1];
+
+ pixmaps[0].as_dst = FALSE;
+ pixmaps[0].as_src = TRUE;
+ pixmaps[0].pPix = pPixmap;
+ pixmaps[0].pReg = NULL;
+
+ exaDoMigration(pixmaps, 1, TRUE);
+}
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 620bc67a4..869cf1772 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -174,6 +174,8 @@ typedef struct {
#endif
void (*do_migration) (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
Bool (*pixmap_is_offscreen) (PixmapPtr pPixmap);
+ void (*do_move_in_pixmap) (PixmapPtr pPixmap);
+ void (*do_move_out_pixmap) (PixmapPtr pPixmap);
Bool swappedOut;
enum ExaMigrationHeuristic migration;
@@ -604,6 +606,9 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap);
void
exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
+void
+exaMoveInPixmap_mixed(PixmapPtr pPixmap);
+
/* exa_render.c */
Bool
exaOpReadsDestination (CARD8 op);
@@ -665,4 +670,10 @@ exaDoMigration_classic (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
void
exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area);
+void
+exaMoveOutPixmap_classic (PixmapPtr pPixmap);
+
+void
+exaMoveInPixmap_classic (PixmapPtr pPixmap);
+
#endif /* EXAPRIV_H */