Mesa (master): egl/wayland: Add format enums to visual map

Daniel Stone daniels at kemper.freedesktop.org
Fri Feb 9 16:25:42 UTC 2018


Module: Mesa
Branch: master
Commit: 1dc013f1ee2246e683d18b968c07f6ab9cf76981
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1dc013f1ee2246e683d18b968c07f6ab9cf76981

Author: Daniel Stone <daniels at collabora.com>
Date:   Tue Feb  6 09:42:27 2018 +0000

egl/wayland: Add format enums to visual map

Extend the visual map from only containing names and bitmasks, to also
carrying the three format enums we need. These are the DRIImage format
tokens for internal allocation, FourCC codes for wl_drm and dmabuf
protocol, and wl_shm codes for swrast drivers.

We will later use these formats to eliminate a bunch of open-coded
conversions.

Signed-off-by: Daniel Stone <daniels at collabora.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Tested-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/egl/drivers/dri2/platform_wayland.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 1384cddd6b..b72b5f8b88 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -68,26 +68,39 @@ enum wl_drm_format_flags {
 static const struct {
    const char *format_name;
    enum wl_drm_format_flags has_format;
+   uint32_t wl_drm_format;
+   uint32_t wl_shm_format;
+   int dri_image_format;
    unsigned int rgba_masks[4];
 } dri2_wl_visuals[] = {
    {
      "XRGB2101010", HAS_XRGB2101010,
+     WL_DRM_FORMAT_XRGB2101010, WL_SHM_FORMAT_XRGB2101010,
+     __DRI_IMAGE_FORMAT_XRGB2101010,
      { 0x3ff00000, 0x000ffc00, 0x000003ff, 0x00000000 }
    },
    {
      "ARGB2101010", HAS_ARGB2101010,
+     WL_DRM_FORMAT_ARGB2101010, WL_SHM_FORMAT_ARGB2101010,
+     __DRI_IMAGE_FORMAT_ARGB2101010,
      { 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 }
    },
    {
      "XRGB8888", HAS_XRGB8888,
+     WL_DRM_FORMAT_XRGB8888, WL_SHM_FORMAT_XRGB8888,
+     __DRI_IMAGE_FORMAT_XRGB8888,
      { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }
    },
    {
      "ARGB8888", HAS_ARGB8888,
+     WL_DRM_FORMAT_ARGB8888, WL_SHM_FORMAT_ARGB8888,
+     __DRI_IMAGE_FORMAT_ARGB8888,
      { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }
    },
    {
      "RGB565", HAS_RGB565,
+     WL_DRM_FORMAT_RGB565, WL_SHM_FORMAT_RGB565,
+     __DRI_IMAGE_FORMAT_RGB565,
      { 0xf800, 0x07e0, 0x001f, 0x0000 }
    },
 };




More information about the mesa-commit mailing list