xf86-video-intel: 21 commits - src/i965_render.c src/intel_display.c src/intel_dri.c src/intel_driver.c src/legacy/i810 src/sna/blt.c src/sna/compiler.h src/sna/gen2_render.c src/sna/gen4_render.c src/sna/gen5_render.c src/sna/gen6_render.c src/sna/gen7_render.c src/sna/kgem.c src/sna/kgem_debug.c src/sna/sna_driver.c src/sna/sna_io.c src/sna/sna_render.c src/sna/sna_render.h src/sna/sna_trapezoids.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Jun 4 04:31:56 PDT 2012


 src/i965_render.c             |   59 ++++----
 src/intel_display.c           |    5 
 src/intel_dri.c               |   16 +-
 src/intel_driver.c            |    5 
 src/legacy/i810/i810_common.h |    2 
 src/legacy/i810/i810_dri.c    |   53 +++----
 src/legacy/i810/i810_driver.c |    2 
 src/legacy/i810/i810_video.c  |    3 
 src/sna/blt.c                 |    2 
 src/sna/compiler.h            |    2 
 src/sna/gen2_render.c         |    2 
 src/sna/gen4_render.c         |    4 
 src/sna/gen5_render.c         |    4 
 src/sna/gen6_render.c         |    4 
 src/sna/gen7_render.c         |    4 
 src/sna/kgem.c                |    2 
 src/sna/kgem_debug.c          |    2 
 src/sna/sna_driver.c          |    2 
 src/sna/sna_io.c              |   10 +
 src/sna/sna_render.c          |    3 
 src/sna/sna_render.h          |    2 
 src/sna/sna_trapezoids.c      |  307 ++++++++++++++++++++++++++++++++++++++----
 22 files changed, 388 insertions(+), 107 deletions(-)

New commits:
commit c9bd4ed7d7d5c9ba6924e911652e03abc9267865
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:29:58 2012 +0100

    legacy/i810: Silence a compiler warning for missing 'const'
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/legacy/i810/i810_common.h b/src/legacy/i810/i810_common.h
index 14b2993..efa2a7d 100644
--- a/src/legacy/i810/i810_common.h
+++ b/src/legacy/i810/i810_common.h
@@ -77,7 +77,7 @@ static inline void memcpy_volatile(volatile void *dst, const void *src,
     int i;
     
     for (i = 0; i < len; i++)
-	((volatile char *)dst)[i] = ((volatile char *)src)[i];
+	((volatile char *)dst)[i] = ((const volatile char *)src)[i];
 }
 
 /* Memory mapped register access macros */
commit 6f8b411b8a833cca6fce8888ce515db6413d57ca
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:21:27 2012 +0100

    uxa: Preferred order for calloc is (count, size)
    
    And assert that the allocation succeeds for good measure. A great big
    dollop of graceful failure is missing...
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/i965_render.c b/src/i965_render.c
index 7bfbcbd..75c99e2 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -2342,8 +2342,10 @@ void gen4_render_state_init(ScrnInfoPtr scrn)
 
 	intel->surface_used = 0;
 
-	if (intel->gen4_render_state == NULL)
-		intel->gen4_render_state = calloc(sizeof(*render), 1);
+	if (intel->gen4_render_state == NULL) {
+		intel->gen4_render_state = calloc(1, sizeof(*render));
+		assert(intel->gen4_render_state != NULL);
+	}
 
 	if (INTEL_INFO(intel)->gen >= 60)
 		return gen6_render_state_init(scrn);
commit 72a29aa74a1488269c2184300e573d060c49e232
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:21:27 2012 +0100

    sna: Check that the buffer was allocated prior to caching it
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 7feaa24..c3c6666 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1139,7 +1139,8 @@ sna_render_picture_extract(struct sna *sna,
 						      &box,
 						      pixmap->devKind,
 						      pixmap->drawable.bitsPerPixel);
-			if (pixmap->usage_hint == 0 &&
+			if (bo != NULL &&
+			    pixmap->usage_hint == 0 &&
 			    box.x2 - box.x1 == pixmap->drawable.width &&
 			    box.y2 - box.y1 == pixmap->drawable.height) {
 				struct sna_pixmap *priv = sna_pixmap(pixmap);
commit 9bff89b1892cee90a80909255876240126b700b2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:21:27 2012 +0100

    legacy/i810: Be paranoid and guard against xf86GetPciInfoForEntity
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index 6ead393..4a73e9b 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -254,7 +254,7 @@ I810PreInit(ScrnInfoPtr scrn, int flags)
    pI810 = I810PTR(scrn);
 
    pI810->pEnt = xf86GetEntityInfo(scrn->entityList[0]);
-   if (pI810->pEnt->location.type != BUS_PCI)
+   if (pI810->pEnt == NULL || pI810->pEnt->location.type != BUS_PCI)
       return FALSE;
 
    if (flags & PROBE_DETECT) {
commit ed6004f7ad09329bd4097331aaff38edc83107b6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:21:27 2012 +0100

    uxa: Be paranoid and guard against xf86GetPciInfoForEntity
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_driver.c b/src/intel_driver.c
index fadc0a6..190517f 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -480,6 +480,8 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
 		return FALSE;
 
 	pEnt = xf86GetEntityInfo(scrn->entityList[0]);
+	if (pEnt == NULL || pEnt->location.type != BUS_PCI)
+		return FALSE;
 
 	if (flags & PROBE_DETECT)
 		return TRUE;
@@ -497,9 +499,6 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
 
 	scrn->displayWidth = 640;	/* default it */
 
-	if (intel->pEnt->location.type != BUS_PCI)
-		return FALSE;
-
 	intel->PciInfo = xf86GetPciInfoForEntity(intel->pEnt->index);
 
 	if (!intel_open_drm_master(scrn))
commit abb8d893742f4ba9567330da9706adda4e636e75
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:21:27 2012 +0100

    sna: Be paranoid and guard against xf86GetPciInfoForEntity
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index a1581f3..59ee57f 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -426,7 +426,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 		return FALSE;
 
 	pEnt = xf86GetEntityInfo(scrn->entityList[0]);
-	if (pEnt->location.type != BUS_PCI)
+	if (pEnt == NULL || pEnt->location.type != BUS_PCI)
 		return FALSE;
 
 	if (flags & PROBE_DETECT)
commit 782cd6eafa9917a5bdb181d66b7f4c05392950ba
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:20:17 2012 +0100

    uxa: check for failure to allocate drmModeCrtc
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_display.c b/src/intel_display.c
index 609cbf7..fcb3239 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -680,6 +680,11 @@ intel_crtc_init(ScrnInfoPtr scrn, struct intel_mode *mode, int num)
 
 	intel_crtc->mode_crtc = drmModeGetCrtc(mode->fd,
 					       mode->mode_res->crtcs[num]);
+	if (intel_crtc->mode_crtc == NULL) {
+		free(intel_crtc);
+		return;
+	}
+
 	intel_crtc->mode = mode;
 	crtc->driver_private = intel_crtc;
 
commit a99bf0125f8f166ff2d65449ecd376c99c3024b8
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:15:51 2012 +0100

    uxa/i965: Drop superfluous 'state' variable
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/i965_render.c b/src/i965_render.c
index c4c1dd3..7bfbcbd 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -2538,20 +2538,21 @@ gen6_composite_create_blend_state(intel_screen_private *intel)
 static drm_intel_bo *
 gen6_composite_create_depth_stencil_state(intel_screen_private *intel)
 {
-	struct gen6_depth_stencil_state *state;
 	drm_intel_bo *depth_stencil_bo;
 	int ret;
 
-	depth_stencil_bo = drm_intel_bo_alloc(intel->bufmgr,
-					"gen6 DEPTH_STENCIL state",
-					sizeof(*state),
-					4096);
+	depth_stencil_bo =
+		drm_intel_bo_alloc(intel->bufmgr,
+				   "gen6 DEPTH_STENCIL state",
+				   sizeof(struct gen6_depth_stencil_state),
+				   4096);
 	assert(depth_stencil_bo);
 
 	ret = drm_intel_bo_map(depth_stencil_bo, TRUE);
 	assert(ret == 0);
 
-	state = memset(depth_stencil_bo->virtual, 0, sizeof(*state));
+	memset(depth_stencil_bo->virtual, 0,
+	       sizeof(struct gen6_depth_stencil_state));
 	drm_intel_bo_unmap(depth_stencil_bo);
 
 	return depth_stencil_bo;
commit 15a00ba047fdb7d388a322f2e33894d20787af2f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:09:52 2012 +0100

    sna/gen2: Remove double 'const'
    
    So constant, we const'ed it twice.
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index e1b31d7..7b3e1ec 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -977,7 +977,7 @@ static void gen2_vertex_flush(struct sna *sna,
 }
 
 inline static int gen2_get_rectangles(struct sna *sna,
-				      const const struct sna_composite_op *op,
+				      const struct sna_composite_op *op,
 				      int want)
 {
 	struct gen2_render_state *state = &sna->render_state.gen2;
commit 99129c369c16d9ff7588a0e59f9285cc339b7eb3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:08:11 2012 +0100

    sna/gen4+: Use an explicit invalid value for alu
    
    Since the static analyser also doesn't like comparing a uint8_t against
    ~0.
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index f982b41..80f6a95 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -2916,7 +2916,7 @@ gen4_render_fill_boxes(struct sna *sna,
 	    (prefer_blt(sna) ||
 	     too_large(dst->drawable.width, dst->drawable.height) ||
 	     !gen4_check_dst_format(format))) {
-		uint8_t alu = ~0;
+		uint8_t alu = GXinvalid;
 
 		pixel = 0;
 		if (op == PictOpClear)
@@ -2929,7 +2929,7 @@ gen4_render_fill_boxes(struct sna *sna,
 						 format))
 			alu = GXcopy;
 
-		if (alu != ~0 &&
+		if (alu != GXinvalid &&
 		    sna_blt_fill_boxes(sna, alu,
 				       dst_bo, dst->drawable.bitsPerPixel,
 				       pixel, box, n))
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 56db4a0..6746a58 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -3250,7 +3250,7 @@ gen5_render_fill_boxes(struct sna *sna,
 	    (prefer_blt_fill(sna) ||
 	     too_large(dst->drawable.width, dst->drawable.height) ||
 	     !gen5_check_dst_format(format))) {
-		uint8_t alu = ~0;
+		uint8_t alu = GXinvalid;
 
 		pixel = 0;
 		if (op == PictOpClear)
@@ -3263,7 +3263,7 @@ gen5_render_fill_boxes(struct sna *sna,
 						 format))
 			alu = GXcopy;
 
-		if (alu != ~0 &&
+		if (alu != GXinvalid &&
 		    sna_blt_fill_boxes(sna, alu,
 				       dst_bo, dst->drawable.bitsPerPixel,
 				       pixel, box, n))
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index cc6cc50..87a2c9c 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -3661,7 +3661,7 @@ gen6_render_fill_boxes(struct sna *sna,
 	    (prefer_blt_fill(sna, dst_bo) ||
 	     too_large(dst->drawable.width, dst->drawable.height) ||
 	     !gen6_check_dst_format(format))) {
-		uint8_t alu = ~0;
+		uint8_t alu = GXinvalid;
 
 		pixel = 0;
 		if (op == PictOpClear)
@@ -3674,7 +3674,7 @@ gen6_render_fill_boxes(struct sna *sna,
 						 format))
 			alu = GXcopy;
 
-		if (alu != ~0 &&
+		if (alu != GXinvalid &&
 		    sna_blt_fill_boxes(sna, alu,
 				       dst_bo, dst->drawable.bitsPerPixel,
 				       pixel, box, n))
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 50eb07e..e30d941 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -3743,7 +3743,7 @@ gen7_render_fill_boxes(struct sna *sna,
 	    (prefer_blt_fill(sna, dst_bo) ||
 	     too_large(dst->drawable.width, dst->drawable.height) ||
 	     !gen7_check_dst_format(format))) {
-		uint8_t alu = ~0;
+		uint8_t alu = GXinvalid;
 
 		pixel = 0;
 		if (op == PictOpClear)
@@ -3756,7 +3756,7 @@ gen7_render_fill_boxes(struct sna *sna,
 						 format))
 			alu = GXcopy;
 
-		if (alu != ~0 &&
+		if (alu != GXinvalid &&
 		    sna_blt_fill_boxes(sna, alu,
 				       dst_bo, dst->drawable.bitsPerPixel,
 				       pixel, box, n))
diff --git a/src/sna/sna_render.h b/src/sna/sna_render.h
index b9360c3..9db1891 100644
--- a/src/sna/sna_render.h
+++ b/src/sna/sna_render.h
@@ -7,6 +7,8 @@
 
 #define GRADIENT_CACHE_SIZE 16
 
+#define GXinvalid 0xff
+
 struct sna;
 struct sna_glyph;
 struct sna_video;
commit fae9c054d47203b68a6c09647945d23074ea4df9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:04:30 2012 +0100

    legacy/i810: Remove unused variable
    
    In order to reduce the volumes of output from static analysers.
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/legacy/i810/i810_dri.c b/src/legacy/i810/i810_dri.c
index a98ed43..24632d4 100644
--- a/src/legacy/i810/i810_dri.c
+++ b/src/legacy/i810/i810_dri.c
@@ -659,9 +659,7 @@ I810DRIScreenInit(ScreenPtr pScreen)
    pI810->cursorARGBHandle = agpHandle;
 
    if (agpHandle != DRM_AGP_NO_HANDLE) {
- 	int r;
-
-      if ((r = drmAgpBind(pI810->drmSubFD, agpHandle, tom)) == 0) {
+      if (drmAgpBind(pI810->drmSubFD, agpHandle, tom) == 0) {
 	 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		    "[agp] GART: Allocated 16K for ARGB mouse cursor image\n");
 	 pI810->CursorARGBStart = tom;
commit 880ec2c9a56d3de33c7fbbfa4c043082fbcf7a78
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 12:04:30 2012 +0100

    legacy/i810: Reorder DRI teardown code to avoid potential NULL derefs
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/legacy/i810/i810_dri.c b/src/legacy/i810/i810_dri.c
index 28a3b91..a98ed43 100644
--- a/src/legacy/i810/i810_dri.c
+++ b/src/legacy/i810/i810_dri.c
@@ -898,30 +898,42 @@ I810DRICloseScreen(ScreenPtr pScreen)
 {
    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
    I810Ptr pI810 = I810PTR(pScrn);
-   I810DRIPtr pI810DRI = (I810DRIPtr) pI810->pDRIInfo->devPrivate;
 
-   if (pI810DRI->irq) {
-       drmCtlUninstHandler(pI810->drmSubFD);
-       pI810DRI->irq = 0;
-   }
+   if (pI810->pDRIInfo) {
+       I810DRIPtr pI810DRI = (I810DRIPtr) pI810->pDRIInfo->devPrivate;
+
+       if (pI810DRI) {
+	   if (pI810DRI->irq) {
+	       drmCtlUninstHandler(pI810->drmSubFD);
+	       pI810DRI->irq = 0;
+	   }
 
-   I810CleanupDma(pScrn);
+	   free(pI810->pDRIInfo->devPrivate);
+	   pI810->pDRIInfo->devPrivate = NULL;
+       }
+
+       I810CleanupDma(pScrn);
+
+       DRICloseScreen(pScreen);
+       DRIDestroyInfoRec(pI810->pDRIInfo);
+       pI810->pDRIInfo = NULL;
+   }
 
    if (pI810->dcacheHandle!=DRM_AGP_NO_HANDLE)
-      drmAgpFree(pI810->drmSubFD, pI810->dcacheHandle);
+       drmAgpFree(pI810->drmSubFD, pI810->dcacheHandle);
    if (pI810->backHandle!=DRM_AGP_NO_HANDLE)
-      drmAgpFree(pI810->drmSubFD, pI810->backHandle);
+       drmAgpFree(pI810->drmSubFD, pI810->backHandle);
    if (pI810->zHandle!=DRM_AGP_NO_HANDLE)
-      drmAgpFree(pI810->drmSubFD, pI810->zHandle);
+       drmAgpFree(pI810->drmSubFD, pI810->zHandle);
    if (pI810->cursorHandle!=DRM_AGP_NO_HANDLE)
-      drmAgpFree(pI810->drmSubFD, pI810->cursorHandle);
+       drmAgpFree(pI810->drmSubFD, pI810->cursorHandle);
    if (pI810->xvmcHandle!=DRM_AGP_NO_HANDLE)
-      drmAgpFree(pI810->drmSubFD, pI810->xvmcHandle);
+       drmAgpFree(pI810->drmSubFD, pI810->xvmcHandle);
    if (pI810->sysmemHandle!=DRM_AGP_NO_HANDLE)
-      drmAgpFree(pI810->drmSubFD, pI810->sysmemHandle);
+       drmAgpFree(pI810->drmSubFD, pI810->sysmemHandle);
 
    if (pI810->agpAcquired == TRUE)
-      drmAgpRelease(pI810->drmSubFD);
+       drmAgpRelease(pI810->drmSubFD);
 
    pI810->backHandle = DRM_AGP_NO_HANDLE;
    pI810->zHandle = DRM_AGP_NO_HANDLE;
@@ -930,17 +942,6 @@ I810DRICloseScreen(ScreenPtr pScreen)
    pI810->sysmemHandle = DRM_AGP_NO_HANDLE;
    pI810->agpAcquired = FALSE;
    pI810->dcacheHandle = DRM_AGP_NO_HANDLE;
-
-   DRICloseScreen(pScreen);
-
-   if (pI810->pDRIInfo) {
-      if (pI810->pDRIInfo->devPrivate) {
-	 free(pI810->pDRIInfo->devPrivate);
-	 pI810->pDRIInfo->devPrivate = NULL;
-      }
-      DRIDestroyInfoRec(pI810->pDRIInfo);
-      pI810->pDRIInfo = NULL;
-   }
 }
 
 static Bool
commit 7424ea7dd08e304baa4efa09e887b833737ac9f6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 11:59:24 2012 +0100

    uxa/dri: Free wait_info along DRI2WaitMSC error paths
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index a177815..4890fe4 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -1522,7 +1522,7 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
 				   strerror(errno));
 			limit--;
 		}
-		goto out_complete;
+		goto out_free;
 	}
 
 	current_msc = vbl.reply.sequence;
@@ -1556,7 +1556,7 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
 					   strerror(errno));
 				limit--;
 			}
-			goto out_complete;
+			goto out_free;
 		}
 
 		wait_info->frame = vbl.reply.sequence;
@@ -1595,7 +1595,7 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
 				   strerror(errno));
 			limit--;
 		}
-		goto out_complete;
+		goto out_free;
 	}
 
 	wait_info->frame = vbl.reply.sequence;
@@ -1603,6 +1603,8 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
 
 	return TRUE;
 
+out_free:
+	i830_dri2_del_frame_event(draw, wait_info);
 out_complete:
 	DRI2WaitMSCComplete(client, draw, target_msc, 0, 0);
 	return TRUE;
commit ebd6dea009479e612c67d78416b8680bb23dba94
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 11:56:11 2012 +0100

    uxa/dri: Make sure is_glamor_pixmap is always initialised
    
    The code paths are too twisty to be sure otherwise.
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index 389ecdd..a177815 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -263,7 +263,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
 	DRI2BufferPtr buffers;
 	I830DRI2BufferPrivatePtr privates;
 	PixmapPtr pixmap, pDepthPixmap;
-	int is_glamor_pixmap = FALSE;
+	bool is_glamor_pixmap = false;
 	int i;
 
 	buffers = calloc(count, sizeof *buffers);
@@ -282,7 +282,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments,
 			pixmap = get_front_buffer(drawable);
 
 			if (pixmap && intel_get_pixmap_private(pixmap) == NULL) {
-				is_glamor_pixmap = TRUE;
+				is_glamor_pixmap = true;
 				drawable = &pixmap->drawable;
 				pixmap = NULL;
 			}
@@ -390,7 +390,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
 	DRI2Buffer2Ptr buffer;
 	I830DRI2BufferPrivatePtr privates;
 	PixmapPtr pixmap;
-	int is_glamor_pixmap;
+	bool is_glamor_pixmap = false;
 
 	buffer = calloc(1, sizeof *buffer);
 	if (buffer == NULL)
@@ -406,7 +406,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
 		pixmap = get_front_buffer(drawable);
 
 		if (pixmap && intel_get_pixmap_private(pixmap) == NULL) {
-			is_glamor_pixmap = TRUE;
+			is_glamor_pixmap = true;
 			drawable = &pixmap->drawable;
 			pixmap = NULL;
 		}
commit 33f0b4b96662d953052232b1c0477ced0c326a62
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 11:54:28 2012 +0100

    legacy/i810: Free offscreen image info struct on failure
    
    Impossible with the current code, the server aborts on failure. However,
    this looks to be the simple answer to keep static analysers quiet.
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c
index 729aa8b..613cbf2 100644
--- a/src/legacy/i810/i810_video.c
+++ b/src/legacy/i810/i810_video.c
@@ -1411,6 +1411,7 @@ I810InitOffscreenImages(ScreenPtr screen)
     offscreenImages[0].num_attributes = 1;
     offscreenImages[0].attributes = Attributes;
 
-    xf86XVRegisterOffscreenImages(screen, offscreenImages, 1);
+    if (!xf86XVRegisterOffscreenImages(screen, offscreenImages, 1))
+	    free(offscreenImages);
 }
 
commit d24340747389db971c04349d1ee517f195c2b28e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 11:53:26 2012 +0100

    sna: Free clip boxes (if allocated) along error path
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index 0d6fbbb..3c6044c 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -646,8 +646,11 @@ tile:
 								       tmp.drawable.bitsPerPixel,
 								       KGEM_BUFFER_WRITE_INPLACE,
 								       &ptr);
-					if (!src_bo)
+					if (!src_bo) {
+						if (clipped != stack)
+							free(clipped);
 						goto fallback;
+					}
 
 					c = clipped;
 					for (n = 0; n < nbox; n++) {
@@ -683,8 +686,11 @@ tile:
 
 					kgem_bo_destroy(&sna->kgem, src_bo);
 
-					if (!n)
+					if (!n) {
+						if (clipped != stack)
+							free(clipped);
 						goto fallback;
+					}
 				}
 			}
 
commit 1215abc5c30cc3e183bde59b1523c09b59c484e3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 11:49:15 2012 +0100

    sna: Make the ignored return value explicit
    
    The return from __kgem_throttle_retire() is just a hint as to whether
    any forward progress was made. In the case of the error path, though it
    is a last ditch effort before aborting, so we do not really care whether
    or not it succeeds, we must try again.
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 537a6b0..3d1e5be 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -191,7 +191,7 @@ retry_gtt:
 	if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) {
 		ErrorF("%s: failed to achieve GTT offset for handle=%d: %d\n",
 		       __FUNCTION__, bo->handle, errno);
-		__kgem_throttle_retire(kgem, 0);
+		(void)__kgem_throttle_retire(kgem, 0);
 		if (kgem_expire_cache(kgem))
 			goto retry_gtt;
 
commit e230b460515a043a1b7353d153e864754ca5e064
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 11:48:23 2012 +0100

    ux/i965: create_sampler_state_bo() expects enums, so feed it the right types
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/i965_render.c b/src/i965_render.c
index 508a846..c4c1dd3 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -2325,9 +2325,13 @@ void gen4_render_state_init(ScrnInfoPtr scrn)
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 	struct gen4_render_state *render;
 	const struct wm_kernel_info *wm_kernels;
-	int i, j, k, l, m;
+	sampler_state_filter_t src_filter;
+	sampler_state_extend_t src_extend;
+	sampler_state_filter_t mask_filter;
+	sampler_state_extend_t mask_extend;
 	drm_intel_bo *sf_kernel_bo, *sf_kernel_mask_bo;
 	drm_intel_bo *border_color_bo;
+	int m;
 
 	intel->needs_3d_invariant = TRUE;
 
@@ -2389,20 +2393,20 @@ void gen4_render_state_init(ScrnInfoPtr scrn)
 	 * kernel.
 	 */
 	border_color_bo = sampler_border_color_create(intel);
-	for (i = 0; i < FILTER_COUNT; i++) {
-		for (j = 0; j < EXTEND_COUNT; j++) {
-			for (k = 0; k < FILTER_COUNT; k++) {
-				for (l = 0; l < EXTEND_COUNT; l++) {
+	for (src_filter = 0; src_filter < FILTER_COUNT; src_filter++) {
+		for (src_extend = 0; src_extend < EXTEND_COUNT; src_extend++) {
+			for (mask_filter = 0; mask_filter < FILTER_COUNT; mask_filter++) {
+				for (mask_extend = 0; mask_extend < EXTEND_COUNT; mask_extend++) {
 					drm_intel_bo *sampler_state_bo;
 
 					sampler_state_bo =
 					    i965_create_sampler_state(intel,
-								      i, j,
-								      k, l,
+								      src_filter, src_extend,
+								      mask_filter, mask_extend,
 								      border_color_bo);
 
 					for (m = 0; m < KERNEL_COUNT; m++) {
-						render->wm_state_bo[m][i][j][k][l] =
+						render->wm_state_bo[m][src_filter][src_extend][mask_filter][mask_extend] =
 							gen4_create_wm_state
 							(intel,
 							 wm_kernels[m]. has_mask,
@@ -2875,7 +2879,11 @@ gen6_render_state_init(ScrnInfoPtr scrn)
 {
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 	struct gen4_render_state *render;
-	int i, j, k, l, m;
+	sampler_state_filter_t src_filter;
+	sampler_state_filter_t mask_filter;
+	sampler_state_extend_t src_extend;
+	sampler_state_extend_t mask_extend;
+	int m;
 	drm_intel_bo *border_color_bo;
 	const struct wm_kernel_info *wm_kernels;
 
@@ -2899,14 +2907,14 @@ gen6_render_state_init(ScrnInfoPtr scrn)
 
 	border_color_bo = sampler_border_color_create(intel);
 
-	for (i = 0; i < FILTER_COUNT; i++) {
-		for (j = 0; j < EXTEND_COUNT; j++) {
-			for (k = 0; k < FILTER_COUNT; k++) {
-				for (l = 0; l < EXTEND_COUNT; l++) {
-					render->ps_sampler_state_bo[i][j][k][l] =
+	for (src_filter = 0; src_filter < FILTER_COUNT; src_filter++) {
+		for (src_extend = 0; src_extend < EXTEND_COUNT; src_extend++) {
+			for (mask_filter = 0; mask_filter < FILTER_COUNT; mask_filter++) {
+				for (mask_extend = 0; mask_extend < EXTEND_COUNT; mask_extend++) {
+					render->ps_sampler_state_bo[src_filter][src_extend][mask_filter][mask_extend] =
 						i965_create_sampler_state(intel,
-								i, j,
-								k, l,
+									  src_filter, src_extend,
+									  mask_filter, mask_extend,
 								border_color_bo);
 				}
 			}
commit 072d7a8b42f04600c9d8054f3648642a1aaff57a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 11:40:01 2012 +0100

    sna/debug: Assert the non-existence of the relocation handle at source
    
    This should help the static analyzer pinpoint the blame and make it
    quieter.
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem_debug.c b/src/sna/kgem_debug.c
index e833a6f..e46ffca 100644
--- a/src/sna/kgem_debug.c
+++ b/src/sna/kgem_debug.c
@@ -48,6 +48,7 @@ kgem_debug_get_reloc_entry(struct kgem *kgem, uint32_t offset)
 		if (kgem->reloc[i].offset == offset)
 			return kgem->reloc+i;
 
+	assert(!"valid relocation entry, unknown batch offset");
 	return NULL;
 }
 
@@ -265,7 +266,6 @@ decode_2d(struct kgem *kgem, uint32_t offset)
 		kgem_debug_print(data, offset, 3, "(%d,%d)\n",
 			  data[3] & 0xffff, data[3] >> 16);
 		reloc = kgem_debug_get_reloc_entry(kgem, offset+4);
-		assert(reloc);
 		kgem_debug_print(data, offset, 4, "dst offset 0x%08x [handle=%d, delta=%d, read=%x, write=%x (fenced? %d, tiling? %d)]\n",
 				 data[4],
 				 reloc->target_handle, reloc->delta,
commit 4a3c355e056339aed68b70470556633dea899b1b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 4 11:32:42 2012 +0100

    sna: Silence a compiler warning for loss of 'const' qualifier
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/blt.c b/src/sna/blt.c
index 65d586c..e9d06eb 100644
--- a/src/sna/blt.c
+++ b/src/sna/blt.c
@@ -150,7 +150,7 @@ memcpy_blt(const void *src, void *dst, int bpp,
 	   int16_t dst_x, int16_t dst_y,
 	   uint16_t width, uint16_t height)
 {
-	uint8_t *src_bytes;
+	const uint8_t *src_bytes;
 	uint8_t *dst_bytes;
 	int byte_width;
 
commit 791029cc16bca36b8dec82297ff7e07a972c51ab
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 2 13:28:43 2012 +0100

    sna/trapezoids: Implement trapezoidal opaque fills inplace
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/compiler.h b/src/sna/compiler.h
index 364ea62..653435f 100644
--- a/src/sna/compiler.h
+++ b/src/sna/compiler.h
@@ -32,6 +32,7 @@
 #define likely(expr) (__builtin_expect (!!(expr), 1))
 #define unlikely(expr) (__builtin_expect (!!(expr), 0))
 #define noinline __attribute__((noinline))
+#define force_inline __attribute__((always_inline))
 #define fastcall __attribute__((regparm(3)))
 #define must_check __attribute__((warn_unused_result))
 #define constant __attribute__((const))
@@ -39,6 +40,7 @@
 #define likely(expr) (expr)
 #define unlikely(expr) (expr)
 #define noinline
+#define force_inline
 #define fastcall
 #define must_check
 #define constant
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index d65c249..e2212b9 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -3666,7 +3666,10 @@ trapezoid_mask_converter(CARD8 op, PicturePtr src, PicturePtr dst,
 struct inplace {
 	uint32_t stride;
 	uint8_t *ptr;
-	uint8_t opacity;
+	union {
+		uint8_t opacity;
+		uint32_t color;
+	};
 };
 
 static inline uint8_t
@@ -3838,6 +3841,110 @@ tor_blt_add_clipped(struct sna *sna,
 	pixman_region_fini(&region);
 }
 
+#define ONE_HALF 0x7f
+#define RB_MASK 0x00ff00ff
+#define RB_ONE_HALF 0x007f007f
+#define RB_MASK_PLUS_ONE 0x01000100
+#define G_SHIFT 8
+
+static force_inline uint32_t
+mul8x2_8 (uint32_t a, uint8_t b)
+{
+	uint32_t t = (a & RB_MASK) * b + RB_ONE_HALF;
+	return ((t + ((t >> G_SHIFT) & RB_MASK)) >> G_SHIFT) & RB_MASK;
+}
+
+static force_inline uint32_t
+add8x2_8x2(uint32_t a, uint32_t b)
+{
+	uint32_t t = a + b;
+	t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK);
+	return t & RB_MASK;
+}
+
+static force_inline uint32_t
+lerp8x4(uint32_t src, uint8_t a, uint32_t dst)
+{
+	return (add8x2_8x2(mul8x2_8(src, a),
+			   mul8x2_8(dst, ~a)) |
+		add8x2_8x2(mul8x2_8(src >> G_SHIFT, a),
+			   mul8x2_8(dst >> G_SHIFT, ~a)) << G_SHIFT);
+}
+
+static void
+tor_blt_lerp32(struct sna *sna,
+	       struct sna_composite_spans_op *op,
+	       pixman_region16_t *clip,
+	       const BoxRec *box,
+	       int coverage)
+{
+	struct inplace *in = (struct inplace *)op;
+	uint32_t *ptr = (uint32_t *)in->ptr;
+	int stride = in->stride / sizeof(uint32_t);
+	int h, w, i;
+
+	if (coverage == 0)
+		return;
+
+	ptr += box->y1 * stride + box->x1;
+
+	h = box->y2 - box->y1;
+	w = box->x2 - box->x1;
+	if (coverage == FAST_SAMPLES_XY) {
+		if ((w | h) == 1) {
+			*ptr = in->color;
+		} else {
+			if (w < 16) {
+				do {
+					for (i = 0; i < w; i++)
+						ptr[i] = in->color;
+					ptr += stride;
+				} while (--h);
+			} else {
+				pixman_fill(ptr, stride, 32,
+					    0, 0, w, h, in->color);
+			}
+		}
+	} else {
+		coverage = coverage * 256 / FAST_SAMPLES_XY;
+		coverage -= coverage >> 8;
+
+		if ((w | h) == 1) {
+			*ptr = lerp8x4(in->color, coverage, *ptr);
+		} else if (w == 1) {
+			do {
+				*ptr = lerp8x4(in->color, coverage, *ptr);
+				ptr += stride;
+			} while (--h);
+		} else{
+			do {
+				for (i = 0; i < w; i++)
+					ptr[i] = lerp8x4(in->color, coverage, ptr[i]);
+				ptr += stride;
+			} while (--h);
+		}
+	}
+}
+
+static void
+tor_blt_lerp32_clipped(struct sna *sna,
+		       struct sna_composite_spans_op *op,
+		       pixman_region16_t *clip,
+		       const BoxRec *box,
+		       int coverage)
+{
+	pixman_region16_t region;
+	int n;
+
+	pixman_region_init_rects(&region, box, 1);
+	RegionIntersect(&region, &region, clip);
+	n = REGION_NUM_RECTS(&region);
+	box = REGION_RECTS(&region);
+	while (n--)
+		tor_blt_lerp32(sna, op, NULL, box++, coverage);
+	pixman_region_fini(&region);
+}
+
 struct mono_inplace_composite {
 	pixman_image_t *src, *dst;
 	int dx, dy;
@@ -4130,6 +4237,134 @@ unbounded_pass:
 }
 
 static bool
+trapezoid_span_inplace__x8r8g8b8(CARD8 op,
+				 uint32_t color,
+				 PicturePtr src,
+				 PicturePtr dst,
+				 PictFormatPtr maskFormat,
+				 int ntrap, xTrapezoid *traps)
+{
+	struct tor tor;
+	span_func_t span;
+	RegionRec region;
+	int16_t dst_x, dst_y;
+	int dx, dy;
+	int n;
+
+	if (op == PictOpOver && (color >> 24) == 0xff)
+		op = PictOpSrc;
+	if (op == PictOpOver) {
+		struct sna_pixmap *priv = sna_pixmap_from_drawable(dst->pDrawable);
+		if (priv && priv->clear && priv->clear_color == 0)
+			op = PictOpSrc;
+	}
+
+	switch (op) {
+	case PictOpSrc:
+		break;
+	default:
+		DBG(("%s: fallback -- can not perform op [%d] in place\n",
+		     __FUNCTION__, op));
+		return false;
+	}
+
+	DBG(("%s: format=%x, op=%d, color=%x\n",
+	     __FUNCTION__, dst->format, op, color));
+
+	if (maskFormat == NULL && ntrap > 1) {
+		DBG(("%s: individual rasterisation requested\n",
+		     __FUNCTION__));
+		do {
+			/* XXX unwind errors? */
+			if (!trapezoid_span_inplace__x8r8g8b8(op, color,
+							      src, dst, NULL,
+							      1, traps++))
+				return false;
+		} while (--ntrap);
+		return true;
+	}
+
+	trapezoids_bounds(ntrap, traps, &region.extents);
+	if (region.extents.y1 >= region.extents.y2 ||
+	    region.extents.x1 >= region.extents.x2)
+		return true;
+
+	DBG(("%s: extents (%d, %d), (%d, %d)\n",
+	     __FUNCTION__,
+	     region.extents.x1, region.extents.y1,
+	     region.extents.x2, region.extents.y2));
+
+	if (!sna_compute_composite_extents(&region.extents,
+					   src, NULL, dst,
+					   0, 0,
+					   0, 0,
+					   region.extents.x1, region.extents.y1,
+					   region.extents.x2 - region.extents.x1,
+					   region.extents.y2 - region.extents.y1))
+		return true;
+
+	DBG(("%s: clipped extents (%d, %d), (%d, %d)\n",
+	     __FUNCTION__,
+	     region.extents.x1, region.extents.y1,
+	     region.extents.x2, region.extents.y2));
+
+	if (tor_init(&tor, &region.extents, 2*ntrap))
+		return true;
+
+	dx = dst->pDrawable->x * FAST_SAMPLES_X;
+	dy = dst->pDrawable->y * FAST_SAMPLES_Y;
+
+	for (n = 0; n < ntrap; n++) {
+		xTrapezoid t;
+
+		if (!project_trapezoid_onto_grid(&traps[n], dx, dy, &t))
+			continue;
+
+		if (pixman_fixed_to_int(traps[n].top) >= region.extents.y2 - dst->pDrawable->y ||
+		    pixman_fixed_to_int(traps[n].bottom) < region.extents.y1 - dst->pDrawable->y)
+			continue;
+
+		tor_add_edge(&tor, &t, &t.left, 1);
+		tor_add_edge(&tor, &t, &t.right, -1);
+	}
+
+	switch (op) {
+	case PictOpSrc:
+		if (dst->pCompositeClip->data)
+			span = tor_blt_lerp32_clipped;
+		else
+			span = tor_blt_lerp32;
+		break;
+	}
+
+	DBG(("%s: move-to-cpu\n", __FUNCTION__));
+	region.data = NULL;
+	if (sna_drawable_move_region_to_cpu(dst->pDrawable, &region,
+					    MOVE_WRITE | MOVE_READ)) {
+		PixmapPtr pixmap;
+		struct inplace inplace;
+
+		pixmap = get_drawable_pixmap(dst->pDrawable);
+
+		get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y);
+
+		inplace.ptr = pixmap->devPrivate.ptr;
+		inplace.ptr += dst_y * pixmap->devKind + dst_x;
+		inplace.stride = pixmap->devKind;
+		inplace.color = color;
+
+		DBG(("%s: render inplace op=%d, color=%08x\n",
+		     __FUNCTION__, op, color));
+		tor_render(NULL, &tor, (void*)&inplace,
+			   dst->pCompositeClip, span, false);
+
+		tor_fini(&tor);
+	}
+
+	return true;
+}
+
+static bool
 trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst,
 		       PictFormatPtr maskFormat, INT16 src_x, INT16 src_y,
 		       int ntrap, xTrapezoid *traps,
@@ -4178,6 +4413,11 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst,
 		return false;
 	}
 
+	if (dst->format == PICT_a8r8g8b8 || dst->format == PICT_x8r8g8b8)
+		return trapezoid_span_inplace__x8r8g8b8(op, color,
+							src, dst, maskFormat,
+							ntrap, traps);
+
 	if (dst->format != PICT_a8) {
 		DBG(("%s: fallback -- can not perform operation in place, format=%x\n",
 		     __FUNCTION__, dst->format));
@@ -4185,36 +4425,49 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst,
 	}
 
 	pixmap = get_drawable_pixmap(dst->pDrawable);
-	priv = sna_pixmap(pixmap);
-	if (priv == NULL) {
-		DBG(("%s: fallback -- unattached\n", __FUNCTION__));
-		return false;
-	}
 
 	unbounded = false;
-	switch (op) {
-	case PictOpAdd:
-		if (priv->clear && priv->clear_color == 0) {
+	priv = sna_pixmap(pixmap);
+	if (priv) {
+		switch (op) {
+		case PictOpAdd:
+			if (priv->clear && priv->clear_color == 0) {
+				unbounded = true;
+				op = PictOpSrc;
+			}
+			if ((color >> 24) == 0)
+				return true;
+			break;
+		case PictOpIn:
+			if (priv->clear && priv->clear_color == 0)
+				return true;
+			if (priv->clear && priv->clear_color == 0xff)
+				op = PictOpSrc;
 			unbounded = true;
-			op = PictOpSrc;
+			break;
+		case PictOpSrc:
+			unbounded = true;
+			break;
+		default:
+			DBG(("%s: fallback -- can not perform op [%d] in place\n",
+			     __FUNCTION__, op));
+			return false;
+		}
+	} else {
+		switch (op) {
+		case PictOpAdd:
+			if ((color >> 24) == 0)
+				return true;
+			break;
+		case PictOpIn:
+		case PictOpSrc:
+			unbounded = true;
+			break;
+		default:
+			DBG(("%s: fallback -- can not perform op [%d] in place\n",
+			     __FUNCTION__, op));
+			return false;
 		}
-		if ((color >> 24) == 0)
-			return true;
-		break;
-	case PictOpIn:
-		if (priv->clear && priv->clear_color == 0)
-			return true;
-		if (priv->clear && priv->clear_color == 0xff)
-			op = PictOpSrc;
-		unbounded = true;
-		break;
-	case PictOpSrc:
-		unbounded = true;
-		break;
-	default:
-		DBG(("%s: fallback -- can not perform op [%d] in place\n",
-		     __FUNCTION__, op));
-		return false;
 	}
 
 	DBG(("%s: format=%x, op=%d, color=%x\n",


More information about the xorg-commit mailing list