[igt-dev] [PATCH i-g-t 2/2] lib/i915/gem_mman: mmap to the CPU instead of the GTT in some tests

Summers, Stuart stuart.summers at intel.com
Tue Nov 19 22:55:14 UTC 2019


On Tue, 2019-11-19 at 22:28 +0000, Chris Wilson wrote:
> Quoting Summers, Stuart (2019-11-19 22:00:17)
> > On Tue, 2019-11-19 at 19:20 +0000, Chris Wilson wrote:
> > > So a possible gem_mmap__device_coherent() {
> > >       ptr = gem_mmap__offset(.type = WC);
> > >       if (ptr)
> > >               return ptr;
> > > 
> > >       ptr = gem_mmap__wc();
> > >       if (ptr)
> > >               return ptr;
> > > 
> > >       return gem_mmap__gt();
> > > }
> > 
> > Yeah I've been playing around locally with something like this (or
> > at
> > least with the mmap_offset/mmap_gtt, your suggestion is cleaner).
> > The
> > problem is in application. Do we apply this to all tests which
> > aren't
> > expliclity doing GGTT testing? Or do we start with something like
> > the
> > gem_ctx_shared and expand over time? I don't have all of the
> > history
> > across the tests, so really appreciate the feedback here Chris.
> 
> In almost all cases, gtt was being used only because it provided
> coherent [uncached] access. There are a few tests that are explicitly
> testing GTT features (and they are easy to spot). The other day I
> think
> I counted around 100 test.c using gem_mmap__gtt of which a quick
> inspection said only 10% of those were looking at GTT features.
> 
> The biggest challenge is choosing the name and semantics of the
> replacement: device/pci_coherent or something like that. And then
> define
> whether or not we use gem_sync() + manual clflush for nonspecific
> testing, or stick with gem_set_domain(GTT) as the lowest common
> denominator. There's pros/cons for either choice (and there will
> always
> be corner cases that explicitly need one or the other) , just patches
> need to be written.

Adding Zbigniew here too for visibility in case I don't get to this.

But corner cases should be covered by specific test cases I'd think.
And if we're trying to push userspace away from gem_set_domain
generally, it seems like the better approach is to model what we want
for the UMDs to use, of course keeping specific cases for backwards
compatibility testing.

Anyway, I'll give another shot similar to what you have above when I
get a chance.

Thanks,
Stuart

> -Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3270 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20191119/0b7a2649/attachment-0001.bin>


More information about the igt-dev mailing list