All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Koskipaa <antti.koskipaa@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 1/3] gem_render_copy: Make render_copyfunc more generic
Date: Mon,  5 Oct 2015 14:42:23 +0300	[thread overview]
Message-ID: <1444045345-17587-2-git-send-email-antti.koskipaa@linux.intel.com> (raw)
In-Reply-To: <1444045345-17587-1-git-send-email-antti.koskipaa@linux.intel.com>

This will allow adding more tests that use this function without excessive
copying and pasting.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
---
 lib/rendercopy_gen8.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/lib/rendercopy_gen8.c b/lib/rendercopy_gen8.c
index a7fc2c4..4a9a283 100644
--- a/lib/rendercopy_gen8.c
+++ b/lib/rendercopy_gen8.c
@@ -49,7 +49,7 @@ struct {
 } viewport;
 
 /* see shaders/ps/blit.g7a */
-static const uint32_t ps_kernel[][4] = {
+static const uint32_t ps_kernel_copy[][4] = {
 #if 1
    { 0x0060005a, 0x21403ae8, 0x3a0000c0, 0x008d0040 },
    { 0x0060005a, 0x21603ae8, 0x3a0000c0, 0x008d0080 },
@@ -920,11 +920,12 @@ static void gen8_emit_primitive(struct intel_batchbuffer *batch, uint32_t offset
 
 #define BATCH_STATE_SPLIT 2048
 
-void gen8_render_copyfunc(struct intel_batchbuffer *batch,
+static void _gen8_render_func(struct intel_batchbuffer *batch,
 			  drm_intel_context *context,
 			  struct igt_buf *src, unsigned src_x, unsigned src_y,
 			  unsigned width, unsigned height,
-			  struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
+			  struct igt_buf *dst, unsigned dst_x, unsigned dst_y,
+			  const uint32_t ps_kernel[][4], int kernel_size)
 {
 	struct annotations_context aub_annotations;
 	uint32_t ps_sampler_state, ps_kernel_off, ps_binding_table;
@@ -944,7 +945,7 @@ void gen8_render_copyfunc(struct intel_batchbuffer *batch,
 					       src, dst);
 	ps_sampler_state  = gen8_create_sampler(batch, &aub_annotations);
 	ps_kernel_off = gen8_fill_ps(batch, &aub_annotations,
-				     ps_kernel, sizeof(ps_kernel));
+				     ps_kernel, kernel_size);
 	vertex_buffer = gen7_fill_vertex_buffer_data(batch, &aub_annotations,
 						     src,
 						     src_x, src_y,
@@ -1030,3 +1031,13 @@ void gen8_render_copyfunc(struct intel_batchbuffer *batch,
 	gen6_render_flush(batch, context, batch_end);
 	intel_batchbuffer_reset(batch);
 }
+
+void gen8_render_copyfunc(struct intel_batchbuffer *batch,
+				 drm_intel_context *context,
+				 struct igt_buf *src, unsigned src_x, unsigned src_y,
+				 unsigned width, unsigned height,
+				 struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
+{
+	_gen8_render_func(batch, context, src, src_x, src_y, width, height,
+			  dst, dst_x, dst_y, ps_kernel_copy, sizeof(ps_kernel_copy));
+}
-- 
2.3.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-10-05 11:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 11:42 [PATCH i-g-t 0/3] Memory bandwidth tester Antti Koskipaa
2015-10-05 11:42 ` Antti Koskipaa [this message]
2015-10-05 11:42 ` [PATCH i-g-t 2/3] gem_render_copy: Add functions for performance testing Antti Koskipaa
2015-10-05 11:42 ` [PATCH i-g-t 3/3] gem_memory_bandwidth: Add test Antti Koskipaa
2015-10-06  9:00   ` Daniel Vetter
2015-10-06  9:25   ` Chris Wilson

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=1444045345-17587-2-git-send-email-antti.koskipaa@linux.intel.com \
    --to=antti.koskipaa@linux.intel.com \
    --cc=intel-gfx@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.