diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-18 18:35:59 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-18 18:49:42 +0000 |
commit | 470741e84c813a257897ee69f14500207a2674dc (patch) | |
tree | 96725387af347f8997fd882187fd2800d6e68624 | |
parent | ab387a89cf64ace9f7d7fa52b7743e78b625f47d (diff) |
sna: Debug uploads
All of the asserts and debug options that lead me to believe that the
tiling was completely screwy for some writes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen6_render.c | 2 | ||||
-rw-r--r-- | src/sna/kgem.c | 7 | ||||
-rw-r--r-- | src/sna/sna_io.c | 18 | ||||
-rw-r--r-- | src/sna/sna_render.c | 12 |
4 files changed, 31 insertions, 8 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 6dfcdf09..7ece9522 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -2423,7 +2423,7 @@ gen6_render_composite(struct sna *sna, if (!gen6_composite_set_target(sna, tmp, dst)) return FALSE; - if (mask == NULL && sna->kgem.mode == KGEM_BLT && + if (mask == NULL && sna->kgem.mode == KGEM_BLT && sna_blt_composite(sna, op, src, dst, src_x, src_y, diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 0fb244f2..b49f92a4 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1139,9 +1139,9 @@ static void kgem_commit(struct kgem *kgem) struct kgem_bo *bo, *next; list_for_each_entry_safe(bo, next, &rq->buffers, request) { - DBG(("%s: release handle=%d (proxy? %d), dirty? %d flush? %d\n", + DBG(("%s: release handle=%d (proxy? %d), dirty? %d flush? %d -> offset=%x\n", __FUNCTION__, bo->handle, bo->proxy != NULL, - bo->dirty, bo->needs_flush)); + bo->dirty, bo->needs_flush, (unsigned)bo->exec->offset)); assert(!bo->purged); assert(bo->proxy || bo->rq == rq); @@ -2615,6 +2615,9 @@ void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo) { void *ptr; + DBG(("%s: handle=%d, tiling=%d, map=%p, domain=%d\n", __FUNCTION__, + bo->handle, bo->tiling, bo->map, bo->domain)); + assert(!bo->purged); assert(bo->exec == NULL); assert(list_is_empty(&bo->list)); diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c index 79448c87..046660ef 100644 --- a/src/sna/sna_io.c +++ b/src/sna/sna_io.c @@ -342,11 +342,10 @@ static void write_boxes_inplace(struct kgem *kgem, struct kgem_bo *bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n) { - int dst_pitch = bo->pitch; - int src_pitch = stride; void *dst; - DBG(("%s x %d, tiling=%d\n", __FUNCTION__, n, bo->tiling)); + DBG(("%s x %d, handle=%d, tiling=%d\n", + __FUNCTION__, n, bo->handle, bo->tiling)); kgem_bo_submit(kgem, bo); @@ -361,10 +360,19 @@ static void write_boxes_inplace(struct kgem *kgem, box->x1 + src_dx, box->y1 + src_dy, box->x1 + dst_dx, box->y1 + dst_dy, box->x2 - box->x1, box->y2 - box->y1, - bpp, src_pitch, dst_pitch)); + bpp, stride, bo->pitch)); + + assert(box->x1 + dst_dx >= 0); + assert((box->x2 + dst_dx)*bpp <= 8*bo->pitch); + assert(box->y1 + dst_dy >= 0); + assert((box->y2 + dst_dy)*bo->pitch <= bo->size); + + assert(box->x1 + src_dx >= 0); + assert((box->x2 + src_dx)*bpp <= 8*stride); + assert(box->y1 + src_dy >= 0); memcpy_blt(src, dst, bpp, - src_pitch, dst_pitch, + stride, bo->pitch, box->x1 + src_dx, box->y1 + src_dy, box->x1 + dst_dx, box->y1 + dst_dy, box->x2 - box->x1, box->y2 - box->y1); diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 7b6661ef..fde95f90 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -41,6 +41,9 @@ #define NO_FIXUP 0 #define NO_EXTRACT 0 +#define DBG_FORCE_UPLOAD 0 +#define DBG_NO_CPU_BO 0 + CARD32 sna_format_for_depth(int depth) { @@ -289,6 +292,9 @@ use_cpu_bo(struct sna *sna, PixmapPtr pixmap, const BoxRec *box) { struct sna_pixmap *priv; + if (DBG_NO_CPU_BO) + return NULL; + priv = sna_pixmap_attach(pixmap); if (priv == NULL || priv->cpu_bo == NULL) { DBG(("%s: no cpu bo\n", __FUNCTION__)); @@ -352,12 +358,18 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box) struct sna_pixmap *priv; int count, w, h; + if (DBG_FORCE_UPLOAD > 0) + return FALSE; + if (pixmap->usage_hint) { DBG(("%s: not migrating pixmap due to usage_hint=%d\n", __FUNCTION__, pixmap->usage_hint)); return FALSE; } + if (DBG_FORCE_UPLOAD < 0) + return TRUE; + w = box->x2 - box->x1; h = box->y2 - box->y1; if (w == pixmap->drawable.width && h == pixmap->drawable.height) { |