Merge "gralloc: Remove PAGE_SIZE 4096 usage" into main
diff --git a/modules/gralloc/gr.h b/modules/gralloc/gr.h
index 14fe6a0..fe66c9b 100644
--- a/modules/gralloc/gr.h
+++ b/modules/gralloc/gr.h
@@ -24,6 +24,7 @@
 #include <hardware/gralloc.h>
 #include <pthread.h>
 #include <errno.h>
+#include <unistd.h>
 
 #include <cutils/native_handle.h>
 
@@ -32,8 +33,10 @@
 struct private_module_t;
 struct private_handle_t;
 
+static const size_t kPageSize = getpagesize();
+
 inline size_t roundUpToPageSize(size_t x) {
-    return (x + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1);
+    return (x + (kPageSize-1)) & ~(kPageSize-1);
 }
 
 int mapFrameBufferLocked(struct private_module_t* module, int format);