diff options
author | David Turner <digit@android.com> | 2014-07-04 13:30:22 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-07-04 13:30:22 +0000 |
commit | 611a3b71431293a123a11af99ff731ab30067632 (patch) | |
tree | 7a0f91449cb6f1b514f77b8a01523aa8a3be4099 /modules | |
parent | 18cf130c439982d1eafa7ef5f598ef7f4b945821 (diff) | |
parent | 3e618a6aa10c783d1536f20edfc3347939cfa18e (diff) | |
download | hardware_libhardware-611a3b71431293a123a11af99ff731ab30067632.zip hardware_libhardware-611a3b71431293a123a11af99ff731ab30067632.tar.gz hardware_libhardware-611a3b71431293a123a11af99ff731ab30067632.tar.bz2 |
am 3e618a6a: Merge "gralloc: let target configure page flipping ioctl"
* commit '3e618a6aa10c783d1536f20edfc3347939cfa18e':
gralloc: let target configure page flipping ioctl
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gralloc/Android.mk | 3 | ||||
-rw-r--r-- | modules/gralloc/framebuffer.cpp | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/modules/gralloc/Android.mk b/modules/gralloc/Android.mk index a4ffd20..092e851 100644 --- a/modules/gralloc/Android.mk +++ b/modules/gralloc/Android.mk @@ -29,5 +29,8 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := gralloc.default LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\" -Wno-missing-field-initializers +ifeq ($(TARGET_USE_PAN_DISPLAY),true) +LOCAL_CFLAGS += -DUSE_PAN_DISPLAY=1 +endif include $(BUILD_SHARED_LIBRARY) diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp index 9d8513a..486e27a 100644 --- a/modules/gralloc/framebuffer.cpp +++ b/modules/gralloc/framebuffer.cpp @@ -42,6 +42,13 @@ /*****************************************************************************/ +// Set TARGET_USE_PAN_DISPLAY to true at compile time if the +// board uses FBIOPAN_DISPLAY to setup page flipping, otherwise +// default ioctl to do page-flipping is FBIOPUT_VSCREENINFO. +#ifndef USE_PAN_DISPLAY +#define USE_PAN_DISPLAY 0 +#endif + // numbers of buffers for page flipping #define NUM_BUFFERS 2 @@ -178,10 +185,15 @@ int mapFrameBufferLocked(struct private_module_t* module) uint32_t flags = PAGE_FLIP; +#if USE_PAN_DISPLAY + if (ioctl(fd, FBIOPAN_DISPLAY, &info) == -1) { + ALOGW("FBIOPAN_DISPLAY failed, page flipping not supported"); +#else if (ioctl(fd, FBIOPUT_VSCREENINFO, &info) == -1) { + ALOGW("FBIOPUT_VSCREENINFO failed, page flipping not supported"); +#endif info.yres_virtual = info.yres; flags &= ~PAGE_FLIP; - ALOGW("FBIOPUT_VSCREENINFO failed, page flipping not supported"); } if (info.yres_virtual < info.yres * 2) { |