xf86-video-intel: 3 commits - src/sna/kgem.c src/sna/sna_glyphs.c src/sna/sna_render_inline.h
Chris Wilson
ickle at kemper.freedesktop.org
Mon Jun 16 02:13:35 PDT 2014
src/sna/kgem.c | 69 +++++++++++++++++++++-----------------------
src/sna/sna_glyphs.c | 29 ++++++++++++++----
src/sna/sna_render_inline.h | 2 -
3 files changed, 56 insertions(+), 44 deletions(-)
New commits:
commit 6b82962e58c0959c94f2df1f0ebd9a478b15cb6b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Jun 16 10:13:09 2014 +0100
sna: Fix logic inversion for final placement in is_gpu_dst()
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h
index 50a19c8..3750117 100644
--- a/src/sna/sna_render_inline.h
+++ b/src/sna/sna_render_inline.h
@@ -129,7 +129,7 @@ is_gpu_dst(struct sna_pixmap *priv)
if (DAMAGE_IS_ALL(priv->cpu_damage))
return false;
- return priv->gpu_damage == NULL && priv->cpu;
+ return priv->gpu_damage != NULL || !priv->cpu;
}
static inline bool
commit 62102f505cd13840e4c910adbe762b3fb46dfaec
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Jun 16 09:46:54 2014 +0100
sna: Promote better active buffer reuse
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index af4064b..924b0a4 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -4727,7 +4727,7 @@ large_inactive:
retry = NUM_CACHE_BUCKETS - bucket;
if (retry > 3 && (flags & CREATE_TEMPORARY) == 0)
retry = 3;
-search_again:
+search_active:
assert(bucket < NUM_CACHE_BUCKETS);
cache = &kgem->active[bucket][tiling];
if (tiling) {
@@ -4805,47 +4805,39 @@ search_again:
}
}
- if (--retry && exact) {
- if (kgem->gen >= 040) {
- for (i = I915_TILING_NONE; i <= I915_TILING_Y; i++) {
- if (i == tiling)
- continue;
-
- cache = &kgem->active[bucket][i];
- list_for_each_entry(bo, cache, list) {
- assert(!bo->purged);
- assert(bo->refcnt == 0);
- assert(bo->reusable);
- assert(!bo->scanout);
- assert(bo->flush == false);
- assert_tiling(kgem, bo);
+ if (kgem->gen >= 040) {
+ for (i = I915_TILING_NONE; i <= I915_TILING_Y; i++) {
+ cache = &kgem->active[bucket][i];
+ list_for_each_entry(bo, cache, list) {
+ assert(!bo->purged);
+ assert(bo->refcnt == 0);
+ assert(bo->reusable);
+ assert(!bo->scanout);
+ assert(bo->flush == false);
+ assert_tiling(kgem, bo);
- if (num_pages(bo) < size)
- continue;
+ if (num_pages(bo) < size)
+ continue;
- if (!gem_set_tiling(kgem->fd,
- bo->handle,
- tiling, pitch))
- continue;
+ if (!gem_set_tiling(kgem->fd,
+ bo->handle,
+ tiling, pitch))
+ continue;
- kgem_bo_remove_from_active(kgem, bo);
+ kgem_bo_remove_from_active(kgem, bo);
- bo->unique_id = kgem_get_unique_id(kgem);
- bo->pitch = pitch;
- bo->tiling = tiling;
- bo->delta = 0;
- DBG((" 1:from active: pitch=%d, tiling=%d, handle=%d, id=%d\n",
- bo->pitch, bo->tiling, bo->handle, bo->unique_id));
- assert(bo->pitch*kgem_aligned_height(kgem, height, bo->tiling) <= kgem_bo_size(bo));
- assert_tiling(kgem, bo);
- bo->refcnt = 1;
- return bo;
- }
+ bo->unique_id = kgem_get_unique_id(kgem);
+ bo->pitch = pitch;
+ bo->tiling = tiling;
+ bo->delta = 0;
+ DBG((" 1:from active: pitch=%d, tiling=%d, handle=%d, id=%d\n",
+ bo->pitch, bo->tiling, bo->handle, bo->unique_id));
+ assert(bo->pitch*kgem_aligned_height(kgem, height, bo->tiling) <= kgem_bo_size(bo));
+ assert_tiling(kgem, bo);
+ bo->refcnt = 1;
+ return bo;
}
}
-
- bucket++;
- goto search_again;
}
if (!exact) { /* allow an active near-miss? */
@@ -4890,6 +4882,11 @@ search_again:
}
}
+ if (--retry) {
+ bucket++;
+ goto search_active;
+ }
+
skip_active_search:
bucket = cache_bucket(size);
retry = NUM_CACHE_BUCKETS - bucket;
commit 2877d018d3510e415f273ce955eb5c272c340e7d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Jun 16 09:24:45 2014 +0100
sna/glyphs: Show number of glyphs in DBG
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index e8d92b8..0835175 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -351,6 +351,20 @@ glyph_extents(int nlist,
extents->y2 = y2 < MAXSHORT ? y2 : MAXSHORT;
}
+#if HAS_DEBUG_FULL
+static void
+glyph_count(int nlist,
+ GlyphListPtr list)
+{
+ int count = 0;
+ while (nlist--) {
+ count += list->len;
+ list++;
+ }
+ return count;
+}
+#endif
+
static inline unsigned int
glyph_size_to_count(int size)
{
@@ -544,8 +558,8 @@ static inline bool clipped_glyphs(PicturePtr dst, int nlist, GlyphListPtr list,
box.y1 += dst->pDrawable->y;
box.y2 += dst->pDrawable->y;
- DBG(("%s? glyph extents (%d, %d), (%d, %d), region (%d, %d), (%d, %d): %s\n",
- __FUNCTION__, box.x1, box.y1, box.x2, box.y2,
+ DBG(("%s? %d glyph in %d lists extents (%d, %d), (%d, %d), region (%d, %d), (%d, %d): %s\n",
+ __FUNCTION__, glyph_count(nlist, list), nlist, box.x1, box.y1, box.x2, box.y2,
dst->pCompositeClip->extents.x1, dst->pCompositeClip->extents.y1,
dst->pCompositeClip->extents.x2, dst->pCompositeClip->extents.y2,
pixman_region_contains_rectangle(dst->pCompositeClip,
@@ -1102,8 +1116,8 @@ glyphs_via_mask(struct sna *sna,
if (box.x2 <= box.x1 || box.y2 <= box.y1)
return true;
- DBG(("%s: bounds=((%d, %d), (%d, %d))\n", __FUNCTION__,
- box.x1, box.y1, box.x2, box.y2));
+ DBG(("%s: nlist=%d, count=%d, bounds=((%d, %d), (%d, %d))\n", __FUNCTION__,
+ nlist, glyph_count(nlist, list), box.x1, box.y1, box.x2, box.y2));
if (!sna_compute_composite_extents(&box,
src, NULL, dst,
@@ -1602,7 +1616,8 @@ glyphs_fallback(CARD8 op,
int x, y, n;
glyph_extents(nlist, list, glyphs, ®ion.extents);
- DBG(("%s: (%d, %d), (%d, %d)\n", __FUNCTION__,
+ DBG(("%s: nlist=%d, count=%d, extents (%d, %d), (%d, %d)\n", __FUNCTION__,
+ nlist, glyph_count(nlist, list),
region.extents.x1, region.extents.y1,
region.extents.x2, region.extents.y2));
@@ -2027,8 +2042,8 @@ glyphs_via_image(struct sna *sna,
if (box.x2 <= box.x1 || box.y2 <= box.y1)
return true;
- DBG(("%s: bounds=((%d, %d), (%d, %d))\n", __FUNCTION__,
- box.x1, box.y1, box.x2, box.y2));
+ DBG(("%s: nlist=%d, count=%d, bounds=((%d, %d), (%d, %d))\n", __FUNCTION__,
+ nlist, glyph_count(nlist, list), box.x1, box.y1, box.x2, box.y2));
if (!sna_compute_composite_extents(&box,
src, NULL, dst,
More information about the xorg-commit
mailing list