public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Summers, Stuart" <stuart.summers@intel.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Subject: Re: [igt-dev] [PATCH i-g-t 2/2] lib/i915/gem_mman: mmap to the CPU instead of the GTT in some tests
Date: Tue, 19 Nov 2019 18:58:31 +0000	[thread overview]
Message-ID: <2f0c488ccf6a9f666e085674a5a9c8f1bdf6cdae.camel@intel.com> (raw)
In-Reply-To: <157418792410.12093.8231741606090477200@skylake-alporthouse-com>


[-- Attachment #1.1: Type: text/plain, Size: 1935 bytes --]

On Tue, 2019-11-19 at 18:25 +0000, Chris Wilson wrote:
> Quoting Stuart Summers (2019-11-19 18:16:19)
> > Do not limit to the GTT for tests which are not specifically
> > testing
> > capability in the GTT.
> > 
> > Signed-off-by: Stuart Summers <stuart.summers@intel.com>
> > ---
> >  lib/i915/gem_mman.c            | 19 +++++++++++++++++++
> >  lib/i915/gem_mman.h            |  1 +
> >  tests/i915/gem_ctx_shared.c    | 20 +++++---------------
> >  tests/i915/gem_exec_schedule.c |  3 +--
> >  4 files changed, 26 insertions(+), 17 deletions(-)
> > 
> > diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> > index a0e34aef..d37840f7 100644
> > --- a/lib/i915/gem_mman.c
> > +++ b/lib/i915/gem_mman.c
> > @@ -40,6 +40,25 @@
> >  #define VG(x) do {} while (0)
> >  #endif
> >  
> > +void *gem_mmap_host(int fd, uint32_t handle, uint64_t size,
> > unsigned prot)
> > +{
> > +       void *ptr;
> > +       uint32_t domain;
> > +
> > +       if (gem_has_mappable_ggtt(fd)) {
> > +               ptr = gem_mmap__gtt(fd, handle, size, prot);
> > +               domain = I915_GEM_DOMAIN_GTT;
> > +       } else {
> > +               ptr = gem_mmap__cpu(fd, handle, 0, size, prot);
> > +               domain = I915_GEM_DOMAIN_CPU;
> > +       }
> > +
> > +       gem_set_domain(fd, handle, /* no write hazard lies! */
> > +                      domain, domain);
> 
> And be very careful putting the set-domain in here; as the lies are
> integral to the test and not suitable for libraries. Domain handling
> is
> sadly of paramount importance for most tests.

Hm.. so maybe a little more in the kernel to safeguard here. I was
thinking of doing that anyway. Then we can adopt the tests as needed.

And for these, maybe the right way to go is to use the new mmap_offset
Zbigniew is implementing. The IOCTL posted by Abdiel already has a WC
case for that.

Thanks,
Stuart

> -Chris

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3270 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-11-19 18:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 18:16 [igt-dev] [PATCH i-g-t 1/2] lib/i915/gem_mman: Add functions to get mmap and gtt versions Stuart Summers
2019-11-19 18:16 ` [igt-dev] [PATCH i-g-t 2/2] lib/i915/gem_mman: mmap to the CPU instead of the GTT in some tests Stuart Summers
2019-11-19 18:23   ` Chris Wilson
2019-11-19 18:23   ` Vanshidhar Konda
2019-11-19 18:25   ` Chris Wilson
2019-11-19 18:58     ` Summers, Stuart [this message]
2019-11-19 19:20       ` Chris Wilson
2019-11-19 22:00         ` Summers, Stuart
2019-11-19 22:28           ` Chris Wilson
2019-11-19 22:55             ` Summers, Stuart
2019-11-19 19:05 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/i915/gem_mman: Add functions to get mmap and gtt versions Patchwork
2019-11-20  7:41 ` [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=2f0c488ccf6a9f666e085674a5a9c8f1bdf6cdae.camel@intel.com \
    --to=stuart.summers@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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