From ba9d41eef39010718ccc41ad1df92073e13a8f74 Mon Sep 17 00:00:00 2001 From: Ragha Khandenahally Date: Sat, 21 Jan 2017 20:52:36 -0800 Subject: [PATCH] Ensure format and usage are in right types. In GRALLOC_MODULE_PERFORM_CREATE_BUFFER, expectation is that usage and format are of type int. Lets make this explicit. Jira: None. Test: Boots to Animation screen on Android Things. Signed-off-by: Ragha Khandenahally --- os/android/grallocbufferhandler.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/os/android/grallocbufferhandler.cpp b/os/android/grallocbufferhandler.cpp index 612f430..41bcced 100644 --- a/os/android/grallocbufferhandler.cpp +++ b/os/android/grallocbufferhandler.cpp @@ -55,11 +55,12 @@ bool GrallocBufferHandler::Init() { bool GrallocBufferHandler::CreateBuffer(uint32_t w, uint32_t h, int format, buffer_handle_t *handle) { - int ret = gralloc_->perform( - gralloc_, GRALLOC_MODULE_PERFORM_CREATE_BUFFER, w, h, - HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, - GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER, - handle); + int usage = + GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER; + // TODO: Take format into consideration. + int undefined_format = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED; + int ret = gralloc_->perform(gralloc_, GRALLOC_MODULE_PERFORM_CREATE_BUFFER, w, + h, undefined_format, usage, handle); if (ret) { ETRACE("GRALLOC_MODULE_PERFORM_CREATE_BUFFER failed %d", ret); return false; -- 2.11.0