remove all references to pmem and simplify the lock/unlock hooks
this gralloc module is only used on the emulator or without a h/w
renderer. therefore there is no synchronization to do in lock/unlock
and pmem buffers are not relevant.
hopefully this will remove some of the confusion about how gralloc
should be implemented and make it more obvious that this implementation
is not intended to be used by h/w renderers.
diff --git a/modules/gralloc/gralloc_priv.h b/modules/gralloc/gralloc_priv.h
index c3655a5..5d7db26 100644
--- a/modules/gralloc/gralloc_priv.h
+++ b/modules/gralloc/gralloc_priv.h
@@ -51,11 +51,6 @@
float xdpi;
float ydpi;
float fps;
-
- enum {
- // flag to indicate we'll post this buffer
- PRIV_USAGE_LOCKED_FOR_POST = 0x80000000
- };
};
/*****************************************************************************/
@@ -68,14 +63,7 @@
#endif
enum {
- PRIV_FLAGS_FRAMEBUFFER = 0x00000001,
- PRIV_FLAGS_USES_PMEM = 0x00000002,
- };
-
- enum {
- LOCK_STATE_WRITE = 1<<31,
- LOCK_STATE_MAPPED = 1<<30,
- LOCK_STATE_READ_MASK = 0x3FFFFFFF
+ PRIV_FLAGS_FRAMEBUFFER = 0x00000001
};
// file-descriptors
@@ -88,18 +76,16 @@
// FIXME: the attributes below should be out-of-line
int base;
- int lockState;
- int writeOwner;
int pid;
#ifdef __cplusplus
- static const int sNumInts = 8;
+ static const int sNumInts = 6;
static const int sNumFds = 1;
static const int sMagic = 0x3141592;
private_handle_t(int fd, int size, int flags) :
fd(fd), magic(sMagic), flags(flags), size(size), offset(0),
- base(0), lockState(0), writeOwner(0), pid(getpid())
+ base(0), pid(getpid())
{
version = sizeof(native_handle);
numInts = sNumInts;
@@ -110,7 +96,7 @@
}
bool usesPhysicallyContiguousMemory() {
- return (flags & PRIV_FLAGS_USES_PMEM) != 0;
+ return false;
}
static int validate(const native_handle* h) {