[Mesa-dev] [PATCH 7/9] wayland-drm: static inline wayland_drm_buffer_get

Daniel Stone daniel at fooishbar.org
Tue Oct 24 09:59:33 UTC 2017


Hi,

On 24 October 2017 at 07:01, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Mon, 23 Oct 2017 16:41:14 +0100
> Daniel Stone <daniel at fooishbar.org> wrote:
>> When a compositor wants to import a buffer into GBM, it calls
>> gbm_bo_import(), which will call wl_drm_buffer_get().
>> wl_drm_buffer_get will test (resource->interface ==
>> &wl_buffer_interface). Previously, both create_buffer() and
>> wl_drm_buffer_get() at least came from the same compilation unit, but
>> now they are built and linked separately. This seems to make an
>> existing problem (ambiguity of 'wl_buffer_interface') worse (symbol
>> resolution now performed in separate compilation units).
>
> this is not the whole truth. At least, if wl_drm_buffer_get() uses
> wl_resource_instance_of() rather than open-coding a broken version of
> the same.
>
>> I don't really see a solution to this, apart from no longer relying on
>> having a single canonical resolution of wl_buffer_interface. The above
>> patch implements that, by removing the interface-address-equal test
>> and replacing it with the destroy-listener test. The patch I provided
>> is equally valid both with and without your series.
>
> There is no relying on having a single canonical resolution of
> wl_buffer_interface, and there has never been as long as any part of
> libwayland has been stable.
>
> See:
> https://cgit.freedesktop.org/wayland/wayland/tree/src/connection.c?id=0.99.0#n840

Ha, guess it's been a while since I've looked at instance_of() then.
Or I just misremembered in the first place. Concern withdrawn in that
case. Presuming the same change is made in Meson, 7-9/9 are now:
Reviewed-by: Daniel Stone <daniels at collabora.com>

Cheers,
Daniel


More information about the mesa-dev mailing list