summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-06 13:24:23 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-06 13:30:37 +0000
commit3244e4b23397f54ca76876dd76ebea9a0abd357e (patch)
tree076018b5e109c827620c0d6a0ffca3a654c12764
parentd3be77f87916e38af717bafaf2000becd5180d76 (diff)
Revert "sna/gen4+: Backport tight vertex packing for simple renderblits"
This reverts commit 8ff76fad1fadc5e309f9a12c30f883460a432049 and commit 48e4dc4bd4b2980f0f804f572d0e3fc1bb4bc21e. I forgot gen4 and gen5 do not have the 'non-normalized' bit in their sampler states.
-rw-r--r--src/sna/gen4_render.c229
-rw-r--r--src/sna/gen5_render.c112
-rw-r--r--src/sna/gen5_render.h63
-rw-r--r--src/sna/sna_render.h4
4 files changed, 187 insertions, 221 deletions
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index ac099a53..e713d351 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -172,8 +172,6 @@ static const struct blendinfo {
#define SAMPLER_OFFSET(sf, se, mf, me, k) \
((((((sf) * EXTEND_COUNT + (se)) * FILTER_COUNT + (mf)) * EXTEND_COUNT + (me)) * KERNEL_COUNT + (k)) * 64)
-#define VERTEX_2s2s 0
-
static void
gen4_emit_pipelined_pointers(struct sna *sna,
const struct sna_composite_op *op,
@@ -2131,6 +2129,28 @@ gen4_copy_bind_surfaces(struct sna *sna, const struct sna_composite_op *op)
gen4_emit_state(sna, op, offset | dirty);
}
+static void
+gen4_render_copy_one(struct sna *sna,
+ const struct sna_composite_op *op,
+ int sx, int sy,
+ int w, int h,
+ int dx, int dy)
+{
+ gen4_get_rectangles(sna, op, 1, gen4_copy_bind_surfaces);
+
+ OUT_VERTEX(dx+w, dy+h);
+ OUT_VERTEX_F((sx+w)*op->src.scale[0]);
+ OUT_VERTEX_F((sy+h)*op->src.scale[1]);
+
+ OUT_VERTEX(dx, dy+h);
+ OUT_VERTEX_F(sx*op->src.scale[0]);
+ OUT_VERTEX_F((sy+h)*op->src.scale[1]);
+
+ OUT_VERTEX(dx, dy);
+ OUT_VERTEX_F(sx*op->src.scale[0]);
+ OUT_VERTEX_F(sy*op->src.scale[1]);
+}
+
static bool
gen4_render_copy_boxes(struct sna *sna, uint8_t alu,
PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy,
@@ -2233,20 +2253,20 @@ fallback_blt:
extents.x2 - extents.x1,
extents.y2 - extents.y1))
goto fallback_tiled_dst;
-
- src_dx += tmp.src.offset[0];
- src_dy += tmp.src.offset[1];
} else {
tmp.src.bo = kgem_bo_reference(src_bo);
tmp.src.width = src->drawable.width;
tmp.src.height = src->drawable.height;
+ tmp.src.offset[0] = tmp.src.offset[1] = 0;
+ tmp.src.scale[0] = 1.f/src->drawable.width;
+ tmp.src.scale[1] = 1.f/src->drawable.height;
}
tmp.is_affine = true;
- tmp.floats_per_vertex = 2;
- tmp.floats_per_rect = 6;
+ tmp.floats_per_vertex = 3;
+ tmp.floats_per_rect = 9;
tmp.u.gen4.wm_kernel = WM_KERNEL;
- tmp.u.gen4.ve_id = VERTEX_2s2s;
+ tmp.u.gen4.ve_id = 2;
tmp.u.gen4.sf = 0;
if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
@@ -2259,33 +2279,19 @@ fallback_blt:
dst_dy += tmp.dst.y;
tmp.dst.x = tmp.dst.y = 0;
+ src_dx += tmp.src.offset[0];
+ src_dy += tmp.src.offset[1];
+
gen4_copy_bind_surfaces(sna, &tmp);
gen4_align_vertex(sna, &tmp);
do {
- int n_this_time;
-
- n_this_time = gen4_get_rectangles(sna, &tmp, n,
- gen4_copy_bind_surfaces);
- n -= n_this_time;
-
- do {
- DBG((" (%d, %d) -> (%d, %d) + (%d, %d)\n",
- box->x1 + src_dx, box->y1 + src_dy,
- box->x1 + dst_dx, box->y1 + dst_dy,
- box->x2 - box->x1, box->y2 - box->y1));
- OUT_VERTEX(box->x2 + dst_dx, box->y2 + dst_dy);
- OUT_VERTEX(box->x2 + src_dx, box->y2 + src_dy);
-
- OUT_VERTEX(box->x1 + dst_dx, box->y2 + dst_dy);
- OUT_VERTEX(box->x1 + src_dx, box->y2 + src_dy);
-
- OUT_VERTEX(box->x1 + dst_dx, box->y1 + dst_dy);
- OUT_VERTEX(box->x1 + src_dx, box->y1 + src_dy);
-
- box++;
- } while (--n_this_time);
- } while (n);
+ gen4_render_copy_one(sna, &tmp,
+ box->x1 + src_dx, box->y1 + src_dy,
+ box->x2 - box->x1, box->y2 - box->y1,
+ box->x1 + dst_dx, box->y1 + dst_dy);
+ box++;
+ } while (--n);
gen4_vertex_flush(sna);
sna_render_composite_redirect_done(sna, &tmp);
@@ -2319,19 +2325,7 @@ gen4_render_copy_blt(struct sna *sna,
int16_t w, int16_t h,
int16_t dx, int16_t dy)
{
- DBG(("%s: src=(%d, %d), dst=(%d, %d), size=(%d, %d)\n", __FUNCTION__,
- sx, sy, dx, dy, w, h));
-
- gen4_get_rectangles(sna, &op->base, 1, gen4_copy_bind_surfaces);
-
- OUT_VERTEX(dx+w, dy+h);
- OUT_VERTEX(sx+w, sy+h);
-
- OUT_VERTEX(dx, dy+h);
- OUT_VERTEX(sx, sy+h);
-
- OUT_VERTEX(dx, dy);
- OUT_VERTEX(sx, sy);
+ gen4_render_copy_one(sna, &op->base, sx, sy, w, h, dx, dy);
}
static void
@@ -2339,8 +2333,6 @@ gen4_render_copy_done(struct sna *sna, const struct sna_copy_op *op)
{
if (sna->render.vertex_offset)
gen4_vertex_flush(sna);
-
- DBG(("%s()\n", __FUNCTION__));
}
static bool
@@ -2396,14 +2388,16 @@ fallback:
gen4_get_card_format(op->base.src.pict_format);
op->base.src.width = src->drawable.width;
op->base.src.height = src->drawable.height;
+ op->base.src.scale[0] = 1.f/src->drawable.width;
+ op->base.src.scale[1] = 1.f/src->drawable.height;
op->base.src.filter = SAMPLER_FILTER_NEAREST;
op->base.src.repeat = SAMPLER_EXTEND_NONE;
op->base.is_affine = true;
- op->base.floats_per_vertex = 2;
- op->base.floats_per_rect = 6;
+ op->base.floats_per_vertex = 3;
+ op->base.floats_per_rect = 9;
op->base.u.gen4.wm_kernel = WM_KERNEL;
- op->base.u.gen4.ve_id = VERTEX_2s2s;
+ op->base.u.gen4.ve_id = 2;
op->base.u.gen4.sf = 0;
if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
@@ -2429,6 +2423,26 @@ fallback:
return true;
}
+static void
+gen4_render_fill_rectangle(struct sna *sna,
+ const struct sna_composite_op *op,
+ int x, int y, int w, int h)
+{
+ gen4_get_rectangles(sna, op, 1, gen4_bind_surfaces);
+
+ OUT_VERTEX(x+w, y+h);
+ OUT_VERTEX_F(1);
+ OUT_VERTEX_F(1);
+
+ OUT_VERTEX(x, y+h);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(1);
+
+ OUT_VERTEX(x, y);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(0);
+}
+
static bool
gen4_render_fill_boxes(struct sna *sna,
CARD8 op,
@@ -2500,10 +2514,10 @@ gen4_render_fill_boxes(struct sna *sna,
gen4_channel_init_solid(sna, &tmp.src, pixel);
tmp.is_affine = true;
- tmp.floats_per_vertex = 2;
- tmp.floats_per_rect = 6;
+ tmp.floats_per_vertex = 3;
+ tmp.floats_per_rect = 9;
tmp.u.gen4.wm_kernel = WM_KERNEL;
- tmp.u.gen4.ve_id = VERTEX_2s2s;
+ tmp.u.gen4.ve_id = 2;
tmp.u.gen4.sf = 0;
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -2515,27 +2529,12 @@ gen4_render_fill_boxes(struct sna *sna,
gen4_align_vertex(sna, &tmp);
do {
- int n_this_time;
-
- n_this_time = gen4_get_rectangles(sna, &tmp, n,
- gen4_bind_surfaces);
- n -= n_this_time;
-
- do {
- DBG((" (%d, %d), (%d, %d)\n",
- box->x1, box->y1, box->x2, box->y2));
- OUT_VERTEX(box->x2, box->y2);
- OUT_VERTEX(1, 1);
-
- OUT_VERTEX(box->x1, box->y2);
- OUT_VERTEX(0, 1);
-
- OUT_VERTEX(box->x1, box->y1);
- OUT_VERTEX(0, 0);
-
- box++;
- } while (--n_this_time);
- } while (n);
+ gen4_render_fill_rectangle(sna, &tmp,
+ box->x1, box->y1,
+ box->x2 - box->x1,
+ box->y2 - box->y1);
+ box++;
+ } while (--n);
gen4_vertex_flush(sna);
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
@@ -2543,22 +2542,10 @@ gen4_render_fill_boxes(struct sna *sna,
}
static void
-gen4_render_fill_op_blt(struct sna *sna,
- const struct sna_fill_op *op,
+gen4_render_fill_op_blt(struct sna *sna, const struct sna_fill_op *op,
int16_t x, int16_t y, int16_t w, int16_t h)
{
- DBG(("%s (%d, %d)x(%d, %d)\n", __FUNCTION__, x,y,w,h));
-
- gen4_get_rectangles(sna, &op->base, 1, gen4_bind_surfaces);
-
- OUT_VERTEX(x+w, y+h);
- OUT_VERTEX(1, 1);
-
- OUT_VERTEX(x, y+h);
- OUT_VERTEX(0, 1);
-
- OUT_VERTEX(x, y);
- OUT_VERTEX(0, 0);
+ gen4_render_fill_rectangle(sna, &op->base, x, y, w, h);
}
fastcall static void
@@ -2566,19 +2553,9 @@ gen4_render_fill_op_box(struct sna *sna,
const struct sna_fill_op *op,
const BoxRec *box)
{
- DBG(("%s: (%d, %d),(%d, %d)\n", __FUNCTION__,
- box->x1, box->y1, box->x2, box->y2));
-
- gen4_get_rectangles(sna, &op->base, 1, gen4_bind_surfaces);
-
- OUT_VERTEX(box->x2, box->y2);
- OUT_VERTEX(1, 1);
-
- OUT_VERTEX(box->x1, box->y2);
- OUT_VERTEX(0, 1);
-
- OUT_VERTEX(box->x1, box->y1);
- OUT_VERTEX(0, 0);
+ gen4_render_fill_rectangle(sna, &op->base,
+ box->x1, box->y1,
+ box->x2-box->x1, box->y2-box->y1);
}
fastcall static void
@@ -2587,28 +2564,12 @@ gen4_render_fill_op_boxes(struct sna *sna,
const BoxRec *box,
int nbox)
{
- DBG(("%s: (%d, %d),(%d, %d)... x %d\n", __FUNCTION__,
- box->x1, box->y1, box->x2, box->y2, nbox));
-
do {
- int nbox_this_time;
-
- nbox_this_time = gen4_get_rectangles(sna, &op->base, nbox,
- gen4_bind_surfaces);
- nbox -= nbox_this_time;
-
- do {
- OUT_VERTEX(box->x2, box->y2);
- OUT_VERTEX(1, 1);
-
- OUT_VERTEX(box->x1, box->y2);
- OUT_VERTEX(0, 1);
-
- OUT_VERTEX(box->x1, box->y1);
- OUT_VERTEX(0, 0);
- box++;
- } while (--nbox_this_time);
- } while (nbox);
+ gen4_render_fill_rectangle(sna, &op->base,
+ box->x1, box->y1,
+ box->x2-box->x1, box->y2-box->y1);
+ box++;
+ } while (--nbox);
}
static void
@@ -2617,8 +2578,6 @@ gen4_render_fill_op_done(struct sna *sna, const struct sna_fill_op *op)
if (sna->render.vertex_offset)
gen4_vertex_flush(sna);
kgem_bo_destroy(&sna->kgem, op->base.src.bo);
-
- DBG(("%s()\n", __FUNCTION__));
}
static bool
@@ -2661,10 +2620,10 @@ gen4_render_fill(struct sna *sna, uint8_t alu,
op->base.mask.bo = NULL;
op->base.is_affine = true;
- op->base.floats_per_vertex = 2;
- op->base.floats_per_rect = 6;
+ op->base.floats_per_vertex = 3;
+ op->base.floats_per_rect = 9;
op->base.u.gen4.wm_kernel = WM_KERNEL;
- op->base.u.gen4.ve_id = VERTEX_2s2s;
+ op->base.u.gen4.ve_id = 2;
op->base.u.gen4.sf = 0;
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -2738,13 +2697,13 @@ gen4_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
tmp.mask.bo = NULL;
tmp.is_affine = true;
- tmp.floats_per_vertex = 2;
- tmp.floats_per_rect = 6;
+ tmp.floats_per_vertex = 3;
+ tmp.floats_per_rect = 9;
tmp.has_component_alpha = false;
tmp.need_magic_ca_pass = false;
tmp.u.gen4.wm_kernel = WM_KERNEL;
- tmp.u.gen4.ve_id = VERTEX_2s2s;
+ tmp.u.gen4.ve_id = 2;
tmp.u.gen4.sf = 0;
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
@@ -2755,17 +2714,7 @@ gen4_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
gen4_bind_surfaces(sna, &tmp);
gen4_align_vertex(sna, &tmp);
- gen4_get_rectangles(sna, &tmp, 1, gen4_bind_surfaces);
-
- DBG((" (%d, %d), (%d, %d)\n", x1, y1, x2, y2));
- OUT_VERTEX(x2, y2);
- OUT_VERTEX(1, 1);
-
- OUT_VERTEX(x1, y2);
- OUT_VERTEX(0, 1);
-
- OUT_VERTEX(x1, y1);
- OUT_VERTEX(0, 0);
+ gen4_render_fill_rectangle(sna, &tmp, x1, y1, x2 - x1, y2 - y1);
gen4_vertex_flush(sna);
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 2e64b8e9..e5c79aaa 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -166,8 +166,6 @@ static const struct blendinfo {
#define SAMPLER_OFFSET(sf, se, mf, me, k) \
((((((sf) * EXTEND_COUNT + (se)) * FILTER_COUNT + (mf)) * EXTEND_COUNT + (me)) * KERNEL_COUNT + (k)) * 64)
-#define VERTEX_2s2s 0
-
static bool
gen5_emit_pipelined_pointers(struct sna *sna,
const struct sna_composite_op *op,
@@ -807,7 +805,7 @@ gen5_emit_pipelined_pointers(struct sna *sna,
uint32_t key;
DBG(("%s: has_mask=%d, src=(%d, %d), mask=(%d, %d),kernel=%d, blend=%d, ca=%d, format=%x\n",
- __FUNCTION__, op->u.gen4.ve_id & 2,
+ __FUNCTION__, op->u.gen5.ve_id & 2,
op->src.filter, op->src.repeat,
op->mask.filter, op->mask.repeat,
kernel, blend, op->has_component_alpha, (int)op->dst.format));
@@ -1020,7 +1018,7 @@ static void gen5_bind_surfaces(struct sna *sna,
op->src.card_format,
false);
if (op->mask.bo) {
- assert(op->u.gen4.ve_id >> 2);
+ assert(op->u.gen5.ve_id >> 2);
binding_table[2] =
gen5_bind_bo(sna,
op->mask.bo,
@@ -2206,20 +2204,20 @@ fallback_blt:
extents.x2 - extents.x1,
extents.y2 - extents.y1))
goto fallback_tiled_dst;
-
- src_dx += tmp.src.offset[0];
- src_dy += tmp.src.offset[1];
} else {
tmp.src.bo = kgem_bo_reference(src_bo);
tmp.src.width = src->drawable.width;
tmp.src.height = src->drawable.height;
+ tmp.src.offset[0] = tmp.src.offset[1] = 0;
+ tmp.src.scale[0] = 1.f/src->drawable.width;
+ tmp.src.scale[1] = 1.f/src->drawable.height;
}
tmp.is_affine = true;
- tmp.floats_per_vertex = 2;
- tmp.floats_per_rect = 6;
+ tmp.floats_per_vertex = 3;
+ tmp.floats_per_rect = 9;
tmp.u.gen5.wm_kernel = WM_KERNEL;
- tmp.u.gen5.ve_id = VERTEX_2s2s;
+ tmp.u.gen5.ve_id = 2;
if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
kgem_submit(&sna->kgem);
@@ -2231,6 +2229,9 @@ fallback_blt:
dst_dy += tmp.dst.y;
tmp.dst.x = tmp.dst.y = 0;
+ src_dx += tmp.src.offset[0];
+ src_dy += tmp.src.offset[1];
+
gen5_copy_bind_surfaces(sna, &tmp);
gen5_align_vertex(sna, &tmp);
@@ -2247,13 +2248,16 @@ fallback_blt:
box->x1 + dst_dx, box->y1 + dst_dy,
box->x2 - box->x1, box->y2 - box->y1));
OUT_VERTEX(box->x2 + dst_dx, box->y2 + dst_dy);
- OUT_VERTEX(box->x2 + src_dx, box->y2 + src_dy);
+ OUT_VERTEX_F((box->x2 + src_dx) * tmp.src.scale[0]);
+ OUT_VERTEX_F((box->y2 + src_dy) * tmp.src.scale[1]);
OUT_VERTEX(box->x1 + dst_dx, box->y2 + dst_dy);
- OUT_VERTEX(box->x1 + src_dx, box->y2 + src_dy);
+ OUT_VERTEX_F((box->x1 + src_dx) * tmp.src.scale[0]);
+ OUT_VERTEX_F((box->y2 + src_dy) * tmp.src.scale[1]);
OUT_VERTEX(box->x1 + dst_dx, box->y1 + dst_dy);
- OUT_VERTEX(box->x1 + src_dx, box->y1 + src_dy);
+ OUT_VERTEX_F((box->x1 + src_dx) * tmp.src.scale[0]);
+ OUT_VERTEX_F((box->y1 + src_dy) * tmp.src.scale[1]);
box++;
} while (--n_this_time);
@@ -2297,13 +2301,16 @@ gen5_render_copy_blt(struct sna *sna,
gen5_get_rectangles(sna, &op->base, 1, gen5_copy_bind_surfaces);
OUT_VERTEX(dx+w, dy+h);
- OUT_VERTEX(sx+w, sy+h);
+ OUT_VERTEX_F((sx+w)*op->base.src.scale[0]);
+ OUT_VERTEX_F((sy+h)*op->base.src.scale[1]);
OUT_VERTEX(dx, dy+h);
- OUT_VERTEX(sx, sy+h);
+ OUT_VERTEX_F(sx*op->base.src.scale[0]);
+ OUT_VERTEX_F((sy+h)*op->base.src.scale[1]);
OUT_VERTEX(dx, dy);
- OUT_VERTEX(sx, sy);
+ OUT_VERTEX_F(sx*op->base.src.scale[0]);
+ OUT_VERTEX_F(sy*op->base.src.scale[1]);
}
static void
@@ -2365,14 +2372,16 @@ fallback:
gen5_get_card_format(op->base.src.pict_format);
op->base.src.width = src->drawable.width;
op->base.src.height = src->drawable.height;
+ op->base.src.scale[0] = 1.f/src->drawable.width;
+ op->base.src.scale[1] = 1.f/src->drawable.height;
op->base.src.filter = SAMPLER_FILTER_NEAREST;
op->base.src.repeat = SAMPLER_EXTEND_NONE;
op->base.is_affine = true;
- op->base.floats_per_vertex = 2;
- op->base.floats_per_rect = 6;
+ op->base.floats_per_vertex = 3;
+ op->base.floats_per_rect = 9;
op->base.u.gen5.wm_kernel = WM_KERNEL;
- op->base.u.gen5.ve_id = VERTEX_2s2s;
+ op->base.u.gen5.ve_id = 2;
if (!kgem_check_bo(&sna->kgem, dst_bo, src_bo, NULL)) {
kgem_submit(&sna->kgem);
@@ -2519,10 +2528,10 @@ gen5_render_fill_boxes(struct sna *sna,
tmp.src.repeat = SAMPLER_EXTEND_REPEAT;
tmp.is_affine = true;
- tmp.floats_per_vertex = 2;
- tmp.floats_per_rect = 6;
+ tmp.floats_per_vertex = 3;
+ tmp.floats_per_rect = 9;
tmp.u.gen5.wm_kernel = WM_KERNEL;
- tmp.u.gen5.ve_id = VERTEX_2s2s;
+ tmp.u.gen5.ve_id = 2;
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
kgem_submit(&sna->kgem);
@@ -2543,13 +2552,16 @@ gen5_render_fill_boxes(struct sna *sna,
DBG((" (%d, %d), (%d, %d)\n",
box->x1, box->y1, box->x2, box->y2));
OUT_VERTEX(box->x2, box->y2);
- OUT_VERTEX(1, 1);
+ OUT_VERTEX_F(1);
+ OUT_VERTEX_F(1);
OUT_VERTEX(box->x1, box->y2);
- OUT_VERTEX(0, 1);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(1);
OUT_VERTEX(box->x1, box->y1);
- OUT_VERTEX(0, 0);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(0);
box++;
} while (--n_this_time);
@@ -2570,13 +2582,16 @@ gen5_render_fill_op_blt(struct sna *sna,
gen5_get_rectangles(sna, &op->base, 1, gen5_fill_bind_surfaces);
OUT_VERTEX(x+w, y+h);
- OUT_VERTEX(1, 1);
+ OUT_VERTEX_F(1);
+ OUT_VERTEX_F(1);
OUT_VERTEX(x, y+h);
- OUT_VERTEX(0, 1);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(1);
OUT_VERTEX(x, y);
- OUT_VERTEX(0, 0);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(0);
}
fastcall static void
@@ -2590,13 +2605,16 @@ gen5_render_fill_op_box(struct sna *sna,
gen5_get_rectangles(sna, &op->base, 1, gen5_fill_bind_surfaces);
OUT_VERTEX(box->x2, box->y2);
- OUT_VERTEX(1, 1);
+ OUT_VERTEX_F(1);
+ OUT_VERTEX_F(1);
OUT_VERTEX(box->x1, box->y2);
- OUT_VERTEX(0, 1);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(1);
OUT_VERTEX(box->x1, box->y1);
- OUT_VERTEX(0, 0);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(0);
}
fastcall static void
@@ -2617,13 +2635,16 @@ gen5_render_fill_op_boxes(struct sna *sna,
do {
OUT_VERTEX(box->x2, box->y2);
- OUT_VERTEX(1, 1);
+ OUT_VERTEX_F(1);
+ OUT_VERTEX_F(1);
OUT_VERTEX(box->x1, box->y2);
- OUT_VERTEX(0, 1);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(1);
OUT_VERTEX(box->x1, box->y1);
- OUT_VERTEX(0, 0);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(0);
box++;
} while (--nbox_this_time);
} while (nbox);
@@ -2689,10 +2710,10 @@ gen5_render_fill(struct sna *sna, uint8_t alu,
op->base.mask.repeat = SAMPLER_EXTEND_NONE;
op->base.is_affine = true;
- op->base.floats_per_vertex = 2;
- op->base.floats_per_rect = 6;
+ op->base.floats_per_vertex = 3;
+ op->base.floats_per_rect = 9;
op->base.u.gen5.wm_kernel = WM_KERNEL;
- op->base.u.gen5.ve_id = VERTEX_2s2s;
+ op->base.u.gen5.ve_id = 2;
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
kgem_submit(&sna->kgem);
@@ -2777,13 +2798,13 @@ gen5_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
tmp.mask.repeat = SAMPLER_EXTEND_NONE;
tmp.is_affine = true;
- tmp.floats_per_vertex = 2;
- tmp.floats_per_rect = 6;
+ tmp.floats_per_vertex = 3;
+ tmp.floats_per_rect = 9;
tmp.has_component_alpha = 0;
tmp.need_magic_ca_pass = false;
tmp.u.gen5.wm_kernel = WM_KERNEL;
- tmp.u.gen5.ve_id = VERTEX_2s2s;
+ tmp.u.gen5.ve_id = 2;
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
_kgem_submit(&sna->kgem);
@@ -2797,13 +2818,16 @@ gen5_render_fill_one(struct sna *sna, PixmapPtr dst, struct kgem_bo *bo,
DBG((" (%d, %d), (%d, %d)\n", x1, y1, x2, y2));
OUT_VERTEX(x2, y2);
- OUT_VERTEX(1, 1);
+ OUT_VERTEX_F(1);
+ OUT_VERTEX_F(1);
OUT_VERTEX(x1, y2);
- OUT_VERTEX(0, 1);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(1);
OUT_VERTEX(x1, y1);
- OUT_VERTEX(0, 0);
+ OUT_VERTEX_F(0);
+ OUT_VERTEX_F(0);
gen4_vertex_flush(sna);
kgem_bo_destroy(&sna->kgem, tmp.src.bo);
@@ -2890,7 +2914,7 @@ static void gen5_render_reset(struct sna *sna)
sna->render_state.gen5.needs_invariant = true;
sna->render_state.gen5.ve_id = -1;
sna->render_state.gen5.last_primitive = -1;
- sna->render_state.gen5.last_pipelined_pointers = -1;
+ sna->render_state.gen5.last_pipelined_pointers = 0;
sna->render_state.gen5.drawrect_offset = -1;
sna->render_state.gen5.drawrect_limit = -1;
diff --git a/src/sna/gen5_render.h b/src/sna/gen5_render.h
index 31caafc7..0f6bae6b 100644
--- a/src/sna/gen5_render.h
+++ b/src/sna/gen5_render.h
@@ -1989,50 +1989,43 @@ struct gen5_sampler_legacy_border_color {
uint8_t color[4];
};
-struct gen5_sampler_state
-{
-
- struct
- {
- unsigned int shadow_function:3;
- unsigned int lod_bias:11;
- unsigned int min_filter:3;
- unsigned int mag_filter:3;
- unsigned int mip_filter:2;
- unsigned int base_level:5;
+struct gen5_sampler_state {
+ struct {
+ unsigned int shadow_function:3;
+ unsigned int lod_bias:11;
+ unsigned int min_filter:3;
+ unsigned int mag_filter:3;
+ unsigned int mip_filter:2;
+ unsigned int base_level:5;
unsigned int pad:1;
- unsigned int lod_preclamp:1;
- unsigned int border_color_mode:1;
+ unsigned int lod_preclamp:1;
+ unsigned int border_color_mode:1;
unsigned int pad0:1;
- unsigned int disable:1;
+ unsigned int disable:1;
} ss0;
- struct
- {
- unsigned int r_wrap_mode:3;
- unsigned int t_wrap_mode:3;
- unsigned int s_wrap_mode:3;
+ struct {
+ unsigned int r_wrap_mode:3;
+ unsigned int t_wrap_mode:3;
+ unsigned int s_wrap_mode:3;
unsigned int pad:3;
- unsigned int max_lod:10;
- unsigned int min_lod:10;
+ unsigned int max_lod:10;
+ unsigned int min_lod:10;
} ss1;
-
- struct
- {
+ struct {
unsigned int pad:5;
- unsigned int border_color_pointer:27;
+ unsigned int border_color_pointer:27;
} ss2;
-
- struct
- {
- unsigned int pad:19;
- unsigned int max_aniso:3;
- unsigned int chroma_key_mode:1;
- unsigned int chroma_key_index:2;
- unsigned int chroma_key_enable:1;
- unsigned int monochrome_filter_width:3;
- unsigned int monochrome_filter_height:3;
+
+ struct {
+ uint32_t pad:13;
+ uint32_t address_round:6;
+ uint32_t max_aniso:3;
+ uint32_t chroma_key_mode:1;
+ uint32_t chroma_key_index:2;
+ uint32_t chroma_key_enable:1;
+ uint32_t mbz:6;
} ss3;
};
diff --git a/src/sna/sna_render.h b/src/sna/sna_render.h
index 91b35688..4174b6fa 100644
--- a/src/sna/sna_render.h
+++ b/src/sna/sna_render.h
@@ -126,8 +126,8 @@ struct sna_composite_op {
} gen4;
struct {
- int wm_kernel;
- int ve_id;
+ int16_t wm_kernel;
+ int16_t ve_id;
} gen5;
struct {