[Glamor] [PATCH] Allow to create textured pixmaps from gbm_bo without using gem names
Zhigang Gong
zhigang.gong at linux.intel.com
Tue Nov 26 17:22:27 PST 2013
On Tue, Nov 26, 2013 at 09:08:16PM +0100, davyaxel at free.fr wrote:
> >
> >
> > There seems to be a last issue to settle: texture format.
> >
> > Dri3 protocol doesn't share any information about the format of the buffers.
> >
> > That means for example that we can't know of which format is an imported buffer,
> > until the pixmap is associated to a window (then we can check the window visual).
> >
> > This is a problem I'm not sure the best way to solve.
> > Perhaps a way is to always use GL_BGRA over GL_RGBA for example, even if the content doesn't match to that.
> > I think this is already what happens when the pixmap has a textured created from a buffer comming from the DDX.
> >
> 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.
>
> Glamor Dri3 support could do that, and keep the old way when dri3 isn't enabled.
>
> Axel Davy
> _______________________________________________
> Glamor mailing list
> Glamor at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/glamor
More information about the Glamor
mailing list