• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef __UAPI_CAM_DEFS_H__
2 #define __UAPI_CAM_DEFS_H__
3 
4 #include <linux/videodev2.h>
5 #include <linux/types.h>
6 #include <linux/ioctl.h>
7 
8 
9 /* camera op codes */
10 #define CAM_COMMON_OPCODE_BASE                  0x100
11 #define CAM_QUERY_CAP                           (CAM_COMMON_OPCODE_BASE + 0x1)
12 #define CAM_ACQUIRE_DEV                         (CAM_COMMON_OPCODE_BASE + 0x2)
13 #define CAM_START_DEV                           (CAM_COMMON_OPCODE_BASE + 0x3)
14 #define CAM_STOP_DEV                            (CAM_COMMON_OPCODE_BASE + 0x4)
15 #define CAM_CONFIG_DEV                          (CAM_COMMON_OPCODE_BASE + 0x5)
16 #define CAM_RELEASE_DEV                         (CAM_COMMON_OPCODE_BASE + 0x6)
17 #define CAM_SD_SHUTDOWN                         (CAM_COMMON_OPCODE_BASE + 0x7)
18 #define CAM_FLUSH_REQ                           (CAM_COMMON_OPCODE_BASE + 0x8)
19 #define CAM_COMMON_OPCODE_MAX                   (CAM_COMMON_OPCODE_BASE + 0x9)
20 
21 #define CAM_COMMON_OPCODE_BASE_v2           0x150
22 #define CAM_ACQUIRE_HW                      (CAM_COMMON_OPCODE_BASE_v2 + 0x1)
23 #define CAM_RELEASE_HW                      (CAM_COMMON_OPCODE_BASE_v2 + 0x2)
24 
25 #define CAM_EXT_OPCODE_BASE                     0x200
26 #define CAM_CONFIG_DEV_EXTERNAL                 (CAM_EXT_OPCODE_BASE + 0x1)
27 
28 /* camera handle type */
29 #define CAM_HANDLE_USER_POINTER                 1
30 #define CAM_HANDLE_MEM_HANDLE                   2
31 
32 /* Generic Blob CmdBuffer header properties */
33 #define CAM_GENERIC_BLOB_CMDBUFFER_SIZE_MASK    0xFFFFFF00
34 #define CAM_GENERIC_BLOB_CMDBUFFER_SIZE_SHIFT   8
35 #define CAM_GENERIC_BLOB_CMDBUFFER_TYPE_MASK    0xFF
36 #define CAM_GENERIC_BLOB_CMDBUFFER_TYPE_SHIFT   0
37 
38 /* Command Buffer Types */
39 #define CAM_CMD_BUF_DMI                     0x1
40 #define CAM_CMD_BUF_DMI16                   0x2
41 #define CAM_CMD_BUF_DMI32                   0x3
42 #define CAM_CMD_BUF_DMI64                   0x4
43 #define CAM_CMD_BUF_DIRECT                  0x5
44 #define CAM_CMD_BUF_INDIRECT                0x6
45 #define CAM_CMD_BUF_I2C                     0x7
46 #define CAM_CMD_BUF_FW                      0x8
47 #define CAM_CMD_BUF_GENERIC                 0x9
48 #define CAM_CMD_BUF_LEGACY                  0xA
49 
50 /* UBWC API Version */
51 #define CAM_UBWC_CFG_VERSION_1              1
52 
53 #ifdef CONFIG_BOARD_SUNFISH
54 
55 #define CAM_DUMP_REQ                        (CAM_COMMON_OPCODE_BASE_v2 + 0x3)
56 
57 /**
58  * struct cam_dump_req_cmd -
59  *        Dump the information of issue req id
60  *
61  * @issue_req_id   : Issue Request Id
62  * @session_handle : Session Handle
63  * @link_hdl       : link handle
64  * @dev_handle     : Device Handle
65  * @error_type     : Error Type
66  * @buf_handle     : Buffer Handle
67  * @offset         : offset for the buffer
68  * @reserved       : Reserved
69  */
70 struct cam_dump_req_cmd {
71        int64_t        issue_req_id;
72        int32_t        session_handle;
73        int32_t        link_hdl;
74        int32_t        dev_handle;
75        int32_t        error_type;
76        uint32_t       buf_handle;
77        int32_t        offset;
78        uint32_t       reserved;
79 };
80 
81 #endif /*CONFIG_BOARD_SUNFISH*/
82 
83 
84 /**
85  * enum flush_type_t - Identifies the various flush types
86  *
87  * @CAM_FLUSH_TYPE_REQ:    Flush specific request
88  * @CAM_FLUSH_TYPE_ALL:    Flush all requests belonging to a context
89  * @CAM_FLUSH_TYPE_MAX:    Max enum to validate flush type
90  *
91  */
92 enum flush_type_t {
93 	CAM_FLUSH_TYPE_REQ,
94 	CAM_FLUSH_TYPE_ALL,
95 	CAM_FLUSH_TYPE_MAX
96 };
97 
98 /**
99  * struct cam_control - Structure used by ioctl control for camera
100  *
101  * @op_code:            This is the op code for camera control
102  * @size:               Control command size
103  * @handle_type:        User pointer or shared memory handle
104  * @reserved:           Reserved field for 64 bit alignment
105  * @handle:             Control command payload
106  */
107 struct cam_control {
108 	uint32_t        op_code;
109 	uint32_t        size;
110 	uint32_t        handle_type;
111 	uint32_t        reserved;
112 	uint64_t        handle;
113 };
114 
115 /* camera IOCTL */
116 #define VIDIOC_CAM_CONTROL \
117 	_IOWR('V', BASE_VIDIOC_PRIVATE, struct cam_control)
118 
119 /**
120  * struct cam_hw_version - Structure for HW version of camera devices
121  *
122  * @major    : Hardware version major
123  * @minor    : Hardware version minor
124  * @incr     : Hardware version increment
125  * @reserved : Reserved for 64 bit aligngment
126  */
127 struct cam_hw_version {
128 	uint32_t major;
129 	uint32_t minor;
130 	uint32_t incr;
131 	uint32_t reserved;
132 };
133 
134 /**
135  * struct cam_iommu_handle - Structure for IOMMU handles of camera hw devices
136  *
137  * @non_secure: Device Non Secure IOMMU handle
138  * @secure:     Device Secure IOMMU handle
139  *
140  */
141 struct cam_iommu_handle {
142 	int32_t non_secure;
143 	int32_t secure;
144 };
145 
146 /* camera secure mode */
147 #define CAM_SECURE_MODE_NON_SECURE             0
148 #define CAM_SECURE_MODE_SECURE                 1
149 
150 /* Camera Format Type */
151 #define CAM_FORMAT_BASE                         0
152 #define CAM_FORMAT_MIPI_RAW_6                   1
153 #define CAM_FORMAT_MIPI_RAW_8                   2
154 #define CAM_FORMAT_MIPI_RAW_10                  3
155 #define CAM_FORMAT_MIPI_RAW_12                  4
156 #define CAM_FORMAT_MIPI_RAW_14                  5
157 #define CAM_FORMAT_MIPI_RAW_16                  6
158 #define CAM_FORMAT_MIPI_RAW_20                  7
159 #define CAM_FORMAT_QTI_RAW_8                    8
160 #define CAM_FORMAT_QTI_RAW_10                   9
161 #define CAM_FORMAT_QTI_RAW_12                   10
162 #define CAM_FORMAT_QTI_RAW_14                   11
163 #define CAM_FORMAT_PLAIN8                       12
164 #define CAM_FORMAT_PLAIN16_8                    13
165 #define CAM_FORMAT_PLAIN16_10                   14
166 #define CAM_FORMAT_PLAIN16_12                   15
167 #define CAM_FORMAT_PLAIN16_14                   16
168 #define CAM_FORMAT_PLAIN16_16                   17
169 #define CAM_FORMAT_PLAIN32_20                   18
170 #define CAM_FORMAT_PLAIN64                      19
171 #define CAM_FORMAT_PLAIN128                     20
172 #define CAM_FORMAT_ARGB                         21
173 #define CAM_FORMAT_ARGB_10                      22
174 #define CAM_FORMAT_ARGB_12                      23
175 #define CAM_FORMAT_ARGB_14                      24
176 #define CAM_FORMAT_DPCM_10_6_10                 25
177 #define CAM_FORMAT_DPCM_10_8_10                 26
178 #define CAM_FORMAT_DPCM_12_6_12                 27
179 #define CAM_FORMAT_DPCM_12_8_12                 28
180 #define CAM_FORMAT_DPCM_14_8_14                 29
181 #define CAM_FORMAT_DPCM_14_10_14                30
182 #define CAM_FORMAT_NV21                         31
183 #define CAM_FORMAT_NV12                         32
184 #define CAM_FORMAT_TP10                         33
185 #define CAM_FORMAT_YUV422                       34
186 #define CAM_FORMAT_PD8                          35
187 #define CAM_FORMAT_PD10                         36
188 #define CAM_FORMAT_UBWC_NV12                    37
189 #define CAM_FORMAT_UBWC_NV12_4R                 38
190 #define CAM_FORMAT_UBWC_TP10                    39
191 #define CAM_FORMAT_UBWC_P010                    40
192 #define CAM_FORMAT_PLAIN8_SWAP                  41
193 #define CAM_FORMAT_PLAIN8_10                    42
194 #define CAM_FORMAT_PLAIN8_10_SWAP               43
195 #define CAM_FORMAT_YV12                         44
196 #define CAM_FORMAT_Y_ONLY                       45
197 #define CAM_FORMAT_DPCM_12_10_12                46
198 #define CAM_FORMAT_MAX                          47
199 
200 /* camera rotaion */
201 #define CAM_ROTATE_CW_0_DEGREE                  0
202 #define CAM_ROTATE_CW_90_DEGREE                 1
203 #define CAM_RORATE_CW_180_DEGREE                2
204 #define CAM_ROTATE_CW_270_DEGREE                3
205 
206 /* camera Color Space */
207 #define CAM_COLOR_SPACE_BASE                    0
208 #define CAM_COLOR_SPACE_BT601_FULL              1
209 #define CAM_COLOR_SPACE_BT601625                2
210 #define CAM_COLOR_SPACE_BT601525                3
211 #define CAM_COLOR_SPACE_BT709                   4
212 #define CAM_COLOR_SPACE_DEPTH                   5
213 #define CAM_COLOR_SPACE_MAX                     6
214 
215 /* camera buffer direction */
216 #define CAM_BUF_INPUT                           1
217 #define CAM_BUF_OUTPUT                          2
218 #define CAM_BUF_IN_OUT                          3
219 
220 /* camera packet device Type */
221 #define CAM_PACKET_DEV_BASE                     0
222 #define CAM_PACKET_DEV_IMG_SENSOR               1
223 #define CAM_PACKET_DEV_ACTUATOR                 2
224 #define CAM_PACKET_DEV_COMPANION                3
225 #define CAM_PACKET_DEV_EEPOM                    4
226 #define CAM_PACKET_DEV_CSIPHY                   5
227 #define CAM_PACKET_DEV_OIS                      6
228 #define CAM_PACKET_DEV_FLASH                    7
229 #define CAM_PACKET_DEV_FD                       8
230 #define CAM_PACKET_DEV_JPEG_ENC                 9
231 #define CAM_PACKET_DEV_JPEG_DEC                 10
232 #define CAM_PACKET_DEV_VFE                      11
233 #define CAM_PACKET_DEV_CPP                      12
234 #define CAM_PACKET_DEV_CSID                     13
235 #define CAM_PACKET_DEV_ISPIF                    14
236 #define CAM_PACKET_DEV_IFE                      15
237 #define CAM_PACKET_DEV_ICP                      16
238 #define CAM_PACKET_DEV_LRME                     17
239 #define CAM_PACKET_DEV_MAX                      18
240 
241 
242 /* constants */
243 #define CAM_PACKET_MAX_PLANES                   3
244 
245 /**
246  * struct cam_plane_cfg - Plane configuration info
247  *
248  * @width:                      Plane width in pixels
249  * @height:                     Plane height in lines
250  * @plane_stride:               Plane stride in pixel
251  * @slice_height:               Slice height in line (not used by ISP)
252  * @meta_stride:                UBWC metadata stride
253  * @meta_size:                  UBWC metadata plane size
254  * @meta_offset:                UBWC metadata offset
255  * @packer_config:              UBWC packer config
256  * @mode_config:                UBWC mode config
257  * @tile_config:                UBWC tile config
258  * @h_init:                     UBWC horizontal initial coordinate in pixels
259  * @v_init:                     UBWC vertical initial coordinate in lines
260  *
261  */
262 struct cam_plane_cfg {
263 	uint32_t                width;
264 	uint32_t                height;
265 	uint32_t                plane_stride;
266 	uint32_t                slice_height;
267 	uint32_t                meta_stride;
268 	uint32_t                meta_size;
269 	uint32_t                meta_offset;
270 	uint32_t                packer_config;
271 	uint32_t                mode_config;
272 	uint32_t                tile_config;
273 	uint32_t                h_init;
274 	uint32_t                v_init;
275 };
276 
277 /**
278  * struct cam_ubwc_plane_cfg_v1 - UBWC Plane configuration info
279  *
280  * @port_type:                  Port Type
281  * @meta_stride:                UBWC metadata stride
282  * @meta_size:                  UBWC metadata plane size
283  * @meta_offset:                UBWC metadata offset
284  * @packer_config:              UBWC packer config
285  * @mode_config_0:              UBWC mode config 0
286  * @mode_config_1:              UBWC 3 mode config 1
287  * @tile_config:                UBWC tile config
288  * @h_init:                     UBWC horizontal initial coordinate in pixels
289  * @v_init:                     UBWC vertical initial coordinate in lines
290  *
291  */
292 struct cam_ubwc_plane_cfg_v1 {
293 	uint32_t                port_type;
294 	uint32_t                meta_stride;
295 	uint32_t                meta_size;
296 	uint32_t                meta_offset;
297 	uint32_t                packer_config;
298 	uint32_t                mode_config_0;
299 	uint32_t                mode_config_1;
300 	uint32_t                tile_config;
301 	uint32_t                h_init;
302 	uint32_t                v_init;
303 };
304 
305 /**
306  * struct cam_cmd_buf_desc - Command buffer descriptor
307  *
308  * @mem_handle:                 Command buffer handle
309  * @offset:                     Command start offset
310  * @size:                       Size of the command buffer in bytes
311  * @length:                     Used memory in command buffer in bytes
312  * @type:                       Type of the command buffer
313  * @meta_data:                  Data type for private command buffer
314  *                              Between UMD and KMD
315  *
316  */
317 struct cam_cmd_buf_desc {
318 	int32_t                 mem_handle;
319 	uint32_t                offset;
320 	uint32_t                size;
321 	uint32_t                length;
322 	uint32_t                type;
323 	uint32_t                meta_data;
324 };
325 
326 /**
327  * struct cam_buf_io_cfg - Buffer io configuration for buffers
328  *
329  * @mem_handle:                 Mem_handle array for the buffers.
330  * @offsets:                    Offsets for each planes in the buffer
331  * @planes:                     Per plane information
332  * @width:                      Main plane width in pixel
333  * @height:                     Main plane height in lines
334  * @format:                     Format of the buffer
335  * @color_space:                Color space for the buffer
336  * @color_pattern:              Color pattern in the buffer
337  * @bpp:                        Bit per pixel
338  * @rotation:                   Rotation information for the buffer
339  * @resource_type:              Resource type associated with the buffer
340  * @fence:                      Fence handle
341  * @early_fence:                Fence handle for early signal
342  * @aux_cmd_buf:                An auxiliary command buffer that may be
343  *                              used for programming the IO
344  * @direction:                  Direction of the config
345  * @batch_size:                 Batch size in HFR mode
346  * @subsample_pattern:          Subsample pattern. Used in HFR mode. It
347  *                              should be consistent with batchSize and
348  *                              CAMIF programming.
349  * @subsample_period:           Subsample period. Used in HFR mode. It
350  *                              should be consistent with batchSize and
351  *                              CAMIF programming.
352  * @framedrop_pattern:          Framedrop pattern
353  * @framedrop_period:           Framedrop period
354  * @flag:                       Flags for extra information
355  * @direction:                  Buffer direction: input or output
356  * @padding:                    Padding for the structure
357  *
358  */
359 struct cam_buf_io_cfg {
360 	int32_t                         mem_handle[CAM_PACKET_MAX_PLANES];
361 	uint32_t                        offsets[CAM_PACKET_MAX_PLANES];
362 	struct cam_plane_cfg            planes[CAM_PACKET_MAX_PLANES];
363 	uint32_t                        format;
364 	uint32_t                        color_space;
365 	uint32_t                        color_pattern;
366 	uint32_t                        bpp;
367 	uint32_t                        rotation;
368 	uint32_t                        resource_type;
369 	int32_t                         fence;
370 	int32_t                         early_fence;
371 	struct cam_cmd_buf_desc         aux_cmd_buf;
372 	uint32_t                        direction;
373 	uint32_t                        batch_size;
374 	uint32_t                        subsample_pattern;
375 	uint32_t                        subsample_period;
376 	uint32_t                        framedrop_pattern;
377 	uint32_t                        framedrop_period;
378 	uint32_t                        flag;
379 	uint32_t                        padding;
380 };
381 
382 /**
383  * struct cam_packet_header - Camera packet header
384  *
385  * @op_code:                    Camera packet opcode
386  * @size:                       Size of the camera packet in bytes
387  * @request_id:                 Request id for this camera packet
388  * @flags:                      Flags for the camera packet
389  * @padding:                    Padding
390  *
391  */
392 struct cam_packet_header {
393 	uint32_t                op_code;
394 	uint32_t                size;
395 	uint64_t                request_id;
396 	uint32_t                flags;
397 	uint32_t                padding;
398 };
399 
400 /**
401  * struct cam_patch_desc - Patch structure
402  *
403  * @dst_buf_hdl:                Memory handle for the dest buffer
404  * @dst_offset:                 Offset byte in the dest buffer
405  * @src_buf_hdl:                Memory handle for the source buffer
406  * @src_offset:                 Offset byte in the source buffer
407  *
408  */
409 struct cam_patch_desc {
410 	int32_t                 dst_buf_hdl;
411 	uint32_t                dst_offset;
412 	int32_t                 src_buf_hdl;
413 	uint32_t                src_offset;
414 };
415 
416 /**
417  * struct cam_packet - Camera packet structure
418  *
419  * @header:                     Camera packet header
420  * @cmd_buf_offset:             Command buffer start offset
421  * @num_cmd_buf:                Number of the command buffer in the packet
422  * @io_config_offset:           Buffer io configuration start offset
423  * @num_io_configs:             Number of the buffer io configurations
424  * @patch_offset:               Patch offset for the patch structure
425  * @num_patches:                Number of the patch structure
426  * @kmd_cmd_buf_index:          Command buffer index which contains extra
427  *                              space for the KMD buffer
428  * @kmd_cmd_buf_offset:         Offset from the beginning of the command
429  *                              buffer for KMD usage.
430  * @payload:                    Camera packet payload
431  *
432  */
433 struct cam_packet {
434 	struct cam_packet_header        header;
435 	uint32_t                        cmd_buf_offset;
436 	uint32_t                        num_cmd_buf;
437 	uint32_t                        io_configs_offset;
438 	uint32_t                        num_io_configs;
439 	uint32_t                        patch_offset;
440 	uint32_t                        num_patches;
441 	uint32_t                        kmd_cmd_buf_index;
442 	uint32_t                        kmd_cmd_buf_offset;
443 	uint64_t                        payload[1];
444 
445 };
446 
447 /**
448  * struct cam_release_dev_cmd - Control payload for release devices
449  *
450  * @session_handle:             Session handle for the release
451  * @dev_handle:                 Device handle for the release
452  */
453 struct cam_release_dev_cmd {
454 	int32_t                 session_handle;
455 	int32_t                 dev_handle;
456 };
457 
458 /**
459  * struct cam_start_stop_dev_cmd - Control payload for start/stop device
460  *
461  * @session_handle:             Session handle for the start/stop command
462  * @dev_handle:                 Device handle for the start/stop command
463  *
464  */
465 struct cam_start_stop_dev_cmd {
466 	int32_t                 session_handle;
467 	int32_t                 dev_handle;
468 };
469 
470 /**
471  * struct cam_config_dev_cmd - Command payload for configure device
472  *
473  * @session_handle:             Session handle for the command
474  * @dev_handle:                 Device handle for the command
475  * @offset:                     Offset byte in the packet handle.
476  * @packet_handle:              Packet memory handle for the actual packet:
477  *                              struct cam_packet.
478  *
479  */
480 struct cam_config_dev_cmd {
481 	int32_t                 session_handle;
482 	int32_t                 dev_handle;
483 	uint64_t                offset;
484 	uint64_t                packet_handle;
485 };
486 
487 /**
488  * struct cam_query_cap_cmd - Payload for query device capability
489  *
490  * @size:               Handle size
491  * @handle_type:        User pointer or shared memory handle
492  * @caps_handle:        Device specific query command payload
493  *
494  */
495 struct cam_query_cap_cmd {
496 	uint32_t        size;
497 	uint32_t        handle_type;
498 	uint64_t        caps_handle;
499 };
500 
501 /**
502  * struct cam_acquire_dev_cmd - Control payload for acquire devices
503  *
504  * @session_handle:     Session handle for the acquire command
505  * @dev_handle:         Device handle to be returned
506  * @handle_type:        Resource handle type:
507  *                      1 = user pointer, 2 = mem handle
508  * @num_resources:      Number of the resources to be acquired
509  * @resources_hdl:      Resource handle that refers to the actual
510  *                      resource array. Each item in this
511  *                      array is device specific resource structure
512  *
513  */
514 struct cam_acquire_dev_cmd {
515 	int32_t         session_handle;
516 	int32_t         dev_handle;
517 	uint32_t        handle_type;
518 	uint32_t        num_resources;
519 	uint64_t        resource_hdl;
520 };
521 
522 /*
523  * In old version, while acquiring device the num_resources in
524  * struct cam_acquire_dev_cmd will be a valid value. During ACQUIRE_DEV
525  * KMD driver will return dev_handle as well as associate HW to handle.
526  * If num_resources is set to the constant below, we are using
527  * the new version and we do not acquire HW in ACQUIRE_DEV IOCTL.
528  * ACQUIRE_DEV will only return handle and we should receive
529  * ACQUIRE_HW IOCTL after ACQUIRE_DEV and that is when the HW
530  * is associated with the dev_handle.
531  *
532  * (Data type): uint32_t
533  */
534 #define CAM_API_COMPAT_CONSTANT                   0xFEFEFEFE
535 
536 #define CAM_ACQUIRE_HW_STRUCT_VERSION_1           1
537 
538 /**
539  * struct cam_acquire_hw_cmd_v1 - Control payload for acquire HW IOCTL (Ver 1)
540  *
541  * @struct_version:     = CAM_ACQUIRE_HW_STRUCT_VERSION_1 for this struct
542  *                      This value should be the first 32-bits in any structure
543  *                      related to this IOCTL. So that if the struct needs to
544  *                      change, we can first read the starting 32-bits, get the
545  *                      version number and then typecast the data to struct
546  *                      accordingly.
547  * @reserved:           Reserved field for 64-bit alignment
548  * @session_handle:     Session handle for the acquire command
549  * @dev_handle:         Device handle to be returned
550  * @handle_type:        Tells you how to interpret the variable resource_hdl-
551  *                      1 = user pointer, 2 = mem handle
552  * @data_size:          Total size of data contained in memory pointed
553  *                      to by resource_hdl
554  * @resource_hdl:       Resource handle that refers to the actual
555  *                      resource data.
556  */
557 struct cam_acquire_hw_cmd_v1 {
558 	uint32_t        struct_version;
559 	uint32_t        reserved;
560 	int32_t         session_handle;
561 	int32_t         dev_handle;
562 	uint32_t        handle_type;
563 	uint32_t        data_size;
564 	uint64_t        resource_hdl;
565 };
566 
567 #define CAM_RELEASE_HW_STRUCT_VERSION_1           1
568 
569 /**
570  * struct cam_release_hw_cmd_v1 - Control payload for release HW IOCTL (Ver 1)
571  *
572  * @struct_version:     = CAM_RELEASE_HW_STRUCT_VERSION_1 for this struct
573  *                      This value should be the first 32-bits in any structure
574  *                      related to this IOCTL. So that if the struct needs to
575  *                      change, we can first read the starting 32-bits, get the
576  *                      version number and then typecast the data to struct
577  *                      accordingly.
578  * @reserved:           Reserved field for 64-bit alignment
579  * @session_handle:     Session handle for the release
580  * @dev_handle:         Device handle for the release
581  */
582 struct cam_release_hw_cmd_v1 {
583 	uint32_t                struct_version;
584 	uint32_t                reserved;
585 	int32_t                 session_handle;
586 	int32_t                 dev_handle;
587 };
588 
589 /**
590  * struct cam_flush_dev_cmd - Control payload for flush devices
591  *
592  * @version:           Version
593  * @session_handle:    Session handle for the acquire command
594  * @dev_handle:        Device handle to be returned
595  * @flush_type:        Flush type:
596  *                     0 = flush specific request
597  *                     1 = flush all
598  * @reserved:          Reserved for 64 bit aligngment
599  * @req_id:            Request id that needs to cancel
600  *
601  */
602 struct cam_flush_dev_cmd {
603 	uint64_t       version;
604 	int32_t        session_handle;
605 	int32_t        dev_handle;
606 	uint32_t       flush_type;
607 	uint32_t       reserved;
608 	int64_t        req_id;
609 };
610 
611 /**
612  * struct cam_ubwc_config - UBWC Configuration Payload
613  *
614  * @api_version:         UBWC config api version
615  * @num_ports:           Number of ports to be configured
616  * @ubwc_plane_config:   Array of UBWC configurations per port
617  *                       Size [CAM_PACKET_MAX_PLANES - 1] per port
618  *                       as UBWC is supported on Y & C planes
619  *                       and therefore a max size of 2 planes
620  *
621  */
622 struct cam_ubwc_config {
623 	uint32_t   api_version;
624 	uint32_t   num_ports;
625 	struct cam_ubwc_plane_cfg_v1
626 		   ubwc_plane_cfg[1][CAM_PACKET_MAX_PLANES - 1];
627 };
628 
629 /**
630  * struct cam_cmd_mem_region_info -
631  *              Cmd buffer region info
632  *
633  * @mem_handle : Memory handle of the region
634  * @offset     : Offset if any
635  * @size       : Size of the region
636  * @flags      : Flags if any
637  */
638 struct cam_cmd_mem_region_info {
639 	int32_t   mem_handle;
640 	uint32_t  offset;
641 	uint32_t  size;
642 	uint32_t  flags;
643 };
644 
645 /**
646  * struct cam_cmd_mem_regions -
647  *        List of multiple memory descriptors of
648  *        of different regions
649  *
650  * @version        : Version number
651  * @num_regions    : Number of regions
652  * @map_info_array : Array of all the regions
653  */
654 struct cam_cmd_mem_regions {
655 	uint32_t version;
656 	uint32_t num_regions;
657 	struct cam_cmd_mem_region_info map_info_array[1];
658 };
659 
660 
661 #endif /* __UAPI_CAM_DEFS_H__ */
662