summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@stericsson.com>2012-06-04 19:45:30 +0800
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-06-04 19:45:30 +0800
commit1cd04b2aba9f3b3468adf0789030240e032d8d3e (patch)
tree2e010c15b347b7acda9bc7a2ab4abca9d58043eb /include/linux
parentcff72c10aa27e3a74eb5d5b7ceb7808d8c917d15 (diff)
parentb7086e0a1dec82bf7e8e96e17738151f0aee82fc (diff)
Merge topic branch 'video' into integration-linux-ux500
Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/clonedev.h50
-rw-r--r--include/linux/compdev.h154
-rw-r--r--include/linux/dispdev.h66
4 files changed, 271 insertions, 0 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 3c9b616c834..b3d7e23440e 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -151,6 +151,7 @@ header-y += hid.h
header-y += hiddev.h
header-y += hidraw.h
header-y += hpet.h
+header-y += hwmem.h
header-y += hysdn_if.h
header-y += i2c-dev.h
header-y += i2c.h
diff --git a/include/linux/clonedev.h b/include/linux/clonedev.h
new file mode 100644
index 00000000000..575233f07e9
--- /dev/null
+++ b/include/linux/clonedev.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2011
+ *
+ * ST-Ericsson Display overlay compositer device driver
+ *
+ * Author: Per-Daniel Olsson <per-daniel.olsson@stericsson.com>
+ * for ST-Ericsson.
+ *
+ * License terms: GNU General Public License (GPL), version 2.
+ */
+
+#ifndef _CLONEDEV_H_
+#define _CLONEDEV_H_
+
+#if !defined(__KERNEL__) && !defined(_KERNEL)
+#include <stdint.h>
+#else
+#include <linux/types.h>
+#include <video/mcde.h>
+#endif
+
+#if defined(__KERNEL__) || defined(_KERNEL)
+#include <linux/mm_types.h>
+#include <linux/bitops.h>
+#else
+#define BIT(nr) (1UL << (nr))
+#endif
+
+#define CLONEDEV_DEFAULT_DEVICE_PREFIX "clone"
+
+/* Cloning mode */
+enum clonedev_mode {
+ CLONEDEV_CLONE_NONE,
+ CLONEDEV_CLONE_VIDEO_OR_UI,
+ CLONEDEV_CLONE_VIDEO_AND_UI,
+ CLONEDEV_CLONE_VIDEO,
+ CLONEDEV_CLONE_UI,
+};
+
+#define CLONEDEV_SET_MODE_IOC _IOW('D', 1, __u32*)
+
+#ifdef __KERNEL__
+
+int clonedev_create(void);
+void clonedev_destroy(void);
+
+#endif /* __KERNEL__ */
+
+#endif /* _CLONEDEV_H_ */
+
diff --git a/include/linux/compdev.h b/include/linux/compdev.h
new file mode 100644
index 00000000000..83285c61b62
--- /dev/null
+++ b/include/linux/compdev.h
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2011
+ *
+ * ST-Ericsson Display overlay compositer device driver
+ *
+ * Author: Anders Bauer <anders.bauer@stericsson.com>
+ * for ST-Ericsson.
+ *
+ * Modified: Per-Daniel Olsson <per-daniel.olsson@stericsson.com>
+ * for ST-Ericsson.
+ *
+ * License terms: GNU General Public License (GPL), version 2.
+ */
+
+#ifndef _COMPDEV_H_
+#define _COMPDEV_H_
+
+#if !defined(__KERNEL__) && !defined(_KERNEL)
+#include <stdint.h>
+#else
+#include <linux/types.h>
+#include <video/mcde.h>
+#endif
+
+#if defined(__KERNEL__) || defined(_KERNEL)
+#include <linux/mm_types.h>
+#include <linux/bitops.h>
+#else
+#define BIT(nr) (1UL << (nr))
+#endif
+
+#define COMPDEV_DEFAULT_DEVICE_PREFIX "comp"
+
+
+enum compdev_fmt {
+ COMPDEV_FMT_RGB565,
+ COMPDEV_FMT_RGB888,
+ COMPDEV_FMT_RGBX8888,
+ COMPDEV_FMT_RGBA8888,
+ COMPDEV_FMT_YUV422,
+ COMPDEV_FMT_YCBCR42XMBN,
+ COMPDEV_FMT_YUV420_SP,
+ COMPDEV_FMT_YVU420_SP,
+ COMPDEV_FMT_YUV420_P,
+};
+
+struct compdev_size {
+ __u16 width;
+ __u16 height;
+};
+
+/* Display rotation */
+enum compdev_rotation {
+ COMPDEV_ROT_0 = 0,
+ COMPDEV_ROT_90_CCW = 90,
+ COMPDEV_ROT_180 = 180,
+ COMPDEV_ROT_270_CCW = 270,
+ COMPDEV_ROT_90_CW = COMPDEV_ROT_270_CCW,
+ COMPDEV_ROT_270_CW = COMPDEV_ROT_90_CCW,
+};
+
+enum compdev_flag {
+ COMPDEV_NO_FLAG = 0x00,
+ COMPDEV_OVERLAY_FLAG = 0x01,
+ COMPDEV_FRAMEBUFFER_FLAG = 0x02,
+ COMPDEV_BYPASS_FLAG = 0x04,
+ COMPDEV_EXTERNAL_DISP_FLAG = 0x08,
+ COMPDEV_PROTECTED_FLAG = 0x0F,
+};
+
+enum compdev_ptr_type {
+ COMPDEV_PTR_PHYSICAL,
+ COMPDEV_PTR_HWMEM_BUF_NAME_OFFSET,
+};
+
+enum compdev_listener_state {
+ COMPDEV_LISTENER_OFF,
+ COMPDEV_LISTENER_ON,
+};
+
+
+struct compdev_rect {
+ __s16 x;
+ __s16 y;
+ __u16 width;
+ __u16 height;
+};
+
+struct compdev_buf {
+ enum compdev_ptr_type type;
+ __s32 hwmem_buf_name;
+ __s32 fd;
+ __u32 offset;
+ __u32 len;
+};
+
+struct compdev_img {
+ enum compdev_fmt fmt;
+ struct compdev_buf buf;
+ __u16 width;
+ __u16 height;
+ __u16 pitch;
+ __u8 z_position;
+ struct compdev_rect dst_rect;
+ struct compdev_rect src_rect;
+ enum compdev_rotation rotation;
+ __u32 flags;
+};
+
+struct compdev_scene_info {
+ enum compdev_rotation ovly_rotation;
+ enum compdev_rotation fb_rotation;
+ __u8 img_count;
+};
+
+
+#define COMPDEV_GET_SIZE_IOC _IOR('D', 1, struct compdev_size)
+#define COMPDEV_POST_BUFFER_IOC _IOW('D', 2, struct compdev_img)
+#define COMPDEV_POST_SCENE_INFO_IOC _IOW('D', 3, struct compdev_scene_info)
+#define COMPDEV_GET_LISTENER_STATE_IOC _IOR('D', 4, enum compdev_listener_state)
+
+
+#if defined(__KERNEL__) || defined(_KERNEL)
+
+#define MAX_NBR_OF_COMPDEVS 2
+
+struct compdev;
+typedef void (*post_buffer_callback)(void *data, struct compdev_img *img);
+typedef void (*post_scene_info_callback)(void *data,
+ struct compdev_scene_info *s_info);
+
+
+int compdev_create(struct mcde_display_device *ddev,
+ struct mcde_overlay *parent_ovly,
+ bool mcde_rotation);
+void compdev_destroy(struct mcde_display_device *ddev);
+
+int compdev_get(int dev_idx, struct compdev **dev);
+int compdev_put(struct compdev *dev);
+int compdev_get_size(struct compdev *dev, struct compdev_size *size);
+int compdev_post_buffer(struct compdev *dev, struct compdev_img *img);
+int compdev_post_scene_info(struct compdev *dev,
+ struct compdev_scene_info *s_info);
+int compdev_get_listener_state(struct compdev *dev,
+ enum compdev_listener_state *listener_state);
+
+int compdev_register_listener_callbacks(struct compdev *dev, void *data,
+ post_buffer_callback pb_cb, post_scene_info_callback si_cb);
+int compdev_deregister_callbacks(struct compdev *dev);
+
+#endif /* __KERNEL__ */
+
+#endif /* _COMPDEV_H_ */
+
diff --git a/include/linux/dispdev.h b/include/linux/dispdev.h
new file mode 100644
index 00000000000..cbcf6705150
--- /dev/null
+++ b/include/linux/dispdev.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2011
+ *
+ * ST-Ericsson Display device driver
+ *
+ * Author: Marcus Lorentzon <marcus.xm.lorentzon@stericsson.com>
+ * for ST-Ericsson.
+ *
+ * License terms: GNU General Public License (GPL), version 2.
+ */
+
+#ifndef _DISPDEV_H_
+#define _DISPDEV_H_
+
+#if !defined(__KERNEL__) && !defined(_KERNEL)
+#include <stdint.h>
+#else
+#include <linux/types.h>
+#include <video/mcde.h>
+#endif
+
+#define DISPDEV_DEFAULT_DEVICE_PREFIX "disp"
+
+enum dispdev_fmt {
+ DISPDEV_FMT_RGB565,
+ DISPDEV_FMT_RGB888,
+ DISPDEV_FMT_RGBX8888,
+ DISPDEV_FMT_RGBA8888,
+ DISPDEV_FMT_YUV422,
+};
+
+struct dispdev_config {
+ uint16_t format;
+ uint16_t stride;
+ uint16_t x;
+ uint16_t y;
+ uint16_t z;
+ uint16_t width;
+ uint16_t height;
+
+ uint32_t user_flags;
+};
+
+struct dispdev_buffer_info {
+ uint16_t buf_idx;
+ uint16_t display_update;
+ struct dispdev_config buf_cfg;
+};
+
+#define DISPDEV_SET_CONFIG_IOC _IOW('D', 1, struct dispdev_config)
+#define DISPDEV_GET_CONFIG_IOC _IOR('D', 2, struct dispdev_config)
+#define DISPDEV_REGISTER_BUFFER_IOC _IO('D', 3)
+#define DISPDEV_UNREGISTER_BUFFER_IOC _IO('D', 4)
+#define DISPDEV_QUEUE_BUFFER_IOC _IOW('D', 5, struct dispdev_buffer_info)
+#define DISPDEV_DEQUEUE_BUFFER_IOC _IO('D', 6)
+
+#ifdef __KERNEL__
+
+int dispdev_create(struct mcde_display_device *ddev, bool overlay,
+ struct mcde_overlay *parent_ovly);
+void dispdev_destroy(struct mcde_display_device *ddev);
+
+#endif /* __KERNEL__ */
+
+#endif /* _DISPDEV_H_ */
+