summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-06 17:11:40 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-06-06 17:14:10 +0100
commitb586624d4f2908d2a998ba87fe0ae31c10f46b91 (patch)
treee7fb2169a935611a9caa076e74697932dbd20800
parent6db1e5231b7a0e79611f771d4efea686f7849e04 (diff)
uxa: Force fallback for copies.
All but uxa_copy_window() perform the preliminary checks for whether acceleration is available. The simplest method for adding the fallback for uxa_copy_window() seems to be to add it in the core copy function, so be it. This allows X to survive a little longer once we encounter a GPU hang. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--uxa/uxa-accel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index 4e07351e..6b177cff 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -589,6 +589,9 @@ uxa_copy_n_to_n(DrawablePtr pSrcDrawable,
int dst_off_x, dst_off_y;
PixmapPtr pSrcPixmap, pDstPixmap;
+ if (uxa_screen->swappedOut || uxa_screen->force_fallback)
+ goto fallback;
+
pSrcPixmap = uxa_get_drawable_pixmap(pSrcDrawable);
pDstPixmap = uxa_get_drawable_pixmap(pDstDrawable);
if (!pSrcPixmap || !pDstPixmap)
@@ -680,11 +683,13 @@ fallback:
uxa_drawable_location(pSrcDrawable),
uxa_drawable_location(pDstDrawable)));
if (uxa_prepare_access(pDstDrawable, UXA_ACCESS_RW)) {
- if (uxa_prepare_access(pSrcDrawable, UXA_ACCESS_RO)) {
+ if (pSrcDrawable == pDstDrawable ||
+ uxa_prepare_access(pSrcDrawable, UXA_ACCESS_RO)) {
fbCopyNtoN(pSrcDrawable, pDstDrawable, pGC, pbox, nbox,
dx, dy, reverse, upsidedown, bitplane,
closure);
- uxa_finish_access(pSrcDrawable);
+ if (pSrcDrawable != pDstDrawable)
+ uxa_finish_access(pSrcDrawable);
}
uxa_finish_access(pDstDrawable);
}