-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlibmmcamera.hsl
523 lines (434 loc) · 12.9 KB
/
libmmcamera.hsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
#include "standard-types.hsl"
#pragma enumsize(4);
#pragma ptrsize(4);
#pragma byteorder(little_endian);
#pragma displayname("Elf (*.so)") ;
#pragma fileextensions(".so") ;
typedef ushort uint16_t;
typedef ulong uint32_t;
typedef ubyte uint8_t;
typedef long int32_t;
enum DEFINES
{
MAX_CID =16,
};
typedef enum sensor_camif_inputformat_t{
CAMIF_BAYER_G_B,
CAMIF_BAYER_B_G,
CAMIF_BAYER_G_R,
CAMIF_BAYER_R_G,
CAMIF_YCBCR_Y_CB_Y_CR,
CAMIF_YCBCR_Y_CR_Y_CB,
CAMIF_YCBCR_CB_Y_CR_Y,
CAMIF_YCBCR_CR_Y_CB_Y,
CAMIF_YCBCR_4_2_2_LINEPACKED, /* Only valid for Offline Snapshot */
CAMIF_YCBCR_4_2_0_LINEPACKED, /* Only valid for Offline Snapshot */
CAMIF_NUMBEROF_INPUTFORMATTYPE /* Used for count purposes only */
} sensor_camif_inputformat_t;
typedef enum sensor_output_format_t{
SENSOR_BAYER,
SENSOR_YCBCR
} sensor_output_format_t;
typedef enum sensor_connection_mode_t{
SENSOR_PARALLEL,
SENSOR_MIPI_CSI,
SENSOR_MIPI_CSI_1,
SENSOR_MIPI_CSI_2,
} sensor_connection_mode_t;
typedef enum sensor_raw_output_t{
SENSOR_8_BIT_DIRECT,
SENSOR_10_BIT_DIRECT,
SENSOR_12_BIT_DIRECT
} sensor_raw_output_t;
typedef enum sensor_mode_t{
SENSOR_MODE_SNAPSHOT,
SENSOR_MODE_RAW_SNAPSHOT,
SENSOR_MODE_PREVIEW,
SENSOR_MODE_VIDEO,
SENSOR_MODE_VIDEO_HD,
SENSOR_MODE_HFR_60FPS,
SENSOR_MODE_HFR_90FPS,
SENSOR_MODE_HFR_120FPS,
SENSOR_MODE_HFR_150FPS,
SENSOR_MODE_ZSL,
SENSOR_MODE_INVALID,
} sensor_mode_t;
typedef enum sensor_load_chromatix_t{
SENSOR_LOAD_CHROMATIX_PREVIEW,
SENSOR_LOAD_CHROMATIX_VIDEO_DEFAULT,
SENSOR_LOAD_CHROMATIX_VIDEO_HD,
SENSOR_LOAD_CHROMATIX_VIDEO_HFR_60FPS,
SENSOR_LOAD_CHROMATIX_VIDEO_HFR_90FPS,
SENSOR_LOAD_CHROMATIX_VIDEO_HFR_120FPS,
SENSOR_LOAD_CHROMATIX_VIDEO_HFR_150FPS,
SENSOR_LOAD_CHROMATIX_AR,
SENSOR_LOAD_CHROMATIX_ZSL,
SENSOR_LOAD_CHROMATIX_MAX,
} sensor_load_chromatix_t;
typedef enum sensor_res_cfg_type_t{
SENSOR_SET_STOP_STREAM,
SENSOR_SET_START_STREAM,
SENSOR_SET_NEW_RESOLUTION,
SENSOR_SEND_EVENT,
SENSOR_SET_CSIPHY_CFG,
SENSOR_SET_CSID_CFG,
SENSOR_LOAD_CHROMATIX,
} sensor_res_cfg_type_t;
struct sensor_crop_parms_t {
uint16_t top_crop;
uint16_t bottom_crop;
uint16_t left_crop;
uint16_t right_crop;
} ;
typedef struct sensor_output_t{
sensor_output_format_t output_format;
sensor_connection_mode_t connection_mode;
sensor_raw_output_t raw_output;
} sensor_output_t;
typedef struct sensor_aec_data_t{
sensor_mode_t op_mode;
uint32_t pixels_per_line;
uint32_t lines_per_frame;
uint32_t pclk;
uint32_t max_fps;
float digital_gain;
float stored_digital_gain;
float max_gain;
uint32_t max_linecount;
} sensor_aec_data_t;
typedef struct sensor_lens_info_t{
float focal_length;
float pix_size;
float f_number;
float total_f_dist;
float hor_view_angle;
float ver_view_angle;
} sensor_lens_info_t;
/* sensor_lib_out_info_t: store information about different resolution
* supported by sensor
*
* x_output: sensor output width (pixels)
* y_output: sensor output height (pixels)
* line_length_pclk: number of pixels per line
* frame_length_lines: number of lines per frame
* vt_pixel_clk: sensor scanning rate (cycles / sec)
* op_pixel_clk: actual sensor output rate (cycles / sec)
* binning_factor: 1 if average is taken, >1 if sum is taken (applies only
* for if this resolution has binning)
* min_fps: minumim fps that can be supported for this resolution
* max_fps: maximum fps that can be supported for this sensor
* mode: mode / modes for which this resolution can be used
* SENSOR_DEFAULT_MODE / SENSOR_HFR_MODE*/
struct sensor_lib_out_info_t {
short x_output;
short y_output;
short line_length_pclk;
short frame_length_lines;
long vt_pixel_clk;
long op_pixel_clk;
short binning_factor;
blob empty[2];
float min_fps;
float max_fps;
long mode;
}sensor_lib_out_info_t;
struct sensor_lib_out_info_array {
/* sensor output for each resolutions */
struct sensor_lib_out_info_t *out_info;
/* Number of valid entries in out_info array */
uint16_t size;
};
struct msm_camera_i2c_reg_array {
uint16_t reg_addr;
uint16_t reg_data;
};
enum msm_camera_i2c_reg_addr_type {
MSM_CAMERA_I2C_BYTE_ADDR = 1,
MSM_CAMERA_I2C_WORD_ADDR,
MSM_CAMERA_I2C_3B_ADDR,
};
enum msm_camera_i2c_data_type {
MSM_CAMERA_I2C_BYTE_DATA = 1,
MSM_CAMERA_I2C_WORD_DATA,
MSM_CAMERA_I2C_SET_BYTE_MASK,
MSM_CAMERA_I2C_UNSET_BYTE_MASK,
MSM_CAMERA_I2C_SET_WORD_MASK,
MSM_CAMERA_I2C_UNSET_WORD_MASK,
MSM_CAMERA_I2C_SET_BYTE_WRITE_MASK_DATA,
};
struct msm_camera_i2c_reg_setting {
struct msm_camera_i2c_reg_array reg_setting;
uint16_t size;
enum msm_camera_i2c_reg_addr_type addr_type;
enum msm_camera_i2c_data_type data_type;
uint16_t delay;
};
struct sensor_lib_reg_settings_array {
struct msm_camera_i2c_reg_setting reg_settings;
uint32_t size;
};
struct msm_camera_csid_vc_cfg {
uint8_t cid;
uint8_t dt;
uint8_t decode_format;
};
struct msm_camera_csid_lut_params {
uint8_t num_cid;
struct msm_camera_csid_vc_cfg vc_cfg[MAX_CID];
};
struct msm_camera_csid_params {
uint8_t lane_cnt;
uint16_t lane_assign;
uint8_t phy_sel;
struct msm_camera_csid_lut_params lut_params;
};
struct msm_camera_csiphy_params {
uint8_t lane_cnt;
uint8_t settle_cnt;
uint16_t lane_mask;
uint8_t combo_mode;
uint8_t csid_core;
};
struct msm_camera_csi2_params {
struct msm_camera_csid_params csid_params;
struct msm_camera_csiphy_params csiphy_params;
};
struct sensor_lib_csi_params_array {
struct msm_camera_csi2_params csi2_params;
uint16_t size;
};
struct sensor_lib_crop_params_array{
struct sensor_crop_parms_t crop_params;
uint16_t size;
};
struct sensor_lib_chromatix_t {
char common_chromatix;
char camera_preview_chromatix;
char camera_snapshot_chromatix;
char camcorder_chromatix;
char liveshot_chromatix;
};
struct sensor_lib_chromatix_array {
struct sensor_lib_chromatix_t sensor_lib_chromatix;
uint16_t size;
};
struct sensor_res_cfg_table_t {
/* Resolution configuration */
sensor_res_cfg_type_t res_cfg_type;
/* Resolution configuration size */
uint16_t size;
};
typedef struct sensor_exposure_info_t{
uint16_t reg_gain;
uint16_t line_count;
float digital_gain;
float sensor_real_gain;
float sensor_digital_gain;
} sensor_exposure_info_t;
struct sensor_pix_fmt_info_t {
uint32_t fourcc;
};
typedef struct _sensor_stream_info_t {
uint16_t vc_cfg_size;
struct msm_camera_csid_vc_cfg vc_cfg;
struct sensor_pix_fmt_info_t pix_fmt_fourcc;
} sensor_stream_info_t;
typedef struct _sensor_stream_info_array_t {
sensor_stream_info_t sensor_stream_info;
uint16_t size;
} sensor_stream_info_array_t;
struct msm_sensor_output_info_t {
uint16_t x_output;
uint16_t y_output;
uint16_t line_length_pclk;
uint16_t frame_length_lines;
uint32_t vt_pixel_clk;
uint32_t op_pixel_clk;
uint16_t binning_factor;
uint16_t fps;
};
struct msm_sensor_output_reg_addr_t {
uint16_t x_output;
uint16_t y_output;
uint16_t line_length_pclk;
uint16_t frame_length_lines;
};
struct msm_sensor_exp_gain_info_t {
uint16_t coarse_int_time_addr;
uint16_t global_gain_addr;
uint16_t vert_offset;
};
struct sensor_meta_data_out_info_t {
int32_t width;
int32_t height;
int32_t fmt;
int32_t ebd;
};
struct sensor_lib_meta_data_info_array {
/* meta data output */
struct sensor_meta_data_out_info_t meta_data_out_info;
/* Number of valid entries in meta data array */
uint16_t size;
};
typedef struct sensor_exposure_table_t{
/** Function to calculate exosure based on real gain and
* linecount value, 1st param - real gain, 2nd param -
* linecount, 3rd param - exposure info output, return staus -
* success / failure */
//int32_t (*sensor_calculate_exposure) (float, uint16_t,
// sensor_exposure_info_t *);
/** Function to create register table from exposure settings
* input param1 - register gain value
* input param2 - coarse integration time value
* input param3 - frame length line value
* input param3 - register settings
* return value - 0 for success and negative value for
* failure **/
//int32_t (*sensor_fill_exposure_array)(uint16_t, uint32_t, uint32_t,
//int32_t, uint32_t, struct msm_camera_i2c_reg_setting *);
} sensor_exposure_table_t;
typedef struct sensor_video_hdr_table_t{
/** Function to create register table from awb settings
* success / failure */
//int32_t (*sensor_fill_awb_array)(uint16_t, uint16_t,
//struct msm_camera_i2c_seq_reg_setting *);
/* sensor awb table size */
uint16_t awb_table_size;
/* video_hdr_capability */
int video_hdr_capability;
} sensor_video_hdr_table_t;
typedef struct msm_sensor_dimension_t{
int32_t width;
int32_t height;
} msm_sensor_dimension_t;
struct msm_sensor_id_info_t {
uint16_t sensor_id_reg_addr;
uint16_t sensor_id;
};
enum msm_sensor_power_seq_type_t {
SENSOR_CLK,
SENSOR_GPIO,
SENSOR_VREG,
SENSOR_I2C_MUX,
};
struct msm_sensor_power_setting {
enum msm_sensor_power_seq_type_t seq_type;
uint16_t seq_val;
long config_val;
uint16_t delay;
//void *data[10];
blob data[10]; // if thats realy 10 chars?
};
struct msm_sensor_power_setting_array {
struct msm_sensor_power_setting *power_setting;
uint16_t size;
};
struct msm_camera_sensor_slave_info {
uint16_t slave_addr;
enum msm_camera_i2c_reg_addr_type addr_type;
struct msm_sensor_id_info_t sensor_id_info;
struct msm_sensor_power_setting_array power_setting_array;
};
enum camb_position_t {
BACK_CAMERA_B,
FRONT_CAMERA_B,
};
struct msm_sensor_init_params {
/* mask of modes supported: 2D, 3D */
int modes_supported;
/* sensor position: front, back */
enum camb_position_t position;
/* sensor mount angle */
uint32_t sensor_mount_angle;
};
struct sensor_lens_info_t{
float focal_length;
float pix_size;
float f_number;
float total_f_dist;
float hor_view_angle;
float ver_view_angle;
} sensor_lens_info_t;
struct csi_lane_params_t {
uint16_t csi_lane_assign;
uint8_t csi_lane_mask;
uint8_t csi_if;
uint8_t csid_core[2];
uint8_t csi_phy_sel;
};
typedef struct sensor_lib_t{
/* sensor slave info */
struct msm_camera_sensor_slave_info sensor_slave_info;
/* sensor info */
struct msm_sensor_init_params sensor_init_params;
/* name of the AF actuator (if any)*/
char actuator_name;
/* name of the eeprom (if any)*/
char eeprom_name;
/* sensor output settings */
sensor_output_t sensor_output;
/* sensor output register address */
struct msm_sensor_output_reg_addr_t output_reg_addr;
/* sensor exposure gain register address */
struct msm_sensor_exp_gain_info_t exp_gain_info;
/* sensor aec info */
sensor_aec_data_t aec_info;
/* sensor snapshot exposure wait frames info */
uint16_t snapshot_exp_wait_frames;
/* number of frames to skip after start stream info */
uint16_t sensor_num_frame_skip;
/* number of frames to skip after start HDR stream info */
uint16_t sensor_num_HDR_frame_skip;
/* sensor pipeline delay */
uint32_t sensor_max_pipeline_frame_delay;
/* sensor exposure table size */
uint16_t exposure_table_size;
/* sensor lens info */
struct sensor_lens_info_t _default_lens_info;
/* csi lane params */
struct csi_lane_params_t csi_lane_params;
/* csi cid params */
struct msm_camera_csid_vc_cfg csi_cid_params;
/* sensor port info that consists of cid mask and fourcc mapaping */
sensor_stream_info_array_t sensor_stream_info_array;
/* csi cid params size */
uint16_t csi_cid_params_size;
/* init settings */
struct sensor_lib_reg_settings_array init_settings_array;
/* start settings */
struct msm_camera_i2c_reg_setting start_settings;
/* stop settings */
struct msm_camera_i2c_reg_setting stop_settings;
/* group on settings */
struct msm_camera_i2c_reg_setting groupon_settings;
/* group off settings */
struct msm_camera_i2c_reg_setting groupoff_settings;
/* resolution config table */
struct sensor_res_cfg_table_t sensor_res_cfg_table;
/* resolution settings */
struct sensor_lib_reg_settings_array res_settings_array;
struct sensor_lib_out_info_array out_info_array;
struct sensor_lib_csi_params_array csi_params_array;
struct sensor_lib_crop_params_array crop_params_array;
struct sensor_lib_chromatix_array chromatix_array;
/* video_hdr mode info*/
struct sensor_lib_meta_data_info_array meta_data_out_info_array;
/* exposure funtion table */
sensor_exposure_table_t exposure_func_table;
/* exposure info */
sensor_exposure_info_t exposure_info;
/* video hdr func table */
sensor_video_hdr_table_t video_hdr_awb_lsc_func_table;
/* scale size tbl count*/
uint8_t scale_tbl_cnt;
/* function to get scale size tbl*/
//int32_t (*get_scale_tbl)(msm_sensor_dimension_t *);
/* supported Scene mode */
uint32_t *sensor_supported_scene_mode;
/* supported effect mode */
uint32_t *sensor_supported_effect_mode;
/* sensor pipeline immediate delay */
uint32_t sensor_max_immediate_frame_delay;
/* library specific data */
//void *data;
} sensor_lib_t;