1
0
Fork 0

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 <vilasbhat@google.com>
This commit is contained in:
Vilas Bhat 2024-03-27 13:27:12 -07:00
parent ffe783c849
commit 407362538c

View file

@ -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_ */