[igt-dev] [PATCH i-g-t 2/2] tests/amdgpu: Fix typo in amd_module_load

Anson Jacob Anson.Jacob at amd.com
Mon Jun 14 15:35:57 UTC 2021


From: Victor Lu <victorchengchi.lu at amd.com>

A typo in amd_module_load was causing the test to fail.
igt_assert_f(err, 0) should have been igt_assert_eq(err, 0),
to check err == 0. Also added drm_fd >= 0 check and made
ioctl query more explicit.

Signed-off-by: Victor Lu <victorchengchi.lu at amd.com>
Acked-by: Anson Jacob <Anson.Jacob at amd.com>
---
 tests/amdgpu/amd_module_load.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/amdgpu/amd_module_load.c b/tests/amdgpu/amd_module_load.c
index e682d2c5..8762b2a2 100644
--- a/tests/amdgpu/amd_module_load.c
+++ b/tests/amdgpu/amd_module_load.c
@@ -41,8 +41,10 @@ sanity_check(void)
 	args.return_pointer = (uintptr_t) &arg_ret;
 	args.return_size = sizeof(int);
 	args.query = AMDGPU_INFO_HW_IP_INFO;
+	args.query_hw_ip.type = AMDGPU_HW_IP_COMPUTE;
 
 	fd = drm_open_driver(DRIVER_AMDGPU);
+	igt_assert_f(fd >= 0, "Module failed to load\n");
 	igt_set_timeout(1, "Module reload timeout!");
 
 	if (ioctl(fd, DRM_IOCTL_AMDGPU_INFO, &args) < 0)
@@ -51,7 +53,7 @@ sanity_check(void)
 	igt_set_timeout(0, NULL);
 	close(fd);
 
-	igt_assert_f(err, 0);
+	igt_assert_eq(err, 0);
 }
 
 igt_main
-- 
2.25.1



More information about the igt-dev mailing list