display: Clean up gralloc
* Remove pmem and ashmem implementations * Remove usage of RefBase * Reduce log verbosity Change-Id: If8ef543d236e5305bd5430f4f9c62c51b3a13787
This commit is contained in:
committed by
Brian Muramatsu
parent
0c8b7b5c84
commit
01d3fd3318
@@ -49,7 +49,6 @@
|
||||
using gralloc::IMemAlloc;
|
||||
using gralloc::IonController;
|
||||
using gralloc::alloc_data;
|
||||
using android::sp;
|
||||
|
||||
C2D_STATUS (*LINK_c2dCreateSurface)( uint32 *surface_id,
|
||||
uint32 surface_bits,
|
||||
@@ -110,7 +109,7 @@ enum eC2DFlags {
|
||||
FLAGS_YUV_DESTINATION = 1<<1
|
||||
};
|
||||
|
||||
static android::sp<gralloc::IAllocController> sAlloc = 0;
|
||||
static gralloc::IAllocController* sAlloc = 0;
|
||||
/******************************************************************************/
|
||||
|
||||
/** State information for each device instance */
|
||||
@@ -922,7 +921,7 @@ static int get_temp_buffer(const bufferInfo& info, alloc_data& data)
|
||||
int allocFlags = GRALLOC_USAGE_PRIVATE_SYSTEM_HEAP;
|
||||
|
||||
if (sAlloc == 0) {
|
||||
sAlloc = gralloc::IAllocController::getInstance(false);
|
||||
sAlloc = gralloc::IAllocController::getInstance();
|
||||
}
|
||||
|
||||
if (sAlloc == 0) {
|
||||
@@ -930,7 +929,7 @@ static int get_temp_buffer(const bufferInfo& info, alloc_data& data)
|
||||
return COPYBIT_FAILURE;
|
||||
}
|
||||
|
||||
int err = sAlloc->allocate(data, allocFlags, 0);
|
||||
int err = sAlloc->allocate(data, allocFlags);
|
||||
if (0 != err) {
|
||||
ALOGE("%s: allocate failed", __FUNCTION__);
|
||||
return COPYBIT_FAILURE;
|
||||
@@ -944,7 +943,7 @@ static int get_temp_buffer(const bufferInfo& info, alloc_data& data)
|
||||
static void free_temp_buffer(alloc_data &data)
|
||||
{
|
||||
if (-1 != data.fd) {
|
||||
sp<IMemAlloc> memalloc = sAlloc->getAllocator(data.allocType);
|
||||
IMemAlloc* memalloc = sAlloc->getAllocator(data.allocType);
|
||||
memalloc->free_buffer(data.base, data.size, 0, data.fd);
|
||||
}
|
||||
}
|
||||
@@ -1163,7 +1162,7 @@ static int stretch_copybit_internal(
|
||||
copy_image((private_handle_t *)src->handle, &src_image, CONVERT_TO_C2D_FORMAT);
|
||||
|
||||
// Flush the cache
|
||||
sp<IMemAlloc> memalloc = sAlloc->getAllocator(src_hnd->flags);
|
||||
IMemAlloc* memalloc = sAlloc->getAllocator(src_hnd->flags);
|
||||
if (memalloc->clean_buffer((void *)(src_hnd->base), src_hnd->size,
|
||||
src_hnd->offset, src_hnd->fd)) {
|
||||
ALOGE("%s: clean_buffer failed", __FUNCTION__);
|
||||
@@ -1234,7 +1233,7 @@ static int stretch_copybit_internal(
|
||||
// copy the temp. destination without the alignment to the actual destination.
|
||||
copy_image(dst_hnd, dst, CONVERT_TO_ANDROID_FORMAT);
|
||||
// Invalidate the cache.
|
||||
sp<IMemAlloc> memalloc = sAlloc->getAllocator(dst_hnd->flags);
|
||||
IMemAlloc* memalloc = sAlloc->getAllocator(dst_hnd->flags);
|
||||
memalloc->clean_buffer((void *)(dst_hnd->base), dst_hnd->size,
|
||||
dst_hnd->offset, dst_hnd->fd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user