[Mesa-dev] [PATCH v11 10/15] vulkan/wsi/x11: Add support for DRI3 v1.1

Daniel Stone daniel at fooishbar.org
Wed Feb 21 21:33:23 UTC 2018


Hi,

On 21 February 2018 at 21:24, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Wed, Feb 21, 2018 at 1:22 PM, Jason Ekstrand <jason at jlekstrand.net>
> wrote:
>>> +   uint32_t n = 0;
>>> +   uint32_t counts[2];
>>> +   uint64_t *modifiers[2];
>>> +
>>> +   if (mod_reply->num_drawable_modifiers) {
>>> +      counts[n] = mod_reply->num_drawable_modifiers;
>>> +      modifiers[n] = vk_alloc(pAllocator,
>>> +                              counts[n] * sizeof(uint64_t),
>>> +                              8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
>>> +      if (!modifiers[n]) {
>>> +         free(mod_reply);
>>> +         goto out;
>>> +      }
>>> +
>>> +      memcpy(modifiers[n],
>>> +
>>> xcb_dri3_get_supported_modifiers_drawable_modifiers(mod_reply),
>>
>> Did we ever get a solid answer on whether or not this memcpy is really
>> needed?  I doubt it is.
>
> I'm an idiot.  It is needed because we free mod_reply at the end of the
> function.  We could probably restructure so it isn't needed but I doubt it's
> really worth it.

Yeah, I couldn't see a way to cleanly plumb it through.

Cheers,
Daniel


More information about the mesa-dev mailing list