Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/2] lib/xe/oa: simplify device id array initialization
@ 2024-09-02 13:49 Jani Nikula
  2024-09-02 13:49 ` [PATCH i-g-t 2/2] lib/intel_device_info: use dedicated macro for struct pci_id_match init Jani Nikula
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Jani Nikula @ 2024-09-02 13:49 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula

Stop abusing INTEL_VGA_DEVICE when we can simply define our own macro
for initializing uint16_t arrays.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 lib/xe/xe_oa.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/lib/xe/xe_oa.c b/lib/xe/xe_oa.c
index 4764ed1fcfb8..1bc2eeb0a11a 100644
--- a/lib/xe/xe_oa.c
+++ b/lib/xe/xe_oa.c
@@ -112,16 +112,15 @@ unsupported_xe_oa_platform(struct intel_xe_perf *perf)
 	return NULL;
 }
 
+#define DEVID(_id) (_id)
+
 static bool
 is_acm_gt1(const struct intel_xe_perf_devinfo *devinfo)
 {
-#undef INTEL_VGA_DEVICE
-#define INTEL_VGA_DEVICE(_id, _info) _id
 	static const uint32_t devids[] = {
-		XE_DG2_G11_IDS(INTEL_VGA_DEVICE, NULL),
-		XE_ATS_M75_IDS(INTEL_VGA_DEVICE, NULL),
+		XE_DG2_G11_IDS(DEVID),
+		XE_ATS_M75_IDS(DEVID),
 	};
-#undef INTEL_VGA_DEVICE
 	for (uint32_t i = 0; i < ARRAY_SIZE(devids); i++) {
 		if (devids[i] == devinfo->devid)
 			return true;
@@ -133,12 +132,9 @@ is_acm_gt1(const struct intel_xe_perf_devinfo *devinfo)
 static bool
 is_acm_gt2(const struct intel_xe_perf_devinfo *devinfo)
 {
-#undef INTEL_VGA_DEVICE
-#define INTEL_VGA_DEVICE(_id, _info) _id
 	static const uint32_t devids[] = {
-		XE_DG2_G12_IDS(INTEL_VGA_DEVICE, NULL),
+		XE_DG2_G12_IDS(DEVID),
 	};
-#undef INTEL_VGA_DEVICE
 	for (uint32_t i = 0; i < ARRAY_SIZE(devids); i++) {
 		if (devids[i] == devinfo->devid)
 			return true;
@@ -150,13 +146,10 @@ is_acm_gt2(const struct intel_xe_perf_devinfo *devinfo)
 static bool
 is_acm_gt3(const struct intel_xe_perf_devinfo *devinfo)
 {
-#undef INTEL_VGA_DEVICE
-#define INTEL_VGA_DEVICE(_id, _info) _id
 	static const uint32_t devids[] = {
-		XE_DG2_G10_IDS(INTEL_VGA_DEVICE, NULL),
-		XE_ATS_M150_IDS(INTEL_VGA_DEVICE, NULL),
+		XE_DG2_G10_IDS(DEVID),
+		XE_ATS_M150_IDS(DEVID),
 	};
-#undef INTEL_VGA_DEVICE
 	for (uint32_t i = 0; i < ARRAY_SIZE(devids); i++) {
 		if (devids[i] == devinfo->devid)
 			return true;
@@ -165,6 +158,8 @@ is_acm_gt3(const struct intel_xe_perf_devinfo *devinfo)
 	return false;
 }
 
+#undef DEVID
+
 struct intel_xe_perf *
 intel_xe_perf_for_devinfo(uint32_t device_id,
 			  uint32_t revision,
-- 
2.39.2


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

end of thread, other threads:[~2024-09-05  8:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 13:49 [PATCH i-g-t 1/2] lib/xe/oa: simplify device id array initialization Jani Nikula
2024-09-02 13:49 ` [PATCH i-g-t 2/2] lib/intel_device_info: use dedicated macro for struct pci_id_match init Jani Nikula
2024-09-03 20:55   ` Dixit, Ashutosh
2024-09-02 19:15 ` ✓ CI.xeBAT: success for series starting with [i-g-t,1/2] lib/xe/oa: simplify device id array initialization Patchwork
2024-09-02 19:34 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-09-03  0:53 ` ✗ CI.xeFULL: " Patchwork
2024-09-03 20:50 ` [PATCH i-g-t 1/2] " Dixit, Ashutosh
2024-09-04 10:23   ` Jani Nikula
2024-09-04  8:29 ` ✓ CI.xeBAT: success for series starting with [i-g-t,1/2] lib/xe/oa: simplify device id array initialization (rev2) Patchwork
2024-09-04  8:36 ` ✓ Fi.CI.BAT: " Patchwork
2024-09-04 10:09 ` ✗ CI.xeFULL: failure " Patchwork
2024-09-05  8:52 ` ✗ Fi.CI.IGT: " Patchwork

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