Add GRALLOC_FRAMEBUFFER_NUM configuration
Add config to set the NUM_BUFFERS. Set NUM_BUFFERS to 1 can prevent page flipping and set it to a larger number can allow userspace to fill up the following frame earlier. Bug: 205917753 Change-Id: Ibf4a52a1e35f4a2404008a48b637cb82c4b46365
This commit is contained in:
parent
dbf2545214
commit
0b5ab223e1
2 changed files with 8 additions and 2 deletions
|
@ -38,5 +38,8 @@ LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\" -Wno-missing-field-initializers
|
||||||
ifeq ($(TARGET_USE_PAN_DISPLAY),true)
|
ifeq ($(TARGET_USE_PAN_DISPLAY),true)
|
||||||
LOCAL_CFLAGS += -DUSE_PAN_DISPLAY=1
|
LOCAL_CFLAGS += -DUSE_PAN_DISPLAY=1
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(GRALLOC_FRAMEBUFFER_NUM),)
|
||||||
|
LOCAL_CFLAGS += -DNUM_BUFFERS=$(GRALLOC_FRAMEBUFFER_NUM)
|
||||||
|
endif
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
|
@ -45,8 +45,10 @@
|
||||||
#define USE_PAN_DISPLAY 0
|
#define USE_PAN_DISPLAY 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// numbers of buffers for page flipping
|
// Enabling page flipping by default
|
||||||
|
#ifndef NUM_BUFFERS
|
||||||
#define NUM_BUFFERS 2
|
#define NUM_BUFFERS 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -157,7 +159,8 @@ int mapFrameBufferLocked(struct private_module_t* module, int format)
|
||||||
info.activate = FB_ACTIVATE_NOW;
|
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;
|
info.yres_virtual = info.yres * NUM_BUFFERS;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue