Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/2] generate_test_batches: Add a MI_LOAD_REGISTER_IMM test batch
Date: Fri, 13 Dec 2013 18:15:47 +0000	[thread overview]
Message-ID: <1386958547-11068-3-git-send-email-damien.lespiau@intel.com> (raw)
In-Reply-To: <1386958547-11068-1-git-send-email-damien.lespiau@intel.com>

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 tests/generate_test_batches.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests/generate_test_batches.c b/tests/generate_test_batches.c
index 997ce37..41f883d 100644
--- a/tests/generate_test_batches.c
+++ b/tests/generate_test_batches.c
@@ -87,6 +87,25 @@ static void emit_mi_flush_dw(struct intel_batchbuffer *batch)
 	batch_finish(batch, "gen8-2d-mi-flush-dw-len-4.batch");
 }
 
+#define MI_LOAD_REGISTER_IMM	(0x22<<23)
+
+/*
+ * Make sure we correctly print out addresses when the address field only
+ * specificies a number of bits (eg. 22:3). The value to decode is then:
+ *   val << 3
+ * and not just the raw field value.
+ */
+static void emit_mi_load_register_imm(struct intel_batchbuffer *batch)
+{
+	batch_start(batch);
+
+	OUT_BATCH(MI_LOAD_REGISTER_IMM | (3-2));
+	OUT_BATCH(0x0000227c);
+	OUT_BATCH(0);
+
+	batch_finish(batch, "gen8-3d-partial-addresses.batch");
+}
+
 static struct gen_batches {
 	int drm_fd;
 	uint32_t devid;
@@ -106,4 +125,5 @@ int main(int argc, char **argv)
 	igt_assert(batch);
 
 	emit_mi_flush_dw(batch);
+	emit_mi_load_register_imm(batch);
 }
-- 
1.8.3.1

  parent reply	other threads:[~2013-12-13 18:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13 18:15 Generate raw batches for unit testing the decoder Damien Lespiau
2013-12-13 18:15 ` [PATCH 1/2] tests: Add a helper to generate raw batches Damien Lespiau
2013-12-13 18:15 ` Damien Lespiau [this message]
2013-12-16 10:53 ` Generate raw batches for unit testing the decoder Damien Lespiau

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=1386958547-11068-3-git-send-email-damien.lespiau@intel.com \
    --to=damien.lespiau@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox