xf86-video-intel: uxa/uxa-accel.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Jun 6 09:14:55 PDT 2010


 uxa/uxa-accel.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit b586624d4f2908d2a998ba87fe0ae31c10f46b91
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jun 6 17:11:40 2010 +0100

    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 at chris-wilson.co.uk>

diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index 4e07351..6b177cf 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);
 	}


More information about the xorg-commit mailing list