Commit 8d5f3552 authored by Yong Zhao's avatar Yong Zhao Committed by Oded Gabbay

drm/amdkfd: Replace mqd with mqd_mgr as the variable name for mqd_manager

This will make reading code much easier.
Signed-off-by: default avatarYong Zhao <yong.zhao@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent 2b281977
...@@ -172,7 +172,7 @@ struct device_queue_manager { ...@@ -172,7 +172,7 @@ struct device_queue_manager {
struct device_queue_manager_ops ops; struct device_queue_manager_ops ops;
struct device_queue_manager_asic_ops asic_ops; struct device_queue_manager_asic_ops asic_ops;
struct mqd_manager *mqds[KFD_MQD_TYPE_MAX]; struct mqd_manager *mqd_mgrs[KFD_MQD_TYPE_MAX];
struct packet_manager packets; struct packet_manager packets;
struct kfd_dev *dev; struct kfd_dev *dev;
struct mutex lock_hidden; /* use dqm_lock/unlock(dqm) */ struct mutex lock_hidden; /* use dqm_lock/unlock(dqm) */
......
...@@ -59,7 +59,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev, ...@@ -59,7 +59,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
switch (type) { switch (type) {
case KFD_QUEUE_TYPE_DIQ: case KFD_QUEUE_TYPE_DIQ:
case KFD_QUEUE_TYPE_HIQ: case KFD_QUEUE_TYPE_HIQ:
kq->mqd = dev->dqm->ops.get_mqd_manager(dev->dqm, kq->mqd_mgr = dev->dqm->ops.get_mqd_manager(dev->dqm,
KFD_MQD_TYPE_HIQ); KFD_MQD_TYPE_HIQ);
break; break;
default: default:
...@@ -67,7 +67,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev, ...@@ -67,7 +67,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
return false; return false;
} }
if (!kq->mqd) if (!kq->mqd_mgr)
return false; return false;
prop.doorbell_ptr = kfd_get_kernel_doorbell(dev, &prop.doorbell_off); prop.doorbell_ptr = kfd_get_kernel_doorbell(dev, &prop.doorbell_off);
...@@ -130,7 +130,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev, ...@@ -130,7 +130,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
kq->queue->device = dev; kq->queue->device = dev;
kq->queue->process = kfd_get_process(current); kq->queue->process = kfd_get_process(current);
retval = kq->mqd->init_mqd(kq->mqd, &kq->queue->mqd, retval = kq->mqd_mgr->init_mqd(kq->mqd_mgr, &kq->queue->mqd,
&kq->queue->mqd_mem_obj, &kq->queue->mqd_mem_obj,
&kq->queue->gart_mqd_addr, &kq->queue->gart_mqd_addr,
&kq->queue->properties); &kq->queue->properties);
...@@ -142,9 +142,9 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev, ...@@ -142,9 +142,9 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
pr_debug("Assigning hiq to hqd\n"); pr_debug("Assigning hiq to hqd\n");
kq->queue->pipe = KFD_CIK_HIQ_PIPE; kq->queue->pipe = KFD_CIK_HIQ_PIPE;
kq->queue->queue = KFD_CIK_HIQ_QUEUE; kq->queue->queue = KFD_CIK_HIQ_QUEUE;
kq->mqd->load_mqd(kq->mqd, kq->queue->mqd, kq->queue->pipe, kq->mqd_mgr->load_mqd(kq->mqd_mgr, kq->queue->mqd,
kq->queue->queue, &kq->queue->properties, kq->queue->pipe, kq->queue->queue,
NULL); &kq->queue->properties, NULL);
} else { } else {
/* allocate fence for DIQ */ /* allocate fence for DIQ */
...@@ -182,7 +182,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev, ...@@ -182,7 +182,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
static void uninitialize(struct kernel_queue *kq) static void uninitialize(struct kernel_queue *kq)
{ {
if (kq->queue->properties.type == KFD_QUEUE_TYPE_HIQ) if (kq->queue->properties.type == KFD_QUEUE_TYPE_HIQ)
kq->mqd->destroy_mqd(kq->mqd, kq->mqd_mgr->destroy_mqd(kq->mqd_mgr,
kq->queue->mqd, kq->queue->mqd,
KFD_PREEMPT_TYPE_WAVEFRONT_RESET, KFD_PREEMPT_TYPE_WAVEFRONT_RESET,
KFD_UNMAP_LATENCY_MS, KFD_UNMAP_LATENCY_MS,
...@@ -191,7 +191,8 @@ static void uninitialize(struct kernel_queue *kq) ...@@ -191,7 +191,8 @@ static void uninitialize(struct kernel_queue *kq)
else if (kq->queue->properties.type == KFD_QUEUE_TYPE_DIQ) else if (kq->queue->properties.type == KFD_QUEUE_TYPE_DIQ)
kfd_gtt_sa_free(kq->dev, kq->fence_mem_obj); kfd_gtt_sa_free(kq->dev, kq->fence_mem_obj);
kq->mqd->uninit_mqd(kq->mqd, kq->queue->mqd, kq->queue->mqd_mem_obj); kq->mqd_mgr->uninit_mqd(kq->mqd_mgr, kq->queue->mqd,
kq->queue->mqd_mem_obj);
kfd_gtt_sa_free(kq->dev, kq->rptr_mem); kfd_gtt_sa_free(kq->dev, kq->rptr_mem);
kfd_gtt_sa_free(kq->dev, kq->wptr_mem); kfd_gtt_sa_free(kq->dev, kq->wptr_mem);
......
...@@ -70,7 +70,7 @@ struct kernel_queue { ...@@ -70,7 +70,7 @@ struct kernel_queue {
/* data */ /* data */
struct kfd_dev *dev; struct kfd_dev *dev;
struct mqd_manager *mqd; struct mqd_manager *mqd_mgr;
struct queue *queue; struct queue *queue;
uint64_t pending_wptr64; uint64_t pending_wptr64;
uint32_t pending_wptr; uint32_t pending_wptr;
......
...@@ -387,7 +387,7 @@ int pqm_debugfs_mqds(struct seq_file *m, void *data) ...@@ -387,7 +387,7 @@ int pqm_debugfs_mqds(struct seq_file *m, void *data)
struct process_queue_node *pqn; struct process_queue_node *pqn;
struct queue *q; struct queue *q;
enum KFD_MQD_TYPE mqd_type; enum KFD_MQD_TYPE mqd_type;
struct mqd_manager *mqd_manager; struct mqd_manager *mqd_mgr;
int r = 0; int r = 0;
list_for_each_entry(pqn, &pqm->queues, process_queue_list) { list_for_each_entry(pqn, &pqm->queues, process_queue_list) {
...@@ -410,11 +410,11 @@ int pqm_debugfs_mqds(struct seq_file *m, void *data) ...@@ -410,11 +410,11 @@ int pqm_debugfs_mqds(struct seq_file *m, void *data)
q->properties.type, q->device->id); q->properties.type, q->device->id);
continue; continue;
} }
mqd_manager = q->device->dqm->ops.get_mqd_manager( mqd_mgr = q->device->dqm->ops.get_mqd_manager(
q->device->dqm, mqd_type); q->device->dqm, mqd_type);
} else if (pqn->kq) { } else if (pqn->kq) {
q = pqn->kq->queue; q = pqn->kq->queue;
mqd_manager = pqn->kq->mqd; mqd_mgr = pqn->kq->mqd_mgr;
switch (q->properties.type) { switch (q->properties.type) {
case KFD_QUEUE_TYPE_DIQ: case KFD_QUEUE_TYPE_DIQ:
seq_printf(m, " DIQ on device %x\n", seq_printf(m, " DIQ on device %x\n",
...@@ -434,7 +434,7 @@ int pqm_debugfs_mqds(struct seq_file *m, void *data) ...@@ -434,7 +434,7 @@ int pqm_debugfs_mqds(struct seq_file *m, void *data)
continue; continue;
} }
r = mqd_manager->debugfs_show_mqd(m, q->mqd); r = mqd_mgr->debugfs_show_mqd(m, q->mqd);
if (r != 0) if (r != 0)
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment