summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
diff options
context:
space:
mode:
authorBen Goz2014-07-16 23:45:35 +0200
committerOded Gabbay2014-07-16 23:45:35 +0200
commited6e6a3487bd736cbcfc74fe0f9d9220bae00c72 (patch)
treeeab96e9c1d318d70b565a759db72c897ab7b2795 /drivers/gpu/drm/amd/amdkfd/kfd_priv.h
parentamdkfd: Add mqd_manager module (diff)
downloadkernel-qcow2-linux-ed6e6a3487bd736cbcfc74fe0f9d9220bae00c72.tar.gz
kernel-qcow2-linux-ed6e6a3487bd736cbcfc74fe0f9d9220bae00c72.tar.xz
kernel-qcow2-linux-ed6e6a3487bd736cbcfc74fe0f9d9220bae00c72.zip
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 @@
#define KFD_SYSFS_FILE_MODE 0444
+/*
+ * When working with cp scheduler we should assign the HIQ manually or via
+ * the radeon driver to a fixed hqd slot, here are the fixed HIQ hqd slot
+ * definitions for Kaveri. In Kaveri only the first ME queues participates
+ * in the cp scheduling taking that in mind we set the HIQ slot in the
+ * second ME.
+ */
+#define KFD_CIK_HIQ_PIPE 4
+#define KFD_CIK_HIQ_QUEUE 0
+
/* GPU ID hash width in bits */
#define KFD_GPU_ID_HASH_WIDTH 16
@@ -57,6 +67,13 @@ extern int max_num_of_queues_per_process;
#define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS_DEFAULT 128
#define KFD_MAX_NUM_OF_QUEUES_PER_PROCESS 1024
+#define KFD_KERNEL_QUEUE_SIZE 2048
+
+enum cache_policy {
+ cache_policy_coherent,
+ cache_policy_noncoherent
+};
+
struct kfd_device_info {
unsigned int max_pasid_bits;
size_t ih_ring_entry_size;
@@ -88,8 +105,10 @@ struct kfd_dev {
struct kgd2kfd_shared_resources shared_resources;
- bool init_complete;
+ /* QCM Device instance */
+ struct device_queue_manager *dqm;
+ bool init_complete;
};
/* KGD2KFD callbacks */
@@ -384,6 +403,21 @@ int kgd2kfd_resume(struct kfd_dev *dev);
/* amdkfd Apertures */
int kfd_init_apertures(struct kfd_process *process);
+/* Queue Context Management */
+int init_queue(struct queue **q, struct queue_properties properties);
+void uninit_queue(struct queue *q);
+void print_queue(struct queue *q);
+
+/* Packet Manager */
+
+struct packet_manager {
+ struct device_queue_manager *dqm;
+ struct kernel_queue *priv_queue;
+ struct mutex lock;
+ bool allocated;
+ struct kfd_mem_obj *ib_buffer_obj;
+};
+
uint64_t kfd_get_number_elems(struct kfd_dev *kfd);
phys_addr_t kfd_get_process_doorbells(struct kfd_dev *dev,
struct kfd_process *process);