[PATCH 4/4] exa: a few small pitch related changes

Maarten Maathuis madman2003 at gmail.com
Mon Nov 23 13:17:46 PST 2009


- Setting pitch before exaCopyDirty* is not needed.

Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
---
 exa/exa.c                 |   11 +++++++++--
 exa/exa_migration_mixed.c |   11 +++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index 023288c..16f39f6 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -323,10 +323,17 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
 
     has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
 
-    if (has_gpu_copy && pExaPixmap->fb_ptr)
+    if (has_gpu_copy) {
+	/* This can be NULL, but the driver prepareAccess call should
+	 * take care of that. */
 	pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
-    else
+	pPixmap->devKind = pExaPixmap->fb_pitch;
+    } else {
+	/* For mixed pixmaps this can be NULL, but that will be fixed
+	 * later in exaPrepareAccessReg_mixed(). */
 	pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
+	pPixmap->devKind = pExaPixmap->sys_pitch;
+    }
 
     /* Store so we can handle repeated / nested calls. */
     pExaScr->access[index].pixmap = pPixmap;
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index a7fdf63..ee32b21 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -101,7 +101,6 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
 	if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
 	    ExaScreenPriv(pPixmap->drawable.pScreen);
 
-	    pPixmap->devKind = pExaPixmap->fb_pitch;
 	    exaCopyDirtyToFb(pixmaps + i);
 
 	    if (pExaScr->deferred_mixed_pixmap == pPixmap)
@@ -109,6 +108,10 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
 	}
 
 	pExaPixmap->use_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
+	if (pExaPixmap->use_gpu_copy)
+	    pPixmap->devKind = pExaPixmap->fb_pitch;
+	else
+	    pPixmap->devKind = pExaPixmap->sys_pitch;
     }
 }
 
@@ -183,17 +186,14 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
 		    pixmaps[0].as_src = TRUE;
 		    pixmaps[0].pReg = NULL;
 		}
-		pPixmap->devKind = pExaPixmap->fb_pitch;
 		exaCopyDirtyToSys(pixmaps);
 	    }
 
 	    if (as_dst)
 		exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
 			       pPixmap->drawable.height);
-	} else if (has_gpu_copy) {
-	    pPixmap->devKind = pExaPixmap->fb_pitch;
+	} else if (has_gpu_copy)
 	    exaCopyDirtyToSys(pixmaps);
-	}
 
 	pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
 	pPixmap->devKind = pExaPixmap->sys_pitch;
@@ -222,7 +222,6 @@ void exaFinishAccess_mixed(PixmapPtr pPixmap, int index)
 		pExaScr->deferred_mixed_pixmap != pPixmap)
 		exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap);
 	    pExaScr->deferred_mixed_pixmap = pPixmap;
-	    pPixmap->devKind = pExaPixmap->fb_pitch;
 	} else
 	    exaMoveInPixmap_mixed(pPixmap);
     }
-- 
1.6.5.2



More information about the xorg-devel mailing list