summaryrefslogtreecommitdiff
path: root/lib/intel_batchbuffer.c
diff options
context:
space:
mode:
authorDominik Grzegorzek <dominik.grzegorzek@intel.com>2020-10-27 10:23:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-11-19 18:50:02 +0000
commit8fd08b167a92531fdc760212e812739422db5854 (patch)
treecbaff8cba22a803142fbc5a9086a591238bb9a18 /lib/intel_batchbuffer.c
parent5bc1047cc8f38a9e0c5a914b6511a639b15a740e (diff)
lib/intel_batchbuffer: add intel_bb_blit_copy wrapper
This patch adds intel_bb_copy_intel_buf to make copying a whole intel_buf easier and more readable. Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Zbigniew KempczyƄski <zbigniew.kempczynski@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/intel_batchbuffer.c')
-rw-r--r--lib/intel_batchbuffer.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 7b4cfb0d..8dd8a502 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -2522,6 +2522,29 @@ void intel_bb_blt_copy(struct intel_bb *ibb,
}
/**
+ * intel_bb_copy_intel_buf:
+ * @batch: batchbuffer object
+ * @src: source buffer (intel_buf)
+ * @dst: destination libdrm buffer object
+ * @size: size of the copy range in bytes
+ *
+ * Emits a copy operation using blitter commands into the supplied batch.
+ * A total of @size bytes from the start of @src is copied
+ * over to @dst. Note that @size must be page-aligned.
+ */
+void intel_bb_copy_intel_buf(struct intel_bb *ibb,
+ struct intel_buf *src, struct intel_buf *dst,
+ long int size)
+{
+ igt_assert(size % 4096 == 0);
+
+ intel_bb_blt_copy(ibb,
+ src, 0, 0, 4096,
+ dst, 0, 0, 4096,
+ 4096/4, size/4096, 32);
+}
+
+/**
* igt_get_huc_copyfunc:
* @devid: pci device id
*