[Mesa-dev] [PATCH v3 3/3] Add a new capabilities for drivers that can't share buffers

Axel Davy axel.davy at ens.fr
Thu Jun 19 13:19:16 PDT 2014


On 19/06/2014 15:56, Giovanni Campagna wrote :
> 2014-06-19 16:16 GMT+02:00 Axel Davy <axel.davy at ens.fr>:
>> On 15/06/2014 07:49, Giovanni Campagna wrote :
>>
>>> From: Giovanni Campagna <gcampagna at src.gnome.org>
>>>
>>> The kms-dri swrast driver cannot share buffers using the GEM,
>>> so it must tell the loader to disable extensions relying on
>>> that, without disabling the image DRI extension altogheter
>>> (which would prevent the loader from working at all).
>>> This requires a new gallium capability (which is queried on
>>> the pipe_screen and for swrast drivers it's forwared to the
>>> winsys), and requires a new version of the DRI image extension.
>>>
>> Why does this require a new version of the DRI image extension ?
>> Could you just set createImageFromName and CreateImageFromNames to NULL, and
>> add checks for that (instead of checking the capability ?
>> It's what is done to check if we can import dma-bufs (check if
>> createImageFromFds is not NULL).
> Yes, but in my opinion a generic getCapabilities() that returns a
> bitmask is more flexible, and will allow avoiding version increases
> and new vfuncs, should negotiation for new features be needed in the
> future.
>
> Giovanni
>
I have no opinion on which solution is better (checking if the DRIimage 
function is non null, or checking capability), but if we opt for 
capability, then the locations at which we check createImageFromFds 
against NULL should be modified to use getCapabilities. Also perhaps 
there's similar things happening for other DRIimage functions.

Axel Davy


More information about the mesa-dev mailing list