Skip to content

Commit e7758be

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 Change-Id: I939992b4cd0debea980dec0127c72be2dff33af8
1 parent 6b228af commit e7758be

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__)
@@ -323,7 +327,7 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
323327
LOGW_IF((state == BufferSlot::FREE) && (mCurrentTexture==i),
324328
"dequeueBuffer: buffer %d is both FREE and current!", i);
325329

326-
if (ALLOW_DEQUEUE_CURRENT_BUFFER) {
330+
if (FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER) {
327331
if (state == BufferSlot::FREE || i == mCurrentTexture) {
328332
foundSync = i;
329333
if (i != mCurrentTexture) {

0 commit comments

Comments
 (0)