[PATCH] intel: make bufmgr_gem shareable from different API

Daniel Stone daniel at fooishbar.org
Thu Sep 11 05:16:47 PDT 2014


Hi,

On 11 September 2014 12:52, Chris Wilson <chris at chris-wilson.co.uk> wrote:

> On Thu, Sep 11, 2014 at 12:33:41PM +0100, Lionel Landwerlin wrote:
> > When using Mesa and LibVA in the same process, one would like to be
> > able bind buffers from the output of the decoder to a GL texture
> > through an EGLImage.
> >
> > LibVA can reuse buffers allocated by Gbm through a file descriptor. It
> > will then wrap it into a drm_intel_bo with
> > drm_intel_bo_gem_create_from_prime().
> >
> > Given both libraries are using libdrm to allocate and use buffer
> > objects, there is a need to have the buffer objects properly
> > refcounted. That is possible if both API use the same drm_intel_bo
> > objects, but that also requires that both API use the same
> > drm_intel_bufmgr object.
>
> The description is wrong though. Reusing buffers export and import
> through a dmabuf, should work and be correctly refcounted already.
>

Indeed.

I've been using the attached patch to deal with the case where we have two
EGLDisplays/DRIscreens that can share DRIimage objects (long story, and a
much more ugly patch), and it works perfectly.

The cover letter's description is right though, in that you get a cryptic
message thanks to relocation having been totally skipped when you submit
objects from a foreign bufmgr.

Cheers,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140911/6280b1ce/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mesa-intel-foreign-bufmgr.patch
Type: text/x-patch
Size: 2783 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140911/6280b1ce/attachment.bin>


More information about the dri-devel mailing list