gralloc: Move unregister_buffer to seperate method

Change-Id: I4b53996be77c874cb7475104c58e428118a133a6
This commit is contained in:
Dominggoes Isakh 2018-12-24 22:12:38 +01:00 committed by Shilin Victor
parent 41bfeb9370
commit 3c913bf8c8
1 changed files with 13 additions and 8 deletions

View File

@ -407,14 +407,7 @@ sd
return retval;
}
static int gralloc_unregister_buffer(gralloc_module_t const* module, buffer_handle_t handle)
{
if (private_handle_t::validate(handle) < 0) {
ALOGE("%s unregistering invalid buffer, returning error", __func__);
return -EINVAL;
}
private_handle_t* hnd = (private_handle_t*)handle;
static int unregister_buffer(private_handle_t* hnd) {
if (hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER) {
hnd->base = 0;
return 0;
@ -475,6 +468,18 @@ static int gralloc_unregister_buffer(gralloc_module_t const* module, buffer_hand
return 0;
}
static int gralloc_unregister_buffer(gralloc_module_t const* module, buffer_handle_t handle)
{
if (private_handle_t::validate(handle) < 0) {
ALOGE("%s unregistering invalid buffer, returning error", __func__);
return -EINVAL;
}
private_handle_t* hnd = (private_handle_t*)handle;
return unregister_buffer(hnd);
}
static int gralloc_lock(gralloc_module_t const* module __unused, buffer_handle_t handle,
int usage, int l __unused, int t __unused, int w __unused,
int h __unused, void** vaddr)