commit | d2299dd03b2c98858425f506c61f03413a147214 | [log] [tgz] |
---|---|---|
author | YiMing Tseng <yimingtseng@google.com> | Thu Dec 16 03:32:23 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Dec 16 03:32:23 2021 +0000 |
tree | 89dd926e78001e0bfdc4698ae7bc5163844afd56 | |
parent | 4b4cb8dab3ae8d0cc01af25984473799bbf939c9 [diff] | |
parent | 56747f919a98d7cffff3bc68cd6cda6460a64ac2 [diff] |
Add GRALLOC_FRAMEBUFFER_NUM configuration am: 0b5ab223e1 am: 56747f919a Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/16235226 Change-Id: I235c7d209671734473f9e5885b49e1670a19fcf2
diff --git a/modules/gralloc/Android.mk b/modules/gralloc/Android.mk index 439c95d..4c4899e 100644 --- a/modules/gralloc/Android.mk +++ b/modules/gralloc/Android.mk
@@ -38,5 +38,8 @@ ifeq ($(TARGET_USE_PAN_DISPLAY),true) LOCAL_CFLAGS += -DUSE_PAN_DISPLAY=1 endif +ifneq ($(GRALLOC_FRAMEBUFFER_NUM),) +LOCAL_CFLAGS += -DNUM_BUFFERS=$(GRALLOC_FRAMEBUFFER_NUM) +endif include $(BUILD_SHARED_LIBRARY)
diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp index b2ec3e4..fc220db 100644 --- a/modules/gralloc/framebuffer.cpp +++ b/modules/gralloc/framebuffer.cpp
@@ -45,8 +45,10 @@ #define USE_PAN_DISPLAY 0 #endif -// numbers of buffers for page flipping +// Enabling page flipping by default +#ifndef NUM_BUFFERS #define NUM_BUFFERS 2 +#endif enum { @@ -157,7 +159,8 @@ info.activate = FB_ACTIVATE_NOW; /* - * Request NUM_BUFFERS screens (at lest 2 for page flipping) + * Request NUM_BUFFERS screens + * To enable page flipping, NUM_BUFFERS should be at least 2. */ info.yres_virtual = info.yres * NUM_BUFFERS;