From e0c43fff3208350995c45604624dd4825f40598c Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 27 Jun 2008 09:46:24 +0100 Subject: [PATCH] More error checking --- hw/xfree86/drivers/modesetting/exa.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/exa.c b/hw/xfree86/drivers/modesetting/exa.c index a804febd6..5cf1d9615 100644 --- a/hw/xfree86/drivers/modesetting/exa.c +++ b/hw/xfree86/drivers/modesetting/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; }