summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShilin Victor <chrono.monochrome@gmail.com>2019-02-12 20:31:12 +0300
committerShilin Victor <chrono.monochrome@gmail.com>2019-02-23 16:52:03 +0300
commit9e1e7fe7265444ee0c23314b7316f8e05bde952c (patch)
treec5878608ce4e2bca268814a45dc349393ccdb327
parenta6b15bf82d441e5790d7df73502a2d659e45c905 (diff)
downloadhardware_samsung-9e1e7fe7265444ee0c23314b7316f8e05bde952c.tar.gz
hardware_samsung-9e1e7fe7265444ee0c23314b7316f8e05bde952c.tar.bz2
hardware_samsung-9e1e7fe7265444ee0c23314b7316f8e05bde952c.zip
exynos4: gralloc: allow skipping bufferMask change on free
an addition of Gralloc HIDL caused Exynos4 gralloc to use only one framebuffer slot of the available two. This happens because the buffer is freed by HIDL immediately after it's allocated, thus making gralloc HAL think that first buffer is free and allocate a second one at the same vaddr (effectively using just one buffer). By skipping bufferMask change on the buffer free, we will make use of two framebuffer slots and fix Vsync issue. Change-Id: I0c3e7f517a67ad9d554111f91ef2f5190c6522c8
-rw-r--r--exynos4/hal/libgralloc_ump/Android.mk4
-rw-r--r--exynos4/hal/libgralloc_ump/alloc_device.cpp3
2 files changed, 6 insertions, 1 deletions
diff --git a/exynos4/hal/libgralloc_ump/Android.mk b/exynos4/hal/libgralloc_ump/Android.mk
index 0cd5ecb..bc15ec0 100644
--- a/exynos4/hal/libgralloc_ump/Android.mk
+++ b/exynos4/hal/libgralloc_ump/Android.mk
@@ -68,4 +68,8 @@ ifeq ($(TARGET_USES_GRALLOC1), true)
LOCAL_CFLAGS += -DADVERTISE_GRALLOC1
endif
+ifeq ($(TARGET_USES_GRALLOC_HIDL), true)
+LOCAL_CFLAGS += -DUSE_GRALLOC_HIDL
+endif
+
include $(BUILD_SHARED_LIBRARY)
diff --git a/exynos4/hal/libgralloc_ump/alloc_device.cpp b/exynos4/hal/libgralloc_ump/alloc_device.cpp
index 1b64dfa..61be7c5 100644
--- a/exynos4/hal/libgralloc_ump/alloc_device.cpp
+++ b/exynos4/hal/libgralloc_ump/alloc_device.cpp
@@ -689,8 +689,9 @@ static int alloc_device_free(alloc_device_t* dev, buffer_handle_t handle)
/* free this buffer */
const size_t bufferSize = m->finfo.line_length * m->info.yres;
int index = (hnd->base - m->framebuffer->base) / bufferSize;
-
+#ifndef USE_GRALLOC_HIDL
m->bufferMask &= ~(1<<index);
+#endif
close(hnd->fd);
} else if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_UMP) {