All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff McGee <jeff.mcgee@intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/3] tests/pm_rps: simplify load helper setup
Date: Fri, 14 Mar 2014 09:34:06 -0500	[thread overview]
Message-ID: <20140314143406.GB5686@jeffdesk> (raw)
In-Reply-To: <1394789268-28703-2-git-send-email-daniel.vetter@ffwll.ch>

On Fri, Mar 14, 2014 at 10:27:47AM +0100, Daniel Vetter wrote:
> 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
> 

My intent here was to allow a subtest which doesn't require the load helper to
run and pass even if the loader helper failed to initialize for whatever
reason. I'm fine if we'd rather avoid the complexity, but can we state that
decision more clearly in the commit message for future reference?
-Jeff

  reply	other threads:[~2014-03-14 14:27 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 ` [PATCH 2/3] tests/pm_rps: simplify load helper setup Daniel Vetter
2014-03-14 14:34   ` Jeff McGee [this message]
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=20140314143406.GB5686@jeffdesk \
    --to=jeff.mcgee@intel.com \
    --cc=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 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.