public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: igt-dev <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t 7/9] tests/i915_pm_rpm: use device coherent mapping instead of mmap_gtt
Date: Fri, 7 Feb 2020 18:29:23 +0530	[thread overview]
Message-ID: <20200207125923.GA11460@intel.com> (raw)
In-Reply-To: <87v9olyjkp.wl-ashutosh.dixit@intel.com>

On 2020-02-04 at 16:16:38 -0800, Dixit, Ashutosh wrote:
> On Fri, 31 Jan 2020 09:31:07 -0800, Ramalingam C wrote:
> >
> > Since on new discrete GPUs we dont have the mappable aperture, if that
> > is acceptable for the test purpose, we should use GEM_MMAP_OFFSET.
> > Hence using gem_mmap_device_coherent() which wraps the mmap options in
> > the order of gem_mmap_offset / gem_mmap / mmap_gtt
> >
> > Incase of fencing/gtt related tests, we mandate the existance of the
> > mmap_gtt.
> >
> > Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> > ---
> >  tests/i915/i915_pm_rpm.c | 24 +++++++++++++++---------
> >  1 file changed, 15 insertions(+), 9 deletions(-)
> >
> > diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
> > index f5f813c3d952..9524d7d3a4dd 100644
> > --- a/tests/i915/i915_pm_rpm.c
> > +++ b/tests/i915/i915_pm_rpm.c
> > @@ -1392,8 +1392,8 @@ static void gem_evict_pwrite_subtest(void)
> >
> >	for (n = 0; n < num_trash_bos; n++) {
> >		trash_bos[n].handle = gem_create(drm_fd, 1024*1024);
> > -		trash_bos[n].ptr = gem_mmap__gtt(drm_fd, trash_bos[n].handle,
> > -						 1024*1024, PROT_WRITE);
> > +		trash_bos[n].ptr = gem_mmap__device_coherent(drm_fd, trash_bos[n].handle,
> > +							     0, 1024*1024, PROT_WRITE);
> >		*trash_bos[n].ptr = 0;
> >	}
> 
> What does gem_mappable_aperture_size() just above return when we don't have
> a mappable aperture? Maybe this also needs to be skipped instead?
Actually the tests are skipped because igt_pm_dmc_loaded(debugfs) is
failing at setup_environment. So all gtt related cases are hidden. But
yes this has to be skipped as aperture size is used or rewritten for
display. For now I am choosing the skipping path.
> 
> > @@ -1535,7 +1535,7 @@ static void fill_igt_fb(struct igt_fb *fb, uint32_t color)
> >	int i;
> >	uint32_t *ptr;
> >
> > -	ptr = gem_mmap__gtt(drm_fd, fb->gem_handle, fb->size, PROT_WRITE);
> > +	ptr = gem_mmap__device_coherent(drm_fd, fb->gem_handle, 0, fb->size, PROT_WRITE);
> >	for (i = 0; i < fb->size/sizeof(uint32_t); i++)
> >		ptr[i] = color;
> >	igt_assert(munmap(ptr, fb->size) == 0);
> 
> Even though fill_igt_fb() is called with tiling set, I think it is still ok
> to do this since all we are doing is filling a solid color for which tiling
> is immaterial.
> 
> > @@ -1827,8 +1827,8 @@ static void pm_test_tiling(void)
> >		for (j = 0, k = 1 << off_bit;
> >		     k <= gtt_obj_max_size; k <<= 1, j++) {
> >			handles[j] = gem_create(drm_fd, k);
> > -			gem_bufs[j] = gem_mmap__gtt(drm_fd, handles[j],
> > -						    k, PROT_WRITE);
> > +			gem_bufs[j] = gem_mmap__device_coherent(drm_fd, handles[j],
> > +								0, k, PROT_WRITE);
> >			memset(gem_bufs[j], 0x0, k);
> >		}
> 
> Maybe we should skip this instead because set/get tiling calls below will
> fail/assert?
Yes I will skip.
> 
> > @@ -1872,7 +1872,7 @@ static void pm_test_caching(void)
> >
> >	handle = gem_create(drm_fd, gtt_obj_max_size);
> >	default_cache_level = gem_get_caching(drm_fd, handle);
> > -	gem_buf = gem_mmap__gtt(drm_fd, handle, gtt_obj_max_size, PROT_WRITE);
> > +	gem_buf = gem_mmap__device_coherent(drm_fd, handle, 0, gtt_obj_max_size, PROT_WRITE);
> >
> >	for (i = 0; i < ARRAY_SIZE(cache_levels); i++) {
> >		igt_assert(wait_for_suspended());
> 
> Does the test work ok or assert with this change? Also I am not sure but
> from the comments it seems the purpose of the test is to really do with
> GGTT so it should be skipped when we don't have aperture?
since all tests are skipping, I am not sure about the functional impact.
True comments talk about GGTT mapping. Better skip as of now. I will do
the changes

Ram
> 
> > @@ -2016,8 +2016,10 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
> >	/* GEM */
> >	igt_subtest("gem-mmap-cpu")
> >		gem_mmap_subtest(false);
> > -	igt_subtest("gem-mmap-gtt")
> > +	igt_subtest("gem-mmap-gtt") {
> > +		gem_require_mappable_ggtt(drm_fd);
> >		gem_mmap_subtest(true);
> > +	}
> >	igt_subtest("gem-pread")
> >		gem_pread_subtest();
> >	igt_subtest("gem-execbuf")
> > @@ -2058,10 +2060,14 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)
> >		dpms_mode_unset_subtest(SCREEN_TYPE_LPSP);
> >	igt_subtest("dpms-mode-unset-non-lpsp")
> >		dpms_mode_unset_subtest(SCREEN_TYPE_NON_LPSP);
> > -	igt_subtest("fences")
> > +	igt_subtest("fences") {
> > +		gem_require_mappable_ggtt(drm_fd);
> >		fences_subtest(false);
> > -	igt_subtest("fences-dpms")
> > +	}
> > +	igt_subtest("fences-dpms") {
> > +		gem_require_mappable_ggtt(drm_fd);
> >		fences_subtest(true);
> > +	}
> 
> These skips look ok to me.
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-02-07 12:59 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 17:31 [igt-dev] [PATCH i-g-t 0/9] Handling mmap_gtt Ramalingam C
2020-01-31 17:31 ` [igt-dev] [PATCH i-g-t 1/9] tests/prime_vgem: Skip fence and gtt specific tests Ramalingam C
2020-02-01  5:42   ` Dixit, Ashutosh
2020-02-03  9:19     ` Janusz Krzysztofik
2020-02-03  9:28   ` Janusz Krzysztofik
2020-01-31 17:31 ` [igt-dev] [PATCH i-g-t 2/9] tests/intel_dp_compliance: Skip tests as tiling is not supported Ramalingam C
2020-02-01  5:55   ` Dixit, Ashutosh
2020-02-04  5:55     ` Dixit, Ashutosh
2020-02-04  6:00       ` Ramalingam C
2020-02-04  6:15         ` Dixit, Ashutosh
2020-01-31 17:31 ` [igt-dev] [PATCH i-g-t 3/9] tests/prime_mmap_coherency: use device coherent mapping instead of mmap_gtt Ramalingam C
2020-02-01  6:27   ` Dixit, Ashutosh
2020-02-02 18:24     ` Ramalingam C
2020-02-04  6:14     ` Dixit, Ashutosh
2020-01-31 17:31 ` [igt-dev] [PATCH i-g-t 4/9] tests/prime_mmap: " Ramalingam C
2020-02-01  6:57   ` Dixit, Ashutosh
2020-02-02 18:28     ` Ramalingam C
2020-02-04  6:29     ` Dixit, Ashutosh
2020-01-31 17:31 ` [igt-dev] [PATCH i-g-t 5/9] tests/kms_psr: Skip tests on mmap_gtt, if no mappable aperture Ramalingam C
2020-02-04  6:38   ` Dixit, Ashutosh
2020-02-09  0:41     ` Dixit, Ashutosh
2020-01-31 17:31 ` [igt-dev] [PATCH i-g-t 6/9] tests/kms_available_modes_crc: Skip test if mappable aperture not supported Ramalingam C
2020-02-04  6:49   ` Dixit, Ashutosh
2020-01-31 17:31 ` [igt-dev] [PATCH i-g-t 7/9] tests/i915_pm_rpm: use device coherent mapping instead of mmap_gtt Ramalingam C
2020-02-05  0:16   ` Dixit, Ashutosh
2020-02-07 12:59     ` Ramalingam C [this message]
2020-01-31 17:31 ` [igt-dev] [PATCH i-g-t 8/9] tests/i915_suspend: skip fence related tests, if no mmap_gtt Ramalingam C
2020-02-05  2:06   ` Dixit, Ashutosh
2020-01-31 17:31 ` [igt-dev] [PATCH i-g-t 9/9] tests/gem_tiling_max_stride: Skip if set tiling is not supported Ramalingam C
2020-02-05  0:43   ` Antonio Argenziano
2020-02-05  1:29     ` Dixit, Ashutosh
2020-01-31 18:45 ` [igt-dev] ✓ Fi.CI.BAT: success for Handling mmap_gtt Patchwork
2020-02-04 12:30 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20200207125923.GA11460@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=ashutosh.dixit@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox