Skip to content

Commit

Permalink
egl: Add back b/10194508 workaround.
Browse files Browse the repository at this point in the history
This was removed because it did not pass CTS and was applied across the board
for all OMAP4 devices, but some still-shipping OMAP4 devices don't need it
due to using DDK 1.12 drivers. Those drivers are only for OMAP4470 though,
and other devices besides OMAPs depend on this workaround too, and we don't
care about CTS for them anyway.

This patch adds this previously-long-standing behavior (EGL_NATIVE_VISUAL_ID)
back under the opt-in BOARD_EGL_WORKAROUND_BUG_10194508 flag.

Change-Id: Ie611634952a35dc756f1de806c850235caf73544
  • Loading branch information
MWisBest authored and andi34 committed Sep 17, 2016
1 parent 3632479 commit 3f02f36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions opengl/libs/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ LOCAL_CFLAGS += -fvisibility=hidden
ifeq ($(BOARD_ALLOW_EGL_HIBERNATION),true)
LOCAL_CFLAGS += -DBOARD_ALLOW_EGL_HIBERNATION
endif
ifeq ($(BOARD_EGL_WORKAROUND_BUG_10194508),true)
LOCAL_CFLAGS += -DWORKAROUND_BUG_10194508
endif
ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),)
LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE)
endif
Expand Down
13 changes: 10 additions & 3 deletions opengl/libs/EGL/eglApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,17 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
// of our native format. So if sRGB gamma is requested, we have to
// modify the EGLconfig's format before setting the native window's
// format.

// by default, just pick RGBA_8888
EGLint format = HAL_PIXEL_FORMAT_RGBA_8888;
EGLint format;
android_dataspace dataSpace = HAL_DATASPACE_UNKNOWN;

#ifdef WORKAROUND_BUG_10194508
if (!cnx->egl.eglGetConfigAttrib(iDpy, config, EGL_NATIVE_VISUAL_ID,
&format)) {
ALOGE("eglGetConfigAttrib(EGL_NATIVE_VISUAL_ID) failed: %#x",
eglGetError());
format = 0;
}
#else
EGLint a = 0;
cnx->egl.eglGetConfigAttrib(iDpy, config, EGL_ALPHA_SIZE, &a);
if (a > 0) {
Expand All @@ -492,6 +498,7 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
format = HAL_PIXEL_FORMAT_RGBX_8888;
}
}
#endif

// now select a corresponding sRGB format if needed
if (attrib_list && dp->haveExtension("EGL_KHR_gl_colorspace")) {
Expand Down

0 comments on commit 3f02f36

Please sign in to comment.