summaryrefstree
path: root/kernel/drivers/vision/vpu/include/lib/vpul-pu.h
blob: 1d2bfe7de316cb8d8d38644172163afe57766fca (plain)
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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
/*
 * Samsung Exynos SoC series VPU driver
 *
 * Copyright (c) 2016 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.
 */

#if !defined(__VPU_PROCESSING_UNIT_CONFIGURATION__)
#define __VPU_PROCESSING_UNIT_CONFIGURATION__

/* VPU 2.1 TODO: move definition to high level file */
#define VPU_2v1

/** \addtogroup VPUL-DS
 *  @{
 */
/** \addtogroup PU Processing units
 *  \brief Structures used to to define PU functionality, resources and parameters
 *  @{
 */

#define VPU_MAXIMAL_MPRB_CONNECTED	43
/* Maximal PUs connected as inputs to one PU */
#define VPUL_PU_MAX_PORTS		5


enum vpul_logical_op_types {
#define ENTRY(a) a,
#include "vpul_pu_opcodes.def"
#undef ENTRY
	NUMBER_OF_OP_TYPE
};


struct pu_ram_port_range {
	__u32	first_ram_port;
	__u32	number_of_ram_ports;
};

enum vpul_pu_instance {
#define VPU_PU_INSTANCE(a, b, c, d, e, f, g, h, i) a,
#include "vpul_pu_instances.def"
#undef VPU_PU_INSTANCE
	VPU_PU_NUMBER
};

/** \enum VPU_PU_TYPES
 * \brief Different types of PUs as HwMapper knows them. Defined using X
 *        macros based on vpul_pu_types.def.
 */
enum VPU_PU_TYPES {
#define VPU_PU_TYPE(a, b, c) a, \

#include "vpul_pu_types.def"
#undef VPU_PU_TYPE
	VPU_PU_TYPES_NUMBER,
	END_OF_PU_INST2TYPE_TRANSLATOR = 0XFFFFFFFF
};


enum vpul_mprb_acc_type {
	VPU_MPRB_ACC_UPDATABLE_PU    = 0,
	VPU_MPRB_ACC_NONUPDATABLE_PU = 1,
	VPU_MPRB_ACC_COUNT
};

/*! \brief DMA parameters */
struct vpul_pu_dma {
	/*! \brief The index of the current IO type description that includes
	 * the start address and the line offset
	 */
	__u32 inout_index;
	/*! 0 = Address is incremented between each 2 lines
	 * 1 = Address is decremented between each 2 lines
	 */
	__u32 offset_lines_inc;

	/*! \brief use to copy data from internal_mem to ext */
	__u32 is_output_vector_dma;
};

/*!
 * \ brief SALB parameters - fully described in user guide
 */
struct vpul_pu_salb {
	__u32 bits_in0			:1;
	__u32 bits_in1			:1;
	__u32 bits_out0			:1;
	__u32 signed_in0		:1;
	__u32 signed_in1		:1;
	__u32 signed_out0		:1;
	__u32 input_enable		:3;
	__u32 use_mask			:1;
	__u32 operation_code		:5;
	__u32 abs_neg			:2;
	__u32 trunc_out			:2;
	__u32 org_val_med		:1;
	__u32 shift_bits		:4;
	__u32 cmp_op			:3;
	__u32 const_in1			:1;
	__u32 thresh_lo			:16;
	__u32 thresh_hi			:16;
	__u32 val_lo			:16;
	__u32 val_hi			:16;
	__u32 val_med_filler		:16;
	__u32 salbregs_custom_trunc_en		:1;
	__u32 salbregs_custom_trunc_bittage	:5;
};

/*!
 * \ brief CALB parameters - fully described in user guide
 */
struct vpul_pu_calb {
	__u32 bits_in0			  :2;
	__u32 bits_in1                    :2;
	__u32 bits_out0                   :2;
	__u32 signed_in0                  :1;
	__u32 signed_in1                  :1;
	__u32 signed_out0                 :1;
	__u32 input_enable                :3;
	__u32 use_mask                    :1;
	__u32 operation_code              :5;
	__u32 abs_neg                     :2;
	__u32 trunc_out                   :2;
	__u32 org_val_med                 :1;
	__u32 shift_bits                  :6;
	__u32 mult_round                  :3;
	__u32 cmp_op                      :3;
	__u32 const_in1                   :1;
	__u32 div_shift_bits              :5;
	__u32 div_overflow_remainder      :1;
	__u32 thresh_lo;
	__u32 thresh_hi;
	__u32 val_lo;
	__u32 val_hi;
	__u32 val_med_filler;
};


/*! \brief Add parameters (Adding two inputs) */
struct vpul_pu_add {
	/*!  input/output bits: 0 = 8 bits. 1 = 16 bits. */
	__u32 bits;
	/*!  input/output sign : 0 = unsigned. 1 = signed. */
	__u32 is_signed;
};

/*!
 * \ brief ROIS parameters - fully described in user guide
 */
struct vpul_pu_rois_out {
	__u32 bits_in0	     :2;
	__u32 signed_in0     :1;
	__u32 use_mask       :1;
	__u32 work_mode      :2;
	__u32 first_min_max  :1;
	__u32 thresh_lo_temp :12;
};

/*!
 * \ brief CROP parameters - fully described in user guide
 */
struct vpul_pu_crop {
	__u32 work_mode	   :2;
	__u32 pad_value    :16;
	__u32 mask_val_in  :16;
	__u32 mask_val_out :16;
	__u32 roi_startx   :14;
	__u32 roi_starty   :14;
};

/*!
 * \ brief MDE parameters - fully described in user guide
 */
struct vpul_pu_mde {
	__u32 work_mode		    :3;
	__u32 result_shift          :6;
	__u32 use_thresh            :1;
	__u32 calc_quantized_angle  :1;
	__u32 eig_coeff             :25;
	__u32 bits_in               :2;
	__u32 signed_in             :1;
	__u32 bits_out              :2;
	__u32 signed_out            :1;
	__u32 output_enable         :2;
	__u32 thresh;
};

/*!
 * \ brief NMS parameters - fully described in user guide
 */
struct vpul_pu_nms {
	__u32 work_mode		     :4;
	__u32 keep_equals            :1;
	__u32 directional_nms        :1;
	__u32 census_mode            :2;
	__u32 add_orig_pixel         :1;
	__u32 bits_in                :2;
	__u32 bits_out               :2;
	__u32 signed_in              :1;
	__u32 support                :2;
	__u32 org_val_out            :1;
	__u32 trunc_out              :1;
	__u32 image_height           :14;
	__u32 thresh;
	__u32 border_mode_up         :1;
	__u32 border_mode_down       :1;
	__u32 border_mode_left       :1;
	__u32 border_mode_right      :1;
	__u32 border_fill            :2;
	__u32 border_fill_constant   :8;
	__u32 strict_comparison_mask :3;
	__u32 cens_thres_0           :3;
	__u32 cens_thres_1           :3;
	__u32 cens_thres_2           :3;
	__u32 cens_thres_3           :3;
	__u32 cens_thres_4           :3;
	__u32 cens_thres_5           :3;
	__u32 cens_thres_6           :3;
	__u32 cens_thres_7           :3;
};

/*! /brief Description for filter coefficients */
struct coeff_item {
	/*!  \brief
         * 0=coefficients are part of static vector.
	 * 1=coefficients are part of dynamic vector (parameters vector)
	 */
	__u32 is_dynamic;
	/*!  \brief coefficients vector dimension size.
	 */
	__u32 vsize;
	/*!  Offsets of the first coefficient from the offset of the process
	 * coefficients vector (either static or dynamic)
	 * TODO: check if it's the same as coefficient_index
	 */
	__u32 offset;
};

/*!
 * \ brief Separable Filter parameters - fully described in user guide
 */
struct vpul_pu_slf {
	__u32 invert_columns                            :1;
	__u32 upsample_mode                             :2;
	__u32 downsample_rows                           :1;
	__u32 downsample_cols                           :1;
	__u32 sampling_offset_x                         :1;
	__u32 sampling_offset_y                         :2;
	__u32 work_mode                                 :2;
	__u32 filter_size_mode                          :2;
	__u32 out_enable_1                              :1;
	__u32 horizontal_only                           :1;
	__u32 bits_in                                   :2;
	__u32 bits_out                                  :2;
	__u32 signed_in                                 :1;
	__u32 signed_out                                :1;
	__u32 do_rounding                               :1;
	__u32 border_mode_up                            :1;
	__u32 border_mode_down                          :1;
	__u32 border_mode_left                          :1;
	__u32 border_mode_right                         :1;
	__u32 border_fill                               :2;
	__u32 border_fill_constant                      :16;
	__u32 coefficient_fraction                      :4;
	__u32 sepfregs_is_max_pooling_mode              :1;
	__u32 sepfregs_stride_value                     :3;
	__u32 sepfregs_stride_offset_height             :2;
	__u32 sepfregs_stride_offset_width              :2;
	__u32 sepfregs_subimage_height                  :17;
	__u32 sepfregs_convert_16f_to_32f               :1;
	__u32 sepfregs_convert_output_sm_to_2scomp      :1;
	__u32 sepfregs_convert_input_2scomp_to_sm       :1;
	__u32 max_pooling_size_spoof_index              :5;

	__u32 maxp_num_slices;
	__u32 maxp_sizes_filt_hor;
	__u32 maxp_sizes_filt_ver;
	/*!  horizontal filter coefficients */
	struct coeff_item horizontal_filter_coeff;

	/*!  vertical filter coefficients */
	struct coeff_item vertical_filter_coeff;
	__u32 coefficient_index;
};

/*!
 * \ brief General Filter parameters - fully described in user guide
 */
struct vpul_pu_glf {
	__u32 filter_size_mode	:3;
	__u32 sad_mode			:1;
	__u32 out_enable_2		:1;
	__u32 two_outputs		:1;
	__u32 input_enable1		:1;
	__u32 bits_in			:1;
	__u32 bits_out			:1;
	__u32 signed_in			:1;
	__u32 signed_out		:1;
	__u32 do_rounding		:1;
	__u32 RAM_type			:1;
	__u32 RAM_offset		:3;
	__u32 image_height		:14;
	__u32 border_mode_up		:1;
	__u32 border_mode_down		:1;
	__u32 border_mode_left		:1;
	__u32 border_mode_right		:1;
	__u32 border_fill		:2;
	__u32 border_fill_constant	:16;
	__u32 coefficient_fraction	:5;
	__u32 signed_coefficients	:1;


	__u32 coefficient_index;
	/*!
	 * value 1 : the coefficients are read by DMA
	 * 0 : coefficients should be explicitly written to registers by CORE
	 */
	__u32 coeffs_from_dma;

	/*!  index into the process level coefficients structure */
	struct coeff_item filter_coeff;
};

/*!
 * \ brief CCM parameters - fully described in user guide
 */
struct vpul_pu_ccm {
	__u32 signed_in			:1;
	__u32 signed_out		:1;
	__u32 output_enable		:3;
	__u32 input_enable		:3;
	__u32 coefficient_shift		:4;
	__u32 coefficient_0		:12;
	__u32 coefficient_1		:12;
	__u32 coefficient_2		:12;
	__u32 coefficient_3		:12;
	__u32 coefficient_4		:12;
	__u32 coefficient_5		:12;
	__u32 coefficient_6		:12;
	__u32 coefficient_7		:12;
	__u32 coefficient_8		:12;
	__u32 offset_0			:16;
	__u32 offset_1			:16;
	__u32 offset_2			:16;
};

/*!
 * \ brief LUT parameters - fully described in user guide
 */
struct vpul_pu_lut {
	__u32 interpolation_mode	:1;
	__u32 lut_size			:1;
	__u32 signed_in0		:1;
	__u32 signed_out0		:1;
	__u32 offset			:16;
	__u32 binsize			:16;
	__u32 inverse_binsize		:16;
};

/*!
 * \ brief Integral Image parameters - fully described in user guide
 */
struct vpul_pu_integral {
	__u32 integral_image_mode		:3;
	__u32 overflow_mode			:1;
	__u32 dt_right_shift			:3;
	__u32 dt_left_shift			:3;
	__u32 dt_coefficient0			:16;
	__u32 dt_coefficient1			:16;
	__u32 dt_coefficient2			:16;
	__u32 cc_min_label			:15;
	__u32 cc_scan_mode			:2;
	__u32 cc_smart_label_search_en		:1;
	__u32 cc_reset_labels_array		:1;
	__u32 cc_label_vector_size		:16;
	__u32 lut_init_en			:1;
	__u32 lut_number_of_values		:16;
	__u32 lut_value_shift			:16;
	__u32 lut_default_overflow		:16;
	__u32 lut_default_underflow		:16;

};

/*!
 * \ brief Upscaler parameters - fully described in user guide
 */
struct vpul_pu_upscaler {
	__u32 interpolation_method		:2;
	__u32 border_fill_mode			:1;
	__u32 do_rounding			:1;
	__u32 border_fill_constant		:16;
};

/*!
 * \ brief Downscaler parameters - fully described in user guide
 */
struct vpul_pu_downscaler {
	__u32 interpolation_method	:2;
	__u32 do_rounding		:1;
};

/*!
 * \ brief Joiner parameters - fully described in user guide
 */
struct vpul_pu_joiner {
	__u32 out_byte0_source_stream	:5;
	__u32 out_byte1_source_stream	:5;
	__u32 out_byte2_source_stream	:5;
	__u32 out_byte3_source_stream	:5;
	__u32 input0_enable	:1;
	__u32 input1_enable	:1;
	__u32 input2_enable	:1;
	__u32 input3_enable	:1;
	__u32 work_mode	:2;

};

/*!
 * \brief Splitter parameters - fully described in user guide
 */
struct vpul_pu_spliter {
	__u32 out0_byte0:3;
	__u32 out0_byte1:3;
	__u32 out1_byte0:3;
	__u32 out1_byte1:3;
	__u32 out2_byte0:3;
	__u32 out2_byte1:3;
	__u32 out3_byte0:3;
	__u32 out3_byte1:3;
};


/*!
 * \brief Histogram parameters - fully described in user guide
 */
struct vpul_pu_histogram {
	__u32 offset			:16;
	__u32 inverse_binsize		:17;
	__u32 variable_increment	:1;
	__u32 dual_histogram		:1;
	__u32 signed_in0		:1;

	__u32 round_index		:1;
	__u32 max_val			:16;
};

/*!
 * \brief Non linear filter(fast) - fully described in user guide
 */
struct vpul_pu_nlf {
	__u32 filter_mode			:3;
	__u32 fast_score_direction	:1;
	__u32 border_mode_up		:1;
	__u32 border_mode_down		:1;
	__u32 border_mode_left		:1;
	__u32 border_mode_right		:1;
	__u32 border_fill			:2;
	__u32 border_tile			:1;
	__u32 border_fill_constant	:8;
	__u32 bits_in				:1;
	__u32 signed_in				:1;
	__u32 census_mode			:2;
	__u32 census_out_image		:1;
	__u32 add_orig_pixel		:1;
	__u32 cens_thres_0			:3;
	__u32 cens_thres_1			:3;
	__u32 cens_thres_2			:3;
	__u32 cens_thres_3			:3;
	__u32 cens_thres_4			:3;
	__u32 cens_thres_5			:3;
	__u32 cens_thres_6			:3;
	__u32 cens_thres_7			:3;
	__u32 neighbors_mask		:9;
};

/*!
 * \brief fast depth - fully described in user guide
 */
struct vpul_pu_fast_depth {
	__u32 max_disparity								:8;
	__u32 min_disparity								:8;
	__u32 dcu_gray_diff_thresh_is_equal_pixels		:8;
	__u32 dcu_gray_diff_thresh_is_near_pixels		:8;
	__u32 dcu_gray_diff_thresh_is_near_to_center	:8;
	__u32 dcu_gray_diff_thresh_do_aggregation		:8;
	__u32 dcu_gray_diff_thresh_is_equal_to_center	:8;
	__u32 dcu_aggregated_neighbor_selection			:11;
	__u32 dcu_patch_size_mode						:2;
	__u32 dcu_rl_borders_trim						:2;
	__u32 dcu_info_thresh_is_informative			:6;
	__u32 dcu_min_pixels_for_cost					:6;
	__u32 dcu_cost_fraction_bits					:4;
	__u32 dcu_cost_c_exp_weights_table_0_0			:8;
	__u32 dcu_cost_c_exp_weights_table_0_1			:8;
	__u32 dcu_cost_c_exp_weights_table_0_2			:8;
	__u32 dcu_cost_c_exp_weights_table_0_3			:8;
	__u32 dcu_cost_c_exp_weights_table_0_4			:8;
	__u32 dcu_cost_c_exp_weights_table_0_5			:8;
	__u32 dcu_cost_c_exp_weights_table_0_6			:8;
	__u32 dcu_cost_c_exp_weights_table_0_7			:8;
	__u32 dpu_cost_thresh_max_good					:8;
	__u32 dpu_ref_dspr_constant_cost				:8;
	__u32 dpu_cost_thresh_count_good_cand			:8;
	__u32 dpu_ref_dspr_max_is_equal					:7;
	__u32 dpu_ref_cost_thresh_use_ref_dsp			:8;
	__u32 dpu_dspr_diff_max_neighbor_is_equal		:7;
	__u32 dpu_ref_dspr_cost_factor					:3;
	__u32 dpu_use_ref_en							:1;
	__u32 dpu_ref_candidate_en						:1;
	__u32 dpu_ref_dspr_prioritization_en			:1;
	__u32 dpu_ref_dspr_up_shift						:2;
	__u32 pre_output_dspr_up_shift					:3;
	__u32 superb_candidate_en						:1;
	__u32 superb_dspr_cost_factor					:3;
	__u32 prioritize_superb_on_non_info_only		:1;
	__u32 dpu_superb_dspr_prioritization_en			:1;
	__u32 dcu_gray_diff_thresh_is_like_superb		:8;
	__u32 cost_thresh_good_for_superb				:8;
	__u32 superb_dspr_constant_cost					:8;
	__u32 dpu_lfsr_seed_0							:16;
	__u32 dpu_lfsr_seed_1							:16;
	__u32 dpu_lfsr_seed_2							:16;
	__u32 dpu_lfsr_seed_3							:16;
	__u32 mcnt_selected_iterations_0_0				:1;
	__u32 mcnt_selected_iterations_0_1				:1;
	__u32 mcnt_selected_iterations_0_2				:1;
	__u32 mcnt_selected_iterations_0_3				:1;
};

/*!
 * \brief FIFO - fully described in user guide
 */
struct vpul_pu_fifo {
	__u32 bits_in                 :1;
};

/*!
 * \brief duplicator - No specific parameters - place holder
 */
struct vpul_pu_duplicator {
	__u32 no_params;
};

struct vpul_pu_dispeq {
	__u32 bypass							:1;
	__u32 mcnt_bilateral_maximization_en	:1;
	__u32 mcnt_use_center_only_en			:1;
	__u32 dspr_shift_down_before_validation	:2;
	__u32 cost_min_for_valid_for_small_dspr	:8;
	__u32 cost_min_for_valid_for_large_dspr	:8;
	__u32 dspr_small_to_large_tresh			:7;
	__u32 dspr_min_diff_for_valid			:7;
	__u32 cost_min_diff_for_update			:8;
	__u32 weight_for_cost_update			:8;
	__u32 mcnt_min_for_multiple_dspr		:3;
};

struct vpul_pu_in_paint {
	__u32 bypass							:1;
	__u32 pic_x_size						:12;
	__u32 pic_y_size						:14;
	__u32 mem_size							:1;
	__u32 rl_validation_en					:1;
	__u32 enhanced_info_en					:1;
	__u32 content_mask_en					:1;
	__u32 x_last_logic_en					:1;
	__u32 background_en						:1;
	__u32 strong_anti_leak_en				:1;
	__u32 background_anti_leak_en			:1;
	__u32 half_strong_en					:1;
	__u32 update_inpainted_cost_en			:1;
	__u32 output_reliable_mask_en			:1;
	__u32 output_stat_mask_en				:1;
	__u32 gray_max_similarity				:8;
	__u32 gray_max_high_similarity			:8;
	__u32 gray_step_penalty					:8;
	__u32 gray_max_total_error				:8;
	__u32 mcnt_min_single					:3;
	__u32 mcnt_max_single					:3;
	__u32 mcnt_min_for_stat_mask			:3;
	__u32 mcnt_max_for_stat_mask			:3;
	__u32 dspr_max_vertical_similarity		:7;
	__u32 dspr_max_diff_from_vertical_avrg	:7;
	__u32 dspr_max_similarity				:7;
	__u32 dspr_max_upper_similarity			:7;
	__u32 dspr_max_anchors_similarity		:7;
	__u32 dspr_max_anchors_grad_val			:7;
	__u32 dspr_max_anchors_grad_shift		:4;
	__u32 dspr_max_diff_to_center			:7;
	__u32 anchor_type_sel_max_support		:2;
	__u32 anchor_type_sel_max_near_support	:2;
	__u32 anchor_type_sel_min_valid			:3;
	__u32 anchor_type_sel_min_near_valid	:3;
	__u32 anchor_logic_trim_0_0				:12;
	__u32 anchor_logic_trim_0_1				:12;
	__u32 x_last_logic_max_edge_diff		:12;
	__u32 x_last_logic_right_margin			:12;
	__u32 downscaled_cost_min_per_index_0_0	:8;
	__u32 downscaled_cost_min_per_index_0_1	:8;
	__u32 downscaled_cost_min_per_index_0_2	:8;
	__u32 cost_min_fill_holes				:8;
	__u32 cost_max_reliable					:8;
	__u32 cost_max_for_anchor				:8;
	__u32 cost_min_is_hidden				:8;
	__u32 cost_max_for_stat_mask			:8;
	__u32 anchor_dist_max_for_strong		:12;
	__u32 hidden_padding_direction			:2;
	__u32 background_gray_val				:8;
	__u32 background_gray_max_similarity	:8;
	__u32 background_dspr_val				:7;
	__u32 background_anchor_margins_0_0		:12;
	__u32 background_anchor_margins_0_1		:12;
	__u32 background_anchor_margins_0_2		:12;
	__u32 background_anchor_margins_0_3		:12;
	__u32 hidden_logic_trim_0_0				:12;
	__u32 hidden_logic_trim_0_1				:12;
	__u32 output_mode						:2;
};

struct vpul_pu_cnn {
	__u32 is_fetch_mode			:1;
	__u32 is_bypass				:1;
};

/*! * \brief FLAMORB parameters
 * work_mode-->pack_output
 * work_mode-->first_minus_second
 * enable_out1 = !work_mode
 * eff_mode = bits_in==8 & mprb==Large
 * pack_bitage = 16
 * bit_diff = 1
 * enable_out1 =1
 * coord_pairs_offset = group_index * flamorb->num_coord_pairs
 */
struct vpul_pu_flam_orb {
	__u32 work_mode				:1;
	__u32 eff_mode				:1;//need to remove after HW mapper change
	__u32 first_minus_second	:1;//need to remove after HW mapper change
	__u32 bit_diff				:1;//need to remove after HW mapper change
	__u32 pack_output			:1;//need to remove after HW mapper change
	__u32 pack_bitage			:1;//need to remove after HW mapper change
	__u32 bits_in				:1;
	__u32 start_x				:8; //need to remove after HW mapper change
	__u32 start_y				:8; //need to remove after HW mapper change
	__u32 end_x				:8; //need to remove after HW mapper change
	__u32 end_y				:8; //need to remove after HW mapper change
	__u32 const_val				:8;
	__u32 use_const_val			:1;
	//__u32 enable_out1			:1;
	//__u32 coord_pairs_offset		:10;
	__u32 num_coord_pairs			:11;
	__u32 scaler_ind				:1;
	__u32 roi_ind					:5;
	__u32 full_roi					:5;


	__u32 inout_index;
};

/*!
 * \brief Map to List parameters
 * \details <B>Calculating buffer size needed:</B> \n Output buffer size written by block calculated in the following way:\n
 * \li if value_in==0 then BytesPerReocrd = 4
 * \li if value_in==1 then BytesPerReocrd = 6 (for bits_in==0 or 1) or 8 (for bits_in==2)
 * \li BytesPerLine = 240(if BytesPerRecord ==8) or 252 (otherwise)
 * \li NumberOfLines = CIEL_DIV(BytesPerLine/BytesPerRecord, num_of_points)
 * \li totalSizeRequired = (NumberOfLines*BytesPerLine)+2
 */
struct vpul_pu_map2list {
	__u32 bits_in				:2;
	__u32 signed_in				:1;
	__u32 value_in				:1;
	__u32 enable_out_map			:1;
	__u32 enable_out_lst			:1;
	__u32 inout_indx			:5;
	__u32 threshold_low;
	__u32 threshold_high;
	__u32 num_of_point;
};

/*! \brief Union for parameters of all different types of Processing units*/
union vpul_pu_parameters {
	struct vpul_pu_dma		dma;
	struct vpul_pu_salb		salb;
	struct vpul_pu_calb		calb;
	struct vpul_pu_rois_out		rois_out;
	struct vpul_pu_crop		crop;
	struct vpul_pu_mde		mde;
	struct vpul_pu_map2list		map2list;
	struct vpul_pu_nms		nms;
	struct vpul_pu_slf		slf;
	struct vpul_pu_glf		glf;
	struct vpul_pu_ccm		ccm;
	struct vpul_pu_lut		lut;
	struct vpul_pu_integral		integral;
	struct vpul_pu_upscaler		upscaler;
	struct vpul_pu_downscaler	downScaler;
	struct vpul_pu_joiner		joiner;
	struct vpul_pu_spliter		spliter;
	struct vpul_pu_histogram	histogram;
	struct vpul_pu_nlf		nlf;
	struct vpul_pu_fast_depth	depth;
	struct vpul_pu_dispeq		disparity;
	struct vpul_pu_in_paint		in_paint;
	struct vpul_pu_cnn		cnn;
	struct vpul_pu_flam_orb		flam_orb;
	struct vpul_pu_fifo		fifo;

	struct vpul_pu_add		add;
};

#define NO_PU_CONNECTED			0xFF

/*!\brief describe input connections of one PU */
struct vpu_pu_input {
	/*! the index of the source PU in the sub-chains PU's list.
	 * A value of NO_PU_CONNECTED (= 0xFF) means that this input is disabled;
	 * this is useful in case there is only 1 active connection to this PU,
	 * on input port other than port #0 - for instance port #2 :
	 * in this case n_in_connect will be set to 3 in vpul_pu structure, and
	 * pu_idx will be set to 0xFF for first 2 instances of vpu_pu_input
	 */
	__u32				pu_idx;
	/*! the index in the source PU output connections, that connected
	 * to this PU.
	 */
	__u32				s_pu_out_idx;
};

#define NO_MPRB_CONNECTED		0xFF

/*!\brief This structure contains one processing unit description */
struct vpul_pu {

	/*!\brief if !=0 bypass block   */
	__u32 bypass;
	/*!\brief operation type */
	enum vpul_logical_op_types	op_type;
	/*!\brief block instance index */
	enum vpul_pu_instance		instance;
	/*!\brief number of MPRBs used */
	__u32				n_mprbs;
	/*!\brief 1K / 4K - see VPUH_MPRB_TYPE values. if both small and large MPRBs
	 * are used :will indicate "large" (4K)
	 */
	__u32				mprb_type;

	 /*! memory connectivity for line buffers; contents of entry #N in array is MPRB actively
	  * connected to ram port #N; if no such MPRB, contents = NO_MPRB_CONNECTED (= 0xFF)
	  * The effective size of the array is max #of ram ports per PU.
	  */
	__u32				mprbs[VPU_MAXIMAL_MPRB_CONNECTED];
	/*!  number of input connections */
	__u32				n_in_connect;
	/*!  input connection information */
	struct vpu_pu_input		in_connect[VPUL_PU_MAX_PORTS];
	/*!  number of output connections */
	__u32				n_out_connect;
	/*!  index of the block input sizes information in process
	 * sizes vector - vpul_sizes
	 */
	__u32				in_size_idx;
	/*!  index of the block output sizes in process
	 * sizes vector - vpul_sizes
	 */
	__u32				out_size_idx;

	/*!  number of params that arrive to the prm of current pu from HW results of
	 * previous pu's
	 */
	__u32				n_run_time_params_from_hw;

	/*!  PU parameter structure */
	union vpul_pu_parameters	params;
};

/*!
 * \brief PU location in TDS, implemented as indexes of vertex, subchain and PU.
 */
struct vpul_pu_location {
	/*!  the index of the vertex the PU is in. */
	__u32				vtx_idx;
	/*!  the index of the subchain in the vertex the PU is in. */
	__u32				sc_idx_in_vtx;
	/*!  the index of the subchain in the sc the PU is in. */
	__u32				pu_idx_in_sc;
};

/** @}*/
/** @}*/

#endif