Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH i-g-t 1/2] lib/xe/oa: simplify device id array initialization
Date: Mon,  2 Sep 2024 16:49:06 +0300	[thread overview]
Message-ID: <20240902134907.2186238-1-jani.nikula@intel.com> (raw)

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


             reply	other threads:[~2024-09-02 13:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02 13:49 Jani Nikula [this message]
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

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=20240902134907.2186238-1-jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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