aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVilas Bhat <vilasbhat@google.com>2024-03-27 18:17:45 +0000
committerVilas Bhat <vilasbhat@google.com>2024-03-28 22:26:52 +0000
commitb9ae59025f9930fa8b4c24b51633149871d63bb8 (patch)
tree844a2f7b44038798833ec9ebb6a6591e8d4c8f20
parent2bf19950431dba01daf1e6c8687fadc55e36180f (diff)
downloaddrm_hwcomposer-b9ae59025f9930fa8b4c24b51633149871d63bb8.tar.gz
drm_hwcomposer: Remove hardcoded PAGE_SIZE usage in gralloc_helperHEADmastermain
Use getpagesize() to make drm_hwcomposer work with multiple page sizes. This benefits Android as AOSP no longer relies on bionic's PAGE_SIZE macro. Bug: 310232825 Test: Presubmit Signed-off-by: Vilas Bhat <vilasbhat@google.com> Change-Id: I9af7436ac9ca6c052f67cdd296a960b51b8ba67a
-rw-r--r--tests/test_include/gralloc_helper.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_include/gralloc_helper.h b/tests/test_include/gralloc_helper.h
index b6cd24d..9741c33 100644
--- a/tests/test_include/gralloc_helper.h
+++ b/tests/test_include/gralloc_helper.h
@@ -47,7 +47,8 @@
static inline size_t round_up_to_page_size(size_t x)
{
- return (x + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
+ const size_t page_size = getpagesize();
+ return (x + (page_size - 1)) & ~(page_size - 1);
}
#endif /* GRALLOC_HELPER_H_ */