gralloc: Remove opaque types
Remove opaque types like size_t, uintptr_t, intptr_t to support
32bit and 64bit processes together.
When a 64bit process creates a handle and a 32bit process validates
the incoming ints against expected ints, opaque types lead to
different and mismatching values.
Always use unit64_t for base address for 32bit and 64bit SF.
Use unsigned int for offset and size, since ION uses that.
Change-Id: I7db5544556a8924f98010b965f837592e9f0b4ca
diff --git a/libgralloc/gr.h b/libgralloc/gr.h
index 32f3256..797d57e 100644
--- a/libgralloc/gr.h
+++ b/libgralloc/gr.h
@@ -33,7 +33,7 @@
struct private_module_t;
struct private_handle_t;
-inline size_t roundUpToPageSize(size_t x) {
+inline unsigned int roundUpToPageSize(unsigned int x) {
return (x + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1);
}
@@ -47,16 +47,16 @@
int mapFrameBufferLocked(struct private_module_t* module);
int terminateBuffer(gralloc_module_t const* module, private_handle_t* hnd);
-size_t getBufferSizeAndDimensions(int width, int height, int format, int usage,
- int& alignedw, int &alignedh);
-size_t getBufferSizeAndDimensions(int width, int height, int format,
- int& alignedw, int &alignedh);
+unsigned int getBufferSizeAndDimensions(int width, int height, int format,
+ int usage, int& alignedw, int &alignedh);
+unsigned int getBufferSizeAndDimensions(int width, int height, int format,
+ int& alignedw, int &alignedh);
// Attributes include aligned width, aligned height, tileEnabled and size of the buffer
void getBufferAttributes(int width, int height, int format, int usage,
int& alignedw, int &alignedh,
- int& tileEnabled, size_t &size);
+ int& tileEnabled, unsigned int &size);
bool isMacroTileEnabled(int format, int usage);