display: Clean up gralloc

* Remove pmem and ashmem implementations
* Remove usage of RefBase
* Reduce log verbosity

Change-Id: If8ef543d236e5305bd5430f4f9c62c51b3a13787
This commit is contained in:
Naseer Ahmed
2012-07-14 21:08:13 -07:00
committed by Brian Muramatsu
parent 0c8b7b5c84
commit 01d3fd3318
19 changed files with 74 additions and 1347 deletions

View File

@@ -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 @@ gpu_context_t::gpu_context_t(const private_module_t* module,
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 @@ int gpu_context_t::gralloc_alloc_framebuffer_locked(size_t size, int usage,
{
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 @@ int gpu_context_t::gralloc_alloc_buffer(size_t size, int usage,
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 @@ int gpu_context_t::free_impl(private_handle_t const* hnd) {
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)