aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/exa/exa_mixed.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/exa/exa_mixed.c')
-rw-r--r--xorg-server/exa/exa_mixed.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/xorg-server/exa/exa_mixed.c b/xorg-server/exa/exa_mixed.c
index b29ee353c..764c7dd58 100644
--- a/xorg-server/exa/exa_mixed.c
+++ b/xorg-server/exa/exa_mixed.c
@@ -93,9 +93,13 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
/* A scratch pixmap will become a driver pixmap right away. */
if (!w || !h) {
exaCreateDriverPixmap_mixed(pPixmap);
- pExaPixmap->offscreen = exaPixmapIsOffscreen(pPixmap);
+ pExaPixmap->use_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
} else
- pExaPixmap->offscreen = FALSE;
+ pExaPixmap->use_gpu_copy = FALSE;
+
+ /* During a fallback we must prepare access. */
+ if (pExaScr->fallback_counter)
+ exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST);
return pPixmap;
}
@@ -107,7 +111,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPrivPtr pExaScr;
ExaPixmapPrivPtr pExaPixmap;
- Bool ret, is_offscreen;
+ Bool ret, has_gpu_copy;
if (!pPixmap)
return FALSE;
@@ -127,7 +131,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
pExaPixmap->driverPriv = NULL;
}
- pExaPixmap->offscreen = FALSE;
+ pExaPixmap->use_gpu_copy = FALSE;
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
}
@@ -141,8 +145,8 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
}
}
- is_offscreen = exaPixmapIsOffscreen(pPixmap);
- if (is_offscreen) {
+ has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
+ if (has_gpu_copy) {
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
pPixmap->devKind = pExaPixmap->fb_pitch;
} else {
@@ -164,7 +168,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
swap(pExaScr, pScreen, ModifyPixmapHeader);
out:
- if (is_offscreen) {
+ if (has_gpu_copy) {
pExaPixmap->fb_ptr = pPixmap->devPrivate.ptr;
pExaPixmap->fb_pitch = pPixmap->devKind;
} else {
@@ -188,6 +192,10 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
+ /* During a fallback we must finish access, but we don't know the index. */
+ if (pExaScr->fallback_counter)
+ exaFinishAccess(&pPixmap->drawable, -1);
+
if (pExaScr->deferred_mixed_pixmap == pPixmap)
pExaScr->deferred_mixed_pixmap = NULL;
@@ -211,7 +219,7 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
}
Bool
-exaPixmapIsOffscreen_mixed(PixmapPtr pPixmap)
+exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv(pScreen);