| .. | .. |
|---|
| 29 | 29 | #include "kfd_priv.h" |
|---|
| 30 | 30 | |
|---|
| 31 | 31 | /** |
|---|
| 32 | | - * struct kernel_queue_ops |
|---|
| 33 | | - * |
|---|
| 34 | | - * @initialize: Initialize a kernel queue, including allocations of GART memory |
|---|
| 35 | | - * needed for the queue. |
|---|
| 36 | | - * |
|---|
| 37 | | - * @uninitialize: Uninitialize a kernel queue and free all its memory usages. |
|---|
| 38 | | - * |
|---|
| 39 | | - * @acquire_packet_buffer: Returns a pointer to the location in the kernel |
|---|
| 32 | + * kq_acquire_packet_buffer: Returns a pointer to the location in the kernel |
|---|
| 40 | 33 | * queue ring buffer where the calling function can write its packet. It is |
|---|
| 41 | 34 | * Guaranteed that there is enough space for that packet. It also updates the |
|---|
| 42 | 35 | * pending write pointer to that location so subsequent calls to |
|---|
| 43 | 36 | * acquire_packet_buffer will get a correct write pointer |
|---|
| 44 | 37 | * |
|---|
| 45 | | - * @submit_packet: Update the write pointer and doorbell of a kernel queue. |
|---|
| 38 | + * kq_submit_packet: Update the write pointer and doorbell of a kernel queue. |
|---|
| 46 | 39 | * |
|---|
| 47 | | - * @sync_with_hw: Wait until the write pointer and the read pointer of a kernel |
|---|
| 48 | | - * queue are equal, which means the CP has read all the submitted packets. |
|---|
| 49 | | - * |
|---|
| 50 | | - * @rollback_packet: This routine is called if we failed to build an acquired |
|---|
| 40 | + * kq_rollback_packet: This routine is called if we failed to build an acquired |
|---|
| 51 | 41 | * packet for some reason. It just overwrites the pending wptr with the current |
|---|
| 52 | 42 | * one |
|---|
| 53 | 43 | * |
|---|
| 54 | 44 | */ |
|---|
| 55 | | -struct kernel_queue_ops { |
|---|
| 56 | | - bool (*initialize)(struct kernel_queue *kq, struct kfd_dev *dev, |
|---|
| 57 | | - enum kfd_queue_type type, unsigned int queue_size); |
|---|
| 58 | | - void (*uninitialize)(struct kernel_queue *kq); |
|---|
| 59 | | - int (*acquire_packet_buffer)(struct kernel_queue *kq, |
|---|
| 60 | | - size_t packet_size_in_dwords, |
|---|
| 61 | | - unsigned int **buffer_ptr); |
|---|
| 62 | 45 | |
|---|
| 63 | | - void (*submit_packet)(struct kernel_queue *kq); |
|---|
| 64 | | - void (*rollback_packet)(struct kernel_queue *kq); |
|---|
| 65 | | -}; |
|---|
| 46 | +int kq_acquire_packet_buffer(struct kernel_queue *kq, |
|---|
| 47 | + size_t packet_size_in_dwords, |
|---|
| 48 | + unsigned int **buffer_ptr); |
|---|
| 49 | +void kq_submit_packet(struct kernel_queue *kq); |
|---|
| 50 | +void kq_rollback_packet(struct kernel_queue *kq); |
|---|
| 51 | + |
|---|
| 66 | 52 | |
|---|
| 67 | 53 | struct kernel_queue { |
|---|
| 68 | | - struct kernel_queue_ops ops; |
|---|
| 69 | | - struct kernel_queue_ops ops_asic_specific; |
|---|
| 70 | | - |
|---|
| 71 | 54 | /* data */ |
|---|
| 72 | 55 | struct kfd_dev *dev; |
|---|
| 73 | 56 | struct mqd_manager *mqd_mgr; |
|---|
| .. | .. |
|---|
| 98 | 81 | |
|---|
| 99 | 82 | struct list_head list; |
|---|
| 100 | 83 | }; |
|---|
| 101 | | - |
|---|
| 102 | | -void kernel_queue_init_cik(struct kernel_queue_ops *ops); |
|---|
| 103 | | -void kernel_queue_init_vi(struct kernel_queue_ops *ops); |
|---|
| 104 | | -void kernel_queue_init_v9(struct kernel_queue_ops *ops); |
|---|
| 105 | 84 | |
|---|
| 106 | 85 | #endif /* KFD_KERNEL_QUEUE_H_ */ |
|---|