summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-06-15 15:29:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-06-15 15:41:08 +0100
commitd1713941e9db3e7a6d83466be1b253978fb4bf01 (patch)
treee127a6a933520040185fabc992c205d3e1657594 /src
parent2b23605efba009fb340ec10b37d54caae159b9b1 (diff)
sna: Tweaks for DBG missing glyphs through fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/gen4_render.c3
-rw-r--r--src/sna/sna_accel.c25
-rw-r--r--src/sna/sna_composite.c3
-rw-r--r--src/sna/sna_glyphs.c18
-rw-r--r--src/sna/sna_io.c10
5 files changed, 45 insertions, 14 deletions
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index ad6f6c59..6379a186 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -1476,6 +1476,9 @@ gen4_emit_state(struct sna *sna,
gen4_emit_drawing_rectangle(sna, op);
if (kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo)) {
+ DBG(("%s: flushing dirty (%d, %d)\n", __FUNCTION__,
+ kgem_bo_is_dirty(op->src.bo),
+ kgem_bo_is_dirty(op->mask.bo)));
OUT_BATCH(MI_FLUSH);
kgem_clear_dirty(&sna->kgem);
kgem_bo_mark_dirty(op->dst.bo);
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index bc85643f..b0021f9f 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1563,6 +1563,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
region->extents.x2 - region->extents.x1 == 1 &&
region->extents.y2 - region->extents.y1 == 1) {
/* Often associated with synchronisation, KISS */
+ DBG(("%s: single pixel read\n", __FUNCTION__));
sna_read_boxes(sna,
priv->gpu_bo, 0, 0,
pixmap, 0, 0,
@@ -1571,8 +1572,11 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
}
} else {
if (sna_damage_contains_box__no_reduce(priv->cpu_damage,
- &region->extents))
+ &region->extents)) {
+ DBG(("%s: region already in CPU damage\n",
+ __FUNCTION__));
goto done;
+ }
}
if (sna_damage_contains_box(priv->gpu_damage,
@@ -1631,6 +1635,9 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
BoxPtr box;
int n;
+ DBG(("%s: region wholly contains damage\n",
+ __FUNCTION__));
+
n = sna_damage_get_boxes(priv->gpu_damage,
&box);
if (n) {
@@ -1658,6 +1665,9 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
int n = REGION_NUM_RECTS(r);
Bool ok = FALSE;
+ DBG(("%s: region wholly inside damage\n",
+ __FUNCTION__));
+
if (use_cpu_bo_for_write(sna, priv))
ok = sna->render.copy_boxes(sna, GXcopy,
pixmap, priv->gpu_bo, 0, 0,
@@ -1680,6 +1690,9 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
int n = REGION_NUM_RECTS(&need);
Bool ok = FALSE;
+ DBG(("%s: region intersects damage\n",
+ __FUNCTION__));
+
if (use_cpu_bo_for_write(sna, priv))
ok = sna->render.copy_boxes(sna, GXcopy,
pixmap, priv->gpu_bo, 0, 0,
@@ -1717,6 +1730,16 @@ done:
}
if (priv->flush)
list_move(&priv->list, &sna->dirty_pixmaps);
+#ifdef HAVE_FULL_DEBUG
+ {
+ RegionRec need;
+
+ RegionNull(&need);
+ assert(priv->gpu_damage == NULL ||
+ !sna_damage_intersect(priv->gpu_damage, r, &need));
+ RegionUninit(&need);
+ }
+#endif
}
if (dx | dy)
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index 97fe70e6..ab1cd39a 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -544,12 +544,14 @@ fallback:
flags = MOVE_WRITE | MOVE_INPLACE_HINT;
else
flags = MOVE_WRITE | MOVE_READ;
+ DBG(("%s: fallback -- move dst to cpu\n", __FUNCTION__));
if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region, flags))
goto out;
if (dst->alphaMap &&
!sna_drawable_move_to_cpu(dst->alphaMap->pDrawable, flags))
goto out;
if (src->pDrawable) {
+ DBG(("%s: fallback -- move src to cpu\n", __FUNCTION__));
if (!sna_drawable_move_to_cpu(src->pDrawable,
MOVE_READ))
goto out;
@@ -560,6 +562,7 @@ fallback:
goto out;
}
if (mask && mask->pDrawable) {
+ DBG(("%s: fallback -- move mask to cpu\n", __FUNCTION__));
if (!sna_drawable_move_to_cpu(mask->pDrawable,
MOVE_READ))
goto out;
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index b06bcda2..17c42d53 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -226,20 +226,22 @@ bail:
}
static void
-glyph_cache_upload(ScreenPtr screen,
- struct sna_glyph_cache *cache,
- GlyphPtr glyph,
+glyph_cache_upload(struct sna_glyph_cache *cache,
+ GlyphPtr glyph, PicturePtr glyph_picture,
int16_t x, int16_t y)
{
DBG(("%s: upload glyph %p to cache (%d, %d)x(%d, %d)\n",
- __FUNCTION__, glyph, x, y, glyph->info.width, glyph->info.height));
+ __FUNCTION__,
+ glyph, x, y,
+ glyph_picture->pDrawable->width,
+ glyph_picture->pDrawable->height));
sna_composite(PictOpSrc,
- GetGlyphPicture(glyph, screen), 0, cache->picture,
+ glyph_picture, 0, cache->picture,
0, 0,
0, 0,
x, y,
- glyph->info.width,
- glyph->info.height);
+ glyph_picture->pDrawable->width,
+ glyph_picture->pDrawable->height);
}
static void
@@ -392,7 +394,7 @@ glyph_cache(ScreenPtr screen,
pos >>= 2;
}
- glyph_cache_upload(screen, cache, glyph,
+ glyph_cache_upload(cache, glyph, glyph_picture,
priv->coordinate.x, priv->coordinate.y);
return TRUE;
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index dfa0623c..3841e520 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -453,9 +453,9 @@ fallback:
int width = box->x2 - box->x1;
int pitch = PITCH(width, cpp);
- DBG((" copy offset %lx [%08x...%08x]: (%d, %d) x (%d, %d), src pitch=%d, dst pitch=%d, bpp=%d\n",
+ DBG((" copy offset %lx [%08x...%08x...%08x]: (%d, %d) x (%d, %d), src pitch=%d, dst pitch=%d, bpp=%d\n",
(long)((char *)src - (char *)ptr),
- *(uint32_t*)src, *(uint32_t*)(src+pitch*height - 4),
+ *(uint32_t*)src, *(uint32_t*)(src+pitch*height/2 + pitch/2 - 4), *(uint32_t*)(src+pitch*height - 4),
box->x1 + dst_dx,
box->y1 + dst_dy,
width, height,
@@ -558,8 +558,8 @@ static bool upload_inplace(struct kgem *kgem,
}
bool sna_write_boxes(struct sna *sna, PixmapPtr dst,
- struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy,
- const void *src, int stride, int16_t src_dx, int16_t src_dy,
+ struct kgem_bo * const dst_bo, int16_t const dst_dx, int16_t const dst_dy,
+ const void * const src, int const stride, int16_t const src_dx, int16_t const src_dy,
const BoxRec *box, int nbox)
{
struct kgem *kgem = &sna->kgem;
@@ -570,7 +570,7 @@ bool sna_write_boxes(struct sna *sna, PixmapPtr dst,
int n, cmd, br13;
bool can_blt;
- DBG(("%s x %d\n", __FUNCTION__, nbox));
+ DBG(("%s x %d, src stride=%d, src dx=(%d, %d)\n", __FUNCTION__, nbox, stride, src_dx, src_dy));
if (upload_inplace(kgem, dst_bo, box, nbox, dst->drawable.bitsPerPixel)) {
fallback: