cvp_hfi_helper.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #include "cvp_comm_def.h"
  6. #ifndef __H_CVP_HFI_HELPER_H__
  7. #define __H_CVP_HFI_HELPER_H__
  8. #define HFI_COMMON_BASE (0)
  9. #define HFI_DOMAIN_BASE_COMMON (HFI_COMMON_BASE + 0)
  10. #define HFI_DOMAIN_BASE_CVP (HFI_COMMON_BASE + 0x04000000)
  11. #define HFI_ARCH_COMMON_OFFSET (0)
  12. #define HFI_CMD_START_OFFSET (0x00010000)
  13. #define HFI_MSG_START_OFFSET (0x00020000)
  14. #define HFI_ERR_NONE (HFI_COMMON_BASE) /**< Status: No error */
  15. #define HFI_ERR_SYS_FATAL (HFI_COMMON_BASE + 0x1) /**< Fatal system error */
  16. #define HFI_ERR_SYS_INVALID_PARAMETER (HFI_COMMON_BASE + 0x2) /**< Invalid system parameter encountered */
  17. #define HFI_ERR_SYS_VERSION_MISMATCH (HFI_COMMON_BASE + 0x3) /**< Interface version mismatch */
  18. #define HFI_ERR_SYS_INSUFFICIENT_RESOURCES (HFI_COMMON_BASE + 0x4) /**< Insufficient system resources */
  19. #define HFI_ERR_SYS_MAX_SESSIONS_REACHED (HFI_COMMON_BASE + 0x5) /**< Maximum number of sessions reached */
  20. #define HFI_ERR_SYS_SESSION_IN_USE (HFI_COMMON_BASE + 0x7) /**< Session ID specified is in use */
  21. #define HFI_ERR_SYS_SESSION_ID_OUT_OF_RANGE (HFI_COMMON_BASE + 0x8) /**< ID is out of range */
  22. #define HFI_ERR_SYS_UNSUPPORTED_TRIGCMD (HFI_COMMON_BASE + 0xA) /**< Unsupported TRIGCMD command*/
  23. #define HFI_ERR_SYS_UNSUPPORTED_RESOURCES (HFI_COMMON_BASE + 0xB) /**< Unsupported resource*/
  24. #define HFI_ERR_SYS_UNSUPPORT_CMD (HFI_COMMON_BASE + 0xC) /**< Command is not supported*/
  25. #define HFI_ERR_SYS_CMDSIZE (HFI_COMMON_BASE + 0xD) /**< command size err*/
  26. #define HFI_ERR_SYS_UNSUPPORT_PROPERTY (HFI_COMMON_BASE + 0xE) /**< Unsupported property*/
  27. #define HFI_ERR_SYS_INIT_EXPECTED (HFI_COMMON_BASE + 0xF) /**< Upon FW start, first command must be SYS_INIT*/
  28. #define HFI_ERR_SYS_INIT_IGNORED (HFI_COMMON_BASE + 0x10) /**< After FW started, SYS_INIT will be ignored*/
  29. #define HFI_ERR_SYS_MAX_DME_SESSIONS_REACHED (HFI_COMMON_BASE + 0x11) /**< Maximum DME sessions Reached */
  30. #define HFI_ERR_SYS_MAX_FD_SESSIONS_REACHED (HFI_COMMON_BASE + 0x12) /**< Maximum FD sessions Reached */
  31. #define HFI_ERR_SYS_MAX_ODT_SESSIONS_REACHED (HFI_COMMON_BASE + 0x13) /**< Maximum ODT sessions Reached*/
  32. #define HFI_ERR_SYS_MAX_CV_SESSIONS_REACHED (HFI_COMMON_BASE + 0x14) /**< Maximum CV sessions Reached*/
  33. #define HFI_ERR_SYS_INVALID_SESSION_TYPE (HFI_COMMON_BASE + 0x15) /**< Invalid session TYPE. */
  34. #define HFI_ERR_SYS_NOC_ERROR (HFI_COMMON_BASE + 0x16) /**< NOC Error encountered */
  35. /**
  36. Level 2 Comment: "Session Level Error types"
  37. Common HFI_ERROR_SESSION_X values to be used as session level error/warning
  38. for event and messages
  39. */
  40. #define HFI_ERR_SESSION_FATAL (HFI_COMMON_BASE + 0x1001) /**< Fatal session error */
  41. #define HFI_ERR_SESSION_INVALID_PARAMETER (HFI_COMMON_BASE + 0x1002) /**< Invalid session parameter */
  42. #define HFI_ERR_SESSION_BAD_POINTER (HFI_COMMON_BASE + 0x1003) /**< Bad pointer encountered */
  43. #define HFI_ERR_SESSION_INVALID_SESSION_ID (HFI_COMMON_BASE + 0x1004) /**< Invalid session ID. eventData2 specifies the session ID. */
  44. #define HFI_ERR_SESSION_INVALID_STREAM_ID (HFI_COMMON_BASE + 0x1005) /**< Invalid stream ID. eventData2 specifies the stream ID. */
  45. #define HFI_ERR_SESSION_INCORRECT_STATE_OPERATION (HFI_COMMON_BASE + 0x1006) /**< Incorrect state for specified operation */
  46. #define HFI_ERR_SESSION_UNSUPPORTED_PROPERTY (HFI_COMMON_BASE + 0x1007) /**< Unsupported property. eventData2 specifies the property index. */
  47. #define HFI_ERR_SESSION_UNSUPPORTED_SETTING (HFI_COMMON_BASE + 0x1008) /**< Unsupported property setting. eventData2 specifies the property index. */
  48. #define HFI_ERR_SESSION_INSUFFICIENT_RESOURCES (HFI_COMMON_BASE + 0x1009) /**< Insufficient resources for session */
  49. #define HFI_ERR_SESSION_STREAM_CORRUPT_OUTPUT_STALLED (HFI_COMMON_BASE + 0x100A) /**< Stream is found to be corrupt; processing is stalled */
  50. #define HFI_ERR_SESSION_STREAM_CORRUPT (HFI_COMMON_BASE + 0x100B) /**< Stream is found to be corrupt; processing is recoverable */
  51. #define HFI_ERR_SESSION_RESERVED (HFI_COMMON_BASE + 0x100C) /**< Reserved */
  52. #define HFI_ERR_SESSION_UNSUPPORTED_STREAM (HFI_COMMON_BASE + 0x100D) /**< Unsupported stream */
  53. #define HFI_ERR_SESSION_CMDSIZE (HFI_COMMON_BASE + 0x100E) /**< Command packet size err*/
  54. #define HFI_ERR_SESSION_UNSUPPORT_CMD (HFI_COMMON_BASE + 0x100F) /**< Command is not supported*/
  55. #define HFI_ERR_SESSION_UNSUPPORT_BUFFERTYPE (HFI_COMMON_BASE + 0x1010) /**< BufferType is not supported*/
  56. #define HFI_ERR_SESSION_BUFFERCOUNT_TOOSMALL (HFI_COMMON_BASE + 0x1011) /**< Buffer Count is less than default*/
  57. #define HFI_ERR_SESSION_INVALID_SCALE_FACTOR (HFI_COMMON_BASE + 0x1012) /**< Downscaling not possible */
  58. #define HFI_ERR_SESSION_UPSCALE_NOT_SUPPORTED (HFI_COMMON_BASE + 0x1013) /**< Upscaling not possible */
  59. #define HFI_ERR_SESSION_CANNOT_KEEP_ASPECT_RATIO (HFI_COMMON_BASE + 0x1014) /**< Cannot maintain aspect ratio */
  60. #define HFI_ERR_SESSION_ADDRESS_NOT_ALIGNED (HFI_COMMON_BASE + 0x1016) /**Address is not aligned */
  61. #define HFI_ERR_SESSION_BUFFERSIZE_TOOSMALL (HFI_COMMON_BASE + 0x1017) /**< Buffer Count is less than default*/
  62. #define HFI_ERR_SESSION_ABORTED (HFI_COMMON_BASE + 0x1018) /**< error caused by session abort*/
  63. #define HFI_ERR_SESSION_BUFFER_ALREADY_SET (HFI_COMMON_BASE + 0x1019) /**< Cannot set buffer multiple times without releasing in between. */
  64. #define HFI_ERR_SESSION_BUFFER_ALREADY_RELEASED (HFI_COMMON_BASE + 0x101A) /**< Cannot release buffer multiple times without setting in between. */
  65. #define HFI_ERR_SESSION_END_BUFFER_NOT_RELEASED (HFI_COMMON_BASE + 0x101B) /**< Session was ended without properly releasing all buffers */
  66. #define HFI_ERR_SESSION_FLUSHED (HFI_COMMON_BASE + 0x101C) /**< Cannot set buffer multiple times without releasing in between. */
  67. #define HFI_ERR_SESSION_KERNEL_MAX_STREAMS_REACHED (HFI_COMMON_BASE + 0x101D) /*Maximum Streams per Kernel reached in a session*/
  68. #define HFI_ERR_SESSION_MAX_STREAMS_REACHED (HFI_COMMON_BASE + 0x101E) /*Maximum Streams Reached in a session*/
  69. #define HFI_ERR_SESSION_HW_HANG_DETECTED (HFI_COMMON_BASE + 0x101F) /*HW hang was detected in one of the HW blocks for a frame*/
  70. #define HFI_EVENT_SYS_ERROR (HFI_COMMON_BASE + 0x1)
  71. #define HFI_EVENT_SESSION_ERROR (HFI_COMMON_BASE + 0x2)
  72. #define HFI_TME_PROFILE_DEFAULT 0x00000001
  73. #define HFI_TME_PROFILE_FRC 0x00000002
  74. #define HFI_TME_PROFILE_ASW 0x00000004
  75. #define HFI_TME_PROFILE_DFS_BOKEH 0x00000008
  76. #define HFI_TME_LEVEL_INTEGER 0x00000001
  77. #define HFI_BUFFER_INPUT (HFI_COMMON_BASE + 0x1)
  78. #define HFI_BUFFER_OUTPUT (HFI_COMMON_BASE + 0x2)
  79. #define HFI_BUFFER_OUTPUT2 (HFI_COMMON_BASE + 0x3)
  80. #define HFI_BUFFER_INTERNAL_PERSIST (HFI_COMMON_BASE + 0x4)
  81. #define HFI_BUFFER_INTERNAL_PERSIST_1 (HFI_COMMON_BASE + 0x5)
  82. #define HFI_BUFFER_COMMON_INTERNAL_SCRATCH (HFI_COMMON_BASE + 0x6)
  83. #define HFI_BUFFER_COMMON_INTERNAL_SCRATCH_1 (HFI_COMMON_BASE + 0x7)
  84. #define HFI_BUFFER_COMMON_INTERNAL_SCRATCH_2 (HFI_COMMON_BASE + 0x8)
  85. #define HFI_BUFFER_COMMON_INTERNAL_RECON (HFI_COMMON_BASE + 0x9)
  86. #define HFI_BUFFER_EXTRADATA_OUTPUT (HFI_COMMON_BASE + 0xA)
  87. #define HFI_BUFFER_EXTRADATA_OUTPUT2 (HFI_COMMON_BASE + 0xB)
  88. #define HFI_BUFFER_EXTRADATA_INPUT (HFI_COMMON_BASE + 0xC)
  89. #define HFI_PROPERTY_SYS_COMMON_START \
  90. (HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + 0x0000)
  91. #define HFI_PROPERTY_SYS_DEBUG_CONFIG \
  92. (HFI_PROPERTY_SYS_COMMON_START + 0x001)
  93. #define HFI_PROPERTY_SYS_RESOURCE_OCMEM_REQUIREMENT_INFO \
  94. (HFI_PROPERTY_SYS_COMMON_START + 0x002)
  95. #define HFI_PROPERTY_SYS_CONFIG_VCODEC_CLKFREQ \
  96. (HFI_PROPERTY_SYS_COMMON_START + 0x003)
  97. #define HFI_PROPERTY_SYS_IDLE_INDICATOR \
  98. (HFI_PROPERTY_SYS_COMMON_START + 0x004)
  99. #define HFI_PROPERTY_SYS_CODEC_POWER_PLANE_CTRL \
  100. (HFI_PROPERTY_SYS_COMMON_START + 0x005)
  101. #define HFI_PROPERTY_SYS_IMAGE_VERSION \
  102. (HFI_PROPERTY_SYS_COMMON_START + 0x006)
  103. #define HFI_PROPERTY_SYS_CONFIG_COVERAGE \
  104. (HFI_PROPERTY_SYS_COMMON_START + 0x007)
  105. #define HFI_PROPERTY_SYS_UBWC_CONFIG \
  106. (HFI_PROPERTY_SYS_COMMON_START + 0x008)
  107. #define HFI_DEBUG_MSG_LOW 0x00000001
  108. #define HFI_DEBUG_MSG_MEDIUM 0x00000002
  109. #define HFI_DEBUG_MSG_HIGH 0x00000004
  110. #define HFI_DEBUG_MSG_ERROR 0x00000008
  111. #define HFI_DEBUG_MSG_FATAL 0x00000010
  112. #define HFI_DEBUG_MSG_PERF 0x00000020
  113. #define HFI_DEBUG_MODE_QUEUE 0x00000001
  114. #define HFI_DEBUG_MODE_QDSS 0x00000002
  115. struct cvp_hfi_debug_config {
  116. u32 debug_config;
  117. u32 debug_mode;
  118. };
  119. struct cvp_hfi_enable {
  120. u32 enable;
  121. };
  122. #define HFI_RESOURCE_SYSCACHE 0x00000002
  123. struct cvp_hfi_resource_subcache_type {
  124. u32 size;
  125. u32 sc_id;
  126. };
  127. struct cvp_hfi_resource_syscache_info_type {
  128. u32 num_entries;
  129. struct cvp_hfi_resource_subcache_type rg_subcache_entries[1];
  130. };
  131. #define HFI_CMD_SYS_COMMON_START \
  132. (HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + HFI_CMD_START_OFFSET \
  133. + 0x0000)
  134. #define HFI_CMD_SYS_INIT (HFI_CMD_SYS_COMMON_START + 0x001)
  135. #define HFI_CMD_SYS_PC_PREP (HFI_CMD_SYS_COMMON_START + 0x002)
  136. #define HFI_CMD_SYS_SET_RESOURCE (HFI_CMD_SYS_COMMON_START + 0x003)
  137. #define HFI_CMD_SYS_RELEASE_RESOURCE (HFI_CMD_SYS_COMMON_START + 0x004)
  138. #define HFI_CMD_SYS_SET_PROPERTY (HFI_CMD_SYS_COMMON_START + 0x005)
  139. #define HFI_CMD_SYS_GET_PROPERTY (HFI_CMD_SYS_COMMON_START + 0x006)
  140. #define HFI_CMD_SYS_SESSION_INIT (HFI_CMD_SYS_COMMON_START + 0x007)
  141. #define HFI_CMD_SYS_SESSION_END (HFI_CMD_SYS_COMMON_START + 0x008)
  142. #define HFI_CMD_SYS_SET_BUFFERS (HFI_CMD_SYS_COMMON_START + 0x009)
  143. #define HFI_CMD_SYS_SESSION_ABORT (HFI_CMD_SYS_COMMON_START + 0x00A)
  144. #define HFI_CMD_SYS_TEST_START (HFI_CMD_SYS_COMMON_START + 0x100)
  145. #define HFI_MSG_SYS_COMMON_START \
  146. (HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + \
  147. HFI_MSG_START_OFFSET + 0x0000)
  148. #define HFI_MSG_SYS_INIT_DONE (HFI_MSG_SYS_COMMON_START + 0x1)
  149. #define HFI_MSG_SYS_PC_PREP_DONE (HFI_MSG_SYS_COMMON_START + 0x2)
  150. #define HFI_MSG_SYS_RELEASE_RESOURCE (HFI_MSG_SYS_COMMON_START + 0x3)
  151. #define HFI_MSG_SYS_DEBUG (HFI_MSG_SYS_COMMON_START + 0x4)
  152. #define HFI_MSG_SYS_SESSION_INIT_DONE (HFI_MSG_SYS_COMMON_START + 0x6)
  153. #define HFI_MSG_SYS_SESSION_END_DONE (HFI_MSG_SYS_COMMON_START + 0x7)
  154. #define HFI_MSG_SYS_IDLE (HFI_MSG_SYS_COMMON_START + 0x8)
  155. #define HFI_MSG_SYS_COV (HFI_MSG_SYS_COMMON_START + 0x9)
  156. #define HFI_MSG_SYS_PROPERTY_INFO (HFI_MSG_SYS_COMMON_START + 0xA)
  157. #define HFI_MSG_SYS_SESSION_ABORT_DONE (HFI_MSG_SYS_COMMON_START + 0xC)
  158. #define HFI_MSG_SESSION_SYNC_DONE (HFI_MSG_SESSION_OX_START + 0xD)
  159. #define HFI_MSG_SESSION_COMMON_START \
  160. (HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + \
  161. HFI_MSG_START_OFFSET + 0x1000)
  162. #define HFI_MSG_EVENT_NOTIFY (HFI_MSG_SESSION_COMMON_START + 0x1)
  163. #define HFI_MSG_SESSION_GET_SEQUENCE_HEADER_DONE \
  164. (HFI_MSG_SESSION_COMMON_START + 0x2)
  165. #define HFI_CMD_SYS_TEST_SSR (HFI_CMD_SYS_TEST_START + 0x1)
  166. #define HFI_TEST_SSR_SW_ERR_FATAL 0x1
  167. #define HFI_TEST_SSR_SW_DIV_BY_ZERO 0x2
  168. #define HFI_TEST_SSR_HW_WDOG_IRQ 0x3
  169. struct cvp_hal_cmd_pkt_hdr {
  170. u32 size;
  171. u32 packet_type;
  172. };
  173. struct cvp_hal_msg_pkt_hdr {
  174. u32 size;
  175. u32 packet;
  176. };
  177. struct cvp_hal_session_cmd_pkt {
  178. u32 size;
  179. u32 packet_type;
  180. u32 session_id;
  181. };
  182. struct cvp_hfi_cmd_sys_init_packet {
  183. u32 size;
  184. u32 packet_type;
  185. u32 arch_type;
  186. };
  187. struct cvp_hfi_cmd_sys_pc_prep_packet {
  188. u32 size;
  189. u32 packet_type;
  190. };
  191. struct cvp_hfi_cmd_sys_set_resource_packet {
  192. u32 size;
  193. u32 packet_type;
  194. u32 resource_handle;
  195. u32 resource_type;
  196. u32 rg_resource_data[1];
  197. };
  198. struct cvp_hfi_cmd_sys_release_resource_packet {
  199. u32 size;
  200. u32 packet_type;
  201. u32 resource_type;
  202. u32 resource_handle;
  203. };
  204. struct cvp_hfi_cmd_sys_set_property_packet {
  205. u32 size;
  206. u32 packet_type;
  207. u32 num_properties;
  208. u32 rg_property_data[1];
  209. };
  210. struct cvp_hfi_cmd_sys_get_property_packet {
  211. u32 size;
  212. u32 packet_type;
  213. u32 num_properties;
  214. u32 rg_property_data[1];
  215. };
  216. struct cvp_hfi_cmd_sys_session_init_packet {
  217. u32 size;
  218. u32 packet_type;
  219. u32 session_id;
  220. u32 session_type;
  221. u32 session_kmask;
  222. u32 session_prio;
  223. u32 is_secure;
  224. u32 dsp_ac_mask;
  225. };
  226. struct cvp_hfi_cmd_sys_session_end_packet {
  227. u32 size;
  228. u32 packet_type;
  229. u32 session_id;
  230. };
  231. struct cvp_hfi_cmd_sys_set_buffers_packet {
  232. u32 size;
  233. u32 packet_type;
  234. u32 buffer_type;
  235. u32 buffer_size;
  236. u32 num_buffers;
  237. u32 rg_buffer_addr[1];
  238. };
  239. struct cvp_hfi_cmd_sys_set_ubwc_config_packet_type {
  240. u32 size;
  241. u32 packet_type;
  242. struct {
  243. u32 max_channel_override : 1;
  244. u32 mal_length_override : 1;
  245. u32 hb_override : 1;
  246. u32 bank_swzl_level_override : 1;
  247. u32 bank_spreading_override : 1;
  248. u32 reserved : 27;
  249. } override_bit_info;
  250. u32 max_channels;
  251. u32 mal_length;
  252. u32 highest_bank_bit;
  253. u32 bank_swzl_level;
  254. u32 bank_spreading;
  255. u32 reserved[2];
  256. };
  257. struct cvp_hfi_cmd_session_set_property_packet {
  258. u32 size;
  259. u32 packet_type;
  260. u32 session_id;
  261. u32 num_properties;
  262. u32 rg_property_data[1];
  263. };
  264. struct cvp_hfi_client {
  265. u32 transaction_id;
  266. u32 data1;
  267. u32 data2;
  268. u64 kdata;
  269. u32 reserved1;
  270. u32 reserved2;
  271. } __packed;
  272. struct cvp_hfi_buf_type {
  273. u32 iova;
  274. u32 size;
  275. u32 offset;
  276. u32 flags;
  277. u32 reserved1;
  278. u32 reserved2;
  279. u32 fence_type;
  280. u32 input_handle;
  281. u32 output_handle;
  282. };
  283. struct cvp_hfi_cmd_session_set_buffers_packet {
  284. u32 size;
  285. u32 packet_type;
  286. u32 session_id;
  287. struct cvp_hfi_client client_data;
  288. struct cvp_hfi_buf_type buf_type;
  289. } __packed;
  290. struct cvp_session_release_buffers_packet {
  291. u32 size;
  292. u32 packet_type;
  293. u32 session_id;
  294. struct cvp_hfi_client client_data;
  295. u32 kernel_type;
  296. u32 buffer_type;
  297. u32 num_buffers;
  298. u32 buffer_idx;
  299. } __packed;
  300. struct cvp_hfi_cmd_session_hdr {
  301. u32 size;
  302. u32 packet_type;
  303. u32 session_id;
  304. struct cvp_hfi_client client_data;
  305. u32 stream_idx;
  306. } __packed;
  307. struct cvp_hfi_msg_session_hdr {
  308. u32 size;
  309. u32 packet_type;
  310. u32 session_id;
  311. u32 error_type;
  312. struct cvp_hfi_client client_data;
  313. u32 stream_idx;
  314. } __packed;
  315. struct cvp_hfi_dumpmsg_session_hdr {
  316. u32 size;
  317. u32 packet_type;
  318. u32 session_id;
  319. u32 error_type;
  320. struct cvp_hfi_client client_data;
  321. u32 dump_offset;
  322. u32 dump_size;
  323. } __packed;
  324. #define HFI_MAX_HW_ACTIVATIONS_PER_FRAME (6)
  325. enum hfi_hw_thread {
  326. HFI_HW_FDU,
  327. HFI_HW_MPU,
  328. HFI_HW_OD,
  329. HFI_HW_ICA,
  330. HFI_HW_VADL,
  331. HFI_HW_TOF,
  332. HFI_HW_RGE,
  333. HFI_HW_XRA,
  334. HFI_HW_LSR,
  335. HFI_MAX_HW_THREADS
  336. };
  337. struct cvp_hfi_msg_session_hdr_ext {
  338. u32 size;
  339. u32 packet_type;
  340. u32 session_id;
  341. u32 error_type;
  342. struct cvp_hfi_client client_data;
  343. u32 stream_idx;
  344. u32 busy_cycles;
  345. u32 total_cycles;
  346. u32 hw_cycles[HFI_MAX_HW_THREADS][HFI_MAX_HW_ACTIVATIONS_PER_FRAME];
  347. u32 fw_cycles[HFI_MAX_HW_ACTIVATIONS_PER_FRAME];
  348. } __packed;
  349. struct cvp_hfi_buffer_mapping_type {
  350. u32 index;
  351. u32 device_addr;
  352. u32 size;
  353. };
  354. struct cvp_hfi_cmd_session_sync_process_packet {
  355. u32 size;
  356. u32 packet_type;
  357. u32 session_id;
  358. u32 sync_id;
  359. u32 rg_data[1];
  360. };
  361. struct cvp_hfi_msg_event_notify_packet {
  362. u32 size;
  363. u32 packet_type;
  364. u32 session_id;
  365. u32 event_id;
  366. u32 event_data1;
  367. u32 event_data2;
  368. u32 rg_ext_event_data[1];
  369. };
  370. struct cvp_hfi_msg_session_op_cfg_packet {
  371. u32 size;
  372. u32 packet_type;
  373. u32 session_id;
  374. u32 error_type;
  375. struct cvp_hfi_client client_data;
  376. u32 stream_idx;
  377. u32 op_conf_id;
  378. } __packed;
  379. struct cvp_hfi_msg_sys_init_done_packet {
  380. u32 size;
  381. u32 packet_type;
  382. u32 error_type;
  383. u32 num_properties;
  384. u32 rg_property_data[1];
  385. };
  386. struct cvp_hfi_msg_sys_pc_prep_done_packet {
  387. u32 size;
  388. u32 packet_type;
  389. u32 error_type;
  390. };
  391. struct cvp_hfi_msg_sys_release_resource_done_packet {
  392. u32 size;
  393. u32 packet_type;
  394. u32 resource_handle;
  395. u32 error_type;
  396. };
  397. struct cvp_hfi_msg_sys_session_init_done_packet {
  398. u32 size;
  399. u32 packet_type;
  400. u32 session_id;
  401. u32 error_type;
  402. u32 num_properties;
  403. u32 rg_property_data[1];
  404. };
  405. struct cvp_hfi_msg_sys_session_end_done_packet {
  406. u32 size;
  407. u32 packet_type;
  408. u32 session_id;
  409. u32 error_type;
  410. };
  411. struct cvp_hfi_msg_session_get_sequence_header_done_packet {
  412. u32 size;
  413. u32 packet_type;
  414. u32 session_id;
  415. u32 error_type;
  416. u32 header_len;
  417. u32 sequence_header;
  418. };
  419. struct cvp_hfi_msg_sys_debug_packet {
  420. u32 size;
  421. u32 packet_type;
  422. u32 msg_type;
  423. u32 msg_size;
  424. u32 time_stamp_hi;
  425. u32 time_stamp_lo;
  426. u8 rg_msg_data[1];
  427. };
  428. struct cvp_hfi_packet_header {
  429. u32 size;
  430. u32 packet_type;
  431. };
  432. struct cvp_hfi_sfr_struct {
  433. u32 bufSize;
  434. u8 rg_data[1];
  435. };
  436. struct cvp_hfi_cmd_sys_test_ssr_packet {
  437. u32 size;
  438. u32 packet_type;
  439. u32 trigger_type;
  440. };
  441. struct cvp_hfi_msg_sys_session_ctrl_done_packet {
  442. u32 size;
  443. u32 packet_type;
  444. u32 session_id;
  445. u32 error_type;
  446. struct cvp_hfi_client client_data;
  447. };
  448. #endif