diff options
author | Dileep Marchya <dmarchya@codeaurora.org> | 2016-09-22 12:31:11 +0530 |
---|---|---|
committer | Dileep Marchya <dmarchya@codeaurora.org> | 2016-09-28 12:32:39 +0530 |
commit | 5b4eaed30b41ab651737f5af052678521895a3f7 (patch) | |
tree | 9fbfb0cf1b03c7ff2a7f21f88eeb64af78edf669 /libgralloc | |
parent | 65eaf80ad66093457c21d8abe267dd3dbc72efe4 (diff) | |
download | display-5b4eaed30b41ab651737f5af052678521895a3f7.tar.gz |
gralloc: Use getpagesize() in place of PAGE_SIZE.
- Use getpagesize() function from unistd.h to get page size
in place of PAGE_SIZE macro.
- Make isDisableUBWCForEncoder declaration pure virtual.
Change-Id: I89405e999e4683874f4daa32188181e688a19812
CRs-Fixed: 1069351
Diffstat (limited to 'libgralloc')
-rw-r--r-- | libgralloc/alloc_controller.h | 2 | ||||
-rw-r--r-- | libgralloc/gr.h | 3 | ||||
-rw-r--r-- | libgralloc/gralloc_priv.h | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/libgralloc/alloc_controller.h b/libgralloc/alloc_controller.h index 8216b0c8..45977e2b 100644 --- a/libgralloc/alloc_controller.h +++ b/libgralloc/alloc_controller.h @@ -56,7 +56,7 @@ class IAllocController { virtual IMemAlloc* getAllocator(int flags) = 0; - virtual bool isDisableUBWCForEncoder(); + virtual bool isDisableUBWCForEncoder() = 0; virtual ~IAllocController() {}; diff --git a/libgralloc/gr.h b/libgralloc/gr.h index 578240a0..5ab576ad 100644 --- a/libgralloc/gr.h +++ b/libgralloc/gr.h @@ -24,6 +24,7 @@ #include <hardware/gralloc.h> #include <pthread.h> #include <errno.h> +#include <unistd.h> #include <cutils/native_handle.h> #include <utils/Singleton.h> @@ -35,7 +36,7 @@ struct private_module_t; struct private_handle_t; inline unsigned int roundUpToPageSize(unsigned int x) { - return (x + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1); + return (x + (getpagesize()-1)) & ~(getpagesize()-1); } template <class Type> diff --git a/libgralloc/gralloc_priv.h b/libgralloc/gralloc_priv.h index 0c023553..732367d8 100644 --- a/libgralloc/gralloc_priv.h +++ b/libgralloc/gralloc_priv.h @@ -30,8 +30,8 @@ #include <cutils/log.h> -#define ROUND_UP_PAGESIZE(x) ( (((unsigned long)(x)) + PAGE_SIZE-1) & \ - (~(PAGE_SIZE-1)) ) +#define ROUND_UP_PAGESIZE(x) (unsigned int)( ((x) + getpagesize()-1) & \ + (~(getpagesize()-1)) ) /* Gralloc usage bits indicating the type of allocation that should be used */ /* SYSTEM heap comes from kernel vmalloc (ION_SYSTEM_HEAP_ID) |