[Glamor] [PATCH] Allow to create textured pixmaps from gbm_bo without using gem names

Axel Davy davy at clipper.ens.fr
Tue Nov 19 00:23:16 PST 2013


On 19/11/2013, Zhigang Gong wrote :
> On Mon, Nov 18, 2013 at 10:52:22PM +0100, Axel Davy wrote:
>> This implements glamor_egl_create_textured_pixmap_from_gbm_bo,
>> which is similar to glamor_egl_create_textured_pixmap, except
>> it takes a gbm_bo as argument.
>>
>> Signed-off-by: Axel Davy <axel.davy at ens.fr>
>> ---
>> The goal of this patch is to enable create textured pixmaps
>> from bo without using gem names, which are forbidden on
>> render-nodes. Since wlglamor xwayland DDX can potentially
>> run under a render-node, it is required (and wlglamor uses
>> gbm_bo).
>> A gbm_bo can be created from an EGLImage, so this function
>> can be used to implement dri3 support (and avoiding gem
>> names): the DDX would use the Mesa extension to create
>> an EGLImage from an fd, then import it as a gbm_bo, and
>> pass it to glamor. Converting a gbm_bo to EGLImage and
>> vice-versa is quite straightforward for Mesa.
>>
>> If it is planned that glamor would give functions to
>> implement dri3 (get fd from pixmap, get pixmap from fd),
>> then this patch is useless.
> There is no plan for DRI3 support currently. If you have any
> proposal which could support DIR3 in glamor, you are welcome
> to submit it here for discussion. For now, this patch LGTM.
> will push it latter.
eglCreateImageKHR allows to create an image from a texture
(this is only supported on intel currently). Glamor could then
import the image as gbm_bo, get an handle from it,
and use the correct ioctl to get an fd.

To convert an fd into pixmap, it could use the
eglCreateImageKHR extension to import an fd as an
image (only supported on intel currently), and import
it as a texture.

That said, it would mean the DDX has less control over the
bo format used by pixmaps, since it would never allocate
the bo itself (tiling, etc, would be under the control of Mesa)
That can be a problem for using the pixmap bo
as scanout buffer.
>> The patch doesn't use 'struct gbm_bo *' but 'void *' to
>> avoid compilation issues if glamor doesn't have gbm
>> support.
>>
>> I've tested this patch on wlglamor with an intel card
>> and a radeon card. The intel card produces correctly
>> the image, but has an issue when rendering. I reported the
>> bug. I have no issues with my radeon card.
> Could you give a pointer to that bug with intel card?
>
> Thanks,
> Zhigang.
Yes: https://bugs.freedesktop.org/show_bug.cgi?id=71759

Axel Davy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/glamor/attachments/20131119/776de6c0/attachment.html>


More information about the Glamor mailing list