summaryrefslogtreecommitdiff
path: root/libgralloc1
diff options
context:
space:
mode:
authorDileep Marchya <dmarchya@codeaurora.org>2016-09-22 12:31:11 +0530
committerDileep Marchya <dmarchya@codeaurora.org>2016-09-28 12:32:39 +0530
commit5b4eaed30b41ab651737f5af052678521895a3f7 (patch)
tree9fbfb0cf1b03c7ff2a7f21f88eeb64af78edf669 /libgralloc1
parent65eaf80ad66093457c21d8abe267dd3dbc72efe4 (diff)
downloaddisplay-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 'libgralloc1')
-rw-r--r--libgralloc1/gralloc_priv.h6
1 files changed, 5 insertions, 1 deletions
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 */