1 /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ 2 /* 3 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. 4 */ 5 6 #ifndef __UAPI_CAM_FD_H__ 7 #define __UAPI_CAM_FD_H__ 8 9 #include <media/cam_defs.h> 10 11 #define CAM_FD_MAX_FACES 35 12 #define CAM_FD_RAW_RESULT_ENTRIES 512 13 14 /* FD Op Codes */ 15 #define CAM_PACKET_OPCODES_FD_FRAME_UPDATE 0x0 16 17 /* FD Command Buffer identifiers */ 18 #define CAM_FD_CMD_BUFFER_ID_GENERIC 0x0 19 #define CAM_FD_CMD_BUFFER_ID_CDM 0x1 20 #define CAM_FD_CMD_BUFFER_ID_MAX 0x2 21 22 /* FD Blob types */ 23 #define CAM_FD_BLOB_TYPE_SOC_CLOCK_BW_REQUEST 0x0 24 #define CAM_FD_BLOB_TYPE_RAW_RESULTS_REQUIRED 0x1 25 26 /* FD Resource IDs */ 27 #define CAM_FD_INPUT_PORT_ID_IMAGE 0x0 28 #define CAM_FD_INPUT_PORT_ID_MAX 0x1 29 30 #define CAM_FD_OUTPUT_PORT_ID_RESULTS 0x0 31 #define CAM_FD_OUTPUT_PORT_ID_RAW_RESULTS 0x1 32 #define CAM_FD_OUTPUT_PORT_ID_WORK_BUFFER 0x2 33 #define CAM_FD_OUTPUT_PORT_ID_MAX 0x3 34 35 /** 36 * struct cam_fd_soc_clock_bw_request - SOC clock, bandwidth request info 37 * 38 * @clock_rate : Clock rate required while processing frame 39 * @bandwidth : Bandwidth required while processing frame 40 * @reserved : Reserved for future use 41 */ 42 struct cam_fd_soc_clock_bw_request { 43 uint64_t clock_rate; 44 uint64_t bandwidth; 45 uint64_t reserved[4]; 46 }; 47 48 /** 49 * struct cam_fd_face - Face properties 50 * 51 * @prop1 : Property 1 of face 52 * @prop2 : Property 2 of face 53 * @prop3 : Property 3 of face 54 * @prop4 : Property 4 of face 55 * 56 * Do not change this layout, this is __inline__ with how HW writes 57 * these values directly when the buffer is programmed to HW 58 */ 59 struct cam_fd_face { 60 uint32_t prop1; 61 uint32_t prop2; 62 uint32_t prop3; 63 uint32_t prop4; 64 }; 65 66 /** 67 * struct cam_fd_results - FD results layout 68 * 69 * @faces : Array of faces with face properties 70 * @face_count : Number of faces detected 71 * @reserved : Reserved for alignment 72 * 73 * Do not change this layout, this is __inline__ with how HW writes 74 * these values directly when the buffer is programmed to HW 75 */ 76 struct cam_fd_results { 77 struct cam_fd_face faces[CAM_FD_MAX_FACES]; 78 uint32_t face_count; 79 uint32_t reserved[3]; 80 }; 81 82 /** 83 * struct cam_fd_hw_caps - Face properties 84 * 85 * @core_version : FD core version 86 * @wrapper_version : FD wrapper version 87 * @raw_results_available : Whether raw results are available on this HW 88 * @supported_modes : Modes supported by this HW. 89 * @reserved : Reserved for future use 90 */ 91 struct cam_fd_hw_caps { 92 struct cam_hw_version core_version; 93 struct cam_hw_version wrapper_version; 94 uint32_t raw_results_available; 95 uint32_t supported_modes; 96 uint64_t reserved; 97 }; 98 99 /** 100 * struct cam_fd_query_cap_cmd - FD Query capabilities information 101 * 102 * @device_iommu : FD IOMMU handles 103 * @cdm_iommu : CDM iommu handles 104 * @hw_caps : FD HW capabilities 105 * @reserved : Reserved for alignment 106 */ 107 struct cam_fd_query_cap_cmd { 108 struct cam_iommu_handle device_iommu; 109 struct cam_iommu_handle cdm_iommu; 110 struct cam_fd_hw_caps hw_caps; 111 uint64_t reserved; 112 }; 113 114 /** 115 * struct cam_fd_acquire_dev_info - FD acquire device information 116 * 117 * @clk_bw_request : SOC clock, bandwidth request 118 * @priority : Priority for this acquire 119 * @mode : Mode in which to run FD HW. 120 * @get_raw_results : Whether this acquire needs face raw results 121 * while frame processing 122 * @reserved : Reserved field for 64 bit alignment 123 */ 124 struct cam_fd_acquire_dev_info { 125 struct cam_fd_soc_clock_bw_request clk_bw_request; 126 uint32_t priority; 127 uint32_t mode; 128 uint32_t get_raw_results; 129 uint32_t reserved[13]; 130 }; 131 132 #endif /* __UAPI_CAM_FD_H__ */ 133