From 0b2c034f6457ef62cc20d308a91620116cdc057d Mon Sep 17 00:00:00 2001 From: Tomasz Figa Date: Sun, 30 Jul 2017 00:02:46 +0900 Subject: [PATCH] st/dri: enable 32-bit RGBX/RGBA formats only on Android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X/GLX can't handle them. This removes almost 500 GLX visuals that were incorrectly exposed. This is a less invasive version of Marek's .getCapability series. Note: the patch is not applicable for master, but only for the 17.2 branch. Suggested-by: Marek Olšák Signed-off-by: Tomasz Figa CC: Fixes: f33d8af7aa354d "st/dri: add 32-bit RGBX/RGBA formats" [Emil Velikov: commit message polish] Reviewed-by: Emil Velikov --- src/gallium/state_trackers/dri/dri_screen.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 59a850b1423..6bd479074fa 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -133,6 +133,11 @@ dri_fill_in_modes(struct dri_screen *screen) MESA_FORMAT_B8G8R8A8_SRGB, MESA_FORMAT_B8G8R8X8_SRGB, MESA_FORMAT_B5G6R5_UNORM, +#ifdef ANDROID + /* + * To reduce the risk of breaking non-Android users in stable release + * let's keep these for Android alone until this is handled properly. + */ /* The 32-bit RGBA format must not precede the 32-bit BGRA format. * Likewise for RGBX and BGRX. Otherwise, the GLX client and the GLX @@ -154,6 +159,7 @@ dri_fill_in_modes(struct dri_screen *screen) /* Required by Android, for HAL_PIXEL_FORMAT_RGBX_8888. */ MESA_FORMAT_R8G8B8X8_UNORM, +#endif }; static const enum pipe_format pipe_formats[] = { PIPE_FORMAT_BGRA8888_UNORM, @@ -161,8 +167,14 @@ dri_fill_in_modes(struct dri_screen *screen) PIPE_FORMAT_BGRA8888_SRGB, PIPE_FORMAT_BGRX8888_SRGB, PIPE_FORMAT_B5G6R5_UNORM, +#ifdef ANDROID + /* + * To reduce the risk of breaking non-Android users in stable release + * let's keep these for Android alone until this is handled properly. + */ PIPE_FORMAT_RGBA8888_UNORM, PIPE_FORMAT_RGBX8888_UNORM, +#endif }; mesa_format format; __DRIconfig **configs = NULL;