[Glamor] Discussing DRI3 support

davyaxel at free.fr davyaxel at free.fr
Wed Nov 27 10:14:32 PST 2013


On 27/11/2013, Zhigang Gong wrote :
> On Tue, Nov 26, 2013 at 09:08:16PM +0100, davyaxel at free.fr wrote:
>
>> I think the best approach is to consider we live in an argb8888 world (which seems a pretty good asumption right now).
>
> Actually, just as you mentioned in last email glamor already faces this problem and uses this assumption too.
> And it uses ARGB8888 for depth32.
>
>>
>> We can't know which component order will result when allocating a texture with GL_BGRA of GL_RGBA.
> Right, the actual internal texture format, the real pixel format, is hardware driver dependent. 
>> For example with gallium drivers, GL_RGBA (the one we use now for all textures) is ABGR8888.
>> To ensure we use ARGB8888, the best to me seems to allocate an argb8888 gbm_bo, and create the texture from it (after converting to an image).
> I agree with this solution.
>
> Thanks,
> Zhigang Gong.
>
>

Thanks.

Could you please tell what you think of the following to enable/handle dri3:

. glamor_init has a new flag GLAMOR_ENABLE_DRI3.
glamor_init would call a glamor_egl function to indicate to glamor_egl the user wants to enable dri3 support.

. In glamor_egl_init, glamor_egl decides if the egl display is dri3 capable. It calls a glamor function that will enable
dri3 support.

. The user has access to a function to know if dri3 support is enabled.

. If dri3 support is enabled, when creating a texture, glamor will first try to get the texture by calling
a glamor_egl function to create a texture (and glamor_egl would use a gbm_bo for this).

. glamor_egl can store the gbm_bo with its private pixmap key with the pixmap, to be able to avoid unnecessary steps when
having to get an fd from a pixmap (it won't need to get the texture from glamor).

. When a pixmap is destroyed, glamor will always call a glamor_egl function if dri3 support is enabled, to enable glamor_egl to delete the gbm_bo.

. glamor defines a function to get the glamor_pixmap_type of a pixmap.

. glamor_egl would define two functions to convert a pixmap to an fd and an fd to a pixmap. The behaviours and types would match exactly to what
asks X Dri3 for the DDXs. The functions would do nothing if dri3 support isn't enabled.




Axel Davy 


More information about the Glamor mailing list