All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/3] tests/gem_exec_parse: add a register write mask
Date: Fri, 18 May 2018 18:10:41 +0100	[thread overview]
Message-ID: <20180518171043.4438-2-lionel.g.landwerlin@intel.com> (raw)
In-Reply-To: <20180518171043.4438-1-lionel.g.landwerlin@intel.com>

Some register are masked (meaning the 16bits are dedicated to identify
which of the other 16bits have to be taken into account by the
hardware). This change adds the mask to the write but doesn't take it
into account in the value comparison assert.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 tests/gem_exec_parse.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c
index b653b1bd..c37c056e 100644
--- a/tests/gem_exec_parse.c
+++ b/tests/gem_exec_parse.c
@@ -261,6 +261,7 @@ struct test_lri {
 	const char *name; /* register name for debug info */
 	uint32_t reg; /* address to test */
 	uint32_t read_mask; /* ignore things like HW status bits */
+	uint32_t write_mask; /* mask to write the register with */
 	uint32_t init_val; /* initial identifiable value to set without LRI */
 	uint32_t test_val; /* value to attempt loading via LRI command */
 	bool whitelisted; /* expect to become NOOP / fail if not whitelisted */
@@ -273,7 +274,7 @@ test_lri(int fd, uint32_t handle, struct test_lri *test)
 	uint32_t lri[] = {
 		MI_LOAD_REGISTER_IMM,
 		test->reg,
-		test->test_val,
+		test->test_val | test->write_mask,
 		MI_BATCH_BUFFER_END,
 	};
 	int bad_lri_errno = parser_version >= 8 ? 0 : -EINVAL;
@@ -284,7 +285,8 @@ test_lri(int fd, uint32_t handle, struct test_lri *test)
 		  test->name, test->reg, test->test_val,
 		  expected_errno, expect);
 
-	intel_register_write(test->reg, test->init_val);
+	intel_register_write(test->reg,
+			     test->init_val | test->write_mask);
 
 	igt_assert_eq_u32((intel_register_read(test->reg) &
 			   test->read_mask),
@@ -498,14 +500,16 @@ igt_main
 	}
 
 	igt_subtest_group {
-#define REG(R, MSK, INI, V, OK, MIN_V) { #R, R, MSK, INI, V, OK, MIN_V }
+#define REG(R, RMSK, WMSK, INI, V, OK, MIN_V) { #R, R, RMSK, WMSK, INI, V, OK, MIN_V }
 		struct test_lri lris[] = {
 			/* dummy head pointer */
 			REG(OASTATUS2,
-			    0xffffff80, 0xdeadf000, 0xbeeff000, false, 0),
+			    0xffffff80, 0x00000000,
+			    0xdeadf000, 0xbeeff000, false, 0),
 			/* NB: [1:0] MBZ */
 			REG(SO_WRITE_OFFSET_0,
-			    0xfffffffc, 0xabcdabc0, 0xbeefbee0, true, 0),
+			    0xfffffffc, 0x00000000,
+			    0xabcdabc0, 0xbeefbee0, true, 0),
 
 			/* It's really important for us to check that
 			 * an LRI to OACONTROL doesn't result in an
@@ -521,7 +525,8 @@ igt_main
 			 * while leaving the OA unit disabled
 			 */
 			REG(OACONTROL,
-			    0xfffff000, 0xfeed0000, 0x31337000, false, 9)
+			    0xfffff000, 0x00000000,
+			    0xfeed0000, 0x31337000, false, 9),
 		};
 #undef REG
 
-- 
2.17.0

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

  reply	other threads:[~2018-05-18 17:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 17:10 [igt-dev] [PATCH i-g-t 0/3] intel/gem: test the partial whitelisting of the INSTPM register Lionel Landwerlin
2018-05-18 17:10 ` Lionel Landwerlin [this message]
2018-05-18 17:15   ` [igt-dev] [PATCH i-g-t 1/3] tests/gem_exec_parse: add a register write mask Chris Wilson
2018-05-18 17:10 ` [igt-dev] [PATCH i-g-t 2/3] tests/gem_exec_parse: verify that we allow LRI on INSTPM Lionel Landwerlin
2018-05-18 17:20   ` Chris Wilson
2018-05-18 17:10 ` [igt-dev] [PATCH i-g-t 3/3] test/gem_ctx_isolation: verify INSTPM isolation on Gen7+ Lionel Landwerlin
2018-05-18 17:14   ` Chris Wilson
2018-05-18 17:15     ` Lionel Landwerlin
2018-05-18 18:14 ` [igt-dev] ✓ Fi.CI.BAT: success for intel/gem: test the partial whitelisting of the INSTPM register Patchwork
2018-05-19  3:40 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20180518171043.4438-2-lionel.g.landwerlin@intel.com \
    --to=lionel.g.landwerlin@intel.com \
    --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.