blob: 7f3b4fdaa26e7e6f1a9dc26be90a28f1fe1bf446 [file] [log] [blame]
Oded Gabbay4a488a72014-07-16 21:08:55 +03001/*
2 * Copyright 2014 Advanced Micro Devices, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef KFD_PRIV_H_INCLUDED
24#define KFD_PRIV_H_INCLUDED
25
26#include <linux/hashtable.h>
27#include <linux/mmu_notifier.h>
28#include <linux/mutex.h>
29#include <linux/types.h>
30#include <linux/atomic.h>
31#include <linux/workqueue.h>
32#include <linux/spinlock.h>
Oded Gabbay19f6d2a2014-07-16 23:25:31 +030033#include <linux/kfd_ioctl.h>
Oded Gabbay4a488a72014-07-16 21:08:55 +030034#include <kgd_kfd_interface.h>
35
Evgeny Pinchuk5b5c4e42014-07-16 21:22:32 +030036#define KFD_SYSFS_FILE_MODE 0444
37
Ben Gozed6e6a32014-07-17 00:45:35 +030038/*
39 * When working with cp scheduler we should assign the HIQ manually or via
40 * the radeon driver to a fixed hqd slot, here are the fixed HIQ hqd slot
41 * definitions for Kaveri. In Kaveri only the first ME queues participates
42 * in the cp scheduling taking that in mind we set the HIQ slot in the
43 * second ME.
44 */
45#define KFD_CIK_HIQ_PIPE 4
46#define KFD_CIK_HIQ_QUEUE 0
47
Evgeny Pinchuk5b5c4e42014-07-16 21:22:32 +030048/* GPU ID hash width in bits */
49#define KFD_GPU_ID_HASH_WIDTH 16
50
51/* Macro for allocating structures */
52#define kfd_alloc_struct(ptr_to_struct) \
53 ((typeof(ptr_to_struct)) kzalloc(sizeof(*ptr_to_struct), GFP_KERNEL))
54
Oded Gabbay19f6d2a2014-07-16 23:25:31 +030055/* Kernel module parameter to specify maximum number of supported processes */
56extern int max_num_of_processes;
57
58#define KFD_MAX_NUM_OF_PROCESSES_DEFAULT 32
59#define KFD_MAX_NUM_OF_PROCESSES 512
60
61/*
62 * Kernel module parameter to specify maximum number of supported queues
63 * per process
64 */
65extern int max_num_of_queues_per_process;
66
67#define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS_DEFAULT 128
68#define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS 1024
69
Ben Gozed6e6a32014-07-17 00:45:35 +030070#define KFD_KERNEL_QUEUE_SIZE 2048
71
Ben Goz31c21fe2014-07-17 00:48:28 +030072/* Kernel module parameter to specify the scheduling policy */
73extern int sched_policy;
74
75/**
76 * enum kfd_sched_policy
77 *
78 * @KFD_SCHED_POLICY_HWS: H/W scheduling policy known as command processor (cp)
79 * scheduling. In this scheduling mode we're using the firmware code to
80 * schedule the user mode queues and kernel queues such as HIQ and DIQ.
81 * the HIQ queue is used as a special queue that dispatches the configuration
82 * to the cp and the user mode queues list that are currently running.
83 * the DIQ queue is a debugging queue that dispatches debugging commands to the
84 * firmware.
85 * in this scheduling mode user mode queues over subscription feature is
86 * enabled.
87 *
88 * @KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION: The same as above but the over
89 * subscription feature disabled.
90 *
91 * @KFD_SCHED_POLICY_NO_HWS: no H/W scheduling policy is a mode which directly
92 * set the command processor registers and sets the queues "manually". This
93 * mode is used *ONLY* for debugging proposes.
94 *
95 */
96enum kfd_sched_policy {
97 KFD_SCHED_POLICY_HWS = 0,
98 KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION,
99 KFD_SCHED_POLICY_NO_HWS
100};
101
Ben Gozed6e6a32014-07-17 00:45:35 +0300102enum cache_policy {
103 cache_policy_coherent,
104 cache_policy_noncoherent
105};
106
Oded Gabbay4a488a72014-07-16 21:08:55 +0300107struct kfd_device_info {
108 unsigned int max_pasid_bits;
109 size_t ih_ring_entry_size;
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300110 uint16_t mqd_size_aligned;
Oded Gabbay4a488a72014-07-16 21:08:55 +0300111};
112
113struct kfd_dev {
114 struct kgd_dev *kgd;
115
116 const struct kfd_device_info *device_info;
117 struct pci_dev *pdev;
118
119 unsigned int id; /* topology stub index */
120
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300121 phys_addr_t doorbell_base; /* Start of actual doorbells used by
122 * KFD. It is aligned for mapping
123 * into user mode
124 */
125 size_t doorbell_id_offset; /* Doorbell offset (from KFD doorbell
126 * to HW doorbell, GFX reserved some
127 * at the start)
128 */
129 size_t doorbell_process_limit; /* Number of processes we have doorbell
130 * space for.
131 */
132 u32 __iomem *doorbell_kernel_ptr; /* This is a pointer for a doorbells
133 * page used by kernel queue
134 */
135
Oded Gabbay4a488a72014-07-16 21:08:55 +0300136 struct kgd2kfd_shared_resources shared_resources;
137
Ben Gozed6e6a32014-07-17 00:45:35 +0300138 /* QCM Device instance */
139 struct device_queue_manager *dqm;
Oded Gabbay4a488a72014-07-16 21:08:55 +0300140
Ben Gozed6e6a32014-07-17 00:45:35 +0300141 bool init_complete;
Oded Gabbay4a488a72014-07-16 21:08:55 +0300142};
143
144/* KGD2KFD callbacks */
145void kgd2kfd_exit(void);
146struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd, struct pci_dev *pdev);
147bool kgd2kfd_device_init(struct kfd_dev *kfd,
148 const struct kgd2kfd_shared_resources *gpu_resources);
149void kgd2kfd_device_exit(struct kfd_dev *kfd);
150
151extern const struct kfd2kgd_calls *kfd2kgd;
152
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300153struct kfd_mem_obj {
154 void *bo;
155 uint64_t gpu_addr;
156 uint32_t *cpu_ptr;
157};
158
159enum kfd_mempool {
160 KFD_MEMPOOL_SYSTEM_CACHEABLE = 1,
161 KFD_MEMPOOL_SYSTEM_WRITECOMBINE = 2,
162 KFD_MEMPOOL_FRAMEBUFFER = 3,
163};
164
Oded Gabbay4a488a72014-07-16 21:08:55 +0300165/* Character device interface */
166int kfd_chardev_init(void);
167void kfd_chardev_exit(void);
168struct device *kfd_chardev(void);
169
Ben Goz241f24f2014-07-17 00:55:28 +0300170/**
171 * enum kfd_preempt_type_filter
172 *
173 * @KFD_PREEMPT_TYPE_FILTER_SINGLE_QUEUE: Preempts single queue.
174 *
175 * @KFD_PRERMPT_TYPE_FILTER_ALL_QUEUES: Preempts all queues in the
176 * running queues list.
177 *
178 * @KFD_PRERMPT_TYPE_FILTER_BY_PASID: Preempts queues that belongs to
179 * specific process.
180 *
181 */
182enum kfd_preempt_type_filter {
183 KFD_PREEMPT_TYPE_FILTER_SINGLE_QUEUE,
184 KFD_PREEMPT_TYPE_FILTER_ALL_QUEUES,
185 KFD_PREEMPT_TYPE_FILTER_BY_PASID
186};
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300187
Ben Goz6e99df52014-07-17 00:36:17 +0300188enum kfd_preempt_type {
189 KFD_PREEMPT_TYPE_WAVEFRONT,
190 KFD_PREEMPT_TYPE_WAVEFRONT_RESET
191};
192
Ben Gozed8aab42014-07-17 00:18:51 +0300193/**
194 * enum kfd_queue_type
195 *
196 * @KFD_QUEUE_TYPE_COMPUTE: Regular user mode queue type.
197 *
198 * @KFD_QUEUE_TYPE_SDMA: Sdma user mode queue type.
199 *
200 * @KFD_QUEUE_TYPE_HIQ: HIQ queue type.
201 *
202 * @KFD_QUEUE_TYPE_DIQ: DIQ queue type.
203 */
204enum kfd_queue_type {
205 KFD_QUEUE_TYPE_COMPUTE,
206 KFD_QUEUE_TYPE_SDMA,
207 KFD_QUEUE_TYPE_HIQ,
208 KFD_QUEUE_TYPE_DIQ
209};
210
Ben Goz6e99df52014-07-17 00:36:17 +0300211enum kfd_queue_format {
212 KFD_QUEUE_FORMAT_PM4,
213 KFD_QUEUE_FORMAT_AQL
214};
215
Ben Gozed8aab42014-07-17 00:18:51 +0300216/**
217 * struct queue_properties
218 *
219 * @type: The queue type.
220 *
221 * @queue_id: Queue identifier.
222 *
223 * @queue_address: Queue ring buffer address.
224 *
225 * @queue_size: Queue ring buffer size.
226 *
227 * @priority: Defines the queue priority relative to other queues in the
228 * process.
229 * This is just an indication and HW scheduling may override the priority as
230 * necessary while keeping the relative prioritization.
231 * the priority granularity is from 0 to f which f is the highest priority.
232 * currently all queues are initialized with the highest priority.
233 *
234 * @queue_percent: This field is partially implemented and currently a zero in
235 * this field defines that the queue is non active.
236 *
237 * @read_ptr: User space address which points to the number of dwords the
238 * cp read from the ring buffer. This field updates automatically by the H/W.
239 *
240 * @write_ptr: Defines the number of dwords written to the ring buffer.
241 *
242 * @doorbell_ptr: This field aim is to notify the H/W of new packet written to
243 * the queue ring buffer. This field should be similar to write_ptr and the user
244 * should update this field after he updated the write_ptr.
245 *
246 * @doorbell_off: The doorbell offset in the doorbell pci-bar.
247 *
248 * @is_interop: Defines if this is a interop queue. Interop queue means that the
249 * queue can access both graphics and compute resources.
250 *
251 * @is_active: Defines if the queue is active or not.
252 *
253 * @vmid: If the scheduling mode is no cp scheduling the field defines the vmid
254 * of the queue.
255 *
256 * This structure represents the queue properties for each queue no matter if
257 * it's user mode or kernel mode queue.
258 *
259 */
260struct queue_properties {
261 enum kfd_queue_type type;
Ben Goz6e99df52014-07-17 00:36:17 +0300262 enum kfd_queue_format format;
Ben Gozed8aab42014-07-17 00:18:51 +0300263 unsigned int queue_id;
264 uint64_t queue_address;
265 uint64_t queue_size;
266 uint32_t priority;
267 uint32_t queue_percent;
268 uint32_t *read_ptr;
269 uint32_t *write_ptr;
270 uint32_t *doorbell_ptr;
271 uint32_t doorbell_off;
272 bool is_interop;
273 bool is_active;
274 /* Not relevant for user mode queues in cp scheduling */
275 unsigned int vmid;
276};
277
278/**
279 * struct queue
280 *
281 * @list: Queue linked list.
282 *
283 * @mqd: The queue MQD.
284 *
285 * @mqd_mem_obj: The MQD local gpu memory object.
286 *
287 * @gart_mqd_addr: The MQD gart mc address.
288 *
289 * @properties: The queue properties.
290 *
291 * @mec: Used only in no cp scheduling mode and identifies to micro engine id
292 * that the queue should be execute on.
293 *
294 * @pipe: Used only in no cp scheduling mode and identifies the queue's pipe id.
295 *
296 * @queue: Used only in no cp scheduliong mode and identifies the queue's slot.
297 *
298 * @process: The kfd process that created this queue.
299 *
300 * @device: The kfd device that created this queue.
301 *
302 * This structure represents user mode compute queues.
303 * It contains all the necessary data to handle such queues.
304 *
305 */
306
307struct queue {
308 struct list_head list;
309 void *mqd;
310 struct kfd_mem_obj *mqd_mem_obj;
311 uint64_t gart_mqd_addr;
312 struct queue_properties properties;
313
314 uint32_t mec;
315 uint32_t pipe;
316 uint32_t queue;
317
318 struct kfd_process *process;
319 struct kfd_dev *device;
320};
321
Ben Goz6e99df52014-07-17 00:36:17 +0300322/*
323 * Please read the kfd_mqd_manager.h description.
324 */
325enum KFD_MQD_TYPE {
326 KFD_MQD_TYPE_CIK_COMPUTE = 0, /* for no cp scheduling */
327 KFD_MQD_TYPE_CIK_HIQ, /* for hiq */
328 KFD_MQD_TYPE_CIK_CP, /* for cp queues and diq */
329 KFD_MQD_TYPE_CIK_SDMA, /* for sdma queues */
330 KFD_MQD_TYPE_MAX
331};
332
Ben Goz241f24f2014-07-17 00:55:28 +0300333struct scheduling_resources {
334 unsigned int vmid_mask;
335 enum kfd_queue_type type;
336 uint64_t queue_mask;
337 uint64_t gws_mask;
338 uint32_t oac_mask;
339 uint32_t gds_heap_base;
340 uint32_t gds_heap_size;
341};
342
343struct process_queue_manager {
344 /* data */
345 struct kfd_process *process;
346 unsigned int num_concurrent_processes;
347 struct list_head queues;
348 unsigned long *queue_slot_bitmap;
349};
350
351struct qcm_process_device {
352 /* The Device Queue Manager that owns this data */
353 struct device_queue_manager *dqm;
354 struct process_queue_manager *pqm;
355 /* Device Queue Manager lock */
356 struct mutex *lock;
357 /* Queues list */
358 struct list_head queues_list;
359 struct list_head priv_queue_list;
360
361 unsigned int queue_count;
362 unsigned int vmid;
363 bool is_debug;
364 /*
365 * All the memory management data should be here too
366 */
367 uint64_t gds_context_area;
368 uint32_t sh_mem_config;
369 uint32_t sh_mem_bases;
370 uint32_t sh_mem_ape1_base;
371 uint32_t sh_mem_ape1_limit;
372 uint32_t page_table_base;
373 uint32_t gds_size;
374 uint32_t num_gws;
375 uint32_t num_oac;
376};
377
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300378/* Data that is per-process-per device. */
379struct kfd_process_device {
380 /*
381 * List of all per-device data for a process.
382 * Starts from kfd_process.per_device_data.
383 */
384 struct list_head per_device_list;
385
386 /* The device that owns this data. */
387 struct kfd_dev *dev;
388
389
Ben Goz45102042014-07-17 01:04:10 +0300390 /* per-process-per device QCM data structure */
391 struct qcm_process_device qpd;
392
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300393 /*Apertures*/
394 uint64_t lds_base;
395 uint64_t lds_limit;
396 uint64_t gpuvm_base;
397 uint64_t gpuvm_limit;
398 uint64_t scratch_base;
399 uint64_t scratch_limit;
400
401 /* Is this process/pasid bound to this device? (amd_iommu_bind_pasid) */
402 bool bound;
403};
404
Oded Gabbay4a488a72014-07-16 21:08:55 +0300405/* Process data */
406struct kfd_process {
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300407 /*
408 * kfd_process are stored in an mm_struct*->kfd_process*
409 * hash table (kfd_processes in kfd_process.c)
410 */
411 struct hlist_node kfd_processes;
412
413 struct mm_struct *mm;
414
415 struct mutex mutex;
416
417 /*
418 * In any process, the thread that started main() is the lead
419 * thread and outlives the rest.
420 * It is here because amd_iommu_bind_pasid wants a task_struct.
421 */
422 struct task_struct *lead_thread;
423
424 /* We want to receive a notification when the mm_struct is destroyed */
425 struct mmu_notifier mmu_notifier;
426
427 /* Use for delayed freeing of kfd_process structure */
428 struct rcu_head rcu;
429
430 unsigned int pasid;
431
432 /*
433 * List of kfd_process_device structures,
434 * one for each device the process is using.
435 */
436 struct list_head per_device_data;
437
Ben Goz45102042014-07-17 01:04:10 +0300438 struct process_queue_manager pqm;
439
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300440 /* The process's queues. */
441 size_t queue_array_size;
442
443 /* Size is queue_array_size, up to MAX_PROCESS_QUEUES. */
444 struct kfd_queue **queues;
445
446 unsigned long allocated_queue_bitmap[DIV_ROUND_UP(KFD_MAX_NUM_OF_QUEUES_PER_PROCESS, BITS_PER_LONG)];
447
448 /*Is the user space process 32 bit?*/
449 bool is_32bit_user_mode;
Oded Gabbay4a488a72014-07-16 21:08:55 +0300450};
451
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300452void kfd_process_create_wq(void);
453void kfd_process_destroy_wq(void);
454struct kfd_process *kfd_create_process(const struct task_struct *);
455struct kfd_process *kfd_get_process(const struct task_struct *);
456
Ben Goz64c7f8c2014-07-17 01:27:00 +0300457struct kfd_process_device *kfd_bind_process_to_device(struct kfd_dev *dev,
458 struct kfd_process *p);
Oded Gabbayb17f0682014-07-17 00:06:27 +0300459void kfd_unbind_process_from_device(struct kfd_dev *dev, unsigned int pasid);
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300460struct kfd_process_device *kfd_get_process_device_data(struct kfd_dev *dev,
461 struct kfd_process *p,
462 int create_pdd);
463
464/* PASIDs */
465int kfd_pasid_init(void);
466void kfd_pasid_exit(void);
467bool kfd_set_pasid_limit(unsigned int new_limit);
468unsigned int kfd_get_pasid_limit(void);
469unsigned int kfd_pasid_alloc(void);
470void kfd_pasid_free(unsigned int pasid);
471
472/* Doorbells */
473void kfd_doorbell_init(struct kfd_dev *kfd);
474int kfd_doorbell_mmap(struct kfd_process *process, struct vm_area_struct *vma);
475u32 __iomem *kfd_get_kernel_doorbell(struct kfd_dev *kfd,
476 unsigned int *doorbell_off);
477void kfd_release_kernel_doorbell(struct kfd_dev *kfd, u32 __iomem *db_addr);
478u32 read_kernel_doorbell(u32 __iomem *db);
479void write_kernel_doorbell(u32 __iomem *db, u32 value);
480unsigned int kfd_queue_id_to_doorbell(struct kfd_dev *kfd,
481 struct kfd_process *process,
482 unsigned int queue_id);
483
Oded Gabbay4a488a72014-07-16 21:08:55 +0300484extern struct device *kfd_device;
485
Evgeny Pinchuk5b5c4e42014-07-16 21:22:32 +0300486/* Topology */
487int kfd_topology_init(void);
488void kfd_topology_shutdown(void);
489int kfd_topology_add_device(struct kfd_dev *gpu);
490int kfd_topology_remove_device(struct kfd_dev *gpu);
491struct kfd_dev *kfd_device_by_id(uint32_t gpu_id);
492struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev);
493struct kfd_dev *kfd_topology_enum_kfd_devices(uint8_t idx);
494
Oded Gabbay4a488a72014-07-16 21:08:55 +0300495/* Interrupts */
496void kgd2kfd_interrupt(struct kfd_dev *dev, const void *ih_ring_entry);
497
498/* Power Management */
499void kgd2kfd_suspend(struct kfd_dev *dev);
500int kgd2kfd_resume(struct kfd_dev *dev);
501
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300502/* amdkfd Apertures */
503int kfd_init_apertures(struct kfd_process *process);
504
Ben Gozed6e6a32014-07-17 00:45:35 +0300505/* Queue Context Management */
Ben Goz241f24f2014-07-17 00:55:28 +0300506inline uint32_t lower_32(uint64_t x);
507inline uint32_t upper_32(uint64_t x);
508
Ben Gozed6e6a32014-07-17 00:45:35 +0300509int init_queue(struct queue **q, struct queue_properties properties);
510void uninit_queue(struct queue *q);
Ben Goz45102042014-07-17 01:04:10 +0300511void print_queue_properties(struct queue_properties *q);
Ben Gozed6e6a32014-07-17 00:45:35 +0300512void print_queue(struct queue *q);
513
Ben Goz64c7f8c2014-07-17 01:27:00 +0300514struct mqd_manager *mqd_manager_init(enum KFD_MQD_TYPE type,
515 struct kfd_dev *dev);
516struct device_queue_manager *device_queue_manager_init(struct kfd_dev *dev);
517void device_queue_manager_uninit(struct device_queue_manager *dqm);
Ben Goz241f24f2014-07-17 00:55:28 +0300518struct kernel_queue *kernel_queue_init(struct kfd_dev *dev,
519 enum kfd_queue_type type);
520void kernel_queue_uninit(struct kernel_queue *kq);
521
Ben Goz45102042014-07-17 01:04:10 +0300522/* Process Queue Manager */
523struct process_queue_node {
524 struct queue *q;
525 struct kernel_queue *kq;
526 struct list_head process_queue_list;
527};
528
529int pqm_init(struct process_queue_manager *pqm, struct kfd_process *p);
530void pqm_uninit(struct process_queue_manager *pqm);
531int pqm_create_queue(struct process_queue_manager *pqm,
532 struct kfd_dev *dev,
533 struct file *f,
534 struct queue_properties *properties,
535 unsigned int flags,
536 enum kfd_queue_type type,
537 unsigned int *qid);
538int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid);
539int pqm_update_queue(struct process_queue_manager *pqm, unsigned int qid,
540 struct queue_properties *p);
541
Ben Gozed6e6a32014-07-17 00:45:35 +0300542/* Packet Manager */
543
Ben Goz241f24f2014-07-17 00:55:28 +0300544#define KFD_HIQ_TIMEOUT (500)
545
Ben Goz64c7f8c2014-07-17 01:27:00 +0300546#define KFD_FENCE_COMPLETED (100)
547#define KFD_FENCE_INIT (10)
Ben Goz241f24f2014-07-17 00:55:28 +0300548#define KFD_UNMAP_LATENCY (150)
549
Ben Gozed6e6a32014-07-17 00:45:35 +0300550struct packet_manager {
551 struct device_queue_manager *dqm;
552 struct kernel_queue *priv_queue;
553 struct mutex lock;
554 bool allocated;
555 struct kfd_mem_obj *ib_buffer_obj;
556};
557
Ben Goz64c7f8c2014-07-17 01:27:00 +0300558int pm_init(struct packet_manager *pm, struct device_queue_manager *dqm);
559void pm_uninit(struct packet_manager *pm);
560int pm_send_set_resources(struct packet_manager *pm,
561 struct scheduling_resources *res);
562int pm_send_runlist(struct packet_manager *pm, struct list_head *dqm_queues);
563int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address,
564 uint32_t fence_value);
565
566int pm_send_unmap_queue(struct packet_manager *pm, enum kfd_queue_type type,
567 enum kfd_preempt_type_filter mode,
568 uint32_t filter_param, bool reset,
569 unsigned int sdma_engine);
570
Ben Goz241f24f2014-07-17 00:55:28 +0300571void pm_release_ib(struct packet_manager *pm);
572
Oded Gabbay19f6d2a2014-07-16 23:25:31 +0300573uint64_t kfd_get_number_elems(struct kfd_dev *kfd);
574phys_addr_t kfd_get_process_doorbells(struct kfd_dev *dev,
575 struct kfd_process *process);
576
Oded Gabbay4a488a72014-07-16 21:08:55 +0300577#endif