diff --git a/cros_gralloc/cros_gralloc_driver.cc b/cros_gralloc/cros_gralloc_driver.cc index 6670e98..10ed89a 100644 --- a/cros_gralloc/cros_gralloc_driver.cc +++ b/cros_gralloc/cros_gralloc_driver.cc @@ -504,7 +504,7 @@ int32_t cros_gralloc_driver::invalidate(buffer_handle_t handle) return buffer->invalidate(); } -int32_t cros_gralloc_driver::flush(buffer_handle_t handle, int32_t *release_fence) +int32_t cros_gralloc_driver::flush(buffer_handle_t handle) { std::lock_guard lock(mutex_); @@ -520,13 +520,6 @@ int32_t cros_gralloc_driver::flush(buffer_handle_t handle, int32_t *release_fenc return -EINVAL; } - /* - * From the ANativeWindow::dequeueBuffer documentation: - * - * "A value of -1 indicates that the caller may access the buffer immediately without - * waiting on a fence." - */ - *release_fence = -1; return buffer->flush(); } diff --git a/cros_gralloc/cros_gralloc_driver.h b/cros_gralloc/cros_gralloc_driver.h index 5678b76..2189c33 100644 --- a/cros_gralloc/cros_gralloc_driver.h +++ b/cros_gralloc/cros_gralloc_driver.h @@ -36,7 +36,7 @@ class cros_gralloc_driver int32_t unlock(buffer_handle_t handle, int32_t *release_fence); int32_t invalidate(buffer_handle_t handle); - int32_t flush(buffer_handle_t handle, int32_t *release_fence); + int32_t flush(buffer_handle_t handle); int32_t get_backing_store(buffer_handle_t handle, uint64_t *out_store); int32_t resource_info(buffer_handle_t handle, uint32_t strides[DRV_MAX_PLANES], diff --git a/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc b/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc index 46afd9b..65fc83c 100644 --- a/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc +++ b/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc @@ -335,8 +335,14 @@ Return CrosGralloc4Mapper::flushLockedBuffer(void* rawHandle, flushLockedB return Void(); } + /* + * From the ANativeWindow::dequeueBuffer documentation: + * + * "A value of -1 indicates that the caller may access the buffer immediately without + * waiting on a fence." + */ int releaseFenceFd = -1; - int ret = mDriver->flush(bufferHandle, &releaseFenceFd); + int ret = mDriver->flush(bufferHandle); if (ret) { ALOGE("Failed to flushLockedBuffer. Flush failed."); hidlCb(Error::BAD_BUFFER, nullptr);