Skip to contentSkip to conversation

drm/amdkfd: Fix MQD size calculation

PATCH In review Zeng, Oak 3 participants 5 messages Oct 4, 2019 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Zeng, Oak

author
#0 lore raw

PATCH 1/2 drm/amdkfd: Fix MQD size calculation

On device initialization, a trunk of GTT memory is pre-allocated for HIQ and all SDMA queues mqd. The size of this allocation was wrong. The correct sdma engine number should be PCIe-optimized SDMA engine number plus xgmi SDMA engine number.

Change-Id Iecd11ae4f5a314591566772aa2a23e1fe4b94275
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +2 -1
index 16c04f8..e55d021 100644
@@ -1849,7 +1849,8 @@ static int allocate_hiq_sdma_mqd(struct device_queue_manager *dqm)
 	struct kfd_dev *dev = dqm->dev;
 	struct kfd_mem_obj *mem_obj = &dqm->hiq_sdma_mqd;
 	uint32_t size = dqm->mqd_mgrs[KFD_MQD_TYPE_SDMA]->mqd_size *
-		dev->device_info->num_sdma_engines *
+		(dev->device_info->num_sdma_engines +
+		dev->device_info->num_xgmi_sdma_engines)*
 		dev->device_info->num_sdma_queues_per_engine +
 		dqm->mqd_mgrs[KFD_MQD_TYPE_HIQ]->mqd_size;
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1570200515-18992-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 2/2 drm/amdkfd: Print more sdma engine hqds in debug fs

Previously only PCIe-optimized SDMA engine hqds were exposed in debug fs. Print all SDMA engine hqds.

Change-Id I03756fc0fa99169d88e265560f505ed186242b02
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -1
index e55d021..0ebc604 100644
@@ -2416,7 +2416,7 @@ int dqm_debugfs_hqds(struct seq_file *m, void *data)
 		}
 	}
 
-	for (pipe = 0; pipe < get_num_sdma_engines(dqm); pipe++) {
+	for (pipe = 0; pipe < get_num_sdma_engines(dqm) + get_num_xgmi_sdma_engines(dqm); pipe++) {
 		for (queue = 0;
 		     queue < dqm->dev->device_info->num_sdma_queues_per_engine;
 		     queue++) {
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1570200515-18992-2-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org

Reviewed-by Felix Kuehling
#4 lore raw

Re: [PATCH 2/2] drm/amdkfd: Print more sdma engine hqds in debug fs

Quoted 7 lines · Oak

Previously only PCIe-optimized SDMA engine hqds were exposed in debug fs. Print all SDMA engine hqds.

Change-Id I03756fc0fa99169d88e265560f505ed186242b02

Minor cosmetic nit-pick inline that checkpatch.pl would probably warn about. With that fixed, this patch is

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0 -0
index e55d021..0ebc604 100644

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c int dqm_debugfs_hqds(struct seq_file *m, void *data) · line 2419

Quoted 5 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -1
@@ -2416,7 +2416,7 @@ int dqm_debugfs_hqds(struct seq_file *m, void *data)
  		}
  	}
 
-	for (pipe = 0; pipe < get_num_sdma_engines(dqm); pipe++) {
+	for (pipe = 0; pipe < get_num_sdma_engines(dqm) + get_num_xgmi_sdma_engines(dqm); pipe++) {

This line looks longer than 80 characters. Try to find a good place to break it.

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c int dqm_debugfs_hqds(struct seq_file *m, void *data) · line 2422

Quoted 3 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0 -0
  		for (queue = 0;
  		     queue < dqm->dev->device_info->num_sdma_queues_per_engine;
  		     queue++) {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Felix Kuehling
#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · Oak

On device initialization, a trunk of GTT memory is pre-allocated for HIQ and all SDMA queues mqd. The size of this allocation was wrong. The correct sdma engine number should be PCIe-optimized SDMA engine number plus xgmi SDMA engine number.

Change-Id Iecd11ae4f5a314591566772aa2a23e1fe4b94275

Minor cosmetic nit-pick inline that checkpatch.pl would probably warn about. With that fixed, this patch is

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0 -0
index 16c04f8..e55d021 100644

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static int allocate_hiq_sdma_mqd(struct device_queue_manager *dqm) · line 1853

Quoted 6 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +2 -1
@@ -1849,7 +1849,8 @@ static int allocate_hiq_sdma_mqd(struct device_queue_manager *dqm)
  	struct kfd_dev *dev = dqm->dev;
  	struct kfd_mem_obj *mem_obj = &dqm->hiq_sdma_mqd;
  	uint32_t size = dqm->mqd_mgrs[KFD_MQD_TYPE_SDMA]->mqd_size *
-		dev->device_info->num_sdma_engines *
+		(dev->device_info->num_sdma_engines +
+		dev->device_info->num_xgmi_sdma_engines)*

There should be a space between ) and *.

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static int allocate_hiq_sdma_mqd(struct device_queue_manager *dqm) · line 1856

Quoted 3 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0 -0
  		dev->device_info->num_sdma_queues_per_engine +
  		dqm->mqd_mgrs[KFD_MQD_TYPE_HIQ]->mqd_size;
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#6 lore raw
In reply to a message not in the archive
Quoted 2 lines · Oak

On device initialization, a trunk of GTT memory is pre-allocated for

typo: trunk -> chunk

Alex

Quoted 29 lines

HIQ and all SDMA queues mqd. The size of this allocation was wrong. The correct sdma engine number should be PCIe-optimized SDMA engine number plus xgmi SDMA engine number.

Change-Id Iecd11ae4f5a314591566772aa2a23e1fe4b94275
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +2 -2
index 16c04f8..e55d021 100644
@@ -1849,7 +1849,8 @@ static int allocate_hiq_sdma_mqd(struct device_queue_manager *dqm)
        struct kfd_dev *dev = dqm->dev;
        struct kfd_mem_obj *mem_obj = &dqm->hiq_sdma_mqd;
        uint32_t size = dqm->mqd_mgrs[KFD_MQD_TYPE_SDMA]->mqd_size *
-               dev->device_info->num_sdma_engines *
+               (dev->device_info->num_sdma_engines +
+               dev->device_info->num_xgmi_sdma_engines)*
                dev->device_info->num_sdma_queues_per_engine +
                dqm->mqd_mgrs[KFD_MQD_TYPE_HIQ]->mqd_size;
 
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx