Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] lib/amdgpu: allow usage convenient chip info
@ 2024-06-22 22:52 vitaly.prosyak
  2024-06-22 22:52 ` [PATCH 2/2] tests/amdgpu/gang_cs: skip test for some chips vitaly.prosyak
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: vitaly.prosyak @ 2024-06-22 22:52 UTC (permalink / raw)
  To: igt-dev
  Cc: Vitaly Prosyak, Alex Deucher, Christian Koenig, Kamil Konieczny,
	Jesse Zhang

From: Vitaly Prosyak <vitaly.prosyak@amd.com>

Make the struct chip_info accessible for use within the test.
The structure will be accessed through a constant pointer,
ensuring that no modifications to its fields are allowed.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
---
 lib/amdgpu/amd_ip_blocks.c | 10 ++--------
 lib/amdgpu/amd_ip_blocks.h | 10 +++++++++-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/lib/amdgpu/amd_ip_blocks.c b/lib/amdgpu/amd_ip_blocks.c
index 2ee94105c..19e2838f5 100644
--- a/lib/amdgpu/amd_ip_blocks.c
+++ b/lib/amdgpu/amd_ip_blocks.c
@@ -16,7 +16,6 @@
 
 #include <amdgpu_drm.h>
 #include "amdgpu_asic_addr.h"
-#include "amd_family.h"
 #include "amd_gfx_v8_0.h"
 #include "ioctl_wrappers.h"
 
@@ -412,15 +411,9 @@ struct amdgpu_ip_block_version sdma_v3_x_ip_block = {
 	.funcs = &sdma_v3_x_ip_funcs
 };
 
-struct chip_info {
-	const char *name;
-	enum radeon_family family;
-	enum chip_class chip_class;
-	  amdgpu_device_handle dev;
-};
-
 /* we may improve later */
 struct amdgpu_ip_blocks_device amdgpu_ips;
+const struct chip_info  *g_pChip = NULL;
 struct chip_info g_chip;
 
 static int
@@ -617,6 +610,7 @@ int setup_amdgpu_ip_blocks(uint32_t major, uint32_t minor, struct amdgpu_gpu_inf
 		{},
 	};
 	struct chip_info *info = &g_chip;
+	g_pChip = &g_chip;
 
 	switch (amdinfo->family_id) {
 	case AMDGPU_FAMILY_SI:
diff --git a/lib/amdgpu/amd_ip_blocks.h b/lib/amdgpu/amd_ip_blocks.h
index 97a9ad489..d4364d604 100644
--- a/lib/amdgpu/amd_ip_blocks.h
+++ b/lib/amdgpu/amd_ip_blocks.h
@@ -8,6 +8,7 @@
 #define AMD_IP_BLOCKS_H
 
 #include "amd_registers.h"
+#include "amd_family.h"
 
 #define MAX_CARDS_SUPPORTED 4
 
@@ -110,8 +111,15 @@ struct amdgpu_ip_blocks_device {
 	int			num_ip_blocks;
 };
 
-extern  struct amdgpu_ip_blocks_device amdgpu_ips;
+struct chip_info {
+	const char *name;
+	enum radeon_family family;
+	enum chip_class chip_class;
+	amdgpu_device_handle dev;
+};
 
+extern  struct amdgpu_ip_blocks_device amdgpu_ips;
+extern const struct chip_info  *g_pChip;
 int
 setup_amdgpu_ip_blocks(uint32_t major, uint32_t minor, struct amdgpu_gpu_info *amdinfo,
 		       amdgpu_device_handle device);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-06-24  9:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-22 22:52 [PATCH 1/2] lib/amdgpu: allow usage convenient chip info vitaly.prosyak
2024-06-22 22:52 ` [PATCH 2/2] tests/amdgpu/gang_cs: skip test for some chips vitaly.prosyak
2024-06-24  1:57   ` Zhang, Jesse(Jie)
2024-06-24  9:44   ` Christian König
2024-06-23  0:00 ` ✓ CI.xeBAT: success for series starting with [1/2] lib/amdgpu: allow usage convenient chip info Patchwork
2024-06-23  0:09 ` ✓ Fi.CI.BAT: " Patchwork
2024-06-23  0:53 ` ✗ CI.xeFULL: failure " Patchwork
2024-06-23  1:38 ` ✗ Fi.CI.IGT: " Patchwork
2024-06-24  1:57 ` [PATCH 1/2] " Zhang, Jesse(Jie)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox