xf86-video-intel: 3 commits - src/sna/kgem.c src/sna/sna_render.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Feb 22 12:33:49 PST 2013


 src/sna/kgem.c       |   48 +++++++++++++++++++++++++++++++++++++++++++++++-
 src/sna/sna_render.c |   17 +++++++++++------
 2 files changed, 58 insertions(+), 7 deletions(-)

New commits:
commit 7a264792772512528a4d6138e09b4ee1ace7f322
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Feb 22 20:13:58 2013 +0000

    sna: Retire before looking for a large 2D buffer
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 72555da..c4ad5fa 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3616,6 +3616,7 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
 		}
 
 large_inactive:
+		__kgem_throttle_retire(kgem, flags);
 		list_for_each_entry(bo, &kgem->large_inactive, list) {
 			assert(bo->refcnt == 0);
 			assert(bo->reusable);
commit 630b114f1ceaf9fb1e35f3aac8c3161119ba5af9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Feb 22 20:08:36 2013 +0000

    sna: Allow search_linear_cache() to reuse large buffers
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index c9b2011..72555da 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2962,8 +2962,53 @@ search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
 	DBG(("%s: num_pages=%d, flags=%x, use_active? %d\n",
 	     __FUNCTION__, num_pages, flags, use_active));
 
-	if (num_pages >= MAX_CACHE_SIZE / PAGE_SIZE)
+	if (num_pages >= MAX_CACHE_SIZE / PAGE_SIZE) {
+retry_large:
+		cache = use_active ? &kgem->large : &kgem->large_inactive;
+		list_for_each_entry_safe(bo, first, cache, list) {
+			assert(bo->refcnt == 0);
+			assert(bo->reusable);
+			assert(!bo->scanout);
+
+			if (num_pages > num_pages(bo))
+				goto discard;
+
+			if (bo->tiling != I915_TILING_NONE) {
+				if (use_active)
+					goto discard;
+
+				if (!gem_set_tiling(kgem->fd, bo->handle,
+						    I915_TILING_NONE, 0))
+					goto discard;
+
+				bo->tiling = I915_TILING_NONE;
+				bo->pitch = 0;
+			}
+
+			if (bo->purged && !kgem_bo_clear_purgeable(kgem, bo))
+					continue;
+
+			list_del(&bo->list);
+			if (bo->rq == (void *)kgem)
+				list_del(&bo->request);
+
+			bo->delta = 0;
+			return bo;
+
+discard:
+			kgem_bo_free(kgem, bo);
+		}
+
+		if (use_active) {
+			use_active = false;
+			goto retry_large;
+		}
+
+		if (__kgem_throttle_retire(kgem, flags))
+			goto retry_large;
+
 		return NULL;
+	}
 
 	if (!use_active && list_is_empty(inactive(kgem, num_pages))) {
 		DBG(("%s: inactive and cache bucket empty\n",
commit d87a0b4c3bc7f1a33edee79e3ed09871461422ea
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Feb 22 20:07:56 2013 +0000

    sna: Allow picture fixup in channel format if not changing RGB depth
    
    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 d9affcb..4bc1fad 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -38,6 +38,13 @@
 #define DBG_FORCE_UPLOAD 0
 #define DBG_NO_CPU_BO 0
 
+#define alphaless(format) PICT_FORMAT(PICT_FORMAT_BPP(format),		\
+				      PICT_FORMAT_TYPE(format),		\
+				      0,				\
+				      PICT_FORMAT_R(format),		\
+				      PICT_FORMAT_G(format),		\
+				      PICT_FORMAT_B(format))
+
 CARD32
 sna_format_for_depth(int depth)
 {
@@ -1566,10 +1573,6 @@ do_fixup:
 		channel->pict_format = PIXMAN_a8;
 	else
 		channel->pict_format = PIXMAN_a8r8g8b8;
-	if (channel->pict_format != picture->format) {
-		DBG(("%s: converting to %08x from %08x\n",
-		     __FUNCTION__, channel->pict_format, picture->format));
-	}
 
 	if (picture->pDrawable &&
 	    !sna_drawable_move_to_cpu(picture->pDrawable, MOVE_READ))
@@ -1588,7 +1591,7 @@ do_fixup:
 	/* Composite in the original format to preserve idiosyncracies */
 	if (!kgem_buffer_is_inplace(channel->bo) &&
 	    (picture->pDrawable == NULL ||
-	     picture->format == channel->pict_format))
+	     alphaless(picture->format) == alphaless(channel->pict_format)))
 		dst = pixman_image_create_bits(channel->pict_format,
 					       w, h, ptr, channel->bo->pitch);
 	else
@@ -1729,7 +1732,9 @@ sna_render_picture_convert(struct sna *sna,
 						   PICT_FORMAT_B(picture->format));
 
 		DBG(("%s: converting to %08x from %08x using composite alpha-fixup\n",
-		     __FUNCTION__, (unsigned)picture->format));
+		     __FUNCTION__,
+		     (unsigned)channel->pict_format,
+		     (unsigned)picture->format));
 
 		tmp = screen->CreatePixmap(screen, w, h, pixmap->drawable.bitsPerPixel, 0);
 		if (tmp == NULL)


More information about the xorg-commit mailing list