display: Clean up gralloc
* Remove pmem and ashmem implementations
* Remove usage of RefBase
* Reduce log verbosity
Change-Id: If8ef543d236e5305bd5430f4f9c62c51b3a13787
diff --git a/libgralloc/alloc_controller.h b/libgralloc/alloc_controller.h
index 134ad40..f04917a 100644
--- a/libgralloc/alloc_controller.h
+++ b/libgralloc/alloc_controller.h
@@ -29,86 +29,43 @@
#ifndef GRALLOC_ALLOCCONTROLLER_H
#define GRALLOC_ALLOCCONTROLLER_H
-#include <utils/RefBase.h>
-
namespace gralloc {
struct alloc_data;
class IMemAlloc;
class IonAlloc;
-class IAllocController : public android::RefBase {
+class IAllocController {
public:
/* Allocate using a suitable method
* Returns the type of buffer allocated
*/
- virtual int allocate(alloc_data& data, int usage,
- int compositionType) = 0;
+ virtual int allocate(alloc_data& data, int usage) = 0;
- virtual android::sp<IMemAlloc> getAllocator(int flags) = 0;
+ virtual IMemAlloc* getAllocator(int flags) = 0;
virtual ~IAllocController() {};
- static android::sp<IAllocController> getInstance(bool useMasterHeap);
+ static IAllocController* getInstance(void);
private:
- static android::sp<IAllocController> sController;
+ static IAllocController* sController;
};
class IonController : public IAllocController {
public:
- virtual int allocate(alloc_data& data, int usage,
- int compositionType);
+ virtual int allocate(alloc_data& data, int usage);
- virtual android::sp<IMemAlloc> getAllocator(int flags);
+ virtual IMemAlloc* getAllocator(int flags);
IonController();
private:
- android::sp<IonAlloc> mIonAlloc;
+ IonAlloc* mIonAlloc;
};
-
-class PmemKernelController : public IAllocController {
-
- public:
- virtual int allocate(alloc_data& data, int usage,
- int compositionType);
-
- virtual android::sp<IMemAlloc> getAllocator(int flags);
-
- PmemKernelController ();
-
- ~PmemKernelController ();
-
- private:
- android::sp<IMemAlloc> mPmemAdspAlloc;
-
-};
-
-// Main pmem controller - this should only
-// be used within gralloc
-class PmemAshmemController : public IAllocController {
-
- public:
- virtual int allocate(alloc_data& data, int usage,
- int compositionType);
-
- virtual android::sp<IMemAlloc> getAllocator(int flags);
-
- PmemAshmemController();
-
- ~PmemAshmemController();
-
- private:
- android::sp<IMemAlloc> mPmemUserspaceAlloc;
- android::sp<IMemAlloc> mAshmemAlloc;
- android::sp<IAllocController> mPmemKernelCtrl;
-
-};
-
} //end namespace gralloc
#endif // GRALLOC_ALLOCCONTROLLER_H