1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef __UAPI_CAM_ISP_H__
20 #define __UAPI_CAM_ISP_H__
21 #include "cam_defs.h"
22 #include "cam_isp_vfe.h"
23 #include "cam_isp_ife.h"
24 #define CAM_ISP_DEV_NAME "cam-isp"
25 #define CAM_ISP_HW_BASE 0
26 #define CAM_ISP_HW_CSID 1
27 #define CAM_ISP_HW_VFE 2
28 #define CAM_ISP_HW_IFE 3
29 #define CAM_ISP_HW_ISPIF 4
30 #define CAM_ISP_HW_MAX 5
31 #define CAM_ISP_PATTERN_BAYER_RGRGRG 0
32 #define CAM_ISP_PATTERN_BAYER_GRGRGR 1
33 #define CAM_ISP_PATTERN_BAYER_BGBGBG 2
34 #define CAM_ISP_PATTERN_BAYER_GBGBGB 3
35 #define CAM_ISP_PATTERN_YUV_YCBYCR 4
36 #define CAM_ISP_PATTERN_YUV_YCRYCB 5
37 #define CAM_ISP_PATTERN_YUV_CBYCRY 6
38 #define CAM_ISP_PATTERN_YUV_CRYCBY 7
39 #define CAM_ISP_PATTERN_MAX 8
40 #define CAM_ISP_RES_USAGE_SINGLE 0
41 #define CAM_ISP_RES_USAGE_DUAL 1
42 #define CAM_ISP_RES_USAGE_MAX 2
43 #define CAM_ISP_RES_ID_PORT 0
44 #define CAM_ISP_RES_ID_CLK 1
45 #define CAM_ISP_RES_ID_MAX 2
46 #define CAM_ISP_LANE_TYPE_DPHY 0
47 #define CAM_ISP_LANE_TYPE_CPHY 1
48 #define CAM_ISP_LANE_TYPE_MAX 2
49 #define CAM_ISP_RES_COMP_GROUP_NONE 0
50 #define CAM_ISP_RES_COMP_GROUP_ID_0 1
51 #define CAM_ISP_RES_COMP_GROUP_ID_1 2
52 #define CAM_ISP_RES_COMP_GROUP_ID_2 3
53 #define CAM_ISP_RES_COMP_GROUP_ID_3 4
54 #define CAM_ISP_RES_COMP_GROUP_ID_4 5
55 #define CAM_ISP_RES_COMP_GROUP_ID_5 6
56 #define CAM_ISP_RES_COMP_GROUP_ID_MAX 6
57 #define CAM_ISP_PACKET_OP_BASE 0
58 #define CAM_ISP_PACKET_INIT_DEV 1
59 #define CAM_ISP_PACKET_UPDATE_DEV 2
60 #define CAM_ISP_PACKET_OP_MAX 3
61 #define CAM_ISP_PACKET_META_BASE 0
62 #define CAM_ISP_PACKET_META_LEFT 1
63 #define CAM_ISP_PACKET_META_RIGHT 2
64 #define CAM_ISP_PACKET_META_COMMON 3
65 #define CAM_ISP_PACKET_META_DMI_LEFT 4
66 #define CAM_ISP_PACKET_META_DMI_RIGHT 5
67 #define CAM_ISP_PACKET_META_DMI_COMMON 6
68 #define CAM_ISP_PACKET_META_CLOCK 7
69 #define CAM_ISP_PACKET_META_CSID 8
70 #define CAM_ISP_PACKET_META_DUAL_CONFIG 9
71 #define CAM_ISP_PACKET_META_GENERIC_BLOB_LEFT 10
72 #define CAM_ISP_PACKET_META_GENERIC_BLOB_RIGHT 11
73 #define CAM_ISP_PACKET_META_GENERIC_BLOB_COMMON 12
74 #define CAM_ISP_DSP_MODE_NONE 0
75 #define CAM_ISP_DSP_MODE_ONE_WAY 1
76 #define CAM_ISP_DSP_MODE_ROUND 2
77 #define CAM_ISP_GENERIC_BLOB_TYPE_HFR_CONFIG 0
78 #define CAM_ISP_GENERIC_BLOB_TYPE_CLOCK_CONFIG 1
79 #define CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG 2
80 struct cam_isp_dev_cap_info {
81   uint32_t hw_type;
82   uint32_t reserved;
83   struct cam_hw_version hw_version;
84 };
85 struct cam_isp_query_cap_cmd {
86   struct cam_iommu_handle device_iommu;
87   struct cam_iommu_handle cdm_iommu;
88   int32_t num_dev;
89   uint32_t reserved;
90   struct cam_isp_dev_cap_info dev_caps[CAM_ISP_HW_MAX];
91 };
92 struct cam_isp_out_port_info {
93   uint32_t res_type;
94   uint32_t format;
95   uint32_t width;
96   uint32_t height;
97   uint32_t comp_grp_id;
98   uint32_t split_point;
99   uint32_t secure_mode;
100   uint32_t reserved;
101 };
102 struct cam_isp_in_port_info {
103   uint32_t res_type;
104   uint32_t lane_type;
105   uint32_t lane_num;
106   uint32_t lane_cfg;
107   uint32_t vc;
108   uint32_t dt;
109   uint32_t format;
110   uint32_t test_pattern;
111   uint32_t usage_type;
112   uint32_t left_start;
113   uint32_t left_stop;
114   uint32_t left_width;
115   uint32_t right_start;
116   uint32_t right_stop;
117   uint32_t right_width;
118   uint32_t line_start;
119   uint32_t line_stop;
120   uint32_t height;
121   uint32_t pixel_clk;
122   uint32_t batch_size;
123   uint32_t dsp_mode;
124   uint32_t hbi_cnt;
125   uint32_t reserved;
126   uint32_t num_out_res;
127   struct cam_isp_out_port_info data[1];
128 };
129 struct cam_isp_resource {
130   uint32_t resource_id;
131   uint32_t length;
132   uint32_t handle_type;
133   uint32_t reserved;
134   uint64_t res_hdl;
135 };
136 struct cam_isp_port_hfr_config {
137   uint32_t resource_type;
138   uint32_t subsample_pattern;
139   uint32_t subsample_period;
140   uint32_t framedrop_pattern;
141   uint32_t framedrop_period;
142   uint32_t reserved;
143 } __attribute__((packed));
144 struct cam_isp_resource_hfr_config {
145   uint32_t num_ports;
146   uint32_t reserved;
147   struct cam_isp_port_hfr_config port_hfr_config[1];
148 } __attribute__((packed));
149 struct cam_isp_dual_split_params {
150   uint32_t split_point;
151   uint32_t right_padding;
152   uint32_t left_padding;
153   uint32_t reserved;
154 };
155 struct cam_isp_dual_stripe_config {
156   uint32_t offset;
157   uint32_t width;
158   uint32_t tileconfig;
159   uint32_t port_id;
160 };
161 struct cam_isp_dual_config {
162   uint32_t num_ports;
163   uint32_t reserved;
164   struct cam_isp_dual_split_params split_params;
165   struct cam_isp_dual_stripe_config stripes[1];
166 } __attribute__((packed));
167 struct cam_isp_clock_config {
168   uint32_t usage_type;
169   uint32_t num_rdi;
170   uint64_t left_pix_hz;
171   uint64_t right_pix_hz;
172   uint64_t rdi_hz[1];
173 } __attribute__((packed));
174 struct cam_isp_bw_vote {
175   uint32_t resource_id;
176   uint32_t reserved;
177   uint64_t cam_bw_bps;
178   uint64_t ext_bw_bps;
179 } __attribute__((packed));
180 struct cam_isp_bw_config {
181   uint32_t usage_type;
182   uint32_t num_rdi;
183   struct cam_isp_bw_vote left_pix_vote;
184   struct cam_isp_bw_vote right_pix_vote;
185   struct cam_isp_bw_vote rdi_vote[1];
186 } __attribute__((packed));
187 #endif
188 
189