<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On 11 September 2014 12:52, Chris Wilson <span dir="ltr"><<a href="mailto:chris@chris-wilson.co.uk" target="_blank">chris@chris-wilson.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Sep 11, 2014 at 12:33:41PM +0100, Lionel Landwerlin wrote:<br>
> When using Mesa and LibVA in the same process, one would like to be<br>
> able bind buffers from the output of the decoder to a GL texture<br>
> through an EGLImage.<br>
><br>
> LibVA can reuse buffers allocated by Gbm through a file descriptor. It<br>
> will then wrap it into a drm_intel_bo with<br>
> drm_intel_bo_gem_create_from_prime().<br>
><br>
> Given both libraries are using libdrm to allocate and use buffer<br>
> objects, there is a need to have the buffer objects properly<br>
> refcounted. That is possible if both API use the same drm_intel_bo<br>
> objects, but that also requires that both API use the same<br>
> drm_intel_bufmgr object.<br>
<br>
</span>The description is wrong though. Reusing buffers export and import<br>
through a dmabuf, should work and be correctly refcounted already.<br></blockquote><div><br></div><div>Indeed.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Cheers,</div><div>Daniel</div></div></div></div>