xf86-video-modesetting: src/exa.c

Alan Hourihane alanh at kemper.freedesktop.org
Fri Jun 27 01:46:41 PDT 2008


 src/exa.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 038ba94f415e5289d7b68de55c28385f8d215e4a
Author: Alan Hourihane <alanh at tungstengraphics.com>
Date:   Fri Jun 27 09:46:24 2008 +0100

    More error checking

diff --git a/src/exa.c b/src/exa.c
index a804feb..5cf1d96 100644
--- a/src/exa.c
+++ b/src/exa.c
@@ -695,11 +695,6 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
     PixmapPtr rootPixmap = pScreen->GetScreenPixmap(pScreen);
     struct exa_entity *exa = ms->exa;
 
-    if (rootPixmap == pPixmap) {
-	miModifyPixmapHeader(pPixmap, width, height, depth,
-			     bitsPerPixel, devKind, NULL);
-    }
-
     if (!priv)
 	return FALSE;
 
@@ -718,6 +713,9 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
     if (width <= 0 || height <= 0 || depth <= 0)
 	return FALSE;
 
+    miModifyPixmapHeader(pPixmap, width, height, depth,
+			     bitsPerPixel, devKind, NULL);
+
     /* Deal with screen resize */
     if (priv->tex) {
 	struct pipe_surface *surf =
@@ -750,9 +748,6 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
 	priv->tex = exa->scrn->texture_create(exa->scrn, &template);
     }
 
-    if (rootPixmap == pPixmap)
-	return TRUE;
-
     return TRUE;
 }
 
@@ -826,17 +821,22 @@ ExaInit(ScrnInfoPtr pScrn)
 		 "%s/%s_dri.so", dri_driver_path, "i915");
 
 	ms->driver = dlopen(filename, RTLD_NOW | RTLD_DEEPBIND | RTLD_GLOBAL);
+	if (!ms->driver)
+		FatalError("failed to initialize i915 - for softpipe only.\n");
 
 	exa->c = xcalloc(1, sizeof(struct exa_context));
 
 	exa->ws = exa_get_pipe_winsys(ms);
+	if (!exa->ws)
+		FatalError("BAD WINSYS\n");
 
 	exa->scrn = softpipe_create_screen(exa->ws);
+	if (!exa->scrn)
+		FatalError("BAD SCREEN\n");
 
 	exa->ctx = softpipe_create(exa->scrn, exa->ws, NULL);
-
 	if (!exa->ctx)
-	    ErrorF("BAD CTX\n");
+	   	FatalError("BAD CTX\n");
 
 	exa->ctx->priv = exa->c;
     }


More information about the xorg-commit mailing list