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:
Shilin Victor 2019-02-12 20:31:12 +03:00
parent 1bb761b224
commit e7eab5f906
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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) {