| /* |
| * Samsung Exynos SoC series VPU driver |
| * |
| * Copyright (c) 2015 Samsung Electronics Co., Ltd |
| * |
| * This program is free software; you can redistribute it and/or modify |
| * it under the terms of the GNU General Public License version 2 as |
| * published by the Free Software Foundation. |
| */ |
| |
| |
| #ifndef VISION_FOR_LINUX_H_ |
| #define VISION_FOR_LINUX_H_ |
| |
| #ifndef __u32 |
| typedef unsigned int __u32; |
| #endif |
| |
| #ifndef __u16 |
| typedef unsigned short __u16; |
| #endif |
| |
| #ifndef __u8 |
| typedef unsigned char __u8; |
| #endif |
| |
| #ifndef __s32 |
| typedef int __s32; |
| #endif |
| |
| #define VS4L_VERSION 5 |
| #define VS4L_TARGET_SC 0xFFFF |
| #define VS4L_TARGET_SC_SHIFT 16 |
| #define VS4L_TARGET_PU 0xFFFF |
| #define VS4L_TARGET_PU_SHIFT 0 |
| |
| enum vs4l_graph_flag { |
| VS4L_GRAPH_FLAG_FIXED, |
| VS4L_GRAPH_FLAG_SHARED_AMONG_SUBCHAINS, |
| VS4L_GRAPH_FLAG_SHARING_AMONG_SUBCHAINS_PREFERRED, |
| VS4L_GRAPH_FLAG_SHARED_AMONG_TASKS, |
| VS4L_GRAPH_FLAG_SHARING_AMONG_TASKS_PREFERRED, |
| VS4L_GRAPH_FLAG_DSBL_LATENCY_BALANCING, |
| VS4L_STATIC_ALLOC_LARGE_MPRB_INSTEAD_SMALL_FLAG, |
| VS4L_STATIC_ALLOC_PU_INSTANCE_LSB, |
| VS4L_GRAPH_FLAG_PRIMITIVE, |
| VS4L_GRAPH_FLAG_EXCLUSIVE, |
| VS4L_GRAPH_FLAG_PERIODIC, |
| VS4L_GRAPH_FLAG_ROUTING, |
| VS4L_GRAPH_FLAG_BYPASS, |
| VS4L_GRAPH_FLAG_END |
| }; |
| |
| struct vs4l_graph { |
| __u32 id; |
| __u32 priority; |
| __u32 time; /* in millisecond */ |
| __u32 flags; |
| __u32 size; |
| unsigned long addr; |
| }; |
| |
| struct vs4l_format { |
| __u32 target; |
| __u32 format; |
| __u32 plane; |
| __u32 width; |
| __u32 height; |
| }; |
| |
| struct vs4l_format_list { |
| __u32 direction; |
| __u32 count; |
| struct vs4l_format *formats; |
| }; |
| |
| struct vs4l_param { |
| __u32 target; |
| unsigned long addr; |
| __u32 offset; |
| __u32 size; |
| }; |
| |
| struct vs4l_param_list { |
| __u32 count; |
| struct vs4l_param *params; |
| }; |
| |
| struct vs4l_ctrl { |
| __u32 ctrl; |
| __u32 value; |
| }; |
| |
| struct vs4l_roi { |
| __u32 x; |
| __u32 y; |
| __u32 w; |
| __u32 h; |
| }; |
| |
| struct vs4l_buffer { |
| struct vs4l_roi roi; |
| union { |
| unsigned long userptr; |
| __s32 fd; |
| } m; |
| unsigned long reserved; |
| }; |
| |
| enum vs4l_buffer_type { |
| VS4L_BUFFER_LIST, |
| VS4L_BUFFER_ROI, |
| VS4L_BUFFER_PYRAMID |
| }; |
| |
| enum vs4l_memory { |
| VS4L_MEMORY_USERPTR = 1, |
| VS4L_MEMORY_VIRTPTR, |
| VS4L_MEMORY_DMABUF |
| }; |
| |
| struct vs4l_container { |
| __u32 type; |
| __u32 target; |
| __u32 memory; |
| __u32 reserved[4]; |
| __u32 count; |
| struct vs4l_buffer *buffers; |
| }; |
| |
| enum vs4l_direction { |
| VS4L_DIRECTION_IN = 1, |
| VS4L_DIRECTION_OT |
| }; |
| |
| enum vs4l_cl_flag { |
| VS4L_CL_FLAG_TIMESTAMP, |
| VS4L_CL_FLAG_PREPARE = 8, |
| VS4L_CL_FLAG_INVALID, |
| VS4L_CL_FLAG_DONE |
| }; |
| |
| struct vs4l_container_list { |
| __u32 direction; |
| __u32 id; |
| __u32 index; |
| __u32 flags; |
| struct timeval timestamp[6]; |
| __u32 count; |
| struct vs4l_container *containers; |
| }; |
| |
| /* |
| * F O U R C C C O D E S F O R V I S I O N |
| * |
| */ |
| |
| #define VS4L_DF_IMAGE(a,b,c,d) ((a) | (b << 8) | (c << 16) | (d << 24)) |
| #define VS4L_DF_IMAGE_RGB VS4L_DF_IMAGE('R','G','B','2') |
| #define VS4L_DF_IMAGE_RGBX VS4L_DF_IMAGE('R','G','B','A') |
| #define VS4L_DF_IMAGE_NV12 VS4L_DF_IMAGE('N','V','1','2') |
| #define VS4L_DF_IMAGE_NV21 VS4L_DF_IMAGE('N','V','2','1') |
| #define VS4L_DF_IMAGE_YUYV VS4L_DF_IMAGE('Y','U','Y','V') |
| #define VS4L_DF_IMAGE_YUV4 VS4L_DF_IMAGE('Y','U','V','4') |
| #define VS4L_DF_IMAGE_U8 VS4L_DF_IMAGE('U','0','0','8') |
| #define VS4L_DF_IMAGE_U16 VS4L_DF_IMAGE('U','0','1','6') |
| #define VS4L_DF_IMAGE_U32 VS4L_DF_IMAGE('U','0','3','2') |
| #define VS4L_DF_IMAGE_S16 VS4L_DF_IMAGE('S','0','1','6') |
| #define VS4L_DF_IMAGE_S32 VS4L_DF_IMAGE('S','0','3','2') |
| |
| /* |
| * I O C T L C O D E S F O R V E R T E X D E V I C E |
| * |
| */ |
| |
| #define VS4L_VERTEXIOC_S_GRAPH _IOW('V', 0, struct vs4l_graph) |
| #define VS4L_VERTEXIOC_S_FORMAT _IOW('V', 1, struct vs4l_format_list) |
| #define VS4L_VERTEXIOC_S_PARAM _IOW('V', 2, struct vs4l_param_list) |
| #define VS4L_VERTEXIOC_S_CTRL _IOW('V', 3, struct vs4l_ctrl) |
| #define VS4L_VERTEXIOC_STREAM_ON _IO('V', 4) |
| #define VS4L_VERTEXIOC_STREAM_OFF _IO('V', 5) |
| #define VS4L_VERTEXIOC_QBUF _IOW('V', 6, struct vs4l_container_list) |
| #define VS4L_VERTEXIOC_DQBUF _IOW('V', 7, struct vs4l_container_list) |
| |
| #endif |