drm/amdkfd: Introduce DIQ type mqd manager
authorOak Zeng <ozeng@amd.com>
Tue, 4 Dec 2018 02:38:43 +0000 (20:38 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:21:02 +0000 (12:21 -0500)
With introduction of new mqd allocation scheme for HIQ,
DIQ and HIQ use different mqd allocation scheme, DIQ
can't reuse HIQ mqd manager

Signed-off-by: Oak Zeng <ozeng@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

index f1596881f20a473384b6d9f01684e5d1a71bec3a..58bb3ad233a11d2984036200c08a93e360977e60 100644 (file)
@@ -58,6 +58,9 @@ static bool initialize(struct kernel_queue *kq, struct kfd_dev *dev,
        kq->nop_packet = nop.u32all;
        switch (type) {
        case KFD_QUEUE_TYPE_DIQ:
+               kq->mqd_mgr = dev->dqm->ops.get_mqd_manager(dev->dqm,
+                                               KFD_MQD_TYPE_DIQ);
+               break;
        case KFD_QUEUE_TYPE_HIQ:
                kq->mqd_mgr = dev->dqm->ops.get_mqd_manager(dev->dqm,
                                                KFD_MQD_TYPE_HIQ);
index ae90a99909efeced0641a2283863bc679e03555e..e69bb4d3c3a967c13637f1d37a462a605cc9a1e6 100644 (file)
@@ -413,6 +413,17 @@ struct mqd_manager *mqd_manager_init_cik(enum KFD_MQD_TYPE type,
                mqd->is_occupied = is_occupied;
 #if defined(CONFIG_DEBUG_FS)
                mqd->debugfs_show_mqd = debugfs_show_mqd;
+#endif
+               break;
+       case KFD_MQD_TYPE_DIQ:
+               mqd->init_mqd = init_mqd_hiq;
+               mqd->uninit_mqd = uninit_mqd;
+               mqd->load_mqd = load_mqd;
+               mqd->update_mqd = update_mqd_hiq;
+               mqd->destroy_mqd = destroy_mqd;
+               mqd->is_occupied = is_occupied;
+#if defined(CONFIG_DEBUG_FS)
+               mqd->debugfs_show_mqd = debugfs_show_mqd;
 #endif
                break;
        case KFD_MQD_TYPE_SDMA:
index 9dbba609450e73a7e2c4702bc7c3d59c1274cf01..75866b4d57265fced332ae52b910481ce10cbc62 100644 (file)
@@ -472,6 +472,17 @@ struct mqd_manager *mqd_manager_init_v9(enum KFD_MQD_TYPE type,
                mqd->is_occupied = is_occupied;
 #if defined(CONFIG_DEBUG_FS)
                mqd->debugfs_show_mqd = debugfs_show_mqd;
+#endif
+               break;
+       case KFD_MQD_TYPE_DIQ:
+               mqd->init_mqd = init_mqd_hiq;
+               mqd->uninit_mqd = uninit_mqd;
+               mqd->load_mqd = load_mqd;
+               mqd->update_mqd = update_mqd_hiq;
+               mqd->destroy_mqd = destroy_mqd;
+               mqd->is_occupied = is_occupied;
+#if defined(CONFIG_DEBUG_FS)
+               mqd->debugfs_show_mqd = debugfs_show_mqd;
 #endif
                break;
        case KFD_MQD_TYPE_SDMA:
index 7f1cff3de4ebdd1e4de4fa3265ad42278b468696..15d2aafff16df75035899d3567d4cb0ff9932d77 100644 (file)
@@ -472,6 +472,17 @@ struct mqd_manager *mqd_manager_init_vi(enum KFD_MQD_TYPE type,
                mqd->is_occupied = is_occupied;
 #if defined(CONFIG_DEBUG_FS)
                mqd->debugfs_show_mqd = debugfs_show_mqd;
+#endif
+               break;
+       case KFD_MQD_TYPE_DIQ:
+               mqd->init_mqd = init_mqd_hiq;
+               mqd->uninit_mqd = uninit_mqd;
+               mqd->load_mqd = load_mqd;
+               mqd->update_mqd = update_mqd_hiq;
+               mqd->destroy_mqd = destroy_mqd;
+               mqd->is_occupied = is_occupied;
+#if defined(CONFIG_DEBUG_FS)
+               mqd->debugfs_show_mqd = debugfs_show_mqd;
 #endif
                break;
        case KFD_MQD_TYPE_SDMA:
index 2aebcc8219d1b4dc6de5bd61604372b964e0efca..10bd1abe16465b49bfefa5f877eeb76c9fbfb31f 100644 (file)
@@ -475,6 +475,7 @@ enum KFD_MQD_TYPE {
        KFD_MQD_TYPE_HIQ,               /* for hiq */
        KFD_MQD_TYPE_CP,                /* for cp queues and diq */
        KFD_MQD_TYPE_SDMA,              /* for sdma queues */
+       KFD_MQD_TYPE_DIQ,               /* for diq */
        KFD_MQD_TYPE_MAX
 };
 
index fcaaf93681ac7f50c50c8c901ed3205e7c6e8b06..7671658ef1f162cc16e43e2a1df96d36850060b5 100644 (file)
@@ -470,7 +470,6 @@ int pqm_debugfs_mqds(struct seq_file *m, void *data)
                        case KFD_QUEUE_TYPE_DIQ:
                                seq_printf(m, "  DIQ on device %x\n",
                                           pqn->kq->dev->id);
-                               mqd_type = KFD_MQD_TYPE_HIQ;
                                break;
                        default:
                                seq_printf(m,