Mesa (master): i965: Add a brw_blorp_copy_buffers() command.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Aug 31 06:46:24 UTC 2017


Module: Mesa
Branch: master
Commit: 225425111fee082e3be14c22c256314b85724ef8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=225425111fee082e3be14c22c256314b85724ef8

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Aug 28 15:57:20 2017 -0700

i965: Add a brw_blorp_copy_buffers() command.

This exposes the new blorp_copy_buffer() functionality to i965.
It should be a drop-in replacement for intel_emit_linear_blit()
(other than the arguments being backwards, for consistency with BLORP).

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/mesa/drivers/dri/i965/brw_blorp.c | 21 +++++++++++++++++++++
 src/mesa/drivers/dri/i965/brw_blorp.h |  8 ++++++++
 2 files changed, 29 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 277ffda4fd..4c6ae36919 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -434,6 +434,27 @@ brw_blorp_copy_miptrees(struct brw_context *brw,
                               dst_aux_usage);
 }
 
+void
+brw_blorp_copy_buffers(struct brw_context *brw,
+                       struct brw_bo *src_bo,
+                       unsigned src_offset,
+                       struct brw_bo *dst_bo,
+                       unsigned dst_offset,
+                       unsigned size)
+{
+   DBG("%s %d bytes from %p[%d] to %p[%d]",
+       __func__, size, src_bo, src_offset, dst_bo, dst_offset);
+
+   struct blorp_batch batch;
+   struct blorp_address src = { .buffer = src_bo, .offset = src_offset };
+   struct blorp_address dst = { .buffer = dst_bo, .offset = dst_offset };
+
+   blorp_batch_init(&brw->blorp, &batch, brw, 0);
+   blorp_buffer_copy(&batch, src, dst, size);
+   blorp_batch_finish(&batch);
+}
+
+
 static struct intel_mipmap_tree *
 find_miptree(GLbitfield buffer_bit, struct intel_renderbuffer *irb)
 {
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h
index c65a68a53d..cf781ec53c 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp.h
@@ -60,6 +60,14 @@ brw_blorp_copy_miptrees(struct brw_context *brw,
                         unsigned src_width, unsigned src_height);
 
 void
+brw_blorp_copy_buffers(struct brw_context *brw,
+                       struct brw_bo *src_bo,
+                       unsigned src_offset,
+                       struct brw_bo *dst_bo,
+                       unsigned dst_offset,
+                       unsigned size);
+
+void
 brw_blorp_clear_color(struct brw_context *brw, struct gl_framebuffer *fb,
                       GLbitfield mask, bool partial_clear, bool encode_srgb);
 void




More information about the mesa-commit mailing list