igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [igt-dev] [PATCH i-g-t v3] Follow kernel's resource streamer removal
Date: Tue, 31 Jul 2018 16:53:06 -0700	[thread overview]
Message-ID: <20180731235306.22786-1-lucas.demarchi@intel.com> (raw)
In-Reply-To: <153202837161.4229.6874421809295761690@skylake-alporthouse-com>

Resource streamer is being removed from all GENs, so rewrite the tests
so to loop over all engines and set the expected return in case the platform has
resource streamer.  This makes it compatible with both old and new
kernels (thanks Chris).

v2: let one test per ring rather than just one test
v3: check what the kernel returns for
    I915_HAS_RESOURCE_STREAMER to decide what we expect as return value
    from the the batch submission (suggested by Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 tests/gem_exec_params.c | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c
index 04c21c05..49c56a8d 100644
--- a/tests/gem_exec_params.c
+++ b/tests/gem_exec_params.c
@@ -87,6 +87,17 @@ static bool has_exec_batch_first(int fd)
 	return val > 0;
 }
 
+static bool has_resource_streamer(int fd)
+{
+	int val = -1;
+	struct drm_i915_getparam gp = {
+		.param = I915_PARAM_HAS_RESOURCE_STREAMER,
+		.value = &val,
+	};
+	ioctl(fd, DRM_IOCTL_I915_GETPARAM , &gp);
+	return val > 0;
+}
+
 static void test_batch_first(int fd)
 {
 	const int gen = intel_gen(intel_get_drm_devid(fd));
@@ -374,28 +385,18 @@ igt_main
 		execbuf.num_cliprects = 0;
 	}
 
-	igt_subtest("rs-invalid-on-bsd-ring") {
-		igt_require(IS_HASWELL(devid) || intel_gen(devid) >= 8);
-		execbuf.flags = I915_EXEC_BSD | LOCAL_I915_EXEC_RESOURCE_STREAMER;
-		RUN_FAIL(EINVAL);
-	}
-
-	igt_subtest("rs-invalid-on-blt-ring") {
-		igt_require(IS_HASWELL(devid) || intel_gen(devid) >= 8);
-		execbuf.flags = I915_EXEC_BLT | LOCAL_I915_EXEC_RESOURCE_STREAMER;
-		RUN_FAIL(EINVAL);
-	}
+	igt_subtest("rs-invalid") {
+		bool has_rs = has_resource_streamer(fd);
+		unsigned int engine;
 
-	igt_subtest("rs-invalid-on-vebox-ring") {
-		igt_require(IS_HASWELL(devid) || intel_gen(devid) >= 8);
-		execbuf.flags = I915_EXEC_VEBOX | LOCAL_I915_EXEC_RESOURCE_STREAMER;
-		RUN_FAIL(EINVAL);
-	}
+		for_each_engine(fd, engine) {
+			int expect = -EINVAL;
+			if (has_rs && (engine == 0 || engine == I915_EXEC_RENDER))
+				expect = 0;
 
-	igt_subtest("rs-invalid-gen") {
-		igt_require(!IS_HASWELL(devid) && intel_gen(devid) < 8);
-		execbuf.flags = I915_EXEC_RENDER | LOCAL_I915_EXEC_RESOURCE_STREAMER;
-		RUN_FAIL(EINVAL);
+			execbuf.flags = engine | LOCAL_I915_EXEC_RESOURCE_STREAMER;
+			igt_assert_eq(__gem_execbuf(fd, &execbuf), expect);
+		}
 	}
 
 	igt_subtest("invalid-fence-in") {
-- 
2.17.1

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

  parent reply	other threads:[~2018-07-31 23:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-12 20:51 [igt-dev] [PATCH i-g-t] Remove resource streamer tests Lucas De Marchi
2018-07-12 21:15 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-07-13  0:07 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-07-13  8:53 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2018-07-19 19:16   ` [igt-dev] [PATCH i-g-t v2] Follow kernel's resource streamer removal Lucas De Marchi
2018-07-19 19:26     ` Chris Wilson
2018-07-23 21:15       ` Lucas De Marchi
2018-07-23 21:17         ` Lucas De Marchi
2018-07-24  9:50         ` Chris Wilson
2018-07-31 23:53       ` Lucas De Marchi [this message]
2018-08-01  8:53         ` [igt-dev] [PATCH i-g-t v3] " Chris Wilson
2018-08-02  5:03           ` Rodrigo Vivi
2018-07-19 19:51     ` [igt-dev] [PATCH i-g-t v2] " Rodrigo Vivi
2018-07-19 20:04       ` Chris Wilson
2018-07-19 20:40         ` Rodrigo Vivi
2018-07-19 19:57 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove resource streamer tests (rev2) Patchwork
2018-07-20  1:27 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-08-01  0:38 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove resource streamer tests (rev3) Patchwork
2018-08-01  1:56 ` [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=20180731235306.22786-1-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).