Commit 85d258f9 authored by Ben Goz's avatar Ben Goz Committed by Oded Gabbay

drm/amdkfd: Make KFD_MQD_TYPE enum types H/W agnostic

As the MQD types are common across all AMD GPUs/APUs, let's remove the CIK part
from the name.
Signed-off-by: default avatarBen Goz <ben.goz@amd.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ff3d04a1
...@@ -57,8 +57,8 @@ static inline ...@@ -57,8 +57,8 @@ static inline
enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type) enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type)
{ {
if (type == KFD_QUEUE_TYPE_SDMA) if (type == KFD_QUEUE_TYPE_SDMA)
return KFD_MQD_TYPE_CIK_SDMA; return KFD_MQD_TYPE_SDMA;
return KFD_MQD_TYPE_CIK_CP; return KFD_MQD_TYPE_CP;
} }
static inline unsigned int get_pipes_num(struct device_queue_manager *dqm) static inline unsigned int get_pipes_num(struct device_queue_manager *dqm)
...@@ -271,7 +271,7 @@ static int create_compute_queue_nocpsch(struct device_queue_manager *dqm, ...@@ -271,7 +271,7 @@ static int create_compute_queue_nocpsch(struct device_queue_manager *dqm,
BUG_ON(!dqm || !q || !qpd); BUG_ON(!dqm || !q || !qpd);
mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_CIK_COMPUTE); mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_COMPUTE);
if (mqd == NULL) if (mqd == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -302,13 +302,13 @@ static int destroy_queue_nocpsch(struct device_queue_manager *dqm, ...@@ -302,13 +302,13 @@ static int destroy_queue_nocpsch(struct device_queue_manager *dqm,
pr_debug("kfd: In Func %s\n", __func__); pr_debug("kfd: In Func %s\n", __func__);
mutex_lock(&dqm->lock); mutex_lock(&dqm->lock);
mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_CIK_COMPUTE); mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_COMPUTE);
if (mqd == NULL) { if (mqd == NULL) {
retval = -ENOMEM; retval = -ENOMEM;
goto out; goto out;
} }
mqd_sdma = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_CIK_SDMA); mqd_sdma = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_SDMA);
if (mqd_sdma == NULL) { if (mqd_sdma == NULL) {
mutex_unlock(&dqm->lock); mutex_unlock(&dqm->lock);
return -ENOMEM; return -ENOMEM;
...@@ -515,7 +515,7 @@ static int init_pipelines(struct device_queue_manager *dqm, ...@@ -515,7 +515,7 @@ static int init_pipelines(struct device_queue_manager *dqm,
memset(hpdptr, 0, CIK_HPD_EOP_BYTES * pipes_num); memset(hpdptr, 0, CIK_HPD_EOP_BYTES * pipes_num);
mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_CIK_COMPUTE); mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_COMPUTE);
if (mqd == NULL) { if (mqd == NULL) {
kfd_gtt_sa_free(dqm->dev, dqm->pipeline_mem); kfd_gtt_sa_free(dqm->dev, dqm->pipeline_mem);
return -ENOMEM; return -ENOMEM;
...@@ -646,7 +646,7 @@ static int create_sdma_queue_nocpsch(struct device_queue_manager *dqm, ...@@ -646,7 +646,7 @@ static int create_sdma_queue_nocpsch(struct device_queue_manager *dqm,
struct mqd_manager *mqd; struct mqd_manager *mqd;
int retval; int retval;
mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_CIK_SDMA); mqd = dqm->get_mqd_manager(dqm, KFD_MQD_TYPE_SDMA);
if (!mqd) if (!mqd)
return -ENOMEM; return -ENOMEM;
......
...@@ -57,7 +57,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev, ...@@ -57,7 +57,7 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
case KFD_QUEUE_TYPE_DIQ: case KFD_QUEUE_TYPE_DIQ:
case KFD_QUEUE_TYPE_HIQ: case KFD_QUEUE_TYPE_HIQ:
kq->mqd = dev->dqm->get_mqd_manager(dev->dqm, kq->mqd = dev->dqm->get_mqd_manager(dev->dqm,
KFD_MQD_TYPE_CIK_HIQ); KFD_MQD_TYPE_HIQ);
break; break;
default: default:
BUG(); BUG();
......
...@@ -423,8 +423,8 @@ struct mqd_manager *mqd_manager_init(enum KFD_MQD_TYPE type, ...@@ -423,8 +423,8 @@ struct mqd_manager *mqd_manager_init(enum KFD_MQD_TYPE type,
mqd->dev = dev; mqd->dev = dev;
switch (type) { switch (type) {
case KFD_MQD_TYPE_CIK_CP: case KFD_MQD_TYPE_CP:
case KFD_MQD_TYPE_CIK_COMPUTE: case KFD_MQD_TYPE_COMPUTE:
mqd->init_mqd = init_mqd; mqd->init_mqd = init_mqd;
mqd->uninit_mqd = uninit_mqd; mqd->uninit_mqd = uninit_mqd;
mqd->load_mqd = load_mqd; mqd->load_mqd = load_mqd;
...@@ -432,7 +432,7 @@ struct mqd_manager *mqd_manager_init(enum KFD_MQD_TYPE type, ...@@ -432,7 +432,7 @@ struct mqd_manager *mqd_manager_init(enum KFD_MQD_TYPE type,
mqd->destroy_mqd = destroy_mqd; mqd->destroy_mqd = destroy_mqd;
mqd->is_occupied = is_occupied; mqd->is_occupied = is_occupied;
break; break;
case KFD_MQD_TYPE_CIK_HIQ: case KFD_MQD_TYPE_HIQ:
mqd->init_mqd = init_mqd_hiq; mqd->init_mqd = init_mqd_hiq;
mqd->uninit_mqd = uninit_mqd; mqd->uninit_mqd = uninit_mqd;
mqd->load_mqd = load_mqd; mqd->load_mqd = load_mqd;
...@@ -440,7 +440,7 @@ struct mqd_manager *mqd_manager_init(enum KFD_MQD_TYPE type, ...@@ -440,7 +440,7 @@ struct mqd_manager *mqd_manager_init(enum KFD_MQD_TYPE type,
mqd->destroy_mqd = destroy_mqd; mqd->destroy_mqd = destroy_mqd;
mqd->is_occupied = is_occupied; mqd->is_occupied = is_occupied;
break; break;
case KFD_MQD_TYPE_CIK_SDMA: case KFD_MQD_TYPE_SDMA:
mqd->init_mqd = init_mqd_sdma; mqd->init_mqd = init_mqd_sdma;
mqd->uninit_mqd = uninit_mqd_sdma; mqd->uninit_mqd = uninit_mqd_sdma;
mqd->load_mqd = load_mqd_sdma; mqd->load_mqd = load_mqd_sdma;
......
...@@ -356,10 +356,10 @@ struct queue { ...@@ -356,10 +356,10 @@ struct queue {
* Please read the kfd_mqd_manager.h description. * Please read the kfd_mqd_manager.h description.
*/ */
enum KFD_MQD_TYPE { enum KFD_MQD_TYPE {
KFD_MQD_TYPE_CIK_COMPUTE = 0, /* for no cp scheduling */ KFD_MQD_TYPE_COMPUTE = 0, /* for no cp scheduling */
KFD_MQD_TYPE_CIK_HIQ, /* for hiq */ KFD_MQD_TYPE_HIQ, /* for hiq */
KFD_MQD_TYPE_CIK_CP, /* for cp queues and diq */ KFD_MQD_TYPE_CP, /* for cp queues and diq */
KFD_MQD_TYPE_CIK_SDMA, /* for sdma queues */ KFD_MQD_TYPE_SDMA, /* for sdma queues */
KFD_MQD_TYPE_MAX KFD_MQD_TYPE_MAX
}; };
......
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