[PATCH] drm/amdkfd: Disable Packet Manager in non HWS mode except Hawaii

Zhao, Yong Yong.Zhao at amd.com
Wed Apr 17 20:54:05 UTC 2019


The packet manager is only needed for HWS mode, as well as Hawaii in non
HWS mode. So only initialize it under those scenarios. This is useful
especially for emulation environment when things are slow.

Change-Id: Iedfa07c94241e3252463e1e5ea537543c2ccef03
Signed-off-by: Yong Zhao <Yong.Zhao at amd.com>
---
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 1d6b15788ebf..ec83914d9867 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -911,13 +911,22 @@ static void uninitialize(struct device_queue_manager *dqm)
 
 static int start_nocpsch(struct device_queue_manager *dqm)
 {
+	int ret = 0;
 	init_interrupts(dqm);
-	return pm_init(&dqm->packets, dqm);
+	/* Cache flushing on Hawaii in non HWS mode is done through packet
+	 * manager (PM), so we need to initialize PM for Hawaii.
+	 */
+	if (dqm->dev->device_info->asic_family == CHIP_HAWAII)
+		ret = pm_init(&dqm->packets, dqm);
+
+	return ret;
 }
 
 static int stop_nocpsch(struct device_queue_manager *dqm)
 {
-	pm_uninit(&dqm->packets);
+	if (dqm->dev->device_info->asic_family == CHIP_HAWAII)
+		pm_uninit(&dqm->packets);
+
 	return 0;
 }
 
-- 
2.17.1



More information about the amd-gfx mailing list