summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Stone <[email protected]>2015-03-02 13:52:59 +0000
committerEmil Velikov <[email protected]>2015-03-07 17:22:05 +0000
commit8357abf4c3a7ea7f2c4e2dcc4381333a979a0758 (patch)
tree6e2a4d7f0b47fa037b059e7e7ea46b26bcfc8558 /src
parentb0f60c891aed6340a4c4e4d1dbf594b97c404d4f (diff)
egl: Take alpha bits into account when selecting GBM formats
This fixes piglit when using PIGLIT_PLATFORM=gbm Tom Stellard: - Fix ARGB2101010 format Cc: "10.4 10.5" <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Chad Versace <[email protected]> (cherry picked from commit 65c8965d033cf9ade5e6f3c88bda6d247d46af9d)
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/platform_drm.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 02e87f7771b..bf205bef47a 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -668,15 +668,21 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
EGLint format, attr_list[3];
- unsigned int mask;
+ unsigned int red, alpha;
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[i],
- __DRI_ATTRIB_RED_MASK, &mask);
- if (mask == 0x3ff00000)
+ __DRI_ATTRIB_RED_MASK, &red);
+ dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[i],
+ __DRI_ATTRIB_ALPHA_MASK, &alpha);
+ if (red == 0x3ff00000 && alpha == 0x00000000)
format = GBM_FORMAT_XRGB2101010;
- else if (mask == 0x00ff0000)
+ else if (red == 0x3ff00000 && alpha == 0xc0000000)
+ format = GBM_FORMAT_ARGB2101010;
+ else if (red == 0x00ff0000 && alpha == 0x00000000)
format = GBM_FORMAT_XRGB8888;
- else if (mask == 0xf800)
+ else if (red == 0x00ff0000 && alpha == 0xff000000)
+ format = GBM_FORMAT_ARGB8888;
+ else if (red == 0xf800)
format = GBM_FORMAT_RGB565;
else
continue;