display: Clean up gralloc

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

Change-Id: If8ef543d236e5305bd5430f4f9c62c51b3a13787
diff --git a/liboverlay/overlayMem.h b/liboverlay/overlayMem.h
index d206136..c743741 100644
--- a/liboverlay/overlayMem.h
+++ b/liboverlay/overlayMem.h
@@ -94,12 +94,11 @@
     uint32_t mNumBuffers;
 
     /* gralloc alloc controller */
-    android::sp<gralloc::IAllocController> mAlloc;
+    gralloc::IAllocController* mAlloc;
 };
 
 //-------------------Inlines-----------------------------------
 
-using android::sp;
 using gralloc::IMemAlloc;
 using gralloc::alloc_data;
 
@@ -109,7 +108,7 @@
     mAllocType = 0;
     mBufSz = 0;
     mNumBuffers = 0;
-    mAlloc = gralloc::IAllocController::getInstance(false);
+    mAlloc = gralloc::IAllocController::getInstance();
 }
 
 inline OvMem::~OvMem() { }
@@ -121,7 +120,7 @@
     int allocFlags = GRALLOC_USAGE_PRIVATE_IOMMU_HEAP;
     if(isSecure) {
         allocFlags |= GRALLOC_USAGE_PRIVATE_MM_HEAP;
-        allocFlags |= GRALLOC_USAGE_PRIVATE_DO_NOT_MAP;
+        allocFlags |= GRALLOC_USAGE_PRIVATE_CP_BUFFER;
     }
 
     int err = 0;
@@ -137,7 +136,7 @@
     data.align = getpagesize();
     data.uncached = true;
 
-    err = mAlloc->allocate(data, allocFlags, 0);
+    err = mAlloc->allocate(data, allocFlags);
     if (err != 0) {
         ALOGE("OvMem: error allocating memory");
         return false;
@@ -158,7 +157,7 @@
         return true;
     }
 
-    sp<IMemAlloc> memalloc = mAlloc->getAllocator(mAllocType);
+    IMemAlloc* memalloc = mAlloc->getAllocator(mAllocType);
     ret = memalloc->free_buffer(mBaseAddr, mBufSz * mNumBuffers, 0, mFd);
     if (ret != 0) {
         ALOGE("OvMem: error freeing buffer");