diff options
author | Mathias Agopian <mathias@google.com> | 2009-05-04 14:26:56 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-05-04 14:26:56 -0700 |
commit | 988b8bd553180e8d71b4028ecb721f46312efe62 (patch) | |
tree | 079f311a2958d953447da28e2039948996f1f58f /modules/gralloc/gralloc_priv.h | |
parent | ccc13876d84f9316b5764aba8080c6e1a96ee214 (diff) | |
download | hardware_libhardware-988b8bd553180e8d71b4028ecb721f46312efe62.zip hardware_libhardware-988b8bd553180e8d71b4028ecb721f46312efe62.tar.gz hardware_libhardware-988b8bd553180e8d71b4028ecb721f46312efe62.tar.bz2 |
lock will now return the vaddr of the buffer. map/umap are gone.
- make sure to return an error if a buffer is locked twice or unlocked while not locked.
- added registerBuffer() and unregisterBuffer() to the gralloc module so that we can do some cleanup when a buffer is no longer needed. this became necessary after we removed map/unmap so we have a place to unmap buffers without the need of a kernel module.
- change the constants for GRALLOC_USAGE_SW_{READ|WRITE}_NEVER to 0, so that NOT specifying them means "NEVER".
Diffstat (limited to 'modules/gralloc/gralloc_priv.h')
-rw-r--r-- | modules/gralloc/gralloc_priv.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/modules/gralloc/gralloc_priv.h b/modules/gralloc/gralloc_priv.h index a6fa69a..b0f2c6c 100644 --- a/modules/gralloc/gralloc_priv.h +++ b/modules/gralloc/gralloc_priv.h @@ -36,6 +36,13 @@ inline size_t roundUpToPageSize(size_t x) { return (x + (PAGESIZE-1)) & ~(PAGESIZE-1); } +int gralloc_map(gralloc_module_t const* module, + buffer_handle_t handle, void** vaddr); + +int gralloc_unmap(gralloc_module_t const* module, + buffer_handle_t handle); + + int mapFrameBufferLocked(struct private_module_t* module); /*****************************************************************************/ @@ -58,6 +65,7 @@ struct private_module_t { float fps; enum { + // flag to indicate we'll post this buffer PRIV_USAGE_LOCKED_FOR_POST = 0x80000000 }; }; @@ -68,16 +76,18 @@ struct private_handle_t : public native_handle { enum { PRIV_FLAGS_FRAMEBUFFER = 0x00000001, - PRIV_FLAGS_USES_PMEM = 0x00000002 + PRIV_FLAGS_USES_PMEM = 0x00000002, + PRIV_FLAGS_MAPPED = 0x00000004, // FIXME: should be out-of-line + PRIV_FLAGS_LOCKED = 0x00000008 // FIXME: should be out-of-line }; int fd; int magic; - int base; + int base; // FIXME: should be out-of-line (meaningless with ipc) int flags; int size; - static const int sNumInts = 5; + static const int sNumInts = 4; static const int sNumFds = 1; static const int sMagic = 0x3141592; |