summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Amit Pundir <amit.pundir@linaro.org> 2015-04-18 20:37:58 +0530
committer Amit Pundir <amit.pundir@linaro.org> 2016-11-14 20:31:07 +0530
commit90c75a2f5bd539c50f9176f9be9a6a574fc606b7 (patch)
treeca6a54b6df5b19a0eae7aaf19620489ff8087269
parentab180e53b9a4dcae5f966584d5aa5021093aee66 (diff)
libGLES_android: Add generic 32bpp BGRA EGLConfig
Add generic 32bpp EGLConfig for BGRA pixel format. BGRA8888 is a common pixel format supported by ARM vendors for a while now and we end up using this proposed fix more often than not for software rendering display support during initial AOSP bringups or AOSP master smoke testing when corresponding hardware graphics blobs are not in sync with AOSP master changes. This EGLConfig is identical to config_4_attribute_list (RGBA_8888) with the only difference of BGRA_8888 EGL_NATIVE_VISUAL_ID. Boot tested on Hikey without hardware graphics (MALI) binary blobs. Boot failure without this patch: W SurfaceFlinger: no suitable EGLConfig found, trying a simpler query F SurfaceFlinger: no suitable EGLConfig found, giving up F libc : Fatal signal 6 (SIGABRT), code -6 in tid 1959 (surfaceflinger) F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** F DEBUG : Build fingerprint: 'generic/hikey/hikey:6.0.1/MASTER/pundir06081327:userdebug/test-keys' F DEBUG : Revision: '0' F DEBUG : ABI: 'arm64' F DEBUG : pid: 1959, tid: 1959, name: surfaceflinger >>> /system/bin/surfaceflinger <<< F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- F DEBUG : Abort message: 'no suitable EGLConfig found, giving up' Boot success with this patch: W SurfaceFlinger: no suitable EGLConfig found, trying a simpler query W SurfaceFlinger: EGL_SLOW_CONFIG selected! I SurfaceFlinger: EGL information: I SurfaceFlinger: vendor    : Android I SurfaceFlinger: version   : 1.4 Android META-EGL I SurfaceFlinger: extensions: EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_swap_buffers_with_damage EGL_KHR_image_base EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer I SurfaceFlinger: Client API: OpenGL_ES I SurfaceFlinger: EGLSurface: 8-8-8-8, config=0x8 I SurfaceFlinger: OpenGL ES informations: I SurfaceFlinger: vendor : Android I SurfaceFlinger: renderer : Android PixelFlinger 1.4 I SurfaceFlinger: version : Open GLES-CM 1.0 Change-Id: I9b17ff67275fe4284a1c0699af04ba480280f607 Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--opengl/libagl/egl.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index c1efd1cae6..d43b61b98a 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -740,6 +740,7 @@ egl_pbuffer_surface_t::egl_pbuffer_surface_t(EGLDisplay dpy,
case GGL_PIXEL_FORMAT_RGB_565: size *= 2; break;
case GGL_PIXEL_FORMAT_RGBA_8888: size *= 4; break;
case GGL_PIXEL_FORMAT_RGBX_8888: size *= 4; break;
+ case GGL_PIXEL_FORMAT_BGRA_8888: size *= 4; break;
default:
ALOGE("incompatible pixel format for pbuffer (format=%d)", f);
pbuffer.data = 0;
@@ -1027,6 +1028,19 @@ static config_pair_t const config_7_attribute_list[] = {
{ EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
};
+// BGRA 8888 config
+static config_pair_t const config_8_attribute_list[] = {
+ { EGL_BUFFER_SIZE, 32 },
+ { EGL_ALPHA_SIZE, 8 },
+ { EGL_BLUE_SIZE, 8 },
+ { EGL_GREEN_SIZE, 8 },
+ { EGL_RED_SIZE, 8 },
+ { EGL_DEPTH_SIZE, 0 },
+ { EGL_CONFIG_ID, 8 },
+ { EGL_NATIVE_VISUAL_ID, GGL_PIXEL_FORMAT_BGRA_8888 },
+ { EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_PBUFFER_BIT|EGL_PIXMAP_BIT },
+};
+
static configs_t const gConfigs[] = {
{ config_0_attribute_list, NELEM(config_0_attribute_list) },
{ config_1_attribute_list, NELEM(config_1_attribute_list) },
@@ -1036,6 +1050,7 @@ static configs_t const gConfigs[] = {
{ config_5_attribute_list, NELEM(config_5_attribute_list) },
{ config_6_attribute_list, NELEM(config_6_attribute_list) },
{ config_7_attribute_list, NELEM(config_7_attribute_list) },
+ { config_8_attribute_list, NELEM(config_8_attribute_list) },
};
static config_management_t const gConfigManagement[] = {
@@ -1118,6 +1133,10 @@ static status_t getConfigFormatInfo(EGLint configID,
pixelFormat = GGL_PIXEL_FORMAT_A_8;
depthFormat = GGL_PIXEL_FORMAT_Z_16;
break;
+ case 8:
+ pixelFormat = GGL_PIXEL_FORMAT_BGRA_8888;
+ depthFormat = 0;
+ break;
default:
return NAME_NOT_FOUND;
}