summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-10-07 07:44:24 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-07 07:44:24 -0700
commit33d7631a96e90fda6138af47cc6e017a54f37f83 (patch)
tree4d2f1ead8f239cd8c84cc7a24aa0fb201cd10fc5
parentb27735ff9406f8cd8d642a3a4ec9388fcdade659 (diff)
parent5b4eaed30b41ab651737f5af052678521895a3f7 (diff)
downloaddisplay-33d7631a96e90fda6138af47cc6e017a54f37f83.tar.gz
Merge "gralloc: Use getpagesize() in place of PAGE_SIZE."
-rw-r--r--libgralloc/alloc_controller.h2
-rw-r--r--libgralloc/gr.h3
-rw-r--r--libgralloc/gralloc_priv.h4
-rw-r--r--libgralloc1/gralloc_priv.h6
4 files changed, 10 insertions, 5 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 3324840a..7d055fc6 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 8f1c12dc..4c059cfd 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)
diff --git a/libgralloc1/gralloc_priv.h b/libgralloc1/gralloc_priv.h
index af7e1732..f2820707 100644
--- a/libgralloc1/gralloc_priv.h
+++ b/libgralloc1/gralloc_priv.h
@@ -20,9 +20,13 @@
#ifndef __GRALLOC_PRIV_H__
#define __GRALLOC_PRIV_H__
+#include <unistd.h>
#include "gr_priv_handle.h"
-#define ROUND_UP_PAGESIZE(x) ((((unsigned int)(x)) + PAGE_SIZE - 1) & (~(PAGE_SIZE - 1)))
+#define ROUND_UP_PAGESIZE(x) roundUpToPageSize(x)
+inline unsigned int roundUpToPageSize(unsigned int x) {
+ return (x + (getpagesize()-1)) & ~(getpagesize()-1);
+}
/* Gralloc usage bits indicating the type of allocation that should be used */
/* Refer gralloc1_producer_usage_t & gralloc1_consumer_usage-t in gralloc1.h */