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,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