summaryrefslogtreecommitdiff
path: root/src/i915_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-18 23:25:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-23 18:52:15 +0100
commit4a3476ea094e84887fefb558e0bba023fee34151 (patch)
treeb570e80f1a575283005781e700a81ee142b79663 /src/i915_render.c
parente5c971e7639095d38da3518a5dc404b708d45cfb (diff)
i915: amalgamate composite into a single primitive list
Combine all the calls to composite between prepare_composite and done_composite into a single primitive list, rather than a primitive call per composite(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/i915_render.c')
-rw-r--r--src/i915_render.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/i915_render.c b/src/i915_render.c
index 59d92481..7c204b62 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -708,6 +708,9 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
FS_END();
}
+
+ intel->prim_offset = 0;
+ intel->prim_count = 0;
}
/* Emit the vertices for a single composite rectangle.
@@ -850,9 +853,10 @@ i915_emit_composite_primitive(PixmapPtr dest,
num_floats = 3 * per_vertex;
- ATOMIC_BATCH(1 + num_floats);
+ ATOMIC_BATCH(num_floats);
+
+ intel->prim_count += num_floats;
- OUT_BATCH(PRIM3D_INLINE | PRIM3D_RECTLIST | (num_floats - 1));
OUT_BATCH_F(intel->dst_coord_adjust + dstX + w);
OUT_BATCH_F(intel->dst_coord_adjust + dstY + h);
if (! intel->render_source_is_solid) {
@@ -926,13 +930,30 @@ i915_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY,
if (intel->needs_render_state_emit)
i915_emit_composite_setup(scrn);
+ if (intel->prim_offset == 0) {
+ intel->prim_offset = intel->batch_used;
+ ATOMIC_BATCH(1);
+ OUT_BATCH(PRIM3D_INLINE | PRIM3D_RECTLIST);
+ ADVANCE_BATCH();
+ }
+
i915_emit_composite_primitive(dest, srcX, srcY, maskX, maskY, dstX,
dstY, w, h);
intel_batch_end_atomic(scrn);
}
-void i915_batch_flush_notify(ScrnInfoPtr scrn)
+void
+i915_vertex_flush(intel_screen_private *intel)
+{
+ if (intel->prim_offset) {
+ *(uint32_t *) (intel->batch_ptr + intel->prim_offset) |= intel->prim_count - 1;
+ intel->prim_offset = 0;
+ }
+}
+
+void
+i915_batch_flush_notify(ScrnInfoPtr scrn)
{
intel_screen_private *intel = intel_get_screen_private(scrn);