aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
diff options
context:
space:
mode:
authorBen Goz <ben.goz@amd.com>2014-07-16 17:55:28 -0400
committerOded Gabbay <oded.gabbay@amd.com>2014-07-16 17:55:28 -0400
commit241f24f823631ced1c6f162db1deebc35037f7d0 (patch)
tree8b06408156d6b9058690a0b78cdcf5878bd98a23 /drivers/gpu/drm/amd/amdkfd/kfd_priv.h
parent31c21fece7a5f279ebdd1ee260493450017183f4 (diff)
amdkfd: Add packet manager module
The packet manager module builds PM4 packets for the sole use of the CP scheduler. Those packets are used by the HIQ to submit runlists to the CP. v3: Removed include of cik_mqds.h Changed lower_32/upper_32 calls to use linux macros Used new gart allocation functions Added documentation v5: Move amdkfd from drm/radeon/ to drm/amd/ Change format of mqd structure to match latest KV firmware Add support for AQL queues creation to enable working with open-source HSA runtime Always chain runlist if you have more than 1 process or if you have over-subscription over the number of queues. Various fixes (typos, style) Signed-off-by: Ben Goz <ben.goz@amd.com> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_priv.h')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_priv.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index 32bca8a67423..219c85a261c3 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -167,6 +167,23 @@ int kfd_chardev_init(void);
167void kfd_chardev_exit(void); 167void kfd_chardev_exit(void);
168struct device *kfd_chardev(void); 168struct device *kfd_chardev(void);
169 169
170/**
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};
170 187
171enum kfd_preempt_type { 188enum kfd_preempt_type {
172 KFD_PREEMPT_TYPE_WAVEFRONT, 189 KFD_PREEMPT_TYPE_WAVEFRONT,
@@ -313,6 +330,51 @@ enum KFD_MQD_TYPE {
313 KFD_MQD_TYPE_MAX 330 KFD_MQD_TYPE_MAX
314}; 331};
315 332
333struct 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
316/* Data that is per-process-per device. */ 378/* Data that is per-process-per device. */
317struct kfd_process_device { 379struct kfd_process_device {
318 /* 380 /*
@@ -434,12 +496,23 @@ int kgd2kfd_resume(struct kfd_dev *dev);
434int kfd_init_apertures(struct kfd_process *process); 496int kfd_init_apertures(struct kfd_process *process);
435 497
436/* Queue Context Management */ 498/* Queue Context Management */
499inline uint32_t lower_32(uint64_t x);
500inline uint32_t upper_32(uint64_t x);
501
437int init_queue(struct queue **q, struct queue_properties properties); 502int init_queue(struct queue **q, struct queue_properties properties);
438void uninit_queue(struct queue *q); 503void uninit_queue(struct queue *q);
439void print_queue(struct queue *q); 504void print_queue(struct queue *q);
440 505
506struct kernel_queue *kernel_queue_init(struct kfd_dev *dev,
507 enum kfd_queue_type type);
508void kernel_queue_uninit(struct kernel_queue *kq);
509
441/* Packet Manager */ 510/* Packet Manager */
442 511
512#define KFD_HIQ_TIMEOUT (500)
513
514#define KFD_UNMAP_LATENCY (150)
515
443struct packet_manager { 516struct packet_manager {
444 struct device_queue_manager *dqm; 517 struct device_queue_manager *dqm;
445 struct kernel_queue *priv_queue; 518 struct kernel_queue *priv_queue;
@@ -448,6 +521,8 @@ struct packet_manager {
448 struct kfd_mem_obj *ib_buffer_obj; 521 struct kfd_mem_obj *ib_buffer_obj;
449}; 522};
450 523
524void pm_release_ib(struct packet_manager *pm);
525
451uint64_t kfd_get_number_elems(struct kfd_dev *kfd); 526uint64_t kfd_get_number_elems(struct kfd_dev *kfd);
452phys_addr_t kfd_get_process_doorbells(struct kfd_dev *dev, 527phys_addr_t kfd_get_process_doorbells(struct kfd_dev *dev,
453 struct kfd_process *process); 528 struct kfd_process *process);