Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 2/3] tests/pm_rps: simplify load helper setup
Date: Fri, 14 Mar 2014 10:27:47 +0100	[thread overview]
Message-ID: <1394789268-28703-2-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1394789268-28703-1-git-send-email-daniel.vetter@ffwll.ch>

There's no need to be fancy here.

Cc: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/pm_rps.c | 33 +++++++--------------------------
 1 file changed, 7 insertions(+), 26 deletions(-)

diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index b1cd13fc33a7..fc6bac647f4a 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -153,7 +153,6 @@ static struct load_helper {
 	drm_intel_bufmgr *bufmgr;
 	struct intel_batchbuffer *batch;
 	drm_intel_bo *target_buffer;
-	bool ready;
 	enum load load;
 	bool exit;
 	struct igt_helper_process igt_proc;
@@ -218,8 +217,6 @@ static void load_helper_run(enum load load)
 		return;
 	}
 
-	igt_require(lh.ready == true);
-
 	lh.load = load;
 
 	igt_fork_helper(&lh.igt_proc) {
@@ -253,42 +250,26 @@ static void load_helper_stop(void)
 	igt_wait_helper(&lh.igt_proc);
 }
 
-/* The load helper resource is used by only some subtests. We attempt to
- * initialize in igt_fixture but do our igt_require check only if a
- * subtest attempts to run it */
 static void load_helper_init(void)
 {
 	lh.devid = intel_get_drm_devid(drm_fd);
 	lh.has_ppgtt = gem_uses_aliasing_ppgtt(drm_fd);
 
 	/* MI_STORE_DATA can only use GTT address on gen4+/g33 and needs
-	 * snoopable mem on pre-gen6. */
-	if (intel_gen(lh.devid) < 6) {
-		igt_debug("load helper init failed: pre-gen6 not supported\n");
-		return;
-	}
-
+	 * snoopable mem on pre-gen6. Hence load-helper only works on gen6+, but
+	 * that's also all we care about for the rps testcase*/
+	igt_assert(intel_gen(lh.devid) >= 6);
 	lh.bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
-	if (!lh.bufmgr) {
-		igt_debug("load helper init failed: buffer manager init\n");
-		return;
-	}
+	igt_assert(lh.bufmgr);
+
 	drm_intel_bufmgr_gem_enable_reuse(lh.bufmgr);
 
 	lh.batch = intel_batchbuffer_alloc(lh.bufmgr, lh.devid);
-	if (!lh.batch) {
-		igt_debug("load helper init failed: batch buffer alloc\n");
-		return;
-	}
+	igt_assert(lh.batch);
 
 	lh.target_buffer = drm_intel_bo_alloc(lh.bufmgr, "target bo",
 					      4096, 4096);
-	if (!lh.target_buffer) {
-		igt_debug("load helper init failed: target buffer alloc\n");
-		return;
-	}
-
-	lh.ready = true;
+	igt_assert(lh.target_buffer);
 }
 
 static void load_helper_deinit(void)
-- 
1.8.4.rc3

  reply	other threads:[~2014-03-14  9:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14  9:27 [PATCH 1/3] tests/pm_rps: ducttape for igt fork helper cleanup issues Daniel Vetter
2014-03-14  9:27 ` Daniel Vetter [this message]
2014-03-14 14:34   ` [PATCH 2/3] tests/pm_rps: simplify load helper setup Jeff McGee
2014-03-14 15:31     ` Daniel Vetter
2014-03-14  9:27 ` [PATCH 3/3] tests/pm_rps: load harder Daniel Vetter
2014-03-14 14:41   ` Jeff McGee
2014-03-14 15:47     ` Daniel Vetter
2014-03-14 14:29 ` [PATCH 1/3] tests/pm_rps: ducttape for igt fork helper cleanup issues Jeff McGee
2014-03-14 15:34   ` Daniel Vetter

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=1394789268-28703-2-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --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