From 407362538c6f31973363a7454880dafcdfb82217 Mon Sep 17 00:00:00 2001 From: Vilas Bhat Date: Wed, 27 Mar 2024 13:27:12 -0700 Subject: drm_hwcomposer: Remove hardcoded PAGE_SIZE usage in gralloc_helper 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. Change-Id: I9af7436ac9ca6c052f67cdd296a960b51b8ba67a Signed-off-by: Vilas Bhat --- tests/test_include/gralloc_helper.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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_ */ -- cgit v1.2.3