Blob Blame History Raw
From 6ab2c04343b5e00a54ebf68f875a64c6accd4de9 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Fri, 18 Feb 2022 15:55:15 -0500
Subject: drm/amdgpu/benchmark: use dev_info rather than DRM macros for logging
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 091cd9c3abeb68981552557676985eec761d6fe5
Patch-mainline: v5.18-rc1
References: jsc#PED-1166 jsc#PED-1168 jsc#PED-1170 jsc#PED-1218 jsc#PED-1220 jsc#PED-1222 jsc#PED-1223 jsc#PED-1225

So we can tell which output goes to which device when multiple GPUs
are present.  Also while we are here, convert DRM_ERROR to dev_info.
The error cases are not critical.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Patrik Jakobsson <pjakobsson@suse.de>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index 313517f7cf10..b38783278a99 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -56,13 +56,15 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
 }
 
 
-static void amdgpu_benchmark_log_results(int n, unsigned size,
+static void amdgpu_benchmark_log_results(struct amdgpu_device *adev,
+					 int n, unsigned size,
 					 unsigned int time,
 					 unsigned sdomain, unsigned ddomain,
 					 char *kind)
 {
 	unsigned int throughput = (n * (size >> 10)) / time;
-	DRM_INFO("amdgpu: %s %u bo moves of %u kB from"
+
+	dev_info(adev->dev, "amdgpu: %s %u bo moves of %u kB from"
 		 " %d to %d in %u ms, throughput: %u Mb/s or %u MB/s\n",
 		 kind, n, size >> 10, sdomain, ddomain, time,
 		 throughput * 8, throughput);
@@ -131,14 +133,14 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
 		if (time < 0)
 			goto out_cleanup;
 		if (time > 0)
-			amdgpu_benchmark_log_results(n, size, time,
+			amdgpu_benchmark_log_results(adev, n, size, time,
 						     sdomain, ddomain, "dma");
 	}
 
 out_cleanup:
 	/* Check error value now. The value can be overwritten when clean up.*/
 	if (r) {
-		DRM_ERROR("Error while benchmarking BO move.\n");
+		dev_info(adev->dev, "Error while benchmarking BO move.\n");
 	}
 
 	if (sobj) {
@@ -239,6 +241,6 @@ void amdgpu_benchmark(struct amdgpu_device *adev, int test_number)
 		break;
 
 	default:
-		DRM_ERROR("Unknown benchmark\n");
+		dev_info(adev->dev, "Unknown benchmark\n");
 	}
 }
-- 
2.38.1