cam_fd.h 3.7 KB

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