hw_fence_drv_priv.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef __HW_FENCE_DRV_INTERNAL_H
  6. #define __HW_FENCE_DRV_INTERNAL_H
  7. #include <linux/kernel.h>
  8. #include <linux/device.h>
  9. #include <linux/types.h>
  10. #include <linux/dma-mapping.h>
  11. #include <linux/soc/qcom/msm_hw_fence.h>
  12. #include <linux/dma-fence-array.h>
  13. #include <linux/slab.h>
  14. /* max u64 to indicate invalid fence */
  15. #define HW_FENCE_INVALID_PARENT_FENCE (~0ULL)
  16. /* hash algorithm constants */
  17. #define HW_FENCE_HASH_A_MULT 4969 /* a multiplier for Hash algorithm */
  18. #define HW_FENCE_HASH_C_MULT 907 /* c multiplier for Hash algorithm */
  19. /* number of queues per type (i.e. ctrl or client queues) */
  20. #define HW_FENCE_CTRL_QUEUES 2 /* Rx and Tx Queues */
  21. #define HW_FENCE_CLIENT_QUEUES 2 /* Rx and Tx Queues */
  22. /* hfi headers calculation */
  23. #define HW_FENCE_HFI_TABLE_HEADER_SIZE (sizeof(struct msm_hw_fence_hfi_queue_table_header))
  24. #define HW_FENCE_HFI_QUEUE_HEADER_SIZE (sizeof(struct msm_hw_fence_hfi_queue_header))
  25. #define HW_FENCE_HFI_CTRL_HEADERS_SIZE (HW_FENCE_HFI_TABLE_HEADER_SIZE + \
  26. (HW_FENCE_HFI_QUEUE_HEADER_SIZE * HW_FENCE_CTRL_QUEUES))
  27. #define HW_FENCE_HFI_CLIENT_HEADERS_SIZE(queues_num) (HW_FENCE_HFI_TABLE_HEADER_SIZE + \
  28. (HW_FENCE_HFI_QUEUE_HEADER_SIZE * queues_num))
  29. /*
  30. * Max Payload size is the bigest size of the message that we can have in the CTRL queue
  31. * in this case the max message is calculated like following, using 32-bits elements:
  32. * 1 header + 1 msg-type + 1 client_id + 2 hash + 1 error
  33. */
  34. #define HW_FENCE_CTRL_QUEUE_MAX_PAYLOAD_SIZE ((1 + 1 + 1 + 2 + 1) * sizeof(u32))
  35. #define HW_FENCE_CTRL_QUEUE_PAYLOAD HW_FENCE_CTRL_QUEUE_MAX_PAYLOAD_SIZE
  36. #define HW_FENCE_CLIENT_QUEUE_PAYLOAD (sizeof(struct msm_hw_fence_queue_payload))
  37. /* Locks area for all clients with RxQ */
  38. #define HW_FENCE_MEM_LOCKS_SIZE(rxq_clients_num) (sizeof(u64) * rxq_clients_num)
  39. #define HW_FENCE_TX_QUEUE 1
  40. #define HW_FENCE_RX_QUEUE 2
  41. /* ClientID for the internal join fence, this is used by the framework when creating a join-fence */
  42. #define HW_FENCE_JOIN_FENCE_CLIENT_ID (~(u32)0)
  43. /**
  44. * msm hw fence flags:
  45. * MSM_HW_FENCE_FLAG_SIGNAL - Flag set when the hw-fence is signaled
  46. */
  47. #define MSM_HW_FENCE_FLAG_SIGNAL BIT(0)
  48. /**
  49. * MSM_HW_FENCE_MAX_JOIN_PARENTS:
  50. * Maximum number of parents that a fence can have for a join-fence
  51. */
  52. #define MSM_HW_FENCE_MAX_JOIN_PARENTS 3
  53. /**
  54. * HW_FENCE_PAYLOAD_REV:
  55. * Payload version with major and minor version information
  56. */
  57. #define HW_FENCE_PAYLOAD_REV(major, minor) (major << 8 | (minor & 0xFF))
  58. enum hw_fence_lookup_ops {
  59. HW_FENCE_LOOKUP_OP_CREATE = 0x1,
  60. HW_FENCE_LOOKUP_OP_DESTROY,
  61. HW_FENCE_LOOKUP_OP_CREATE_JOIN,
  62. HW_FENCE_LOOKUP_OP_FIND_FENCE
  63. };
  64. /**
  65. * enum hw_fence_client_data_id - Enum with the clients having client_data, an optional
  66. * parameter passed from the waiting client and returned
  67. * to it upon fence signaling. Only the first HW Fence
  68. * Client for non-VAL clients (e.g. GFX, IPE, VPU) have
  69. * client_data.
  70. * @HW_FENCE_CLIENT_DATA_ID_CTX0: GFX Client 0.
  71. * @HW_FENCE_CLIENT_DATA_ID_IPE: IPE Client 0.
  72. * @HW_FENCE_CLIENT_DATA_ID_VPU: VPU Client 0.
  73. * @HW_FENCE_CLIENT_DATA_ID_VAL0: Debug validation client 0.
  74. * @HW_FENCE_CLIENT_DATA_ID_VAL1: Debug validation client 1.
  75. * @HW_FENCE_MAX_CLIENTS_WITH_DATA: Max number of clients with data, also indicates an
  76. * invalid hw_fence_client_data_id
  77. */
  78. enum hw_fence_client_data_id {
  79. HW_FENCE_CLIENT_DATA_ID_CTX0,
  80. HW_FENCE_CLIENT_DATA_ID_IPE,
  81. HW_FENCE_CLIENT_DATA_ID_VPU,
  82. HW_FENCE_CLIENT_DATA_ID_VAL0,
  83. HW_FENCE_CLIENT_DATA_ID_VAL1,
  84. HW_FENCE_MAX_CLIENTS_WITH_DATA,
  85. };
  86. /**
  87. * struct msm_hw_fence_queue - Structure holding the data of the hw fence queues.
  88. * @va_queue: pointer to the virtual address of the queue elements
  89. * @q_size_bytes: size of the queue
  90. * @va_header: pointer to the hfi header virtual address
  91. * @pa_queue: physical address of the queue
  92. * @rd_wr_idx_start: start read and write indexes for client queue (zero by default)
  93. * @rd_wr_idx_factor: factor to multiply custom index to get index in dwords (one by default)
  94. * @skip_wr_idx: bool to indicate if update to write_index is skipped within hw fence driver and
  95. * hfi_header->tx_wm is updated instead
  96. */
  97. struct msm_hw_fence_queue {
  98. void *va_queue;
  99. u32 q_size_bytes;
  100. void *va_header;
  101. phys_addr_t pa_queue;
  102. u32 rd_wr_idx_start;
  103. u32 rd_wr_idx_factor;
  104. bool skip_wr_idx;
  105. };
  106. /**
  107. * enum payload_type - Enum with the queue payload types.
  108. */
  109. enum payload_type {
  110. HW_FENCE_PAYLOAD_TYPE_1 = 1
  111. };
  112. /**
  113. * struct msm_hw_fence_client - Structure holding the per-Client allocated resources.
  114. * @client_id: internal client_id used within HW fence driver; index into the clients struct
  115. * @client_id_ext: external client_id, equal to client_id except for clients with configurable
  116. * number of sub-clients (e.g. ife clients)
  117. * @mem_descriptor: hfi header memory descriptor
  118. * @queues: queues descriptor
  119. * @queues_num: number of client queues
  120. * @ipc_signal_id: id of the signal to be triggered for this client
  121. * @ipc_client_vid: virtual id of the ipc client for this hw fence driver client
  122. * @ipc_client_pid: physical id of the ipc client for this hw fence driver client
  123. * @update_rxq: bool to indicate if client uses rx-queue
  124. * @send_ipc: bool to indicate if client requires ipc interrupt for already signaled fences
  125. * @wait_queue: wait queue for the validation clients
  126. * @val_signal: doorbell flag to signal the validation clients in the wait queue
  127. */
  128. struct msm_hw_fence_client {
  129. enum hw_fence_client_id client_id;
  130. enum hw_fence_client_id client_id_ext;
  131. struct msm_hw_fence_mem_addr mem_descriptor;
  132. struct msm_hw_fence_queue queues[HW_FENCE_CLIENT_QUEUES];
  133. int queues_num;
  134. int ipc_signal_id;
  135. int ipc_client_vid;
  136. int ipc_client_pid;
  137. bool update_rxq;
  138. bool send_ipc;
  139. #if IS_ENABLED(CONFIG_DEBUG_FS)
  140. wait_queue_head_t wait_queue;
  141. atomic_t val_signal;
  142. #endif /* CONFIG_DEBUG_FS */
  143. };
  144. /**
  145. * struct msm_hw_fence_mem_data - Structure holding internal memory attributes
  146. *
  147. * @attrs: attributes for the memory allocation
  148. */
  149. struct msm_hw_fence_mem_data {
  150. unsigned long attrs;
  151. };
  152. /**
  153. * struct msm_hw_fence_dbg_data - Structure holding debugfs data
  154. *
  155. * @root: debugfs root
  156. * @entry_rd: flag to indicate if debugfs dumps a single line or table
  157. * @context_rd: debugfs setting to indicate which context id to dump
  158. * @seqno_rd: debugfs setting to indicate which seqno to dump
  159. * @hw_fence_sim_release_delay: delay in micro seconds for the debugfs node that simulates the
  160. * hw-fences behavior, to release the hw-fences
  161. * @create_hw_fences: boolean to continuosly create hw-fences within debugfs
  162. * @clients_list: list of debug clients registered
  163. * @clients_list_lock: lock to synchronize access to the clients list
  164. * @lock_wake_cnt: number of times that driver triggers wake-up ipcc to unlock inter-vm try-lock
  165. */
  166. struct msm_hw_fence_dbg_data {
  167. struct dentry *root;
  168. bool entry_rd;
  169. u64 context_rd;
  170. u64 seqno_rd;
  171. u32 hw_fence_sim_release_delay;
  172. bool create_hw_fences;
  173. struct list_head clients_list;
  174. struct mutex clients_list_lock;
  175. u64 lock_wake_cnt;
  176. };
  177. /**
  178. * struct hw_fence_client_type_desc - Structure holding client type properties, including static
  179. * properties and client queue properties read from device-tree.
  180. *
  181. * @name: name of client type, used to parse properties from device-tree
  182. * @init_id: initial client_id for given client type within the 'hw_fence_client_id' enum, e.g.
  183. * HW_FENCE_CLIENT_ID_CTL0 for DPU clients
  184. * @max_clients_num: maximum number of clients of given client type
  185. * @clients_num: number of clients of given client type
  186. * @queues_num: number of queues per client of given client type; either one (for only Tx Queue) or
  187. * two (for both Tx and Rx Queues)
  188. * @queue_entries: number of entries per client queue of given client type
  189. * @start_padding: size of padding between queue table header and first queue header in bytes
  190. * @end_padding: size of padding between queue header(s) and first queue payload in bytes
  191. * @mem_size: size of memory allocated for client queue(s) per client in bytes
  192. * @txq_idx_start: start read and write indexes for client tx queue (zero by default)
  193. * @txq_idx_factor: factor to multiply custom TxQ idx to get index in dwords (one by default)
  194. * @skip_txq_wr_idx: bool to indicate if update to tx queue write_index is skipped within hw fence
  195. * driver and hfi_header->tx_wm is updated instead
  196. */
  197. struct hw_fence_client_type_desc {
  198. char *name;
  199. enum hw_fence_client_id init_id;
  200. u32 max_clients_num;
  201. u32 clients_num;
  202. u32 queues_num;
  203. u32 queue_entries;
  204. u32 start_padding;
  205. u32 end_padding;
  206. u32 mem_size;
  207. u32 txq_idx_start;
  208. u32 txq_idx_factor;
  209. bool skip_txq_wr_idx;
  210. };
  211. /**
  212. * struct hw_fence_client_queue_desc - Structure holding client queue properties for a client.
  213. *
  214. * @type: pointer to client queue properties of client type
  215. * @start_offset: start offset of client queue memory region, from beginning of carved-out memory
  216. * allocation for hw fence driver
  217. */
  218. struct hw_fence_client_queue_desc {
  219. struct hw_fence_client_type_desc *type;
  220. u32 start_offset;
  221. };
  222. /**
  223. * struct hw_fence_driver_data - Structure holding internal hw-fence driver data
  224. *
  225. * @dev: device driver pointer
  226. * @resources_ready: value set by driver at end of probe, once all resources are ready
  227. * @hw_fence_table_entries: total number of hw-fences in the global table
  228. * @hw_fence_mem_fences_table_size: hw-fences global table total size
  229. * @hw_fence_queue_entries: total number of entries that can be available in the queue
  230. * @hw_fence_ctrl_queue_size: size of the ctrl queue for the payload
  231. * @hw_fence_mem_ctrl_queues_size: total size of ctrl queues, including: header + rxq + txq
  232. * @hw_fence_client_queue_size: descriptors of client queue properties for each hw fence client
  233. * @hw_fence_client_types: descriptors of properties for each hw fence client type
  234. * @rxq_clients_num: number of supported hw fence clients with rxq (configured based on device-tree)
  235. * @clients_num: number of supported hw fence clients (configured based on device-tree)
  236. * @hw_fences_tbl: pointer to the hw-fences table
  237. * @hw_fences_tbl_cnt: number of elements in the hw-fence table
  238. * @client_lock_tbl: pointer to the per-client locks table
  239. * @client_lock_tbl_cnt: number of elements in the locks table
  240. * @hw_fences_mem_desc: memory descriptor for the hw-fence table
  241. * @clients_locks_mem_desc: memory descriptor for the locks table
  242. * @ctrl_queue_mem_desc: memory descriptor for the ctrl queues
  243. * @ctrl_queues: pointer to the ctrl queues
  244. * @io_mem_base: pointer to the carved-out io memory
  245. * @res: resources for the carved out memory
  246. * @size: size of the carved-out memory
  247. * @label: label for the carved-out memory (this is used by SVM to find the memory)
  248. * @peer_name: peer name for this carved-out memory
  249. * @rm_nb: hyp resource manager notifier
  250. * @memparcel: memparcel for the allocated memory
  251. * @used_mem_size: total memory size of global table, lock region, and ctrl and client queues
  252. * @db_label: doorbell label
  253. * @rx_dbl: handle to the Rx doorbell
  254. * @debugfs_data: debugfs info
  255. * @ipcc_reg_base: base for ipcc regs mapping
  256. * @ipcc_io_mem: base for the ipcc io mem map
  257. * @ipcc_size: size of the ipcc io mem mapping
  258. * @protocol_id: ipcc protocol id used by this driver
  259. * @ipcc_client_vid: ipcc client virtual-id for this driver
  260. * @ipcc_client_pid: ipcc client physical-id for this driver
  261. * @ipc_clients_table: table with the ipcc mapping for each client of this driver
  262. * @qtime_reg_base: qtimer register base address
  263. * @qtime_io_mem: qtimer io mem map
  264. * @qtime_size: qtimer io mem map size
  265. * @client_id_mask: bitmask for tracking registered client_ids
  266. * @clients_register_lock: lock to synchronize clients registration and deregistration
  267. * @clients: table with the handles of the registered clients; size is equal to clients_num
  268. * @vm_ready: flag to indicate if vm has been initialized
  269. * @ipcc_dpu_initialized: flag to indicate if dpu hw is initialized
  270. */
  271. struct hw_fence_driver_data {
  272. struct device *dev;
  273. bool resources_ready;
  274. /* Table & Queues info */
  275. u32 hw_fence_table_entries;
  276. u32 hw_fence_mem_fences_table_size;
  277. u32 hw_fence_queue_entries;
  278. /* ctrl queues */
  279. u32 hw_fence_ctrl_queue_size;
  280. u32 hw_fence_mem_ctrl_queues_size;
  281. /* client queues */
  282. struct hw_fence_client_queue_desc *hw_fence_client_queue_size;
  283. struct hw_fence_client_type_desc *hw_fence_client_types;
  284. u32 rxq_clients_num;
  285. u32 clients_num;
  286. /* HW Fences Table VA */
  287. struct msm_hw_fence *hw_fences_tbl;
  288. u32 hw_fences_tbl_cnt;
  289. /* Table with a Per-Client Lock */
  290. u64 *client_lock_tbl;
  291. u32 client_lock_tbl_cnt;
  292. /* Memory Descriptors */
  293. struct msm_hw_fence_mem_addr hw_fences_mem_desc;
  294. struct msm_hw_fence_mem_addr clients_locks_mem_desc;
  295. struct msm_hw_fence_mem_addr ctrl_queue_mem_desc;
  296. struct msm_hw_fence_queue ctrl_queues[HW_FENCE_CTRL_QUEUES];
  297. /* carved out memory */
  298. void __iomem *io_mem_base;
  299. struct resource res;
  300. size_t size;
  301. u32 label;
  302. u32 peer_name;
  303. struct notifier_block rm_nb;
  304. u32 memparcel;
  305. u32 used_mem_size;
  306. /* doorbell */
  307. u32 db_label;
  308. /* VM virq */
  309. void *rx_dbl;
  310. /* debugfs */
  311. struct msm_hw_fence_dbg_data debugfs_data;
  312. /* ipcc regs */
  313. phys_addr_t ipcc_reg_base;
  314. void __iomem *ipcc_io_mem;
  315. uint32_t ipcc_size;
  316. u32 protocol_id;
  317. u32 ipcc_client_vid;
  318. u32 ipcc_client_pid;
  319. /* table with mapping of ipc client for each hw-fence client */
  320. struct hw_fence_client_ipc_map *ipc_clients_table;
  321. /* qtime reg */
  322. phys_addr_t qtime_reg_base;
  323. void __iomem *qtime_io_mem;
  324. uint32_t qtime_size;
  325. /* synchronize client_ids registration and deregistration */
  326. struct mutex clients_register_lock;
  327. /* table with registered client handles */
  328. struct msm_hw_fence_client **clients;
  329. bool vm_ready;
  330. /* state variables */
  331. bool ipcc_dpu_initialized;
  332. };
  333. /**
  334. * struct msm_hw_fence_queue_payload - hardware fence clients queues payload.
  335. * @size: size of queue payload
  336. * @type: type of queue payload
  337. * @version: version of queue payload. High eight bits are for major and lower eight
  338. * bits are for minor version
  339. * @ctxt_id: context id of the dma fence
  340. * @seqno: sequence number of the dma fence
  341. * @hash: fence hash
  342. * @flags: see MSM_HW_FENCE_FLAG_* flags descriptions
  343. * @client_data: data passed from and returned to waiting client upon fence signaling
  344. * @error: error code for this fence, fence controller receives this
  345. * error from the signaling client through the tx queue and
  346. * propagates the error to the waiting client through rx queue
  347. * @timestamp_lo: low 32-bits of qtime of when the payload is written into the queue
  348. * @timestamp_hi: high 32-bits of qtime of when the payload is written into the queue
  349. */
  350. struct msm_hw_fence_queue_payload {
  351. u32 size;
  352. u16 type;
  353. u16 version;
  354. u64 ctxt_id;
  355. u64 seqno;
  356. u64 hash;
  357. u64 flags;
  358. u64 client_data;
  359. u32 error;
  360. u32 timestamp_lo;
  361. u32 timestamp_hi;
  362. u32 reserve;
  363. };
  364. /**
  365. * struct msm_hw_fence - structure holding each hw fence data.
  366. * @valid: field updated when a hw-fence is reserved. True if hw-fence is in use
  367. * @error: field to hold a hw-fence error
  368. * @ctx_id: context id
  369. * @seq_id: sequence id
  370. * @wait_client_mask: bitmask holding the waiting-clients of the fence
  371. * @fence_allocator: field to indicate the client_id that reserved the fence
  372. * @fence_signal-client:
  373. * @lock: this field is required to share information between the Driver & Driver ||
  374. * Driver & FenceCTL. Needs to be 64-bit atomic inter-processor lock.
  375. * @flags: field to indicate the state of the fence
  376. * @parent_list: list of indexes with the parents for a child-fence in a join-fence
  377. * @parent_cnt: total number of parents for a child-fence in a join-fence
  378. * @pending_child_cnt: children refcount for a parent-fence in a join-fence. Access must be atomic
  379. * or locked
  380. * @fence_create_time: debug info with the create time timestamp
  381. * @fence_trigger_time: debug info with the trigger time timestamp
  382. * @fence_wait_time: debug info with the register-for-wait timestamp
  383. * @debug_refcount: refcount used for debugging
  384. * @client_data: array of data optionally passed from and returned to clients waiting on the fence
  385. * during fence signaling
  386. */
  387. struct msm_hw_fence {
  388. u32 valid;
  389. u32 error;
  390. u64 ctx_id;
  391. u64 seq_id;
  392. u64 wait_client_mask;
  393. u32 fence_allocator;
  394. u32 fence_signal_client;
  395. u64 lock; /* Datatype must be 64-bit. */
  396. u64 flags;
  397. u64 parent_list[MSM_HW_FENCE_MAX_JOIN_PARENTS];
  398. u32 parents_cnt;
  399. u32 pending_child_cnt;
  400. u64 fence_create_time;
  401. u64 fence_trigger_time;
  402. u64 fence_wait_time;
  403. u64 debug_refcount;
  404. u64 client_data[HW_FENCE_MAX_CLIENTS_WITH_DATA];
  405. };
  406. int hw_fence_init(struct hw_fence_driver_data *drv_data);
  407. int hw_fence_alloc_client_resources(struct hw_fence_driver_data *drv_data,
  408. struct msm_hw_fence_client *hw_fence_client,
  409. struct msm_hw_fence_mem_addr *mem_descriptor);
  410. int hw_fence_init_controller_signal(struct hw_fence_driver_data *drv_data,
  411. struct msm_hw_fence_client *hw_fence_client);
  412. int hw_fence_init_controller_resources(struct msm_hw_fence_client *hw_fence_client);
  413. void hw_fence_cleanup_client(struct hw_fence_driver_data *drv_data,
  414. struct msm_hw_fence_client *hw_fence_client);
  415. void hw_fence_utils_reset_queues(struct hw_fence_driver_data *drv_data,
  416. struct msm_hw_fence_client *hw_fence_client);
  417. int hw_fence_create(struct hw_fence_driver_data *drv_data,
  418. struct msm_hw_fence_client *hw_fence_client,
  419. u64 context, u64 seqno, u64 *hash);
  420. int hw_fence_destroy(struct hw_fence_driver_data *drv_data,
  421. struct msm_hw_fence_client *hw_fence_client,
  422. u64 context, u64 seqno);
  423. int hw_fence_destroy_with_hash(struct hw_fence_driver_data *drv_data,
  424. struct msm_hw_fence_client *hw_fence_client, u64 hash);
  425. int hw_fence_process_fence_array(struct hw_fence_driver_data *drv_data,
  426. struct msm_hw_fence_client *hw_fence_client,
  427. struct dma_fence_array *array, u64 *hash_join_fence, u64 client_data);
  428. int hw_fence_process_fence(struct hw_fence_driver_data *drv_data,
  429. struct msm_hw_fence_client *hw_fence_client, struct dma_fence *fence, u64 *hash,
  430. u64 client_data);
  431. int hw_fence_update_queue(struct hw_fence_driver_data *drv_data,
  432. struct msm_hw_fence_client *hw_fence_client, u64 ctxt_id, u64 seqno, u64 hash,
  433. u64 flags, u64 client_data, u32 error, int queue_type);
  434. inline u64 hw_fence_get_qtime(struct hw_fence_driver_data *drv_data);
  435. int hw_fence_read_queue(struct msm_hw_fence_client *hw_fence_client,
  436. struct msm_hw_fence_queue_payload *payload, int queue_type);
  437. int hw_fence_register_wait_client(struct hw_fence_driver_data *drv_data,
  438. struct dma_fence *fence, struct msm_hw_fence_client *hw_fence_client, u64 context,
  439. u64 seqno, u64 *hash, u64 client_data);
  440. struct msm_hw_fence *msm_hw_fence_find(struct hw_fence_driver_data *drv_data,
  441. struct msm_hw_fence_client *hw_fence_client,
  442. u64 context, u64 seqno, u64 *hash);
  443. enum hw_fence_client_data_id hw_fence_get_client_data_id(enum hw_fence_client_id client_id);
  444. #endif /* __HW_FENCE_DRV_INTERNAL_H */