From 996254486f2fd503ca07f54b4191c6bde71fe9c0 Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Fri, 16 Dec 2011 10:44:48 -0800 Subject: [PATCH] libgralloc: Check for genlock success on all genlock calls Change-Id: I5bb9d209f80c6b9499197cda697d1a0293b409ba --- libgralloc/mapper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgralloc/mapper.cpp b/libgralloc/mapper.cpp index 2cecbd5..5eaa0fe 100755 --- a/libgralloc/mapper.cpp +++ b/libgralloc/mapper.cpp @@ -152,7 +152,7 @@ int gralloc_register_buffer(gralloc_module_t const* module, } // Attach the genlock handle - if (GENLOCK_FAILURE == genlock_attach_lock((native_handle_t *)handle)) { + if (GENLOCK_NO_ERROR != genlock_attach_lock((native_handle_t *)handle)) { LOGE("%s: genlock_attach_lock failed", __FUNCTION__); gralloc_unmap(module, handle); hnd->base = 0; @@ -252,7 +252,7 @@ int gralloc_lock(gralloc_module_t const* module, } int timeout = GENLOCK_MAX_TIMEOUT; - if (GENLOCK_FAILURE == genlock_lock_buffer((native_handle_t *)handle, + if (GENLOCK_NO_ERROR != genlock_lock_buffer((native_handle_t *)handle, (genlock_lock_type)lockType, timeout)) { LOGE("%s: genlock_lock_buffer (lockType=0x%x) failed", __FUNCTION__, @@ -292,7 +292,7 @@ int gralloc_unlock(gralloc_module_t const* module, if ((hnd->flags & private_handle_t::PRIV_FLAGS_SW_LOCK)) { // Unlock the buffer. - if (GENLOCK_FAILURE == genlock_unlock_buffer((native_handle_t *)handle)) { + if (GENLOCK_NO_ERROR != genlock_unlock_buffer((native_handle_t *)handle)) { LOGE("%s: genlock_unlock_buffer failed", __FUNCTION__); return -EINVAL; } else