diff options
author | Per-Daniel Olsson <per-daniel.olsson@stericsson.com> | 2012-02-10 18:30:04 +0100 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:04:28 +0200 |
commit | fdd0c051aff401925d7e6a7118931245052d434a (patch) | |
tree | 52b8f72036ed822310324ae5e87f6f65702f66b7 /include/linux/compdev.h | |
parent | f61b197ad7132acff379d7a55f4fcfe48885a803 (diff) |
misc: compdev: Updated for new kernel composition
The compdev device has been updated for the new B2R2/MCDE composition
in the kernel. All B2R2 work will now be done in the kernel. A callback
interface has been added for potential listeners. Such listeners could
for example be cloning for external devices.
ST-Ericsson Linux next: NA
ST-Ericsson ID: 404691
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I0c059fd6ef889356b1de77684c30721ce6b3ebbf
Signed-off-by: Per-Daniel Olsson <per-daniel.olsson@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/49974
Reviewed-by: QATOOLS
Reviewed-by: Robert FEKETE <robert.fekete@stericsson.com>
Reviewed-by: QABUILD
Diffstat (limited to 'include/linux/compdev.h')
-rw-r--r-- | include/linux/compdev.h | 88 |
1 files changed, 68 insertions, 20 deletions
diff --git a/include/linux/compdev.h b/include/linux/compdev.h index 9e707c7b770..83285c61b62 100644 --- a/include/linux/compdev.h +++ b/include/linux/compdev.h @@ -30,7 +30,7 @@ #endif #define COMPDEV_DEFAULT_DEVICE_PREFIX "comp" -#define NUM_COMPDEV_BUFS 2 + enum compdev_fmt { COMPDEV_FMT_RGB565, @@ -38,34 +38,52 @@ enum compdev_fmt { 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 { - uint16_t width; - uint16_t height; + __u16 width; + __u16 height; }; /* Display rotation */ enum compdev_rotation { COMPDEV_ROT_0 = 0, COMPDEV_ROT_90_CCW = 90, - COMPDEV_ROT_180_CCW = 180, + COMPDEV_ROT_180 = 180, COMPDEV_ROT_270_CCW = 270, COMPDEV_ROT_90_CW = COMPDEV_ROT_270_CCW, - COMPDEV_ROT_180_CW = COMPDEV_ROT_180_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 { - __s32 x; - __s32 y; - __s32 width; - __s32 height; + __s16 x; + __s16 y; + __u16 width; + __u16 height; }; struct compdev_buf { @@ -79,27 +97,57 @@ struct compdev_buf { struct compdev_img { enum compdev_fmt fmt; struct compdev_buf buf; - __s32 width; - __s32 height; - __u32 pitch; + __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_post_buffers_req { - enum compdev_rotation rotation; - struct compdev_img img_buffers[NUM_COMPDEV_BUFS]; - __u8 buffer_count; +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_BUFFERS_IOC _IOW('D', 2, struct compdev_post_buffers_req) -#ifdef __KERNEL__ +#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); + 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_ */ |