1 #ifndef __UAPI_CAM_JPEG_H__
2 #define __UAPI_CAM_JPEG_H__
3 
4 #include "cam_defs.h"
5 
6 /* enc, dma, cdm(enc/dma) are used in querycap */
7 #define CAM_JPEG_DEV_TYPE_ENC      0
8 #define CAM_JPEG_DEV_TYPE_DMA      1
9 #define CAM_JPEG_DEV_TYPE_MAX      2
10 
11 #define CAM_JPEG_NUM_DEV_PER_RES_MAX      1
12 
13 /* definitions needed for jpeg aquire device */
14 #define CAM_JPEG_RES_TYPE_ENC        0
15 #define CAM_JPEG_RES_TYPE_DMA        1
16 #define CAM_JPEG_RES_TYPE_MAX        2
17 
18 /* packet opcode types */
19 #define CAM_JPEG_OPCODE_ENC_UPDATE 0
20 #define CAM_JPEG_OPCODE_DMA_UPDATE 1
21 
22 /* ENC input port resource type */
23 #define CAM_JPEG_ENC_INPUT_IMAGE                 0x0
24 
25 /* ENC output port resource type */
26 #define CAM_JPEG_ENC_OUTPUT_IMAGE                0x1
27 
28 #define CAM_JPEG_ENC_IO_IMAGES_MAX               0x2
29 
30 /* DMA input port resource type */
31 #define CAM_JPEG_DMA_INPUT_IMAGE                 0x0
32 
33 /* DMA output port resource type */
34 #define CAM_JPEG_DMA_OUTPUT_IMAGE                0x1
35 
36 #define CAM_JPEG_DMA_IO_IMAGES_MAX               0x2
37 
38 #define CAM_JPEG_IMAGE_MAX                       0x2
39 
40 /**
41  * struct cam_jpeg_dev_ver - Device information for particular hw type
42  *
43  * This is used to get device version info of JPEG ENC, JPEG DMA
44  * from hardware and use this info in CAM_QUERY_CAP IOCTL
45  *
46  * @size : Size of struct passed
47  * @dev_type: Hardware type for the cap info(jpeg enc, jpeg dma)
48  * @hw_ver: Major, minor and incr values of a device version
49  */
50 struct cam_jpeg_dev_ver {
51 	uint32_t size;
52 	uint32_t dev_type;
53 	struct cam_hw_version hw_ver;
54 };
55 
56 /**
57  * struct cam_jpeg_query_cap_cmd - JPEG query device capability payload
58  *
59  * @dev_iommu_handle: Jpeg iommu handles for secure/non secure
60  *      modes
61  * @cdm_iommu_handle: Iommu handles for secure/non secure modes
62  * @num_enc: Number of encoder
63  * @num_dma: Number of dma
64  * @dev_ver: Returned device capability array
65  */
66 struct cam_jpeg_query_cap_cmd {
67 	struct cam_iommu_handle dev_iommu_handle;
68 	struct cam_iommu_handle cdm_iommu_handle;
69 	uint32_t num_enc;
70 	uint32_t num_dma;
71 	struct cam_jpeg_dev_ver dev_ver[CAM_JPEG_DEV_TYPE_MAX];
72 };
73 
74 /**
75  * struct cam_jpeg_res_info - JPEG output resource info
76  *
77  * @format: Format of the resource
78  * @width:  Width in pixels
79  * @height: Height in lines
80  * @fps:  Fps
81  */
82 struct cam_jpeg_res_info {
83 	uint32_t format;
84 	uint32_t width;
85 	uint32_t height;
86 	uint32_t fps;
87 };
88 
89 /**
90  * struct cam_jpeg_acquire_dev_info - An JPEG device info
91  *
92  * @dev_type: Device type (ENC/DMA)
93  * @reserved: Reserved Bytes
94  * @in_res: In resource info
95  * @in_res: Iut resource info
96  */
97 struct cam_jpeg_acquire_dev_info {
98 	uint32_t dev_type;
99 	uint32_t reserved;
100 	struct cam_jpeg_res_info in_res;
101 	struct cam_jpeg_res_info out_res;
102 };
103 
104 /**
105  * struct cam_jpeg_config_inout_param_info - JPEG Config time
106  *     input output params
107  *
108  * @clk_index: Input Param- clock selection index.(-1 default)
109  * @output_size: Output Param - jpeg encode/dma output size in
110  *     bytes
111  */
112 struct cam_jpeg_config_inout_param_info {
113 	int32_t clk_index;
114 	int32_t output_size;
115 };
116 
117 #endif /* __UAPI_CAM_JPEG_H__ */
118