Skip to content

Commit e2fa30c

Browse files
committed
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
1 parent 4d71053 commit e2fa30c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

libs/gui/Android.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ LOCAL_SHARED_LIBRARIES := \
3232

3333
LOCAL_MODULE:= libgui
3434

35+
ifeq ($(TARGET_BOARD_PLATFORM), tegra)
36+
LOCAL_CFLAGS += -DALLOW_DEQUEUE_CURRENT_BUFFER
37+
endif
38+
3539
include $(BUILD_SHARED_LIBRARY)
3640

3741
ifeq (,$(ONE_SHOT_MAKEFILE))

libs/gui/SurfaceTexture.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@
3636
#include <utils/Log.h>
3737
#include <utils/String8.h>
3838

39-
40-
#define ALLOW_DEQUEUE_CURRENT_BUFFER false
39+
#ifdef ALLOW_DEQUEUE_CURRENT_BUFFER
40+
#define FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER true
41+
#warning "ALLOW_DEQUEUE_CURRENT_BUFFER enabled"
42+
#else
43+
#define FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER false
44+
#endif
4145

4246
// Macros for including the SurfaceTexture name in log messages
4347
#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,
325329
LOGW_IF((state == BufferSlot::FREE) && (mCurrentTexture==i),
326330
"dequeueBuffer: buffer %d is both FREE and current!", i);
327331

328-
if (ALLOW_DEQUEUE_CURRENT_BUFFER) {
332+
if (FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER) {
329333
if (state == BufferSlot::FREE || i == mCurrentTexture) {
330334
foundSync = i;
331335
if (i != mCurrentTexture) {

0 commit comments

Comments
 (0)