All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Subject: [igt-dev] [PATCH i-g-t v3 01/15] lib/intel_batchbuffer: add intel_bb_blit_copy wrapper
Date: Fri,  2 Oct 2020 08:54:28 +0200	[thread overview]
Message-ID: <20201002065442.30037-2-dominik.grzegorzek@intel.com> (raw)
In-Reply-To: <20201002065442.30037-1-dominik.grzegorzek@intel.com>

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>
---
 lib/intel_batchbuffer.c | 23 +++++++++++++++++++++++
 lib/intel_batchbuffer.h |  3 +++
 2 files changed, 26 insertions(+)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 60dbfe26..d810e10e 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -2521,6 +2521,29 @@ void intel_bb_blt_copy(struct intel_bb *ibb,
 	intel_bb_flush_blit(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
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index d20b4e66..dd401d89 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -646,6 +646,9 @@ void intel_bb_blt_copy(struct intel_bb *ibb,
 		       struct intel_buf *dst,
 		       int dst_x1, int dst_y1, int dst_pitch,
 		       int width, int height, int bpp);
+void intel_bb_copy_intel_buf(struct intel_bb *ibb,
+			     struct intel_buf *dst, struct intel_buf *src,
+			     long int size);
 
 /**
  * igt_huc_copyfunc_t:
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-10-02  6:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02  6:54 [igt-dev] [PATCH i-g-t v3 00/15] tests: Remove libdrm dependency Dominik Grzegorzek
2020-10-02  6:54 ` Dominik Grzegorzek [this message]
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 02/15] Remove unused intel_bufmgr.h headers Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 03/15] i915/gem_pwrite_snooped: Remove libdrm dependency Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 04/15] i915/gem_pread_after_blit.c: " Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 05/15] i915/gem_threaded_access_tiled.c: " Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 06/15] i915/gem_tiled_blits: " Dominik Grzegorzek
2020-10-23  8:19   ` Zbigniew Kempczyński
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 07/15] i915/gem_unfence_active_buffers.c: Remove librdm dependency Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 08/15] i915/gem_unref_active_buffers.c: Remove libdrm dependency Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 09/15] i915/gem_tiled_partial_pwrite_pread: " Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 10/15] i915/gem_set_tiling_vs_blit.c: " Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 11/15] tests/kms_fence_pin_leak.c: " Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 12/15] tests/kms_flip.c: " Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 13/15] tests/kms_psr2_su.c: Get rid of unused bufmgr Dominik Grzegorzek
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 14/15] tests/i915/gem_ppgtt: make copying more readable Dominik Grzegorzek
2020-10-23  8:23   ` Zbigniew Kempczyński
2020-10-02  6:54 ` [igt-dev] [PATCH i-g-t v3 15/15] HAX: don't run failing test in BAT Dominik Grzegorzek
2020-10-02  7:37 ` [igt-dev] ✓ Fi.CI.BAT: success for tests: Remove libdrm dependency (rev3) Patchwork
2020-10-02  8:35 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-10-02 10:27   ` Grzegorzek, Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201002065442.30037-2-dominik.grzegorzek@intel.com \
    --to=dominik.grzegorzek@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.