From: Imre Deak <imre.deak@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org, Brian Welty <brian.welty@intel.com>
Subject: Re: [igt-dev] [PATCH v3 1/3] lib/rendercopy: Add AUX page table support
Date: Wed, 6 Nov 2019 21:04:10 +0200 [thread overview]
Message-ID: <20191106190410.GA4718@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <157305975054.26738.7202718363105466782@skylake-alporthouse-com>
On Wed, Nov 06, 2019 at 05:02:30PM +0000, Chris Wilson wrote:
> Quoting Imre Deak (2019-11-06 16:36:49)
> > On Wed, Nov 06, 2019 at 04:14:36PM +0000, Chris Wilson wrote:
> > > Quoting Imre Deak (2019-11-06 16:00:16)
> > > > On Wed, Nov 06, 2019 at 11:11:40AM +0000, Chris Wilson wrote:
> > > > > What's the coherency model for the pgt->bo? There's a lot of writes here
> > > > > from the CPU how are you making sure they are visible to the GPU?
> > > >
> > > > My understanding: execbuf will do a clflush for the buf on non-LLC
> > > > platforms, while on LLC platforms that's not needed; not sure if there
> > > > will be any non-LLC platforms where the AUX pagetable will be needed.
> > >
> > > No, we don't unless you tell us you modified it between batches. That
> > > would be the case if you were using drm_intel_bo_map(true) everytime,
> > > but again that will then stall the GPU between every batch -- which we
> > > definitely do not want when testing [as it will hide every bug] :)
> >
> > Do you see a problem with the way I program it here though? I call
> > drm_intel_bo_map(true) for the purpose of programming a new table. If
> > you see a problem with that what do you suggest instead?
>
> You create a new pagetable for every batch. Good for solitary render
> copies, not so good for validation :( I expect we are invoking too many
> stalls to be able to detect missing flushes and invalidations.
>
> I would not suggest this interface is suitable long term. There is a
> large leap between this and userspace, that I feel like we should be
> covering more of the stepping stones so that userspace can trust the
> layers it is built on [for some value of trust].
Yes, but the stall you mention should only happen on non-LLC platofrms.
At least on LLC we don't need to flush CPU caches, so it's not clear
what would cause the stall.
An API to create the pagetable at a higher level would be more efficient
in any case. Are you ok implementing that as a follow-up and starting
with the current approach?
> > > > On top of that the AUX GAM has its own caches - found that now in an HSD
> > > > doc - which will be invalidated whenever GAM's top level table base
> > > > pointer register is set from the context image, which happens whenver
> > > > switching to the context.
> > >
> > > But not for a lite-restore?
> >
> > We still write the top level table regsiter from the batch, so that
> > could in itself trigger the invalidation.
>
> I would not expect that to be true for real clients. Or is it the only
> recommended programming model?
The spec doesn't detail programming models, it only describes the page
table format. I suppose programming the pgt pointer only once for a
context and then using CCS_AUX_INV later after entries have been
modified would be another way.
> > > So we have a problem when updating existing entries between batches
> > > inside the same context? We put a big hammer at the front of the
> > > request for TLB invalidation. If there's a flush we can add, we need
> > > it there.
> >
> > Yes, there is, see the CCS_AUX_INV reg in bspec. But I suspect this
> > would have the same effect as writing the table ptr register, so not
> > sure when exactly this would be needed.
>
> But the top level base pointer will not be updated on a lite restore;
> are you sure the invalidation will occur if sublevels of the tt are
> updated?
No, that doesn't. So if the batch wouldn't write the top level table
register, we would need to invalidate the caches using CCS_AUX_INV.
> The good thing is that this is all virtual addresses, though there is a
> slight danger with using system pages if the TLB is not flushed before
> release (i.e. it can still access the page contents after someone else
> uses them).
You mean we'd need to invalidate the AUX pgt caches when releasing the
pages for a surface? Agreed that makes sense for robustness, even though
I can't see how writes could go astray if we invalidate the graphics
address mapping for the surface anyway.
--Imre
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-11-06 19:05 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 19:34 [igt-dev] [PATCH v2 1/3] lib/rendercopy: Add AUX page table support Imre Deak
2019-11-05 19:34 ` [igt-dev] [PATCH v2 2/3] tests/gem_render_copy: Adjust the tgl+ compressed buf alignments Imre Deak
2019-11-05 19:34 ` [igt-dev] [PATCH v2 3/3] tests/gem_render_copy: Add compressed src to compressed dst subtests Imre Deak
2019-11-08 15:09 ` [igt-dev] [PATCH v3 " Imre Deak
2019-11-13 14:32 ` [igt-dev] [PATCH v4 " Imre Deak
2019-11-12 20:15 ` [igt-dev] [PATCH v2 " Brian Welty
2019-11-13 14:34 ` Imre Deak
2019-11-05 20:14 ` [igt-dev] ✗ GitLab.Pipeline: failure for series starting with [v2,1/3] lib/rendercopy: Add AUX page table support Patchwork
2019-11-05 20:27 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-11-05 21:42 ` [igt-dev] [PATCH v3 1/3] " Imre Deak
2019-11-05 22:24 ` Chris Wilson
2019-11-05 22:33 ` Imre Deak
2019-11-06 6:53 ` [igt-dev] [PATCH v4 " Imre Deak
2019-11-07 18:36 ` [igt-dev] [PATCH v5 " Imre Deak
2019-11-06 11:11 ` [igt-dev] [PATCH v3 " Chris Wilson
2019-11-06 16:00 ` Imre Deak
2019-11-06 16:14 ` Chris Wilson
2019-11-06 16:36 ` Imre Deak
2019-11-06 17:02 ` Chris Wilson
2019-11-06 19:04 ` Imre Deak [this message]
2019-11-06 21:25 ` Chris Wilson
2019-11-07 12:41 ` Chris Wilson
2019-11-07 18:37 ` Imre Deak
2019-11-05 21:59 ` [igt-dev] ✗ GitLab.Pipeline: failure for series starting with [v3,1/3] lib/rendercopy: Add AUX page table support (rev2) Patchwork
2019-11-05 22:11 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-11-06 7:17 ` [igt-dev] ✗ GitLab.Pipeline: failure for series starting with [v4,1/3] lib/rendercopy: Add AUX page table support (rev3) Patchwork
2019-11-06 7:36 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-11-06 16:57 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [v2,1/3] lib/rendercopy: Add AUX page table support Patchwork
2019-11-06 18:50 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [v3,1/3] lib/rendercopy: Add AUX page table support (rev2) Patchwork
2019-11-07 0:23 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [v4,1/3] lib/rendercopy: Add AUX page table support (rev3) Patchwork
2019-11-07 19:13 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [v5,1/3] lib/rendercopy: Add AUX page table support (rev4) Patchwork
2019-11-07 19:15 ` [igt-dev] ✗ GitLab.Pipeline: failure " Patchwork
2019-11-08 16:25 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [v5,1/3] lib/rendercopy: Add AUX page table support (rev5) Patchwork
2019-11-09 0:57 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [v5,1/3] lib/rendercopy: Add AUX page table support (rev4) Patchwork
2019-11-10 7:23 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [v5,1/3] lib/rendercopy: Add AUX page table support (rev5) Patchwork
2019-11-13 15:36 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [v5,1/3] lib/rendercopy: Add AUX page table support (rev6) Patchwork
2019-11-14 4:52 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-11-14 16:15 ` Imre Deak
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=20191106190410.GA4718@ideak-desk.fi.intel.com \
--to=imre.deak@intel.com \
--cc=brian.welty@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