summaryrefslogtreecommitdiffstats
path: root/libs/gui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-14 19:17:37 -0800
committerMathias Agopian <mathias@google.com>2011-11-18 13:50:35 -0800
commit7c6eba666917308a64fadb0f0e08d7c041311976 (patch)
tree91e4f8803c41877ff323eb864f18b763340edfa6 /libs/gui
parent6285c6cf1076e15bef12da8800ed64e4bd6e2ec8 (diff)
downloadframeworks_native-7c6eba666917308a64fadb0f0e08d7c041311976.zip
frameworks_native-7c6eba666917308a64fadb0f0e08d7c041311976.tar.gz
frameworks_native-7c6eba666917308a64fadb0f0e08d7c041311976.tar.bz2
enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices
this flag should be enabled for all targets, but currently some have issues with it, so we're turning it on only for tested targets. this will hopefully resolve some performance issues. Bug: 5553562, 5631630 Change-Id: I54c7a9e2068586898ab13e405d95534669260537
Diffstat (limited to 'libs/gui')
-rw-r--r--libs/gui/Android.mk4
-rw-r--r--libs/gui/SurfaceTexture.cpp10
2 files changed, 11 insertions, 3 deletions
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index ed319f5..9767568 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -32,6 +32,10 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_MODULE:= libgui
+ifeq ($(TARGET_BOARD_PLATFORM), tegra)
+ LOCAL_CFLAGS += -DALLOW_DEQUEUE_CURRENT_BUFFER
+endif
+
include $(BUILD_SHARED_LIBRARY)
ifeq (,$(ONE_SHOT_MAKEFILE))
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 0561909..bec962f 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -36,8 +36,12 @@
#include <utils/Log.h>
#include <utils/String8.h>
-
-#define ALLOW_DEQUEUE_CURRENT_BUFFER false
+#ifdef ALLOW_DEQUEUE_CURRENT_BUFFER
+#define FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER true
+#warning "ALLOW_DEQUEUE_CURRENT_BUFFER enabled"
+#else
+#define FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER false
+#endif
// Macros for including the SurfaceTexture name in log messages
#define ST_LOGV(x, ...) LOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
@@ -325,7 +329,7 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
LOGW_IF((state == BufferSlot::FREE) && (mCurrentTexture==i),
"dequeueBuffer: buffer %d is both FREE and current!", i);
- if (ALLOW_DEQUEUE_CURRENT_BUFFER) {
+ if (FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER) {
if (state == BufferSlot::FREE || i == mCurrentTexture) {
foundSync = i;
if (i != mCurrentTexture) {