All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Hackmann <ghackmann@google.com>
To: Rob Herring <robh@kernel.org>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: dumb BOs and prime
Date: Fri, 4 Dec 2015 15:48:26 -0800	[thread overview]
Message-ID: <5662264A.4010209@google.com> (raw)
In-Reply-To: <CAL_JsqLnth9+H=1WnAjAwF008xQUC0vLxUyy_ZuoGWsE01psBQ@mail.gmail.com>

On 12/04/2015 11:23 AM, Rob Herring wrote:
> On Fri, Dec 4, 2015 at 12:40 PM, Benjamin Gaignard
> <benjamin.gaignard@linaro.org> wrote:
>> Hi Rob,
>>
>> I got the same problem today with sti drm/kms driver and dumb Bo.
>> The issue comes become hwcomposer because is the master and authenticated on
>> /dev/dri/cardX
>> Dumb allocation is done by gralloc which does a new open (so it is not
>> authenticated) on drm node the consequence is that we can't use prime
>> functions...
>> If you use render node you won't be able to call dumb functions.
>>
>> To get out of this I think I will implement additional helpers in gem_cma to
>> have ioctl like DRM_GEM_CMA_CREATE and DRM_GEM_CMA_MMAP
>> and call them instead of dumb so be able to use render node.
>> Of course it is only for drivers which already use gem_cma helpers (like
>> sti)
>
> That's only marginally better than per driver BO calls which is the
> whole thing I'm trying to avoid. There should be some way to pass the
> auth token to gralloc?
>
> Rob

Frankly, you probably want to approach this by allocating dma-bufs using 
something external to DRM (probably ion) and then have your hwcomposer 
import them into DRM when they're passed to the display.

Backing gralloc allocations with dumb BOs doesn't really fit the way 
gralloc is designed: like dma-buf, it's built around passing buffers 
between different hardware blocks, and some of those buffers may never 
even touch the display hardware.  You'll also run up against other 
(deliberate) limitations of dumb BOs like not being able to allocate YUV 
buffers.

Unfortunately this currently means adding some shim driver code to 
create the ion device.  (Device-Tree bindings for ion are on my long, 
long backlog of things to do.) It's not a lot of code, especially if all 
you need is a CMA heap, but it's still non-zero.

Note that supporting dumb BOs in your KMS driver is still useful, since 
the recovery console in AOSP has KMS support now.  In that case it's a 
single privileged process software-rendering everything, so it bypasses 
gralloc/hwcomposer and calls directly into libdrm.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-12-04 23:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 17:49 dumb BOs and prime Rob Herring
2015-12-04 18:07 ` Daniel Stone
2015-12-04 18:21 ` Martin Peres
2015-12-04 18:40   ` Benjamin Gaignard
2015-12-04 19:23     ` Rob Herring
2015-12-04 23:48       ` Greg Hackmann [this message]
2015-12-05 10:16         ` Daniel Vetter
2015-12-05 23:40         ` Rob Herring
2015-12-05 23:52           ` Stéphane Marchesin

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=5662264A.4010209@google.com \
    --to=ghackmann@google.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robh@kernel.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.