cam_fd.h 3.8 KB

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