aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVilas Bhat <vilasbhat@google.com>2024-03-27 13:27:12 -0700
committerVilas Bhat <vilasbhat@google.com>2024-03-27 14:00:10 -0700
commit407362538c6f31973363a7454880dafcdfb82217 (patch)
treeef442da1cd608d0da7a1478eb8a259372a552f13
parentffe783c84995accfeac4788e0f862d9609e4ddca (diff)
downloaddrm_hwcomposer-upstream-main.tar.gz
drm_hwcomposer: Remove hardcoded PAGE_SIZE usage in gralloc_helperupstream-main
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 <vilasbhat@google.com>
-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_ */