Hi,

On 11 September 2014 12:52, Chris Wilson <chris@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