summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-08 10:43:24 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2010-06-10 21:08:08 +0100
commit9f4a244a363167dc62fa454af197ca8ba6a5e434 (patch)
treea25488123ccbe6f6a9dc70f9584973d7da166d13
parentfcdd53c6c130bf29cfd92309672c1fed3ec048f6 (diff)
implicit-flush
(cherry picked from commit 0776a42b70f2de7b7d7d8804046c79442da1cb8a) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r--src/i830_batchbuffer.c31
-rw-r--r--src/i830_batchbuffer.h1
-rw-r--r--src/i915_render.c7
3 files changed, 25 insertions, 14 deletions
diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index 2107acbd..d8dc02d4 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -144,6 +144,24 @@ void intel_batch_teardown(ScrnInfoPtr scrn)
}
}
+void intel_batch_do_flush(ScrnInfoPtr scrn)
+{
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+
+ while (!list_is_empty(&intel->flush_pixmaps)) {
+ struct intel_pixmap *entry;
+
+ entry = list_first_entry(&intel->flush_pixmaps,
+ struct intel_pixmap,
+ flush);
+
+ entry->flush_read_domains = entry->flush_write_domain = 0;
+ list_del(&entry->flush);
+ }
+
+ intel->need_mi_flush = FALSE;
+}
+
void intel_batch_emit_flush(ScrnInfoPtr scrn)
{
intel_screen_private *intel = intel_get_screen_private(scrn);
@@ -160,18 +178,7 @@ void intel_batch_emit_flush(ScrnInfoPtr scrn)
OUT_BATCH(MI_FLUSH | flags);
ADVANCE_BATCH();
- while (!list_is_empty(&intel->flush_pixmaps)) {
- struct intel_pixmap *entry;
-
- entry = list_first_entry(&intel->flush_pixmaps,
- struct intel_pixmap,
- flush);
-
- entry->flush_read_domains = entry->flush_write_domain = 0;
- list_del(&entry->flush);
- }
-
- intel->need_mi_flush = FALSE;
+ intel_batch_do_flush(scrn);
}
void intel_batch_submit(ScrnInfoPtr scrn)
diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index 17c223f6..5e09f4dc 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -36,6 +36,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
void intel_batch_init(ScrnInfoPtr scrn);
void intel_batch_teardown(ScrnInfoPtr scrn);
void intel_batch_emit_flush(ScrnInfoPtr scrn);
+void intel_batch_do_flush(ScrnInfoPtr scrn);
void intel_batch_submit(ScrnInfoPtr scrn);
void intel_batch_wait_last(ScrnInfoPtr scrn);
diff --git a/src/i915_render.c b/src/i915_render.c
index caf1b5d8..0fe960a7 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -828,8 +828,11 @@ i915_prepare_composite(int op, PicturePtr source_picture,
intel->i915_render_state.op = op;
- if((source && i830_uxa_pixmap_is_dirty(source)) ||
- (mask && i830_uxa_pixmap_is_dirty(mask)))
+ /* BUF_INFO is an implicit flush */
+ if (dest != intel->render_current_dest)
+ intel_batch_do_flush(scrn);
+ else if((source && i830_uxa_pixmap_is_dirty(source)) ||
+ (mask && i830_uxa_pixmap_is_dirty(mask)))
intel_batch_emit_flush(scrn);
intel->needs_render_state_emit = TRUE;