[Mesa-dev] [PATCH 3/3] egl/x11: Handle both depth 30 formats for eglCreateImage().

Michel Dänzer michel at daenzer.net
Fri Apr 6 10:01:08 UTC 2018


On 2018-03-27 07:53 PM, Daniel Stone wrote:
> On 12 March 2018 at 20:45, Mario Kleiner <mario.kleiner.de at gmail.com> wrote:
>> We need to distinguish if a backing pixmap of a window is
>> XRGB2101010 or XBGR2101010, as different gpu hw supports
>> different formats. NVidia hw prefers XBGR, whereas AMD and
>> Intel are happy with XRGB.
>>
>> We use the red channel mask of the visual to distinguish at
>> depth 30, but because we can't easily get the associated
>> visual of a Pixmap, we use the visual of the x-screens root
>> window instead as a proxy.
>>
>> This fixes desktop composition of color depth 30 windows
>> when the X11 compositor uses EGL.
> 
> I have no reason to doubt your testing, so this patch is:
> Acked-by: Daniel Stone <daniels at collabora.com>
> 
> But it does rather fill me with trepidation, given that X11 Pixmaps
> are supposed to be a dumb 'bag of bits', doing nothing else than
> providing the same number and size of channels to the actual client
> data for the Visual associated with the Window.

As far as X11 is concerned, the number of channels and their sizes don't
even matter; a pixmap is simply a container for an unsigned integer of n
bits (where n is the pixmap depth) per pixel, with no inherent meaning
attached to those values.

That said, I'm not sure this is true for EGL as well. But even if it
isn't, there would have to be another mechanism to determine the format,
e.g. a config associated with the EGL pixmap. The pixmap doesn't even
necessarily have the same depth as the root window, so using the
latter's visual doesn't make much sense.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list