[PATCH 6/7] anv: add VK_EXT_display_control to anv driver [v2]

Keith Packard keithp at keithp.com
Wed Jun 20 05:31:46 UTC 2018


Jason Ekstrand <jason at jlekstrand.net> writes:

>> +   if (allocator)
>> +     alloc = allocator;
>> +   else
>> +     alloc = &device->instance->alloc;
>>
>
> This is what vk_alloc2 is for. :-)
...
> And vk_free2
...
> This isn't needed if you're using vk_alloc2

Yeah, but I need to pass the allocator down to the wsi common code, and
that doesn't have any way to touch the device driver allocator
pointer. I bet I'm just missing something here. Help?

>> +
>> +   fence = vk_zalloc2(&device->alloc, allocator, sizeof (*fence), 8,
>> +                      VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
>>
>
> Above you used vk_alloc and here you're using vk_zalloc.  Mind picking
> one?  I don't think zalloc is needed but it doesn't hurt so I don't care
> which.

Thanks. Existing code is using zalloc for fences; I'll use that everywhere.

> Indentation could be consistent between the two functions you add.  I don't
> care which style.

Sure; these function names are kinda long. I've wrapped the first call
after the (

> vk_free2?

I've had to compute 'alloc' to pass into wsi_common; I figured I might
as well use it.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180619/9773bcd9/attachment.sig>


More information about the dri-devel mailing list