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

Author: Daniel Stone <dani...@collabora.com>
Date:   Tue Feb  6 17:38:37 2018 +0000

gbm/dri: Add RGBA masks to GBM format table

Eventually, we can replace the visuals list inside GBM EGL driver with
this one.

Signed-off-by: Daniel Stone <dani...@collabora.com>
Reviewed-by: Emil Velikov <emil.veli...@collabora.com>
Tested-by: Ilia Mirkin <imir...@alum.mit.edu>

---

 src/gbm/backends/dri/gbm_dri.c | 46 +++++++++++++++++++++++++++++++++---------
 1 file changed, 37 insertions(+), 9 deletions(-)

diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index fd5fb4b91c..7e2423e935 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -546,16 +546,44 @@ dri_screen_create_sw(struct gbm_dri_device *dri)
 static const struct {
    uint32_t gbm_format;
    int dri_image_format;
+   uint32_t rgba_masks[4];
 } gbm_to_dri_image_formats[] = {
-   { GBM_FORMAT_R8,          __DRI_IMAGE_FORMAT_R8          },
-   { GBM_FORMAT_GR88,        __DRI_IMAGE_FORMAT_GR88        },
-   { GBM_FORMAT_RGB565,      __DRI_IMAGE_FORMAT_RGB565      },
-   { GBM_FORMAT_XRGB8888,    __DRI_IMAGE_FORMAT_XRGB8888    },
-   { GBM_FORMAT_ARGB8888,    __DRI_IMAGE_FORMAT_ARGB8888    },
-   { GBM_FORMAT_XBGR8888,    __DRI_IMAGE_FORMAT_XBGR8888    },
-   { GBM_FORMAT_ABGR8888,    __DRI_IMAGE_FORMAT_ABGR8888    },
-   { GBM_FORMAT_XRGB2101010, __DRI_IMAGE_FORMAT_XRGB2101010 },
-   { GBM_FORMAT_ARGB2101010, __DRI_IMAGE_FORMAT_ARGB2101010 },
+   {
+     GBM_FORMAT_R8, __DRI_IMAGE_FORMAT_R8,
+     { 0x000000ff, 0x00000000, 0x00000000, 0x00000000 },
+   },
+   {
+     GBM_FORMAT_GR88, __DRI_IMAGE_FORMAT_GR88,
+     { 0x000000ff, 0x0000ff00, 0x00000000, 0x00000000 },
+   },
+   {
+     GBM_FORMAT_RGB565, __DRI_IMAGE_FORMAT_RGB565,
+     { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 },
+   },
+   {
+     GBM_FORMAT_XRGB8888, __DRI_IMAGE_FORMAT_XRGB8888,
+     { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 },
+   },
+   {
+     GBM_FORMAT_ARGB8888, __DRI_IMAGE_FORMAT_ARGB8888,
+     { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x000000ff },
+   },
+   {
+     GBM_FORMAT_XBGR8888, __DRI_IMAGE_FORMAT_XBGR8888,
+     { 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000 },
+   },
+   {
+     GBM_FORMAT_ABGR8888, __DRI_IMAGE_FORMAT_ABGR8888,
+     { 0x000000ff, 0x0000ff00, 0x00ff0000, 0x000000ff },
+   },
+   {
+     GBM_FORMAT_XRGB2101010, __DRI_IMAGE_FORMAT_XRGB2101010,
+     { 0x3ff00000, 0x000ffc00, 0x000003ff, 0x00000000 },
+   },
+   {
+     GBM_FORMAT_ARGB2101010, __DRI_IMAGE_FORMAT_ARGB2101010,
+     { 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 },
+   },
 };
 
 /* The two GBM_BO_FORMAT_[XA]RGB8888 formats alias the GBM_FORMAT_*

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to