summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-16 15:51:33 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-16 16:09:57 +0000
commit377f5e16cd14bdf42e67b0c8f2e13b75526f3a85 (patch)
tree9baa8905740389d0a7cb77f5f1ba4b6d11c17ec9
parent6387f2fb8a40f32cc4a3e4228983dcf0604ac4dc (diff)
sna/gen[45]: clear the state tracker before setting the formats
When backporting the patches from gen6, I didn't notice the memset that came later, and this wasn't along the paths checked by rendercheck. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen4_render.c6
-rw-r--r--src/sna/gen5_render.c22
-rw-r--r--src/sna/gen7_render.c2
3 files changed, 16 insertions, 14 deletions
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index 7d1005da..6351fa98 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -1459,7 +1459,7 @@ gen4_emit_vertex_elements(struct sna *sna,
static void
gen4_emit_state(struct sna *sna,
const struct sna_composite_op *op,
- uint16_t wm_binding_table)
+ uint16_t wm_binding_table)
{
gen4_emit_binding_table(sna, wm_binding_table);
gen4_emit_pipelined_pointers(sna, op, op->op, op->u.gen4.wm_kernel);
@@ -2422,6 +2422,8 @@ fallback:
box, n);
}
+ memset(&tmp, 0, sizeof(tmp));
+
DBG(("%s (%d, %d)->(%d, %d) x %d\n",
__FUNCTION__, src_dx, src_dy, dst_dx, dst_dy, n));
@@ -2435,8 +2437,6 @@ fallback:
if (!gen4_check_format(tmp.src.pict_format))
goto fallback;
- memset(&tmp, 0, sizeof(tmp));
-
tmp.op = alu == GXcopy ? PictOpSrc : PictOpClear;
tmp.dst.pixmap = dst;
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index a06194e1..5104cb7e 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -2689,7 +2689,7 @@ gen5_copy_bind_surfaces(struct sna *sna,
binding_table[0] =
gen5_bind_bo(sna,
op->dst.bo, op->dst.width, op->dst.height,
- gen5_get_dest_format(op->dst.pixmap->drawable.depth),
+ gen5_get_dest_format(op->dst.format),
TRUE);
binding_table[1] =
gen5_bind_bo(sna,
@@ -2745,6 +2745,8 @@ fallback:
box, n);
}
+ memset(&tmp, 0, sizeof(tmp));
+
if (dst->drawable.depth == src->drawable.depth) {
tmp.dst.format = sna_render_format_for_depth(dst->drawable.depth);
tmp.src.pict_format = tmp.dst.format;
@@ -2752,14 +2754,15 @@ fallback:
tmp.dst.format = sna_format_for_depth(dst->drawable.depth);
tmp.src.pict_format = sna_format_for_depth(src->drawable.depth);
}
- if (!gen5_check_format(tmp.src.pict_format))
+ if (!gen5_check_format(tmp.src.pict_format)) {
+ DBG(("%s: unsupported source format, %x, use BLT\n",
+ __FUNCTION__, tmp.src.pict_format));
goto fallback;
+ }
DBG(("%s (%d, %d)->(%d, %d) x %d\n",
__FUNCTION__, src_dx, src_dy, dst_dx, dst_dy, n));
- memset(&tmp, 0, sizeof(tmp));
-
tmp.op = alu == GXcopy ? PictOpSrc : PictOpClear;
tmp.dst.pixmap = dst;
@@ -2917,7 +2920,6 @@ fallback:
op->base.dst.pixmap = dst;
op->base.dst.width = dst->drawable.width;
op->base.dst.height = dst->drawable.height;
- op->base.dst.format = sna_format_for_depth(dst->drawable.depth);
op->base.dst.bo = dst_bo;
op->base.src.bo = src_bo;
@@ -3057,11 +3059,11 @@ gen5_render_fill_boxes(struct sna *sna,
if (op == PictOpClear)
pixel = 0;
else if (!sna_get_pixel_from_rgba(&pixel,
- color->red,
- color->green,
- color->blue,
- color->alpha,
- PICT_a8r8g8b8))
+ color->red,
+ color->green,
+ color->blue,
+ color->alpha,
+ PICT_a8r8g8b8))
return FALSE;
memset(&tmp, 0, sizeof(tmp));
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index b8e55659..75caa6fc 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2985,7 +2985,7 @@ gen7_emit_copy_state(struct sna *sna,
binding_table[0] =
gen7_bind_bo(sna,
op->dst.bo, op->dst.width, op->dst.height,
- gen7_get_dest_format(op->dst.pixmap->drawable.depth),
+ gen7_get_dest_format(op->dst.format),
TRUE);
binding_table[1] =
gen7_bind_bo(sna,