From: Matthew Brost <matthew.brost@intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Andi Shyti <andi.shyti@linux.intel.com>,
intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
Chris Wilson <chris.p.wilson@linux.intel.com>,
Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
Nirmoy Das <nirmoy.das@intel.com>
Subject: Re: [PATCH 0/2] Allow partial memory mapping for cpu memory
Date: Tue, 13 Aug 2024 02:54:31 +0000 [thread overview]
Message-ID: <ZrrK5yjirbjJQSFL@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <ZrogDGT326oSUZls@phenom.ffwll.local>
On Mon, Aug 12, 2024 at 04:45:32PM +0200, Daniel Vetter wrote:
> On Mon, Aug 12, 2024 at 01:51:30PM +0200, Andi Shyti wrote:
> > Hi Daniel,
> >
> > On Mon, Aug 12, 2024 at 11:11:21AM +0200, Daniel Vetter wrote:
> > > On Fri, Aug 09, 2024 at 11:20:56AM +0100, Andi Shyti wrote:
> > > > On Fri, Aug 09, 2024 at 10:53:38AM +0200, Daniel Vetter wrote:
> > > > > On Wed, Aug 07, 2024 at 11:05:19AM +0100, Andi Shyti wrote:
> > > > > > This patch series concludes on the memory mapping fixes and
> > > > > > improvements by allowing partial memory mapping for the cpu
> > > > > > memory as well.
> > > > > >
> > > > > > The partial memory mapping by adding an object offset was
> > > > > > implicitely included in commit 8bdd9ef7e9b1 ("drm/i915/gem: Fix
> > > > > > Virtual Memory mapping boundaries calculation") for the gtt
> > > > > > memory.
> > > > >
> > > > > Does userspace actually care? Do we have a flag or something, so that
> > > > > userspace can discover this?
> > > > >
> > > > > Adding complexity of any kind is absolute no-go, unless there's a
> > > > > userspace need. This also includes the gtt accidental fix.
> > > >
> > > > Actually this missing functionality was initially filed as a bug
> > > > by mesa folks. So that this patch was requested by them (Lionel
> > > > is Cc'ed).
> > > >
> > > > The tests cases that have been sent previously and I'm going to
> > > > send again, are directly taken from mesa use cases.
> > >
> > > Please add the relevant mesa MR to this patch then, and some relevant
> > > explanations for how userspace detects this all and decides to use it.
> >
> > AFAIK, there is no Mesa MR. We are adding a feature that was
> > missing, but Mesa already supported it (indeed, Nimroy suggested
> > adding the Fixes tag for this).
> >
> > Also because, Mesa was receiving an invalid address error and
> > asked to support the partial mapping of the memory.
>
> Uh this sounds a bit too much like just yolo'ing uabi. There's two cases:
>
> - Either this is a regression, it worked previously, mesa is now angry.
> Then we absolutely need a Fixes: tag, and we also need that for the
> preceeding work to re-enable this for gtt mappings.
>
> - Or mesa is just plain wrong here, which is what my guess is. Because bo
> mappings have always been full-object (except for the old-style shm
> mmaps). In that case mesa needs to be fixed (because we're not going to
> backport old uapi).
>
> Also in that case, _if_ (and that's a really big if) we really want this
> uapi, we need it in xe too, it needs a proper mesa MR to use it, it
I looked at this code from Xe PoV to see if we support this and I think
we actually do as our CPU fault handler more or less just calls
ttm_bo_vm_fault_reserved which has similar code to this patch. So I
think this actually a valid fix. Can't be 100% sure though as I quickly
just reversed engineered this code and TTM.
We don't have IGT test cases for this in Xe though, we likely should add
some if mesa is doing this.
Matt
> needs igt testcases, and it needs a solid way to detect whether the
> kernel supports this feature or not. But unless other drivers are doing
> this too, I have some big questions why i915-gem needs this.
>
> > > Also, does xe also support this? If we only add this to i915-gem but xe
> > > doesn't have it, it doesn't make much sense imo.
> >
> > I don't know about. Lionel, Do you have anything to add here from
> > your side?
>
> "I don't know" is not an acceptable answer for uapi work.
> -Sima
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
next prev parent reply other threads:[~2024-08-13 2:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 10:05 [PATCH 0/2] Allow partial memory mapping for cpu memory Andi Shyti
2024-08-07 10:05 ` [PATCH 1/2] drm/i915/gem: Do not look for the exact address in node Andi Shyti
2024-08-08 16:11 ` Nirmoy Das
2024-08-07 10:05 ` [PATCH 2/2] drm/i915/gem: Calculate object page offset for partial memory mapping Andi Shyti
2024-08-08 16:11 ` Nirmoy Das
2024-08-07 11:13 ` ✓ Fi.CI.BAT: success for Allow partial memory mapping for cpu memory Patchwork
2024-08-07 22:30 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-08-08 0:10 ` ✓ Fi.CI.BAT: success for Allow partial memory mapping for cpu memory (rev2) Patchwork
2024-08-08 7:32 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-08-09 8:53 ` [PATCH 0/2] Allow partial memory mapping for cpu memory Daniel Vetter
2024-08-09 10:20 ` Andi Shyti
2024-08-12 9:11 ` Daniel Vetter
2024-08-12 11:51 ` Andi Shyti
2024-08-12 14:45 ` Daniel Vetter
2024-08-13 2:54 ` Matthew Brost [this message]
2024-08-13 14:09 ` Daniel Vetter
2024-08-13 19:08 ` Matthew Brost
2024-08-14 2:08 ` Matthew Brost
2024-08-19 14:17 ` Daniel Vetter
2024-08-19 15:31 ` Andi Shyti
2024-08-22 9:29 ` Daniel Vetter
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=ZrrK5yjirbjJQSFL@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=andi.shyti@linux.intel.com \
--cc=chris.p.wilson@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lionel.g.landwerlin@intel.com \
--cc=nirmoy.das@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox