summaryrefslogtreecommitdiff
path: root/sm8150/kernel-headers/media/cam_fd.h
blob: 6b2247f60bb06c4c8c3b5f2ef4a90327cce63210 (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
#ifndef __UAPI_CAM_FD_H__
#define __UAPI_CAM_FD_H__

#include "cam_defs.h"

#define CAM_FD_MAX_FACES                       35
#define CAM_FD_RAW_RESULT_ENTRIES              512

/* FD Op Codes */
#define CAM_PACKET_OPCODES_FD_FRAME_UPDATE     0x0

/* FD Command Buffer identifiers */
#define CAM_FD_CMD_BUFFER_ID_GENERIC           0x0
#define CAM_FD_CMD_BUFFER_ID_CDM               0x1
#define CAM_FD_CMD_BUFFER_ID_MAX               0x2

/* FD Blob types */
#define CAM_FD_BLOB_TYPE_SOC_CLOCK_BW_REQUEST  0x0
#define CAM_FD_BLOB_TYPE_RAW_RESULTS_REQUIRED  0x1

/* FD Resource IDs */
#define CAM_FD_INPUT_PORT_ID_IMAGE             0x0
#define CAM_FD_INPUT_PORT_ID_MAX               0x1

#define CAM_FD_OUTPUT_PORT_ID_RESULTS          0x0
#define CAM_FD_OUTPUT_PORT_ID_RAW_RESULTS      0x1
#define CAM_FD_OUTPUT_PORT_ID_WORK_BUFFER      0x2
#define CAM_FD_OUTPUT_PORT_ID_MAX              0x3

/**
 * struct cam_fd_soc_clock_bw_request - SOC clock, bandwidth request info
 *
 * @clock_rate : Clock rate required while processing frame
 * @bandwidth  : Bandwidth required while processing frame
 * @reserved   : Reserved for future use
 */
struct cam_fd_soc_clock_bw_request {
	uint64_t    clock_rate;
	uint64_t    bandwidth;
	uint64_t    reserved[4];
};

/**
 * struct cam_fd_face - Face properties
 *
 * @prop1 : Property 1 of face
 * @prop2 : Property 2 of face
 * @prop3 : Property 3 of face
 * @prop4 : Property 4 of face
 *
 * Do not change this layout, this is __inline__ with how HW writes
 * these values directly when the buffer is programmed to HW
 */
struct cam_fd_face {
	uint32_t    prop1;
	uint32_t    prop2;
	uint32_t    prop3;
	uint32_t    prop4;
};

/**
 * struct cam_fd_results - FD results layout
 *
 * @faces      : Array of faces with face properties
 * @face_count : Number of faces detected
 * @reserved   : Reserved for alignment
 *
 * Do not change this layout, this is __inline__ with how HW writes
 * these values directly when the buffer is programmed to HW
 */
struct cam_fd_results {
	struct cam_fd_face    faces[CAM_FD_MAX_FACES];
	uint32_t              face_count;
	uint32_t              reserved[3];
};

/**
 * struct cam_fd_hw_caps - Face properties
 *
 * @core_version          : FD core version
 * @wrapper_version       : FD wrapper version
 * @raw_results_available : Whether raw results are available on this HW
 * @supported_modes       : Modes supported by this HW.
 * @reserved              : Reserved for future use
 */
struct cam_fd_hw_caps {
	struct cam_hw_version    core_version;
	struct cam_hw_version    wrapper_version;
	uint32_t                 raw_results_available;
	uint32_t                 supported_modes;
	uint64_t                 reserved;
};

/**
 * struct cam_fd_query_cap_cmd - FD Query capabilities information
 *
 * @device_iommu : FD IOMMU handles
 * @cdm_iommu    : CDM iommu handles
 * @hw_caps      : FD HW capabilities
 * @reserved     : Reserved for alignment
 */
struct cam_fd_query_cap_cmd {
	struct cam_iommu_handle    device_iommu;
	struct cam_iommu_handle    cdm_iommu;
	struct cam_fd_hw_caps      hw_caps;
	uint64_t                   reserved;
};

/**
 * struct cam_fd_acquire_dev_info - FD acquire device information
 *
 * @clk_bw_request  : SOC clock, bandwidth request
 * @priority        : Priority for this acquire
 * @mode            : Mode in which to run FD HW.
 * @get_raw_results : Whether this acquire needs face raw results
 *                    while frame processing
 * @reserved        : Reserved field for 64 bit alignment
 */
struct cam_fd_acquire_dev_info {
	struct cam_fd_soc_clock_bw_request clk_bw_request;
	uint32_t                           priority;
	uint32_t                           mode;
	uint32_t                           get_raw_results;
	uint32_t                           reserved[13];
};

#endif /* __UAPI_CAM_FD_H__ */