All of lore.kernel.org
 help / color / mirror / Atom feed
From: lepton <ytht.net@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Christian König" <christian.koenig@amd.com>,
	"Thomas Hellström" <thomas_os@shipmail.org>,
	"# v4 . 10+" <stable@vger.kernel.org>
Subject: Re: [PATCH 1/2] drm/vgem: Do not allocate backing shmemfs file for an import dmabuf object
Date: Tue, 7 Jul 2020 11:17:51 -0700	[thread overview]
Message-ID: <CALqoU4ypBqcAo+xH2usVRffKzR6AkgGdJBmQ0vWe9MZ1kTHCqw@mail.gmail.com> (raw)
In-Reply-To: <159414243217.17526.6453360763938648186@build.alporthouse.com>

On Tue, Jul 7, 2020 at 10:20 AM Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Quoting lepton (2020-07-07 18:05:21)
> > On Tue, Jul 7, 2020 at 9:00 AM Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > >
> > > If we assign obj->filp, we believe that the create vgem bo is native and
> > > allow direct operations like mmap() assuming it behaves as backed by a
> > > shmemfs inode. When imported from a dmabuf, the obj->pages are
> > > not always meaningful and the shmemfs backing store misleading.
> > >
> > > Note, that regular mmap access to a vgem bo is via the dumb buffer API,
> > > and that rejects attempts to mmap an imported dmabuf,
> > What do you mean by "regular mmap access" here?  It looks like vgem is
> > using vgem_gem_dumb_map as .dumb_map_offset callback then it doesn't call
> > drm_gem_dumb_map_offset
>
> As I too found out, and so had to correct my story telling.
>
> By regular mmap() access I mean mmap on the vgem bo [via the dumb buffer
> API] as opposed to mmap() via an exported dma-buf fd. I had to look at
> igt to see how it was being used.
Now it seems your fix is to disable "regular mmap" on imported dma buf
for vgem. I am not really a graphic guy, but then the api looks like:
for a gem handle, user space has to guess to find out the way to mmap
it. If user space guess wrong, then it will fail to mmap. Is this the
expected way
for people to handle gpu buffer?
> -Chris

WARNING: multiple messages have this Message-ID (diff)
From: lepton <ytht.net@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: "Thomas Hellström" <thomas_os@shipmail.org>,
	"# v4 . 10+" <stable@vger.kernel.org>,
	"Christian König" <christian.koenig@amd.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/vgem: Do not allocate backing shmemfs file for an import dmabuf object
Date: Tue, 7 Jul 2020 11:17:51 -0700	[thread overview]
Message-ID: <CALqoU4ypBqcAo+xH2usVRffKzR6AkgGdJBmQ0vWe9MZ1kTHCqw@mail.gmail.com> (raw)
In-Reply-To: <159414243217.17526.6453360763938648186@build.alporthouse.com>

On Tue, Jul 7, 2020 at 10:20 AM Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Quoting lepton (2020-07-07 18:05:21)
> > On Tue, Jul 7, 2020 at 9:00 AM Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > >
> > > If we assign obj->filp, we believe that the create vgem bo is native and
> > > allow direct operations like mmap() assuming it behaves as backed by a
> > > shmemfs inode. When imported from a dmabuf, the obj->pages are
> > > not always meaningful and the shmemfs backing store misleading.
> > >
> > > Note, that regular mmap access to a vgem bo is via the dumb buffer API,
> > > and that rejects attempts to mmap an imported dmabuf,
> > What do you mean by "regular mmap access" here?  It looks like vgem is
> > using vgem_gem_dumb_map as .dumb_map_offset callback then it doesn't call
> > drm_gem_dumb_map_offset
>
> As I too found out, and so had to correct my story telling.
>
> By regular mmap() access I mean mmap on the vgem bo [via the dumb buffer
> API] as opposed to mmap() via an exported dma-buf fd. I had to look at
> igt to see how it was being used.
Now it seems your fix is to disable "regular mmap" on imported dma buf
for vgem. I am not really a graphic guy, but then the api looks like:
for a gem handle, user space has to guess to find out the way to mmap
it. If user space guess wrong, then it will fail to mmap. Is this the
expected way
for people to handle gpu buffer?
> -Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: lepton <ytht.net@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: "# v4 . 10+" <stable@vger.kernel.org>,
	"Christian König" <christian.koenig@amd.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/2] drm/vgem: Do not allocate backing shmemfs file for an import dmabuf object
Date: Tue, 7 Jul 2020 11:17:51 -0700	[thread overview]
Message-ID: <CALqoU4ypBqcAo+xH2usVRffKzR6AkgGdJBmQ0vWe9MZ1kTHCqw@mail.gmail.com> (raw)
In-Reply-To: <159414243217.17526.6453360763938648186@build.alporthouse.com>

On Tue, Jul 7, 2020 at 10:20 AM Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Quoting lepton (2020-07-07 18:05:21)
> > On Tue, Jul 7, 2020 at 9:00 AM Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > >
> > > If we assign obj->filp, we believe that the create vgem bo is native and
> > > allow direct operations like mmap() assuming it behaves as backed by a
> > > shmemfs inode. When imported from a dmabuf, the obj->pages are
> > > not always meaningful and the shmemfs backing store misleading.
> > >
> > > Note, that regular mmap access to a vgem bo is via the dumb buffer API,
> > > and that rejects attempts to mmap an imported dmabuf,
> > What do you mean by "regular mmap access" here?  It looks like vgem is
> > using vgem_gem_dumb_map as .dumb_map_offset callback then it doesn't call
> > drm_gem_dumb_map_offset
>
> As I too found out, and so had to correct my story telling.
>
> By regular mmap() access I mean mmap on the vgem bo [via the dumb buffer
> API] as opposed to mmap() via an exported dma-buf fd. I had to look at
> igt to see how it was being used.
Now it seems your fix is to disable "regular mmap" on imported dma buf
for vgem. I am not really a graphic guy, but then the api looks like:
for a gem handle, user space has to guess to find out the way to mmap
it. If user space guess wrong, then it will fail to mmap. Is this the
expected way
for people to handle gpu buffer?
> -Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-07-07 18:18 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 16:00 [PATCH 1/2] drm/vgem: Do not allocate backing shmemfs file for an import dmabuf object Chris Wilson
2020-07-07 16:00 ` [Intel-gfx] " Chris Wilson
2020-07-07 16:00 ` Chris Wilson
2020-07-07 16:00 ` [PATCH 2/2] drm/vgem: Replace opencoded version of drm_gem_dumb_map_offset() Chris Wilson
2020-07-07 16:00   ` [Intel-gfx] " Chris Wilson
2020-07-08  9:56   ` Daniel Vetter
2020-07-08  9:56     ` [Intel-gfx] " Daniel Vetter
2020-07-08 14:53     ` Chris Wilson
2020-07-08 14:53       ` [Intel-gfx] " Chris Wilson
2020-07-07 16:33 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/2] drm/vgem: Do not allocate backing shmemfs file for an import dmabuf object Patchwork
2020-07-07 17:05 ` [PATCH 1/2] " lepton
2020-07-07 17:05   ` [Intel-gfx] " lepton
2020-07-07 17:05   ` lepton
2020-07-07 17:20   ` Chris Wilson
2020-07-07 17:20     ` [Intel-gfx] " Chris Wilson
2020-07-07 18:17     ` lepton [this message]
2020-07-07 18:17       ` lepton
2020-07-07 18:17       ` lepton
2020-07-07 18:35       ` Chris Wilson
2020-07-07 18:35         ` [Intel-gfx] " Chris Wilson
2020-07-08  9:22         ` Christian König
2020-07-08  9:22           ` [Intel-gfx] " Christian König
2020-07-08  9:22           ` Christian König
2020-07-08  9:54           ` Daniel Vetter
2020-07-08  9:54             ` [Intel-gfx] " Daniel Vetter
2020-07-08  9:54             ` Daniel Vetter
2020-07-08 14:37             ` Christian König
2020-07-08 14:37               ` [Intel-gfx] " Christian König
2020-07-08 14:37               ` Christian König
2020-07-08 15:01               ` Daniel Vetter
2020-07-08 15:01                 ` [Intel-gfx] " Daniel Vetter
2020-07-08 15:01                 ` Daniel Vetter
2020-07-08 15:05                 ` Christian König
2020-07-08 15:05                   ` [Intel-gfx] " Christian König
2020-07-08 15:05                   ` Christian König
2020-07-08 16:11                   ` Daniel Vetter
2020-07-08 16:11                     ` [Intel-gfx] " Daniel Vetter
2020-07-08 16:11                     ` Daniel Vetter
2020-07-08 16:19                     ` Daniel Vetter
2020-07-08 16:19                       ` [Intel-gfx] " Daniel Vetter
2020-07-08 16:19                       ` Daniel Vetter
2020-07-09  8:48                       ` Christian König
2020-07-09  8:48                         ` [Intel-gfx] " Christian König
2020-07-09  8:48                         ` Christian König
2020-07-09 13:54                         ` Steven Price
2020-07-09 13:54                           ` [Intel-gfx] " Steven Price
2020-07-09 13:54                           ` Steven Price
2020-07-09 14:15                           ` Christian König
2020-07-09 14:15                             ` [Intel-gfx] " Christian König
2020-07-09 14:15                             ` Christian König
2020-07-09  8:49                     ` Christian König
2020-07-09  8:49                       ` [Intel-gfx] " Christian König
2020-07-09  8:49                       ` Christian König
2020-07-08  5:44 ` lepton
2020-07-08  5:44   ` [Intel-gfx] " lepton
2020-07-08  5:44   ` lepton

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=CALqoU4ypBqcAo+xH2usVRffKzR6AkgGdJBmQ0vWe9MZ1kTHCqw@mail.gmail.com \
    --to=ytht.net@gmail.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stable@vger.kernel.org \
    --cc=thomas_os@shipmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.