Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jasber Chen <yipeng.chen@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: "Jasber Chen" <yipeng.chen@amd.com>,
	"Jasber Chen" <yipeng.chen@amd.corp-partner.google.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: [igt-dev] tests/amdgpu: skips query-timestamp-while-idle test on raven/raven2
Date: Tue, 20 Jun 2023 14:44:53 +0800	[thread overview]
Message-ID: <20230620064453.1600743-1-yipeng.chen@amd.com> (raw)
In-Reply-To: <20230619025836.1514883-1-yipeng.chen@amd.com>

From: Jasber Chen <yipeng.chen@amd.corp-partner.google.com>

tests/amdgpu: skips query-timestamp-while-idle test on raven/raven2.
The RLC counter used for GPU clocks can not keep counting in auto level dpm.
Querying GPU clocks can not work as expected when GPU is idling.

Signed-off-by: Jasber Chen <yipeng.chen@amd.com>
Reviewed by: Vitaly Prosyak <vitaly.prosyak@amd.com>
---
 tests/amdgpu/amd_info.c | 47 ++++++++++++++++++-----------------------
 1 file changed, 20 insertions(+), 27 deletions(-)

diff --git a/tests/amdgpu/amd_info.c b/tests/amdgpu/amd_info.c
index d6aea827..9c063429 100644
--- a/tests/amdgpu/amd_info.c
+++ b/tests/amdgpu/amd_info.c
@@ -1,24 +1,8 @@
 /*
+ * SPDX-License-Identifier: MIT
+ * Copyright 2023 Advanced Micro Devices, Inc.
  * Copyright 2014 Advanced Micro Devices, Inc.
  * Copyright 2021 Valve Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "config.h"
@@ -27,10 +11,10 @@
 
 #include <amdgpu.h>
 #include <amdgpu_drm.h>
+#include "lib/amdgpu/amdgpu_asic_addr.h"
 
-static amdgpu_device_handle dev;
 
-static void query_firmware_version_test(void)
+static void query_firmware_version_test(amdgpu_device_handle dev)
 {
 	struct amdgpu_gpu_info gpu_info = {};
 	uint32_t version, feature;
@@ -43,7 +27,7 @@ static void query_firmware_version_test(void)
 		     "Failed to query the firmware version\n");
 }
 
-static void query_timestamp_test(uint32_t sleep_time, int sample_count)
+static void query_timestamp_test(amdgpu_device_handle dev, uint32_t sleep_time, int sample_count)
 {
 	struct amdgpu_gpu_info gpu_info = {};
 	double median, std_err, err_95_conf;
@@ -123,7 +107,10 @@ IGT_TEST_DESCRIPTION("Test the consistency of the data provided through the "
 		     "DRM_AMDGPU_INFO IOCTL");
 igt_main
 {
+	amdgpu_device_handle device;
+	struct amdgpu_gpu_info gpu_info = {0};
 	int fd = -1;
+	int r = -1;
 
 	igt_fixture {
 		uint32_t major, minor;
@@ -131,29 +118,35 @@ igt_main
 
 		fd = drm_open_driver(DRIVER_AMDGPU);
 
-		err = amdgpu_device_initialize(fd, &major, &minor, &dev);
+		err = amdgpu_device_initialize(fd, &major, &minor, &device);
 		igt_require(err == 0);
 
 		igt_info("Initialized amdgpu, driver version %d.%d\n",
 			 major, minor);
+
+		r = amdgpu_query_gpu_info(device, &gpu_info);
+		igt_assert_eq(r, 0);
 	}
 
 	igt_describe("Make sure we can retrieve the firmware version");
 	igt_subtest("query-firmware-version")
-		query_firmware_version_test();
+		query_firmware_version_test(device);
 
 	igt_describe("Check that the GPU time ticks constantly, and at the "
 		     "same rate as the CPU");
 	igt_subtest("query-timestamp")
-		query_timestamp_test(10000, 100);
+		query_timestamp_test(device, 10000, 100);
 
 	igt_describe("Check that the GPU time keeps on ticking, even during "
 		     "long idle times which could lead to clock/power gating");
-	igt_subtest("query-timestamp-while-idle")
-		query_timestamp_test(7000000, 1);
+	igt_subtest("query-timestamp-while-idle") {
+		igt_skip_on(ASICREV_IS_RAVEN(gpu_info.chip_external_rev) ||
+			    ASICREV_IS_RAVEN2(gpu_info.chip_external_rev));
+		query_timestamp_test(device, 7000000, 1);
+	}
 
 	igt_fixture {
-		amdgpu_device_deinitialize(dev);
+		amdgpu_device_deinitialize(device);
 		close(fd);
 	}
 }
-- 
2.39.2

  parent reply	other threads:[~2023-06-20  6:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19  2:58 [igt-dev] tests/amdgpu: skips query-timestamp-while-idle test on raven/raven2 Jasber Chen
2023-06-19 18:25 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-06-20  2:20 ` [igt-dev] " Jasber Chen
2023-06-20  6:00   ` Christian König
2023-06-20  4:46 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
2023-06-20  5:41 ` [igt-dev] [PATCH] Subject: " Jasber Chen
2023-06-20  5:52 ` [igt-dev] " Jasber Chen
2023-06-20  6:44 ` Jasber Chen [this message]
2023-06-20  7:11   ` Christian König
2023-06-20  9:43 ` Jasber Chen
2023-06-20 13:46 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/amdgpu: skips query-timestamp-while-idle test on raven/raven2 (rev6) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230620064453.1600743-1-yipeng.chen@amd.com \
    --to=yipeng.chen@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=yipeng.chen@amd.corp-partner.google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox