aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2011-12-30 21:29:15 +0000
committerGerrit Code Review <gerrit@betelgeuse.canonical.com>2011-12-30 21:29:15 +0000
commita4b8785c956130b41329849e3562469399199f55 (patch)
tree3740f97fd29498357f220683d2decbb4aa85fd6f
parent44f5551c40059147e191d7d74aac8a5dab15cef7 (diff)
parent6d317ed1c3028f1119b07b8a7a67c50f0b7e910f (diff)
downloadbionic-linaro_android_4.0.3.tar.gz
Merge "bionic:Add new header files for graphics" into linaro_android_4.0.3linaro_android_4.0.3
-rw-r--r--libc/kernel/common/linux/hwmem.h146
-rw-r--r--libc/kernel/common/video/b2r2_blt.h191
2 files changed, 337 insertions, 0 deletions
diff --git a/libc/kernel/common/linux/hwmem.h b/libc/kernel/common/linux/hwmem.h
new file mode 100644
index 000000000..1da9d40c3
--- /dev/null
+++ b/libc/kernel/common/linux/hwmem.h
@@ -0,0 +1,146 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _HWMEM_H_
+#define _HWMEM_H_
+
+#ifndef _KERNEL
+#include <stdint.h>
+#include <sys/types.h>
+#else
+#include <linux/types.h>
+#include <linux/mm_types.h>
+#endif
+
+#define HWMEM_DEFAULT_DEVICE_NAME "hwmem"
+
+enum hwmem_alloc_flags {
+
+ HWMEM_ALLOC_HINT_WRITE_COMBINE = (1 << 0),
+
+ HWMEM_ALLOC_HINT_NO_WRITE_COMBINE = (1 << 1),
+
+ HWMEM_ALLOC_HINT_CACHED = (1 << 2),
+
+ HWMEM_ALLOC_HINT_UNCACHED = (1 << 3),
+
+ HWMEM_ALLOC_HINT_CACHE_WB = (1 << 4),
+
+ HWMEM_ALLOC_HINT_CACHE_WT = (1 << 5),
+
+ HWMEM_ALLOC_HINT_CACHE_NAOW = (1 << 6),
+
+ HWMEM_ALLOC_HINT_CACHE_AOW = (1 << 7),
+
+ HWMEM_ALLOC_HINT_INNER_AND_OUTER_CACHE = (1 << 8),
+
+ HWMEM_ALLOC_HINT_INNER_CACHE_ONLY = (1 << 9),
+
+ HWMEM_ALLOC_RESERVED_CHI = (1 << 31),
+};
+
+enum hwmem_access {
+
+ HWMEM_ACCESS_READ = (1 << 0),
+
+ HWMEM_ACCESS_WRITE = (1 << 1),
+
+ HWMEM_ACCESS_IMPORT = (1 << 2),
+};
+
+enum hwmem_mem_type {
+
+ HWMEM_MEM_SCATTERED_SYS,
+
+ HWMEM_MEM_CONTIGUOUS_SYS,
+};
+
+struct hwmem_region_us {
+ __u32 offset;
+ __u32 count;
+ __u32 start;
+ __u32 end;
+ __u32 size;
+};
+
+struct hwmem_alloc_request {
+
+ __u32 size;
+
+ __u32 flags;
+
+ __u32 default_access;
+
+ __u32 mem_type;
+};
+
+struct hwmem_set_domain_request {
+
+ __s32 id;
+
+ __u32 access;
+
+ struct hwmem_region_us region;
+};
+
+struct hwmem_pin_request {
+
+ __s32 id;
+
+ __u32 phys_addr;
+};
+
+struct hwmem_set_access_request {
+
+ __s32 id;
+
+ __u32 access;
+
+ pid_t pid;
+};
+
+struct hwmem_get_info_request {
+
+ __s32 id;
+
+ __u32 size;
+
+ __u32 mem_type;
+
+ __u32 access;
+};
+
+#define HWMEM_ALLOC_IOC _IOW('W', 1, struct hwmem_alloc_request)
+
+#define HWMEM_ALLOC_FD_IOC _IOW('W', 2, struct hwmem_alloc_request)
+
+#define HWMEM_RELEASE_IOC _IO('W', 3)
+
+#define HWMEM_SET_CPU_DOMAIN_IOC _IOW('W', 4, struct hwmem_set_domain_request)
+
+#define HWMEM_SET_SYNC_DOMAIN_IOC _IOW('W', 5, struct hwmem_set_domain_request)
+
+#define HWMEM_PIN_IOC _IOWR('W', 6, struct hwmem_pin_request)
+
+#define HWMEM_UNPIN_IOC _IO('W', 7)
+
+#define HWMEM_SET_ACCESS_IOC _IOW('W', 8, struct hwmem_set_access_request)
+
+#define HWMEM_GET_INFO_IOC _IOWR('W', 9, struct hwmem_get_info_request)
+
+#define HWMEM_EXPORT_IOC _IO('W', 10)
+
+#define HWMEM_IMPORT_IOC _IO('W', 11)
+
+#define HWMEM_IMPORT_FD_IOC _IO('W', 12)
+
+#endif
+
diff --git a/libc/kernel/common/video/b2r2_blt.h b/libc/kernel/common/video/b2r2_blt.h
new file mode 100644
index 000000000..41e6e0caa
--- /dev/null
+++ b/libc/kernel/common/video/b2r2_blt.h
@@ -0,0 +1,191 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_VIDEO_B2R2_BLT_H
+#define _LINUX_VIDEO_B2R2_BLT_H
+
+#include <linux/types.h>
+#include <linux/bitops.h>
+
+struct b2r2_blt_rect {
+ __s32 x;
+ __s32 y;
+ __s32 width;
+ __s32 height;
+};
+
+enum b2r2_blt_fmt {
+ B2R2_BLT_FMT_UNUSED = 0,
+ B2R2_BLT_FMT_16_BIT_ARGB4444 = 4,
+ B2R2_BLT_FMT_16_BIT_ARGB1555 = 5,
+ B2R2_BLT_FMT_16_BIT_RGB565 = 6,
+ B2R2_BLT_FMT_24_BIT_RGB888 = 11,
+ B2R2_BLT_FMT_32_BIT_ARGB8888 = 16,
+ B2R2_BLT_FMT_YUV420_PACKED_PLANAR = 20,
+ B2R2_BLT_FMT_YUV422_PACKED_PLANAR = 23,
+ B2R2_BLT_FMT_Y_CB_Y_CR = 25,
+ B2R2_BLT_FMT_CB_Y_CR_Y = 27,
+ B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR = 39,
+ B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR = 40,
+
+ B2R2_BLT_FMT_32_BIT_ABGR8888 = 0x7F000000,
+ B2R2_BLT_FMT_24_BIT_ARGB8565 = 0x7F000001,
+ B2R2_BLT_FMT_24_BIT_YUV888 = 0x7F000002,
+ B2R2_BLT_FMT_32_BIT_AYUV8888 = 0x7F000003,
+ B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE = 0x7F000004,
+ B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE = 0x7F000005,
+ B2R2_BLT_FMT_1_BIT_A1 = 0x7F000006,
+ B2R2_BLT_FMT_8_BIT_A8 = 0x7F000007,
+ B2R2_BLT_FMT_YUV444_PACKED_PLANAR = 0x7F000008,
+};
+
+enum b2r2_blt_ptr_type {
+ B2R2_BLT_PTR_NONE,
+ B2R2_BLT_PTR_VIRTUAL,
+ B2R2_BLT_PTR_PHYSICAL,
+ B2R2_BLT_PTR_FD_OFFSET,
+ B2R2_BLT_PTR_HWMEM_BUF_NAME_OFFSET,
+};
+
+struct b2r2_blt_buf {
+ enum b2r2_blt_ptr_type type;
+ __s32 hwmem_buf_name;
+ __s32 fd;
+ __u32 offset;
+ __u32 len;
+ void *bits;
+};
+
+struct b2r2_blt_img {
+ enum b2r2_blt_fmt fmt;
+ struct b2r2_blt_buf buf;
+ __s32 width;
+ __s32 height;
+ __u32 pitch;
+};
+
+enum b2r2_blt_transform {
+ B2R2_BLT_TRANSFORM_NONE = 0,
+ B2R2_BLT_TRANSFORM_FLIP_H = 1,
+ B2R2_BLT_TRANSFORM_FLIP_V = 2,
+ B2R2_BLT_TRANSFORM_CCW_ROT_90 = 4,
+ B2R2_BLT_TRANSFORM_CCW_ROT_180 = 3,
+ B2R2_BLT_TRANSFORM_CCW_ROT_270 = 7,
+ B2R2_BLT_TRANSFORM_FLIP_H_CCW_ROT_90 = 5,
+ B2R2_BLT_TRANSFORM_FLIP_V_CCW_ROT_90 = 6,
+};
+
+#ifndef _KERNEL
+#define BIT(nr) (1UL << (nr))
+#endif
+enum b2r2_blt_flag {
+ B2R2_BLT_FLAG_ASYNCH = BIT(0),
+ B2R2_BLT_FLAG_DRY_RUN = BIT(1),
+ B2R2_BLT_FLAG_PER_PIXEL_ALPHA_BLEND = BIT(2),
+ B2R2_BLT_FLAG_GLOBAL_ALPHA_BLEND = BIT(3),
+ B2R2_BLT_FLAG_SOURCE_COLOR_KEY = BIT(4),
+ B2R2_BLT_FLAG_SOURCE_FILL = BIT(5),
+ B2R2_BLT_FLAG_SOURCE_FILL_RAW = BIT(6),
+ B2R2_BLT_FLAG_DEST_COLOR_KEY = BIT(7),
+ B2R2_BLT_FLAG_SRC_IS_NOT_PREMULT = BIT(8),
+ B2R2_BLT_FLAG_DITHER = BIT(9),
+ B2R2_BLT_FLAG_BLUR = BIT(10),
+ B2R2_BLT_FLAG_SOURCE_MASK = BIT(11),
+ B2R2_BLT_FLAG_DESTINATION_CLIP = BIT(12),
+ B2R2_BLT_FLAG_INHERIT_PRIO = BIT(13),
+ B2R2_BLT_FLAG_SRC_NO_CACHE_FLUSH = BIT(14),
+ B2R2_BLT_FLAG_SRC_MASK_NO_CACHE_FLUSH = BIT(15),
+ B2R2_BLT_FLAG_DST_NO_CACHE_FLUSH = BIT(16),
+ B2R2_BLT_FLAG_BG_BLEND = BIT(17),
+ B2R2_BLT_FLAG_BG_NO_CACHE_FLUSH = BIT(18),
+ B2R2_BLT_FLAG_REPORT_WHEN_DONE = BIT(29),
+ B2R2_BLT_FLAG_REPORT_PERFORMANCE = BIT(30),
+ B2R2_BLT_FLAG_CLUT_COLOR_CORRECTION = BIT(31),
+};
+
+struct b2r2_blt_req {
+ __u32 size;
+ enum b2r2_blt_flag flags;
+ enum b2r2_blt_transform transform;
+ __s32 prio;
+ void *clut;
+ struct b2r2_blt_img src_img;
+ struct b2r2_blt_img src_mask;
+ struct b2r2_blt_rect src_rect;
+ __u32 src_color;
+ struct b2r2_blt_img bg_img;
+ struct b2r2_blt_rect bg_rect;
+ struct b2r2_blt_img dst_img;
+ struct b2r2_blt_rect dst_rect;
+ struct b2r2_blt_rect dst_clip_rect;
+ __u32 dst_color;
+ __u8 global_alpha;
+ __u32 report1;
+ __u32 report2;
+};
+
+enum b2r2_blt_cap {
+ B2R2_BLT_CAP_UNUSED = 0,
+
+ B2R2_BLT_CAP_FMT_SOURCE,
+
+ B2R2_BLT_CAP_FMT_SOURCE_MASK,
+
+ B2R2_BLT_CAP_FMT_DEST,
+
+ B2R2_BLT_CAP_PER_PIXEL_ALPHA_BLEND,
+
+ B2R2_BLT_CAP_GLOBAL_ALPHA_BLEND,
+
+ B2R2_BLT_CAP_SOURCE_COLOR_KEY,
+
+ B2R2_BLT_CAP_SOURCE_FILL,
+
+ B2R2_BLT_CAP_SOURCE_FILL_RAW,
+
+ B2R2_BLT_CAP_DEST_COLOR_KEY,
+
+ B2R2_BLT_CAP_DITHER,
+
+ B2R2_BLT_CAP_BLUR,
+
+ B2R2_BLT_CAP_MINIFICATION_LIMIT,
+
+ B2R2_BLT_CAP_MAGNIFICATION_LIMIT,
+
+ B2R2_BLT_CAP_SCALING_FRAC_BITS,
+
+ B2R2_BLT_CAP_ROTATION_STEP_DEG,
+};
+
+struct b2r2_blt_query_cap {
+ enum b2r2_blt_fmt fmt;
+ enum b2r2_blt_cap cap;
+ __u32 result;
+};
+
+struct b2r2_blt_report {
+ __u32 request_id;
+ __u32 report1;
+ __u32 report2;
+ __u32 usec_elapsed;
+};
+
+#define B2R2_BLT_IOC_MAGIC 0xb2
+
+#define B2R2_BLT_IOC _IOW(B2R2_BLT_IOC_MAGIC, 1, struct b2r2_blt_req)
+
+#define B2R2_BLT_SYNCH_IOC _IOW(B2R2_BLT_IOC_MAGIC, 2, int)
+
+#define B2R2_BLT_QUERY_CAP_IOC _IOWR(B2R2_BLT_IOC_MAGIC, 3, struct b2r2_blt_query_cap)
+
+#endif
+