[PATCH 5/6] exa: remove a few pExaPixmap checks and turn others in FatalErrors.

Maarten Maathuis madman2003 at gmail.com
Sat Feb 28 16:36:34 PST 2009


---
 exa/exa_migration.c |   28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index 8b91150..e7c73f8 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -52,7 +52,10 @@ exaPixmapIsPinned (PixmapPtr pPix)
 {
     ExaPixmapPriv (pPix);
 
-    return pExaPixmap == NULL || pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED;
+    if (pExaPixmap == NULL)
+	FatalError("exaPixmapIsPinned was called on a non-exa pixmap.\n");
+
+    return pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED;
 }
 
 /**
@@ -78,16 +81,17 @@ exaMemcpyBox (PixmapPtr pPixmap, BoxPtr pbox, CARD8 *src, int src_pitch,
  
 /**
  * Returns TRUE if the pixmap is dirty (has been modified in its current
- * location compared to the other), or lacks a private for tracking
- * dirtiness.
+ * location compared to the other).
  */
 static Bool
 exaPixmapIsDirty (PixmapPtr pPix)
 {
     ExaPixmapPriv (pPix);
 
-    return pExaPixmap == NULL ||
-	REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)) ||
+    if (pExaPixmap == NULL)
+	FatalError("exaPixmapIsDirty was called on a non-exa pixmap.\n");
+
+    return REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)) ||
 	!REGION_EQUAL(pScreen, &pExaPixmap->validSys, &pExaPixmap->validFB);
 }
 
@@ -460,13 +464,6 @@ exaMigrateTowardFb (ExaMigrationPtr migrate)
     PixmapPtr pPixmap = migrate->pPix;
     ExaPixmapPriv (pPixmap);
 
-    if (pExaPixmap == NULL) {
-	DBG_MIGRATE(("UseScreen: ignoring exa-uncontrolled pixmap %p (%s)\n",
-		     (pointer)pPixmap,
-		     exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
-	return;
-    }
-
     if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) {
 	DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n",
 		     (pointer)pPixmap));
@@ -507,13 +504,6 @@ exaMigrateTowardSys (ExaMigrationPtr migrate)
     PixmapPtr pPixmap = migrate->pPix;
     ExaPixmapPriv (pPixmap);
 
-    if (pExaPixmap == NULL) {
-	DBG_MIGRATE(("UseMem: ignoring exa-uncontrolled pixmap %p (%s)\n",
-		     (pointer)pPixmap,
-		     exaPixmapIsOffscreen(pPixmap) ? "s" : "m"));
-	return;
-    }
-
     DBG_MIGRATE(("UseMem: %p score %d\n", (pointer)pPixmap, pExaPixmap->score));
 
     if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
-- 
1.6.1.3



More information about the xorg-devel mailing list