summaryrefslogtreecommitdiff
authorSky Zhou <sky.zhou@amlogic.com>2017-03-27 23:08:23 (GMT)
committer Sky Zhou <sky.zhou@amlogic.com>2017-03-28 00:22:18 (GMT)
commitf1f62c91d064f73385626dcc7b8db4831cc441ad (patch)
tree2078721ab99a0076ed29631f9ea7425476215cb9
parented1798fd4ba7dfb801ae5cb9ecce69f3877c18af (diff)
downloadgralloc-f1f62c91d064f73385626dcc7b8db4831cc441ad.zip
gralloc-f1f62c91d064f73385626dcc7b8db4831cc441ad.tar.gz
gralloc-f1f62c91d064f73385626dcc7b8db4831cc441ad.tar.bz2
PD #138752: move amlogic defined usage from libhardware to here.
Change-Id: I4184e4220a98e585bbee1e599a46408cd08f4800
Diffstat
-rw-r--r--alloc_device.cpp4
-rw-r--r--alloc_ion.cpp5
-rw-r--r--gralloc_usage_ext.h12
3 files changed, 20 insertions, 1 deletions
diff --git a/alloc_device.cpp b/alloc_device.cpp
index 761baa8..8a00109 100644
--- a/alloc_device.cpp
+++ b/alloc_device.cpp
@@ -32,6 +32,10 @@
#include "gralloc_helper.h"
#include "framebuffer_device.h"
+#if PLATFORM_SDK_VERSION >= 24
+#include "gralloc_usage_ext.h"
+#endif
+
#include "alloc_device_allocator_specific.h"
#if MALI_AFBC_GRALLOC == 1
#include "gralloc_buffer_priv.h"
diff --git a/alloc_ion.cpp b/alloc_ion.cpp
index e96d9c4..253732a 100644
--- a/alloc_ion.cpp
+++ b/alloc_ion.cpp
@@ -31,10 +31,13 @@
#include "gralloc_priv.h"
#include "gralloc_helper.h"
#include "framebuffer_device.h"
-
#include <linux/ion.h>
#include <ion/ion.h>
+#if PLATFORM_SDK_VERSION >= 24
+#include "gralloc_usage_ext.h"
+#endif
+
int alloc_backend_alloc(alloc_device_t* dev, size_t size, int usage, buffer_handle_t* pHandle)
{
private_module_t* m = reinterpret_cast<private_module_t*>(dev->common.module);
diff --git a/gralloc_usage_ext.h b/gralloc_usage_ext.h
new file mode 100644
index 0000000..9460839
--- a/dev/null
+++ b/gralloc_usage_ext.h
@@ -0,0 +1,12 @@
+#ifndef GRALLOC_USAGE_EXT_H
+#define GRALLOC_USAGE_EXT_H
+
+/* gralloc usage extensions */
+enum {
+ GRALLOC_USAGE_AML_VIDEO_OVERLAY = 0x01000000,
+ GRALLOC_USAGE_AML_DMA_BUFFER = 0x02000000,
+ GRALLOC_USAGE_AML_OMX_OVERLAY = 0x04000000,
+ GRALLOC_USAGE_AML_SECURE = 0x08000000,
+};
+
+#endif /* GRALLOC_USAGE_EXT_H */