summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-06 13:43:55 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-06 13:47:12 +0000
commit4af910e8be92e0ca241ce1e93e322c712dcbe340 (patch)
tree32673ebd51bd730d28a1a7544047dc1ce194a167
parent3244e4b23397f54ca76876dd76ebea9a0abd357e (diff)
sna/gen4+: Trim the redundant float from the fill vertices
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen4_render.c27
-rw-r--r--src/sna/gen5_render.c63
2 files changed, 36 insertions, 54 deletions
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index e713d351..c3e452d7 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -2431,16 +2431,13 @@ gen4_render_fill_rectangle(struct sna *sna,
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_F(.5);
OUT_VERTEX(x, y+h);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(x, y);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(0);
+ OUT_VERTEX_F(.5);
}
static bool
@@ -2514,10 +2511,10 @@ gen4_render_fill_boxes(struct sna *sna,
gen4_channel_init_solid(sna, &tmp.src, pixel);
tmp.is_affine = true;
- tmp.floats_per_vertex = 3;
- tmp.floats_per_rect = 9;
+ tmp.floats_per_vertex = 2;
+ tmp.floats_per_rect = 6;
tmp.u.gen4.wm_kernel = WM_KERNEL;
- tmp.u.gen4.ve_id = 2;
+ tmp.u.gen4.ve_id = 1;
tmp.u.gen4.sf = 0;
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -2620,10 +2617,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 = 3;
- op->base.floats_per_rect = 9;
+ op->base.floats_per_vertex = 2;
+ op->base.floats_per_rect = 6;
op->base.u.gen4.wm_kernel = WM_KERNEL;
- op->base.u.gen4.ve_id = 2;
+ op->base.u.gen4.ve_id = 1;
op->base.u.gen4.sf = 0;
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
@@ -2697,13 +2694,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 = 3;
- tmp.floats_per_rect = 9;
+ tmp.floats_per_vertex = 2;
+ tmp.floats_per_rect = 6;
tmp.has_component_alpha = false;
tmp.need_magic_ca_pass = false;
tmp.u.gen4.wm_kernel = WM_KERNEL;
- tmp.u.gen4.ve_id = 2;
+ tmp.u.gen4.ve_id = 1;
tmp.u.gen4.sf = 0;
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index e5c79aaa..c86cc24c 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -2528,10 +2528,10 @@ gen5_render_fill_boxes(struct sna *sna,
tmp.src.repeat = SAMPLER_EXTEND_REPEAT;
tmp.is_affine = true;
- tmp.floats_per_vertex = 3;
- tmp.floats_per_rect = 9;
+ tmp.floats_per_vertex = 2;
+ tmp.floats_per_rect = 6;
tmp.u.gen5.wm_kernel = WM_KERNEL;
- tmp.u.gen5.ve_id = 2;
+ tmp.u.gen5.ve_id = 1;
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
kgem_submit(&sna->kgem);
@@ -2552,16 +2552,13 @@ 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_F(1);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(box->x1, box->y2);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(box->x1, box->y1);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(0);
+ OUT_VERTEX_F(.5);
box++;
} while (--n_this_time);
@@ -2582,16 +2579,13 @@ 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_F(1);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(x, y+h);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(x, y);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(0);
+ OUT_VERTEX_F(.5);
}
fastcall static void
@@ -2605,16 +2599,13 @@ 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_F(1);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(box->x1, box->y2);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(box->x1, box->y1);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(0);
+ OUT_VERTEX_F(.5);
}
fastcall static void
@@ -2635,16 +2626,13 @@ gen5_render_fill_op_boxes(struct sna *sna,
do {
OUT_VERTEX(box->x2, box->y2);
- OUT_VERTEX_F(1);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(box->x1, box->y2);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(box->x1, box->y1);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(0);
+ OUT_VERTEX_F(.5);
box++;
} while (--nbox_this_time);
} while (nbox);
@@ -2710,10 +2698,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 = 3;
- op->base.floats_per_rect = 9;
+ op->base.floats_per_vertex = 2;
+ op->base.floats_per_rect = 6;
op->base.u.gen5.wm_kernel = WM_KERNEL;
- op->base.u.gen5.ve_id = 2;
+ op->base.u.gen5.ve_id = 1;
if (!kgem_check_bo(&sna->kgem, dst_bo, NULL)) {
kgem_submit(&sna->kgem);
@@ -2798,13 +2786,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 = 3;
- tmp.floats_per_rect = 9;
+ tmp.floats_per_vertex = 2;
+ tmp.floats_per_rect = 6;
tmp.has_component_alpha = 0;
tmp.need_magic_ca_pass = false;
tmp.u.gen5.wm_kernel = WM_KERNEL;
- tmp.u.gen5.ve_id = 2;
+ tmp.u.gen5.ve_id = 1;
if (!kgem_check_bo(&sna->kgem, bo, NULL)) {
_kgem_submit(&sna->kgem);
@@ -2818,16 +2806,13 @@ 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_F(1);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(x1, y2);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(1);
+ OUT_VERTEX_F(.5);
OUT_VERTEX(x1, y1);
- OUT_VERTEX_F(0);
- OUT_VERTEX_F(0);
+ OUT_VERTEX_F(.5);
gen4_vertex_flush(sna);
kgem_bo_destroy(&sna->kgem, tmp.src.bo);