summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/system/graphics.h28
-rw-r--r--libion/kernel-headers/linux/rockchip_ion.h61
2 files changed, 89 insertions, 0 deletions
diff --git a/include/system/graphics.h b/include/system/graphics.h
index 529a562f3..7381b32ec 100644
--- a/include/system/graphics.h
+++ b/include/system/graphics.h
@@ -60,6 +60,28 @@ typedef enum android_pixel_format {
HAL_PIXEL_FORMAT_BGRA_8888 = 5,
/*
+ * sRGB color pixel formats:
+ *
+ * The red, green and blue components are stored in sRGB space, and converted
+ * to linear space when read, using the standard sRGB to linear equation:
+ *
+ * Clinear = Csrgb / 12.92 for Csrgb <= 0.04045
+ * = (Csrgb + 0.055 / 1.055)^2.4 for Csrgb > 0.04045
+ *
+ * When written the inverse transformation is performed:
+ *
+ * Csrgb = 12.92 * Clinear for Clinear <= 0.0031308
+ * = 1.055 * Clinear^(1/2.4) - 0.055 for Clinear > 0.0031308
+ *
+ *
+ * The alpha component, if present, is always stored in linear space and
+ * is left unmodified when read or written.
+ *
+ */
+ HAL_PIXEL_FORMAT_sRGB_A_8888 = 0xC,
+ HAL_PIXEL_FORMAT_sRGB_X_8888 = 0xD,
+
+ /*
* 0x100 - 0x1FF
*
* This range is reserved for pixel formats that are specific to the HAL
@@ -190,6 +212,7 @@ typedef enum android_pixel_format {
* extra metadata to define.
*/
HAL_PIXEL_FORMAT_RAW16 = 0x20,
+ HAL_PIXEL_FORMAT_RAW_SENSOR = 0x20, // TODO(rubenbrunk): Remove RAW_SENSOR.
/*
* Android RAW10 format:
@@ -441,6 +464,11 @@ typedef enum android_pixel_format {
HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16
HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21
HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, // YUY2
+ HAL_PIXEL_FORMAT_YCrCb_NV12 = 0x15, // YUY2
+ HAL_PIXEL_FORMAT_YCrCb_NV12_VIDEO = 0x16,
+ HAL_PIXEL_FORMAT_YCrCb_NV12_10 = 0x17, // YUY2_1obit
+ HAL_PIXEL_FORMAT_YCbCr_422_SP_10 = 0x18, //
+ HAL_PIXEL_FORMAT_YCrCb_420_SP_10 = 0x19, //
} android_pixel_format_t;
/*
diff --git a/libion/kernel-headers/linux/rockchip_ion.h b/libion/kernel-headers/linux/rockchip_ion.h
new file mode 100644
index 000000000..92d8c536f
--- /dev/null
+++ b/libion/kernel-headers/linux/rockchip_ion.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2014 Meiyou.chen <cmy@rock-chips.com>
+ * Copyright (C) 2014 ROCKCHIP, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef _LINUX_ROCKCHIP_ION_H
+#define _LINUX_ROCKCHIP_ION_H
+
+#ifdef __KERNEL__
+#include "../../drivers/staging/android/ion/ion.h"
+#else
+#include <linux/ion.h>
+#endif
+
+#define ROCKCHIP_ION_VERSION "v1.1"
+
+/*
+ * ion_heap_ids order by ion_heap_type
+ */
+enum ion_heap_ids {
+ ION_VMALLOC_HEAP_ID = 0,
+ ION_CARVEOUT_HEAP_ID = 2,
+ ION_CMA_HEAP_ID = 4,
+ ION_SECURE_HEAP_ID = 5,
+};
+
+#define ION_HEAP(bit) (1 << (bit))
+
+struct ion_phys_data {
+ ion_user_handle_t handle;
+ unsigned long phys;
+ unsigned long size;
+};
+
+#define ION_IOC_ROCKCHIP_MAGIC 'R'
+
+/**
+ * Get phys addr of the handle specified.
+ */
+#define ION_IOC_GET_PHYS _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, \
+ struct ion_phys_data)
+
+/* Alloc secure region. */
+#define ION_IOC_ALLOC_SECURE _IOWR(ION_IOC_ROCKCHIP_MAGIC, 1, \
+ struct ion_phys_data)
+
+/* Free secure region alloced. */
+#define ION_IOC_FREE_SECURE _IOWR(ION_IOC_ROCKCHIP_MAGIC, 2, \
+ struct ion_phys_data)
+
+#endif