summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAndrew Dodd <atd7@cornell.edu>2012-12-10 08:26:54 -0500
committerAndrew Dodd <atd7@cornell.edu>2012-12-10 18:49:46 -0500
commita0a706b8258863757cf2e3664c8fddaa794a0514 (patch)
tree2301ee95a505b2d5c2df27e45a4a6400e6ec9238 /services
parenta1aa229340e805da8cbd1edaaf2e6fcb380a1070 (diff)
downloadframeworks_native-a0a706b8258863757cf2e3664c8fddaa794a0514.zip
frameworks_native-a0a706b8258863757cf2e3664c8fddaa794a0514.tar.gz
frameworks_native-a0a706b8258863757cf2e3664c8fddaa794a0514.tar.bz2
DisplayDevice: Backwards compatibility with old EGL
From 4.1 to 4.2, the display subsystem was reworked to use SurfaceTextureClient/BufferQueue instead of FramebufferNativeWindow for the framebuffer itself. Unfortunately, some legacy EGL libraries make assumptions that any framebuffer device will be FramebufferNativeWindow. These EGL libraries will fail when used in 4.2 as if the framebuffer is not FramebufferNativeWindow, they will try to dequeue more than one buffer at a time, which will cause a hang of the graphics subsystem. This allows use of FramebufferNativeWindow to keep legacy EGL implementations happy. Confirmed EGL implementations that need this include but are not limited to: Set BOARD_EGL_NEEDS_LEGACY_FB to use Tegra2/3 ICS EGL Mali400 ICS EGL (Allwinner A10) Mali400 Jellybean (4.1) EGL (Samsung Exynos4) Original implementation by OndraOrg of XDA: http://forum.xda-developers.com/showpost.php?p=34469675&postcount=19 Change-Id: I74005cf6753b3c9bfb4c1e32fb641f5167787917
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/Android.mk4
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp7
2 files changed, 11 insertions, 0 deletions
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index 5a57697..69c4e21 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -38,6 +38,10 @@ ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true)
LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
endif
+ifeq ($(BOARD_EGL_NEEDS_LEGACY_FB),true)
+ LOCAL_CFLAGS += -DBOARD_EGL_NEEDS_LEGACY_FB
+endif
+
ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
endif
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index c56645f..395402d 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -28,6 +28,9 @@
#include <ui/PixelFormat.h>
#include <gui/SurfaceTextureClient.h>
+#ifdef BOARD_EGL_NEEDS_LEGACY_FB
+#include <ui/FramebufferNativeWindow.h>
+#endif
#include <GLES/gl.h>
#include <EGL/egl.h>
@@ -123,7 +126,11 @@ EGLSurface DisplayDevice::getEGLSurface() const {
void DisplayDevice::init(EGLConfig config)
{
+#ifndef BOARD_EGL_NEEDS_LEGACY_FB
ANativeWindow* const window = mNativeWindow.get();
+#else
+ ANativeWindow* const window = new FramebufferNativeWindow();
+#endif
int format;
window->query(window, NATIVE_WINDOW_FORMAT, &format);