summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-12-17 00:06:35 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-12-17 00:06:35 +0000
commit283955c9d380a39d8baab32008cab250ab66da93 (patch)
treec87c7bb1c44219e1cdf45506113ef451ce15d998
parentb90ef426c66264a7e492330286352c5d43dc7c26 (diff)
parent0b5ab223e110f3a34b30e7b61e4ea68c03dba98b (diff)
downloadlibhardware-283955c9d380a39d8baab32008cab250ab66da93.tar.gz
Snap for 8010657 from 0b5ab223e110f3a34b30e7b61e4ea68c03dba98b to sc-d2-release
Change-Id: Iae2d3f086c4b010bd2684990f1bf82bcef899f13
-rw-r--r--modules/gralloc/Android.mk3
-rw-r--r--modules/gralloc/framebuffer.cpp7
2 files changed, 8 insertions, 2 deletions
diff --git a/modules/gralloc/Android.mk b/modules/gralloc/Android.mk
index 439c95dd..4c4899ea 100644
--- a/modules/gralloc/Android.mk
+++ b/modules/gralloc/Android.mk
@@ -38,5 +38,8 @@ LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\" -Wno-missing-field-initializers
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 b2ec3e44..fc220dbc 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 @@ int mapFrameBufferLocked(struct private_module_t* module, int format)
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;