mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-06 21:55:41 +00:00
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
This commit is contained in:
parent
a6b15bf82d
commit
9e1e7fe726
2 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue