From: Inki Dae <inki.dae@samsung.com>
To: 'Rob Clark' <rob.clark@linaro.org>
Cc: sw0312.kim@samsung.com, kyungmin.park@samsung.com,
dri-devel@lists.freedesktop.org
Subject: RE: [PATCH 3/4] drm/exynos: added userptr feature.
Date: Wed, 16 May 2012 22:27:23 +0900 [thread overview]
Message-ID: <003801cd3367$a09ca180$e1d5e480$%dae@samsung.com> (raw)
In-Reply-To: <CAF6AEGtFsypq7wOqyd1jYKxS3LP8_MCZNiG-jRWEKnbVFRchkw@mail.gmail.com>
> -----Original Message-----
> From: robdclark@gmail.com [mailto:robdclark@gmail.com] On Behalf Of Rob
> Clark
> Sent: Wednesday, May 16, 2012 9:13 PM
> To: Inki Dae
> Cc: Dave Airlie; kyungmin.park@samsung.com; sw0312.kim@samsung.com; dri-
> devel@lists.freedesktop.org
> Subject: Re: [PATCH 3/4] drm/exynos: added userptr feature.
>
> On Wed, May 16, 2012 at 4:20 AM, Inki Dae <inki.dae@samsung.com> wrote:
> >
> >
> >> -----Original Message-----
> >> From: Dave Airlie [mailto:airlied@gmail.com]
> >> Sent: Wednesday, May 16, 2012 6:23 PM
> >> To: Rob Clark
> >> Cc: Inki Dae; kyungmin.park@samsung.com; sw0312.kim@samsung.com; dri-
> >> devel@lists.freedesktop.org
> >> Subject: Re: [PATCH 3/4] drm/exynos: added userptr feature.
> >>
> >> On Tue, May 15, 2012 at 8:34 AM, Rob Clark <rob.clark@linaro.org>
wrote:
> >> > On Mon, Apr 23, 2012 at 7:43 AM, Inki Dae <inki.dae@samsung.com>
> wrote:
> >> >> this feature could be used to use memory region allocated by
malloc()
> >> in user
> >> >> mode and mmaped memory region allocated by other memory allocators.
> >> userptr
> >> >> interface can identify memory type through vm_flags value and would
> get
> >> >> pages or page frame numbers to user space appropriately.
> >> >
> >> > I apologize for being a little late to jump in on this thread, but...
> >> >
> >> > I must confess to not being a huge fan of userptr. It really is
> >> > opening a can of worms, and seems best avoided if at all possible.
> >> > I'm not entirely sure the use-case for which you require this, but I
> >> > wonder if there isn't an alternative way? I mean, the main case I
> >> > could think of for mapping userspace memory would be something like
> >> > texture upload. But could that be handled in an alternative way,
> >> > something like a pwrite or texture_upload API, which could
> temporarily
> >> > pin the userspace memory, kick off a dma from that user buffer to a
> >> > proper GEM buffer, and then unpin the user buffer when the DMA
> >> > completes?
> >>
> >> I'm with Rob on this, I really hate the userptr idea, and my problem
> >> with letting it into exynos is it sets a benchmark for others to do
> >> things the same way. I'm still not 100% sure how its going to be used
> >> even with all your explainations.
> >>
> >> Since we've agreed only the X server can access the interface, it
> >> makes 0 sense to me to exist at all, as the X server can avoid malloc
> >> memory for all objects it accesses.
> >>
> >> I don't think pixman is at the level where you should be acceleration
> >> it directly. I thought the point of pixman was a fast SW engine, not
> >> something to be trunked down to a hw engine. The idea being you use
> >> cairo and backend it onto something.
> >>
> >
> > For more understanding, PIXMAN draws something on shmem and next id of
> the
> > shmem is sent to X and next X gets user address to the id and next EXA's
> gpu
> > backend does BitBLT using gpu hardware. However, the gpu backend doesn't
> > aware of the user address so the purpose of using userptr is to import
> the
> > shmem into a gem object for gpu to aware of the memory region as source.
> so
> > pixman would use SW engine as is.
>
> if this is all just for X/EXA, wouldn't it make more sense to handle
> the operation at the EXA layer before falling back to sw (which would
> go to pixman)?
>
Note that PIXMAN is also used as backend of Evas amd the shmem is sent to
EXA backend of X to use gpu.(not same process)
> >> I know ssp had some ideas for making pixman be able to do hw accel,
> >> but userptr doesn't seem like the proper solution, it seems like a
> >> hack that needs a lot more VM work to operate properly, and by setting
> >> a precedent for one GPU driver, I'll have 20 implementations of this
> >> from ARM vendors and nobody will ever go back and fix things properly.
> >>
> >
> > I'm not sure that this is a hack or not but thing similar to this is
> being
> > used at via driver. you can refer to via_lock_all_dma_pages function of
> > via_dmablit.c file and this driver also uses get_user_pages() to lock
> all
> > the pages to the user space for DMA to access the memory region, maybe
> for
> > BitBLT. And I really wonder you think just using get_user_pages() is a
> hack
> > or importing user address into a gem object. there may be my
> > misunderstanding so give me any comments.
>
> My objection is not really the get_user_pages(), but rather converting
> that into a GEM object, which might exist for longer period of time,
> be exported to dmabuf and passed to other driver, etc. (Not to
> mention you don't really have control if userspace does free(ptr)
> while the GEM object still exists..)
>
Hm...Good point. ok, got it. I gonna stop it forward. Instead, we will
follow the via way for next so do you agree that the via way has no any
problem?
Thanks,
Inki Dae
> From a quick look at the via code, it appears to return while the blit
> is still queued, which I don't completely like but at least the
> pinning and hw use of the userspace buffer is just temporary and not
> able to exist for an indefinite amount of time.
>
> BR,
> -R
>
> > Thanks,
> > Inki Dae
> >
> >> So I'm really not sure the best way to move this forward, maybe a very
> >> clear set of use cases of where stuff plugs into this, and why dma-buf
> >> or some other method isn't sufficient, but I'm having trouble getting
> >> past the fact its setting a dangerous precedent.
> >>
> >> Dave.
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2012-05-16 13:27 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 13:43 [PATCH 0/4] updated exynos-drm-next Inki Dae
2012-04-23 13:43 ` [PATCH 1/4] drm/exynos: added cache attribute support for gem Inki Dae
2012-04-23 13:43 ` [PATCH 2/4] drm/exynos: added drm prime feature Inki Dae
2012-04-23 13:43 ` [PATCH 3/4] drm/exynos: added userptr feature Inki Dae
2012-04-24 5:17 ` [PATCH v2 " Inki Dae
2012-04-25 10:15 ` Dave Airlie
2012-04-25 12:46 ` InKi Dae
2012-05-05 10:19 ` daeinki
2012-05-05 10:22 ` Dave Airlie
2012-05-07 18:18 ` Jerome Glisse
2012-05-08 7:59 ` Inki Dae
2012-05-08 15:05 ` Jerome Glisse
2012-05-08 6:48 ` Inki Dae
2012-05-09 6:17 ` [PATCH 0/2 v3] " Inki Dae
2012-05-09 6:17 ` [PATCH 1/2 v3] drm/exynos: added userptr limit ioctl Inki Dae
2012-05-09 6:17 ` [PATCH 2/2 v3] drm/exynos: added userptr feature Inki Dae
2012-05-09 14:45 ` Jerome Glisse
2012-05-09 18:32 ` Jerome Glisse
2012-05-10 2:44 ` Inki Dae
2012-05-10 15:05 ` Jerome Glisse
2012-05-10 15:31 ` Daniel Vetter
2012-05-10 15:52 ` Jerome Glisse
2012-05-11 1:47 ` Inki Dae
2012-05-11 2:08 ` Minchan Kim
2012-05-10 1:39 ` Inki Dae
2012-05-10 4:58 ` Minchan Kim
2012-05-10 6:53 ` KOSAKI Motohiro
2012-05-10 7:27 ` Minchan Kim
2012-05-10 7:31 ` Kyungmin Park
2012-05-10 7:56 ` Minchan Kim
2012-05-10 7:58 ` Minchan Kim
2012-05-10 6:57 ` Inki Dae
2012-05-10 7:05 ` Minchan Kim
2012-05-10 7:59 ` InKi Dae
2012-05-10 8:11 ` Minchan Kim
2012-05-10 8:44 ` Inki Dae
2012-05-10 17:53 ` KOSAKI Motohiro
2012-05-11 0:50 ` Minchan Kim
2012-05-11 2:51 ` KOSAKI Motohiro
2012-05-11 3:01 ` Jerome Glisse
2012-05-11 21:20 ` KOSAKI Motohiro
2012-05-11 22:22 ` Jerome Glisse
2012-05-11 22:59 ` KOSAKI Motohiro
2012-05-11 23:29 ` Jerome Glisse
2012-05-11 23:39 ` KOSAKI Motohiro
2012-05-12 4:48 ` InKi Dae
2012-05-14 4:29 ` Minchan Kim
2012-05-14 6:17 ` [PATCH 0/2 v4] " Inki Dae
2012-05-14 6:17 ` [PATCH 1/2 v4] drm/exynos: added userptr limit ioctl Inki Dae
2012-05-14 8:12 ` Inki Dae
2012-05-14 6:17 ` [PATCH 2/2 v4] drm/exynos: added userptr feature Inki Dae
2012-05-14 6:33 ` KOSAKI Motohiro
2012-05-14 6:52 ` Inki Dae
2012-05-14 7:04 ` KOSAKI Motohiro
2012-05-14 7:21 ` Inki Dae
2012-05-14 8:13 ` Inki Dae
2012-05-14 19:26 ` Jerome Glisse
2012-05-15 4:33 ` Inki Dae
2012-05-15 14:31 ` Jerome Glisse
2012-05-16 8:49 ` Inki Dae
2012-05-14 8:12 ` [PATCH 0/2 " Inki Dae
2012-05-15 7:34 ` [PATCH 3/4] " Rob Clark
2012-05-15 8:17 ` Inki Dae
2012-05-15 9:35 ` Rob Clark
2012-05-15 13:40 ` InKi Dae
2012-05-15 14:28 ` Rob Clark
2012-05-16 6:04 ` Inki Dae
2012-05-16 8:42 ` Rob Clark
2012-05-16 10:30 ` Inki Dae
2012-05-16 9:22 ` Dave Airlie
2012-05-16 10:20 ` Inki Dae
2012-05-16 12:12 ` Rob Clark
2012-05-16 13:27 ` Inki Dae [this message]
2012-04-23 13:43 ` [PATCH 4/4] drm/exynos: added a feature to get gem buffer information Inki Dae
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='003801cd3367$a09ca180$e1d5e480$%dae@samsung.com' \
--to=inki.dae@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kyungmin.park@samsung.com \
--cc=rob.clark@linaro.org \
--cc=sw0312.kim@samsung.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