mesa/src/egl
Mario Kleiner 61a02729f7 egl/x11: Handle both depth 30 formats for eglCreateImage(). (v4)
We need to distinguish if the backing storage of a pixmap
is XRGB2101010 or XBGR2101010, as different gpu hw supports
different formats. NVidia hw prefers XBGR, whereas AMD and
Intel are happy with XRGB.

Use the red channel mask of the first depth 30 visual of
the x-screen to distinguish which hw format to choose.

This fixes desktop composition of color depth 30 windows
when the X11 compositor uses EGL.

v2: Switch from using the visual of the root window to simply
    using the first depth 30 visual for the x-screen, as testing
    shows that each driver only exports either xrgb ordering or
    xbgr ordering for the channel masks of its depth 30 visuals,
    so this should be unambiguous and avoid trouble if X ever
    supports depth 30 pixmaps on screens with a non-depth 30 root
    window visual. This per Michels suggestion.

v3: No change to v2, but spent some time testing this more on
    AMD hw, with my software hacked up to intentionally choose
    pixel formats/visual with the non-preferred xBGR2101010
    ordering on the ati-ddx, also with a standard non-OpenGL
    X-Window with depth 30 visual, to make sure that things show
    up properly with the right colors on the screen when going
    through EGL+OpenGL based compositing on KDE-5. Iow. to confirm
    that my explanation to the v2 patch on the mailing list of why
    it should work and the actual practice agree (or possibly that
    i am good at fooling myself during testing ;).

v4: Drop the local `red_mask` and just `return visual->red_mask`/
    `return 0`, as suggested by Eric Engestrom.

    Rebased onto current master, to take the cleanup via the new
    function dri2_format_for_depth() into account.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-08-01 12:55:37 +01:00
..
drivers egl/x11: Handle both depth 30 formats for eglCreateImage(). (v4) 2018-08-01 12:55:37 +01:00
generate egl: Add dma_buf_import_modifiers for glvnd 2017-08-21 12:13:50 +01:00
main egl: Fix missing clamping in eglSetDamageRegionKHR 2018-07-24 14:46:21 +01:00
wayland egl: remove wayland-egl now that we're using libwayland-egl 2018-06-06 12:12:01 -07:00
.gitignore egl: add gitignore 2017-04-22 00:42:38 +01:00
Android.mk egl: Use the canonical drm-uapi fourcc header to avoid local defines. 2018-07-18 10:37:54 -07:00
egl-entrypoint-check
egl-symbols-check *-symbol-check: use correct nm path when cross-compiling 2018-02-26 13:50:59 +00:00
Makefile.am egl: Use the canonical drm-uapi fourcc header to avoid local defines. 2018-07-18 10:37:54 -07:00
Makefile.sources egl: remove suprous header eglcompiler.h 2017-05-08 15:33:59 +01:00
meson.build egl: Use the canonical drm-uapi fourcc header to avoid local defines. 2018-07-18 10:37:54 -07:00
SConscript egl: Use the canonical drm-uapi fourcc header to avoid local defines. 2018-07-18 10:37:54 -07:00