xf86-video-ati: Branch 'master'

Dave Airlie airlied at kemper.freedesktop.org
Sun Oct 4 21:24:34 PDT 2009


 src/drmmode_display.c |   33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

New commits:
commit 86cafb8affea448bdf58300044e755201b822d2a
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Oct 5 14:17:25 2009 +1000

    kms: don't use scratch pixmaps when copying fbcon.
    
    scratch pixmaps seem to interact badly with mixed pixmaps, it appears
    some state may be getting left around in the privates somewhere, since
    scratch pixmap headers don't get destroyed.

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 1b5f0ac..6f3f6df 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -156,16 +156,19 @@ create_pixmap_for_fbcon(drmmode_ptr drmmode,
 		return NULL;
 	}
 
-	pixmap = GetScratchPixmapHeader(pScreen,
-					fbcon->width, fbcon->height,
-					fbcon->depth, fbcon->bpp,
-					fbcon->pitch, NULL);
-	if (pixmap == NULL) {
+	pixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, fbcon->depth, 0);
+	if (!pixmap) 
+		return NULL;
+
+	if (!(*pScreen->ModifyPixmapHeader)(pixmap, fbcon->width, fbcon->height,
+					   fbcon->depth, fbcon->bpp,
+					   fbcon->pitch, NULL)) {
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			   "Couldn't allocate pixmap fbcon contents\n");
 		return NULL;
 	}
-
+	
+	exaMoveInPixmap(pixmap);
 	radeon_set_pixmap_bo(pixmap, bo);
 
 	radeon_bo_unref(bo);
@@ -199,10 +202,17 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 	if (!src)
 		return;
 
-	dst = GetScratchPixmapHeader(pScreen,
-				     pScrn->virtualX, pScrn->virtualY,
-				     pScrn->depth, pScrn->bitsPerPixel,
-				     pitch, NULL);
+	dst = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScrn->depth, 0);
+	if (!dst)
+		goto out_free_src;
+
+	if (!(*pScreen->ModifyPixmapHeader)(dst, pScrn->virtualX,
+					    pScrn->virtualY, pScrn->depth,
+					    pScrn->bitsPerPixel, pitch,
+					    NULL))
+		goto out_free_dst;
+
+	exaMoveInPixmap(dst);
 	radeon_set_pixmap_bo(dst, info->front_bo);
 	info->accel_state->exa->PrepareCopy (src, dst,
 					     -1, -1, GXcopy, FB_ALLONES);
@@ -210,8 +220,9 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 				      pScrn->virtualX, pScrn->virtualY);
 	info->accel_state->exa->DoneCopy (dst);
 	radeon_cs_flush_indirect(pScrn);
-
+ out_free_dst:
 	(*pScreen->DestroyPixmap)(dst);
+ out_free_src:
 	(*pScreen->DestroyPixmap)(src);
 
 }


More information about the xorg-commit mailing list