xf86-video-intel: 2 commits - src/sna/kgem.c uxa/uxa-accel.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Dec 15 02:52:10 PST 2011


 src/sna/kgem.c  |    6 +++---
 uxa/uxa-accel.c |    7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit e68a8748f3418179eb41e8d81ba1050b883b7e47
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Dec 15 09:44:20 2011 +0000

    uxa: Move the region creation beyond the call into glamor
    
    So that we avoid leaking the region if hooking into glamor.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index 67712d2..00948b7 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -714,12 +714,12 @@ uxa_poly_fill_rect(DrawablePtr pDrawable,
 	uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
 	RegionPtr pClip = fbGetCompositeClip(pGC);
 	PixmapPtr pPixmap;
-	register BoxPtr pbox;
+	RegionPtr pReg;
+	BoxPtr pbox;
 	int fullX1, fullX2, fullY1, fullY2;
 	int xoff, yoff;
 	int xorg, yorg;
 	int n;
-	RegionPtr pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED);
 
 	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
 		int ok;
@@ -729,12 +729,13 @@ uxa_poly_fill_rect(DrawablePtr pDrawable,
 		uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
 
 		if (!ok)
-			goto fallback;
+			uxa_check_poly_fill_rect(pDrawable, pGC, nrect, prect);
 
 		return;
 	}
 
 	/* Compute intersection of rects and clip region */
+	pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED);
 	REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y);
 	REGION_INTERSECT(pScreen, pReg, pClip, pReg);
 
commit e3153a779ed220ad71958ce56be179d458794964
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Dec 15 09:30:28 2011 +0000

    sna: cap the number of times we attempt to resubmit the batch upon EBUSY
    
    Just in case the kernel gets stuck in a loop and we fail to make any
    progress at all.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index fbff051..a661041 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1072,7 +1072,7 @@ void _kgem_submit(struct kgem *kgem)
 		assert(rq->bo->gpu == 0);
 		if (kgem_batch_write(kgem, handle) == 0) {
 			struct drm_i915_gem_execbuffer2 execbuf;
-			int ret;
+			int ret, retry = 3;
 
 			VG_CLEAR(execbuf);
 			execbuf.buffers_ptr = (uintptr_t)kgem->exec;
@@ -1100,13 +1100,13 @@ void _kgem_submit(struct kgem *kgem)
 			ret = drmIoctl(kgem->fd,
 				       DRM_IOCTL_I915_GEM_EXECBUFFER2,
 				       &execbuf);
-			while (ret == -1 && errno == EBUSY) {
+			while (ret == -1 && errno == EBUSY && retry--) {
 				drmCommandNone(kgem->fd, DRM_I915_GEM_THROTTLE);
 				ret = drmIoctl(kgem->fd,
 					       DRM_IOCTL_I915_GEM_EXECBUFFER2,
 					       &execbuf);
 			}
-			if (ret == -1 && errno == EIO) {
+			if (ret == -1 && (errno == EIO || errno == EBUSY)) {
 				DBG(("%s: GPU hang detected\n", __FUNCTION__));
 				kgem->wedged = 1;
 				ret = 0;


More information about the xorg-commit mailing list