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

Author: Daniel Stone <dani...@collabora.com>
Date:   Tue Feb  6 18:06:52 2018 +0000

egl/wayland: Widen channel masks to bpp

Widen the channel masks given in the visual table to the full width of
the pixel format, i.e. as many leading zeros as required.

No functional change.

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/egl/drivers/dri2/platform_wayland.c | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c 
b/src/egl/drivers/dri2/platform_wayland.c
index e1d5af4e3f..b74dfa2ba9 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -70,11 +70,26 @@ static const struct {
    int has_format;
    unsigned int rgba_masks[4];
 } dri2_wl_visuals[] = {
-   { "XRGB2101010", HAS_XRGB2101010, { 0x3ff00000, 0xffc00, 0x3ff, 0 } },
-   { "ARGB2101010", HAS_ARGB2101010, { 0x3ff00000, 0xffc00, 0x3ff, 0xc0000000 
} },
-   { "XRGB8888", HAS_XRGB8888, { 0xff0000, 0xff00, 0x00ff, 0 } },
-   { "ARGB8888", HAS_ARGB8888, { 0xff0000, 0xff00, 0x00ff, 0xff000000 } },
-   { "RGB565",   HAS_RGB565,   { 0x00f800, 0x07e0, 0x001f, 0 } },
+   {
+     "XRGB2101010", HAS_XRGB2101010,
+     { 0x3ff00000, 0x000ffc00, 0x000003ff, 0x00000000 }
+   },
+   {
+     "ARGB2101010", HAS_ARGB2101010,
+     { 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 }
+   },
+   {
+     "XRGB8888", HAS_XRGB8888,
+     { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }
+   },
+   {
+     "ARGB8888", HAS_ARGB8888,
+     { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }
+   },
+   {
+     "RGB565", HAS_RGB565,
+     { 0xf800, 0x07e0, 0x001f, 0x0000 }
+   },
 };
 
 static int

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

Reply via email to