All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: petri.latvala@intel.com, igt-dev@lists.freedesktop.org,
	badal.nilawar@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t v3 8/8] i915_pm_rpm: Extend gem-mmap-type test with D3Cold
Date: Wed, 4 May 2022 13:55:38 -0400	[thread overview]
Message-ID: <YnK+Guf0oyqHnPAX@intel.com> (raw)
In-Reply-To: <20220504135900.13806-9-anshuman.gupta@intel.com>

On Wed, May 04, 2022 at 07:29:00PM +0530, Anshuman Gupta wrote:
> Added d3cold dynamic subtest to gem-mmap-type with device class
> memory region. It test both D3Cold-{VRAM_SR, Off} by using
> d3cold_sr_lmem_threshold i915_params debugfs.
> 
> v2:
> - Two different subtest d3cold-off and d3cold-vrsr. [Rodrigo]
> v3:
> - Skip the d3cold-vram-sr test when lmem_threshold is not available.
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  tests/i915/i915_pm_rpm.c | 41 ++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 39 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
> index a062fde88..3a4e2901b 100644
> --- a/tests/i915/i915_pm_rpm.c
> +++ b/tests/i915/i915_pm_rpm.c
> @@ -1129,11 +1129,12 @@ static struct pci_device *setup_d3cold_and_get_root_port(void)
>  }
>  
>  static void gem_mmap_args(const struct mmap_offset *t,
> -			  struct drm_i915_gem_memory_class_instance *mem_regions)
> +			  struct drm_i915_gem_memory_class_instance *mem_regions, bool d3cold)
>  {
>  	int i;
>  	uint32_t handle;
>  	int buf_size = 8192;
> +	struct pci_device *root;
>  	uint8_t *gem_buf;
>  
>  	/* Create, map and set data while the device is active. */
> @@ -1151,17 +1152,29 @@ static void gem_mmap_args(const struct mmap_offset *t,
>  	for (i = 0; i < buf_size; i++)
>  		igt_assert(gem_buf[i] == (i & 0xFF));
>  
> +	if (d3cold)
> +		root = setup_d3cold_and_get_root_port();
> +
>  	/* Now suspend, read and modify. */
>  	disable_all_screens_and_wait(&ms_data);
>  
> +	if (d3cold)
> +		igt_assert(wait_for_d3cold(root));
> +
>  	for (i = 0; i < buf_size; i++)
>  		igt_assert(gem_buf[i] == (i & 0xFF));
>  	igt_assert(wait_for_suspended());
>  
> +	if (d3cold)
> +		igt_assert(wait_for_d3cold(root));
> +
>  	for (i = 0; i < buf_size; i++)
>  		gem_buf[i] = (~i & 0xFF);
>  	igt_assert(wait_for_suspended());
>  
> +	if (d3cold)
> +		igt_assert(wait_for_d3cold(root));
> +
>  	/* Now resume and see if it's still there. */
>  	enable_one_screen_and_wait(&ms_data);
>  	for (i = 0; i < buf_size; i++)
> @@ -1173,12 +1186,18 @@ static void gem_mmap_args(const struct mmap_offset *t,
>  	 * suspended. */
>  	disable_all_screens_and_wait(&ms_data);
>  
> +	if (d3cold)
> +		igt_assert(wait_for_d3cold(root));
> +
>  	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());
>  
> +	if (d3cold)
> +		igt_assert(wait_for_d3cold(root));
> +
>  	for (i = 0; i < buf_size; i++)
>  		gem_buf[i] = i & 0xFF;
>  
> @@ -1187,6 +1206,9 @@ static void gem_mmap_args(const struct mmap_offset *t,
>  
>  	igt_assert(wait_for_suspended());
>  
> +	if (d3cold)
> +		igt_assert(wait_for_d3cold(root));
> +
>  	/* Resume and check if it's still there. */
>  	enable_one_screen_and_wait(&ms_data);
>  	for (i = 0; i < buf_size; i++)
> @@ -2186,7 +2208,22 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
>  		for_each_mmap_offset_type(drm_fd, t) {
>  			for_each_memory_region(r, drm_fd) {
>  				igt_dynamic_f("%s-%s", t->name, r->name)
> -				gem_mmap_args(t, &r->ci);
> +				gem_mmap_args(t, &r->ci, false);
> +
> +				if (r->ci.memory_class == I915_MEMORY_CLASS_SYSTEM)
> +					continue;
> +
> +				igt_dynamic_f("%s-%s-%s", t->name, "d3cold-off", r->name) {
> +					if (lmem_threshold >= 0)
> +						set_d3cold_sr_lmem_threshold(debugfs, 300);
> +					gem_mmap_args(t, &r->ci, true);
> +				}
> +
> +				igt_dynamic_f("%s-%s-%s", t->name, "d3cold-vrsr", r->name) {
> +					igt_require(lmem_threshold >= 0);
> +					set_d3cold_sr_lmem_threshold(debugfs, 0);
> +					gem_mmap_args(t, &r->ci, true);
> +				}
>  			}
>  		}
>  	}
> -- 
> 2.26.2
> 

  reply	other threads:[~2022-05-04 17:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 13:58 [igt-dev] [PATCH i-g-t v3 0/8] D3Cold Tool & IGT Anshuman Gupta
2022-05-04 13:58 ` [igt-dev] [PATCH i-g-t v3 1/8] test/i915_pm_rpm: Add placement to gem-{mmap-type, execbuf} Anshuman Gupta
2022-05-04 13:58 ` [igt-dev] [PATCH i-g-t v3 2/8] lib/igt_device: Get gfx PCI card root port Anshuman Gupta
2022-05-04 13:58 ` [igt-dev] [PATCH i-g-t v3 3/8] lib/igt_pm: D3Cold runtime pm infrastructure Anshuman Gupta
2022-05-04 18:05   ` Rodrigo Vivi
2022-05-04 13:58 ` [igt-dev] [PATCH i-g-t v3 4/8] tools: Add intel_pm_rpm tool Anshuman Gupta
2022-05-04 13:58 ` [igt-dev] [PATCH i-g-t v3 5/8] i915_pm_rpm: Add D3Cold basic subtest Anshuman Gupta
2022-05-04 13:58 ` [igt-dev] [PATCH i-g-t v3 6/8] i915_pm_rpm: Extend gem_exec_stress test with D3Cold Anshuman Gupta
2022-05-04 17:54   ` Rodrigo Vivi
2022-05-04 13:58 ` [igt-dev] [PATCH i-g-t v3 7/8] i915_pm_rpm: Extend gem_execbuf " Anshuman Gupta
2022-05-04 17:54   ` Rodrigo Vivi
2022-05-04 13:59 ` [igt-dev] [PATCH i-g-t v3 8/8] i915_pm_rpm: Extend gem-mmap-type " Anshuman Gupta
2022-05-04 17:55   ` Rodrigo Vivi [this message]
2022-05-04 14:58 ` [igt-dev] ✗ Fi.CI.BAT: failure for D3Cold Tool & IGT (rev3) 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=YnK+Guf0oyqHnPAX@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@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 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.