summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-23 15:53:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-23 15:55:47 +0100
commit33d3077266942b23c5bc05ef4a9a6cebe357272a (patch)
tree81f30f32b0229daba520bd63449426facc068541
parent03e6aee8fd2cc7486fbd2ec55a537c712786486b (diff)
sna: Debug compile fix, and some extra comments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen3_render.c23
-rw-r--r--src/sna/sna_blt.c10
-rw-r--r--src/sna/sna_display.c2
-rw-r--r--src/sna/sna_dri.c34
-rw-r--r--src/sna/sna_video.c2
5 files changed, 52 insertions, 19 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index c40718b7..1252ba4f 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -3394,7 +3394,7 @@ gen3_render_copy(struct sna *sna, uint8_t alu,
return sna_blt_copy(sna, alu,
src_bo, dst_bo,
dst->drawable.bitsPerPixel,
- op);
+ tmp);
#endif
/* Prefer to use the BLT */
@@ -3499,8 +3499,8 @@ gen3_render_fill_boxes(struct sna *sna,
box, n);
#endif
- DBG(("%s (op=%d, color=(%04x,%04x,%04x, %04x))\n",
- __FUNCTION__, op,
+ DBG(("%s (op=%d, format=%x, color=(%04x,%04x,%04x, %04x))\n",
+ __FUNCTION__, op, (int)format,
color->red, color->green, color->blue, color->alpha));
if (op >= ARRAY_SIZE(gen3_blend_op)) {
@@ -3511,7 +3511,8 @@ gen3_render_fill_boxes(struct sna *sna,
if (dst->drawable.width > 2048 ||
dst->drawable.height > 2048 ||
- dst_bo->pitch > 8192)
+ dst_bo->pitch > 8192 ||
+ !gen3_check_dst_format(format))
return gen3_render_fill_boxes_try_blt(sna, op, format, color,
dst, dst_bo,
box, n);
@@ -3529,6 +3530,12 @@ gen3_render_fill_boxes(struct sna *sna,
PICT_a8r8g8b8))
return FALSE;
+ DBG(("%s: using shader for op=%d, format=%x, pixel=%x\n",
+ __FUNCTION__, op, (int)format, pixel));
+
+ if (pixel == 0)
+ op = PictOpClear;
+
memset(&tmp, 0, sizeof(tmp));
tmp.op = op;
tmp.dst.pixmap = dst;
@@ -3538,7 +3545,7 @@ gen3_render_fill_boxes(struct sna *sna,
tmp.dst.bo = dst_bo;
tmp.floats_per_vertex = 2;
- tmp.src.gen3.type = SHADER_CONSTANT;
+ tmp.src.gen3.type = op == PictOpClear ? SHADER_ZERO : SHADER_CONSTANT;
tmp.src.gen3.mode = pixel;
if (!kgem_check_bo(&sna->kgem, dst_bo))
@@ -3556,8 +3563,8 @@ gen3_render_fill_boxes(struct sna *sna,
n -= n_this_time;
do {
- DBG((" (%d, %d), (%d, %d)\n",
- box->x1, box->y1, box->x2, box->y2));
+ DBG((" (%d, %d), (%d, %d): %x\n",
+ box->x1, box->y1, box->x2, box->y2, pixel));
OUT_VERTEX(box->x2);
OUT_VERTEX(box->y2);
OUT_VERTEX(box->x1);
@@ -3608,7 +3615,7 @@ gen3_render_fill(struct sna *sna, uint8_t alu,
return sna_blt_fill(sna, alu,
dst_bo, dst->drawable.bitsPerPixel,
color,
- op);
+ tmp);
#endif
/* Prefer to use the BLT if already engaged */
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 3d350b1d..35fdc12d 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1155,8 +1155,11 @@ Bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu,
DBG(("%s (%d, %08x, %d) x %d\n",
__FUNCTION__, bpp, color, alu, nbox));
- if (bo->tiling == I915_TILING_Y)
+ if (bo->tiling == I915_TILING_Y) {
+ DBG(("%s: fallback -- dst uses Y-tiling\n",
+ __FUNCTION__));
return FALSE;
+ }
cmd = XY_COLOR_BLT_CMD;
if (bpp == 32)
@@ -1167,8 +1170,11 @@ Bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu,
cmd |= BLT_DST_TILED;
br13 >>= 2;
}
- if (br13 > MAXSHORT)
+ if (br13 > MAXSHORT) {
+ DBG(("%s: fallback -- pitch is too large %d [%d]\n",
+ __FUNCTION__, bo->pitch, br13));
return FALSE;
+ }
br13 |= fill_ROP[alu] << 16;
switch (bpp) {
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 42e3f595..cb1beba7 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -818,7 +818,7 @@ sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num)
list_add(&sna_crtc->link, &mode->crtcs);
DBG(("%s: attached crtc[%d] id=%d, pipe=%d\n",
- __FUNCTION__, num, sna_crtc->mode_crtc->crtc_id, sna_crtc->pipe));
+ __FUNCTION__, num, sna_crtc->id, sna_crtc->pipe));
}
static Bool
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index f025607f..d4a3e3f3 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -388,16 +388,18 @@ sna_dri_copy_region(DrawablePtr draw,
int16_t dx, dy;
DBG(("%s(region=(%d, %d), (%d, %d)))\n", __FUNCTION__,
- region ? REGION_EXTENTS(NULL, region)->x1 : 0,
- region ? REGION_EXTENTS(NULL, region)->y1 : 0,
- region ? REGION_EXTENTS(NULL, region)->x2 : draw->width,
- region ? REGION_EXTENTS(NULL, region)->y2 : draw->height));
+ REGION_EXTENTS(NULL, region)->x1,
+ REGION_EXTENTS(NULL, region)->y1,
+ REGION_EXTENTS(NULL, region)->x2,
+ REGION_EXTENTS(NULL, region)->y2));
- DBG(("%s: dst -- attachment=%d, name=%d, handle=%d\n",
+ DBG(("%s: draw (%d, %d)\n", __FUNCTION__, draw->x, draw->y));
+ DBG(("%s: dst -- attachment=%d, name=%d, handle=%d [screen %d]\n",
__FUNCTION__,
dst_buffer->attachment,
dst_buffer->name,
- dst_priv->bo->handle));
+ dst_priv->bo->handle,
+ sna_pixmap(sna->front)->gpu_bo->handle));
DBG(("%s: src -- attachment=%d, name=%d, handle=%d\n",
__FUNCTION__,
src_buffer->attachment,
@@ -407,6 +409,9 @@ sna_dri_copy_region(DrawablePtr draw,
if (draw->type == DRAWABLE_WINDOW) {
WindowPtr win = (WindowPtr)draw;
+ DBG(("%s: draw=(%d, %d), delta=(%d, %d)\n",
+ __FUNCTION__, draw->x, draw->y,
+ get_drawable_dx(draw), get_drawable_dy(draw)));
pixman_region_translate(region, draw->x, draw->y);
pixman_region_init(&clip);
@@ -418,8 +423,23 @@ sna_dri_copy_region(DrawablePtr draw,
region = &clip;
get_drawable_deltas(draw, dst, &dx, &dy);
- } else
+
+ DBG(("%s clipped=(%d, %d), (%d, %d)x%d\n", __FUNCTION__,
+ REGION_EXTENTS(NULL, region)->x1,
+ REGION_EXTENTS(NULL, region)->y1,
+ REGION_EXTENTS(NULL, region)->x2,
+ REGION_EXTENTS(NULL, region)->y2,
+ REGION_NUM_RECTS(region)));
+
+ if (dst_buffer->attachment == DRI2BufferFrontLeft) {
+ assert(dst == sna->front);
+ assert(dst_priv->bo == sna_pixmap(sna->front)->gpu_bo);
+ }
+ } else {
+ assert(draw->x == 0);
+ assert(draw->y == 0);
dx = dy = 0;
+ }
assert(sna_pixmap(src)->cpu_damage == NULL);
assert(sna_pixmap(dst)->cpu_damage == NULL);
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index 7f520da2..c0b1451d 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -482,7 +482,7 @@ sna_video_copy_data(struct sna *sna,
if (frame->bo == NULL)
return FALSE;
- /* In the common case, we can simply the upload to a single pwrite */
+ /* In the common case, we can simply the upload in a single pwrite */
if (video->rotation == RR_Rotate_0) {
if (is_planar_fourcc(frame->id)) {
uint16_t pitch[2] = {