All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: igt-dev <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/i915_pm_rpm: mmap type based dynamic subtests
Date: Mon, 17 Feb 2020 15:14:42 +0530	[thread overview]
Message-ID: <20200217094442.GA6572@intel.com> (raw)
In-Reply-To: <20200217094045.6788-1-ramalingam.c@intel.com>

On 2020-02-17 at 15:10:45 +0530, Ramalingam C wrote:
> Tests for gem_mmap_gtt/cpu are replaced with dynamic subtests with
> the array of mmap_types passed to gem_mmap_offset.
> 
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/i915/i915_pm_rpm.c | 34 ++++++++++++++--------------------
>  1 file changed, 14 insertions(+), 20 deletions(-)
> 
> diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
> index 3d7343240802..0c2821122956 100644
> --- a/tests/i915/i915_pm_rpm.c
> +++ b/tests/i915/i915_pm_rpm.c
> @@ -1007,7 +1007,7 @@ static void debugfs_forcewake_user_subtest(void)
>  	igt_assert(wait_for_suspended());
>  }
>  
> -static void gem_mmap_subtest(bool gtt_mmap)
> +static void gem_mmap_args(const struct mmap_offset *t)
>  {
>  	int i;
>  	uint32_t handle;
> @@ -1019,14 +1019,9 @@ static void gem_mmap_subtest(bool gtt_mmap)
>  
>  	handle = gem_create(drm_fd, buf_size);
>  
> -	if (gtt_mmap) {
> -		gem_buf = gem_mmap__gtt(drm_fd, handle, buf_size,
> -					PROT_READ | PROT_WRITE);
> -	}
> -	else {
> -		gem_buf = gem_mmap__cpu(drm_fd, handle, 0, buf_size, 0);
> -	}
> -
> +	gem_buf = __gem_mmap_offset(drm_fd, handle, 0, buf_size,
> +				    PROT_READ | PROT_WRITE, t->type);
> +	igt_require(gem_buf);
>  
>  	for (i = 0; i < buf_size; i++)
>  		gem_buf[i] = i & 0xFF;
> @@ -1056,13 +1051,9 @@ static void gem_mmap_subtest(bool gtt_mmap)
>  	 * suspended. */
>  	disable_all_screens_and_wait(&ms_data);
>  
> -	if (gtt_mmap) {
> -		gem_buf = gem_mmap__gtt(drm_fd, handle, buf_size,
> -					PROT_READ | PROT_WRITE);
> -	}
> -	else {
> -		gem_buf = gem_mmap__cpu(drm_fd, handle, 0, buf_size, 0);
> -	}
> +	gem_buf = __gem_mmap_offset(drm_fd, handle, 0, buf_size,
> +				    PROT_READ | PROT_WRITE, t->type);
> +	igt_require(gem_buf);
>  
>  	igt_assert(wait_for_suspended());
>  
> @@ -2014,10 +2005,13 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
>  		modeset_subtest(SCREEN_TYPE_NON_LPSP, 1, WAIT_STATUS | USE_DPMS);
>  
>  	/* GEM */
> -	igt_subtest("gem-mmap-cpu")
> -		gem_mmap_subtest(false);
> -	igt_subtest("gem-mmap-gtt")
> -		gem_mmap_subtest(true);
> +	igt_subtest_with_dynamic("gem-mmap-type") {
> +		for_each_mmap_offset_type(t) {
> +			igt_dynamic_f("%s", t->name)
> +				gem_mmap_args(t);
> +		}
> +	}
Chris,

This is what you suggested I guess. But what is the mmap_offset is not
supported? shouldn't we have the legacy tests in such scenario?

Lmem specific tests are not added yet. We will add it in separate
patches.

-Ram
> +
>  	igt_subtest("gem-pread")
>  		gem_pread_subtest();
>  	igt_subtest("gem-execbuf")
> -- 
> 2.20.1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-02-17  9:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 13:45 [igt-dev] [PATCH i-g-t v2 1/2] tests/intel_dp_compliance: use device coherent mapping instead of mmap_gtt Ramalingam C
2020-02-07 13:45 ` [igt-dev] [PATCH i-g-t v2 2/2] tests/i915_pm_rpm: " Ramalingam C
2020-02-07 14:44   ` Chris Wilson
2020-02-10  5:47     ` Ramalingam C
2020-02-10  6:36       ` Dixit, Ashutosh
2020-02-17  9:40   ` [igt-dev] [PATCH i-g-t] tests/i915_pm_rpm: mmap type based dynamic subtests Ramalingam C
2020-02-17  9:44     ` Ramalingam C [this message]
2020-02-18  7:45       ` Chris Wilson
2020-02-18  9:07         ` C, Ramalingam
2020-02-18 10:59           ` Chris Wilson
2020-02-18 11:45     ` Chris Wilson
2020-03-10  3:27   ` [igt-dev] [PATCH i-g-t v2 2/2] tests/i915_pm_rpm: use device coherent mapping instead of mmap_gtt Dixit, Ashutosh
2020-02-07 15:05 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/2] tests/intel_dp_compliance: " Patchwork
2020-02-08  3:27 ` [igt-dev] [PATCH i-g-t v2 1/2] " Dixit, Ashutosh
2020-02-10 15:32 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,v2,1/2] " Patchwork
2020-02-17 11:25 ` [igt-dev] ✗ GitLab.Pipeline: failure for series starting with [i-g-t,v2,1/2] tests/intel_dp_compliance: use device coherent mapping instead of mmap_gtt (rev2) Patchwork
2020-02-17 14:19 ` [igt-dev] ✓ Fi.CI.BAT: success " 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=20200217094442.GA6572@intel.com \
    --to=ramalingam.c@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.