summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
diff options
context:
space:
mode:
authorBen Goz2014-07-17 00:04:10 +0200
committerOded Gabbay2014-07-17 00:04:10 +0200
commit45102048f77ef72a57a877efad0f012b917d4df7 (patch)
treebe08a988cacf7bf00ad66693c25cab6321ae48b8 /drivers/gpu/drm/amd/amdkfd/kfd_priv.h
parentamdkfd: Add packet manager module (diff)
downloadkernel-qcow2-linux-45102048f77ef72a57a877efad0f012b917d4df7.tar.gz
kernel-qcow2-linux-45102048f77ef72a57a877efad0f012b917d4df7.tar.xz
kernel-qcow2-linux-45102048f77ef72a57a877efad0f012b917d4df7.zip
amdkfd: Add process queue manager module
The queue scheduler divides into two sections, one section is process bounded and the other section is device bounded. The process bounded section is handled by this module. The PQM handles usermode queue setup, updates and tear-down. v3: Used kernel parameter to limit queues per process instead of define Added use of doorbell address from user v4: Modified pqm_create_queue so that only when creating usermode queues the driver should return the queue properties to the userspace. Added an info message print when no more queues can be opened because of the queue per process limitation v5: Move amdkfd from drm/radeon/ to drm/amd/ 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.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index 219c85a261c3..72b2e27d466a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -387,6 +387,9 @@ struct kfd_process_device {
struct kfd_dev *dev;
+ /* per-process-per device QCM data structure */
+ struct qcm_process_device qpd;
+
/*Apertures*/
uint64_t lds_base;
uint64_t lds_limit;
@@ -432,6 +435,8 @@ struct kfd_process {
*/
struct list_head per_device_data;
+ struct process_queue_manager pqm;
+
/* The process's queues. */
size_t queue_array_size;
@@ -501,12 +506,33 @@ inline uint32_t upper_32(uint64_t x);
int init_queue(struct queue **q, struct queue_properties properties);
void uninit_queue(struct queue *q);
+void print_queue_properties(struct queue_properties *q);
void print_queue(struct queue *q);
struct kernel_queue *kernel_queue_init(struct kfd_dev *dev,
enum kfd_queue_type type);
void kernel_queue_uninit(struct kernel_queue *kq);
+/* Process Queue Manager */
+struct process_queue_node {
+ struct queue *q;
+ struct kernel_queue *kq;
+ struct list_head process_queue_list;
+};
+
+int pqm_init(struct process_queue_manager *pqm, struct kfd_process *p);
+void pqm_uninit(struct process_queue_manager *pqm);
+int pqm_create_queue(struct process_queue_manager *pqm,
+ struct kfd_dev *dev,
+ struct file *f,
+ struct queue_properties *properties,
+ unsigned int flags,
+ enum kfd_queue_type type,
+ unsigned int *qid);
+int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid);
+int pqm_update_queue(struct process_queue_manager *pqm, unsigned int qid,
+ struct queue_properties *p);
+
/* Packet Manager */
#define KFD_HIQ_TIMEOUT (500)