[Mesa-dev] [PATCH v13 16/36] i965: Remove same-FD restriction for imports
Daniel Stone
daniel at fooishbar.org
Mon Jun 5 13:51:40 UTC 2017
Hi,
Getting back to this after holidays ...
On 19 May 2017 at 19:26, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Fri, May 19, 2017 at 2:37 AM, Daniel Stone <daniels at collabora.com> wrote:
>>
>> Intel hardware requires that all planes of an image come from the same
>> buffer, which is currently implemented by testing that all FDs are
>> numerically the same.
>>
>> However, when going through a winsys (e.g.) or anything which transits
>> FDs individually, the FDs may be different even if the underlying buffer
>> is the same.
>>
>> Since there is nothing we can do to detect this properly, just remove
>> the test for now.
>
> That's not actually true. If two FDs point to the same underlying GEM bo,
> then brw_bo_gem_create_from_prime (called below) will return the same
> pointers for both of them. What we really want to do is call that on all of
> the FDs (or maybe all of the unique FDs?) and check that they're all the
> same.
You're right: I hadn't spotted that the kernel FD -> handle import
actually reused handles rather than giving us unique ones. This works
great for Mesa with a BO cache (hash table keyed by GEM handle), but
means that everyone using it must do the same. Time to fix Weston, I
guess. :\
Varad's fix in v14 does the right thing, but leaks a reference for
every idx>=1 plane.
Cheers,
Daniel
More information about the mesa-dev
mailing list