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:45:35 -0400
committerOded Gabbay <oded.gabbay@amd.com>2014-07-16 17:45:35 -0400
commited6e6a3487bd736cbcfc74fe0f9d9220bae00c72 (patch)
treeeab96e9c1d318d70b565a759db72c897ab7b2795 /drivers/gpu/drm/amd/amdkfd/kfd_priv.h
parent6e99df5741b3332dcceb86915b2818af640c51f9 (diff)
amdkfd: Add kernel queue module
The kernel queue module enables the amdkfd to establish kernel queues, not exposed to user space. The kernel queues are used for HIQ (HSA Interface Queue) and DIQ (Debug Interface Queue) operations v3: Removed use of internal typedefs and added use of the new gart allocation functions v4: Fixed a miscalculation in kernel queue wrapping 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 Add define for kernel queue size Various fixes 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.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index 0eb20322f374..bba3c2ada261 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -35,6 +35,16 @@
35 35
36#define KFD_SYSFS_FILE_MODE 0444 36#define KFD_SYSFS_FILE_MODE 0444
37 37
38/*
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
38/* GPU ID hash width in bits */ 48/* GPU ID hash width in bits */
39#define KFD_GPU_ID_HASH_WIDTH 16 49#define KFD_GPU_ID_HASH_WIDTH 16
40 50
@@ -57,6 +67,13 @@ extern int max_num_of_queues_per_process;
57#define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS_DEFAULT 128 67#define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS_DEFAULT 128
58#define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS 1024 68#define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS 1024
59 69
70#define KFD_KERNEL_QUEUE_SIZE 2048
71
72enum cache_policy {
73 cache_policy_coherent,
74 cache_policy_noncoherent
75};
76
60struct kfd_device_info { 77struct kfd_device_info {
61 unsigned int max_pasid_bits; 78 unsigned int max_pasid_bits;
62 size_t ih_ring_entry_size; 79 size_t ih_ring_entry_size;
@@ -88,8 +105,10 @@ struct kfd_dev {
88 105
89 struct kgd2kfd_shared_resources shared_resources; 106 struct kgd2kfd_shared_resources shared_resources;
90 107
91 bool init_complete; 108 /* QCM Device instance */
109 struct device_queue_manager *dqm;
92 110
111 bool init_complete;
93}; 112};
94 113
95/* KGD2KFD callbacks */ 114/* KGD2KFD callbacks */
@@ -384,6 +403,21 @@ int kgd2kfd_resume(struct kfd_dev *dev);
384/* amdkfd Apertures */ 403/* amdkfd Apertures */
385int kfd_init_apertures(struct kfd_process *process); 404int kfd_init_apertures(struct kfd_process *process);
386 405
406/* Queue Context Management */
407int init_queue(struct queue **q, struct queue_properties properties);
408void uninit_queue(struct queue *q);
409void print_queue(struct queue *q);
410
411/* Packet Manager */
412
413struct packet_manager {
414 struct device_queue_manager *dqm;
415 struct kernel_queue *priv_queue;
416 struct mutex lock;
417 bool allocated;
418 struct kfd_mem_obj *ib_buffer_obj;
419};
420
387uint64_t kfd_get_number_elems(struct kfd_dev *kfd); 421uint64_t kfd_get_number_elems(struct kfd_dev *kfd);
388phys_addr_t kfd_get_process_doorbells(struct kfd_dev *dev, 422phys_addr_t kfd_get_process_doorbells(struct kfd_dev *dev,
389 struct kfd_process *process); 423 struct kfd_process *process);