dumb BOs and prime

Benjamin Gaignard benjamin.gaignard at linaro.org
Fri Dec 4 10:40:39 PST 2015


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)

Benjamin


Le vendredi 4 décembre 2015, Martin Peres <martin.peres at linux.intel.com> a
écrit :

> On 04/12/15 19:49, Rob Herring wrote:
>
>> I'm working on getting Android working with DRM drivers. ATM, I'm
>> using virtio-gpu as the driver and trying to get just KMS side working
>> without rendering. I have it working with stock AOSP and the emulated
>> fb with a few additions to the virtio-gpu driver[1]. Now I'm trying to
>> get things working with native KMS using drm_gralloc and
>> drm_hwcomposer (now in AOSP). I've hit one problem though which I'm
>> not sure how to solve without hacking around it.
>>
>> Is prime allowed on dumb BOs? AIUI, dumb buffer allocation is not
>> allowed on render nodes and drmPrimeHandleToFD is not allowed on
>> card0, so I'm stuck. I could open both nodes, but then I want the case
>> of no render node to work. After some searching, I thought it was a
>> matter of needing to do drmAuthMagic, but then found that is
>> considered obsolete[2].
>>
>
> Obsolete when using render nodes, but still necessary on usual nodes
> (/dev/dri/cardX) as far as I remember. The usual nodes can do everything
> the render nodes can do.
>
> Authentication should help! Please make sure you are master or
> authenticated before doing anything on the usual nodes.
>
>
>> Rob
>>
>> [1] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git
>> android-4.4
>> [2]
>> http://www.x.org/wiki/Events/XDC2013/XDC2013DavidHerrmannDRMSecurity/slides.pdf
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>>

-- 

Benjamin Gaignard

Graphic Working Group

Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs

Follow *Linaro: *Facebook <http://www.facebook.com/pages/Linaro> | Twitter
<http://twitter.com/#!/linaroorg> | Blog
<http://www.linaro.org/linaro-blog/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20151204/8d53a325/attachment.html>


More information about the dri-devel mailing list