display: Clean up gralloc
* Remove pmem and ashmem implementations
* Remove usage of RefBase
* Reduce log verbosity
Change-Id: If8ef543d236e5305bd5430f4f9c62c51b3a13787
diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp
index 4f00e4a..b72320b 100644
--- a/libgralloc/gpu.cpp
+++ b/libgralloc/gpu.cpp
@@ -29,10 +29,9 @@
#include "alloc_controller.h"
using namespace gralloc;
-using android::sp;
gpu_context_t::gpu_context_t(const private_module_t* module,
- sp<IAllocController> alloc_ctrl ) :
+ IAllocController* alloc_ctrl ) :
mAllocCtrl(alloc_ctrl)
{
// Zero out the alloc_device_t
@@ -44,9 +43,6 @@
common.module = const_cast<hw_module_t*>(&module->base.common);
common.close = gralloc_close;
alloc = gralloc_alloc;
-#if 0
- allocSize = gralloc_alloc_size;
-#endif
free = gralloc_free;
}
@@ -56,8 +52,8 @@
{
private_module_t* m = reinterpret_cast<private_module_t*>(common.module);
- // we don't support allocations with both the FB and PMEM_ADSP flags
- if (usage & GRALLOC_USAGE_PRIVATE_ADSP_HEAP) {
+ // we don't support framebuffer allocations with graphics heap flags
+ if (usage & GRALLOC_HEAP_MASK) {
return -EINVAL;
}
@@ -140,7 +136,7 @@
else
data.align = getpagesize();
data.pHandle = (unsigned int) pHandle;
- err = mAllocCtrl->allocate(data, usage, 0);
+ err = mAllocCtrl->allocate(data, usage);
if (usage & GRALLOC_USAGE_PRIVATE_UNSYNCHRONIZED) {
flags |= private_handle_t::PRIV_FLAGS_UNSYNCHRONIZED;
@@ -242,7 +238,7 @@
m->bufferMask &= ~(1<<index);
} else {
terminateBuffer(&m->base, const_cast<private_handle_t*>(hnd));
- sp<IMemAlloc> memalloc = mAllocCtrl->getAllocator(hnd->flags);
+ IMemAlloc* memalloc = mAllocCtrl->getAllocator(hnd->flags);
int err = memalloc->free_buffer((void*)hnd->base, (size_t) hnd->size,
hnd->offset, hnd->fd);
if(err)