Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tejas Upadhyay <tejas.upadhyay@intel.com>
To: igt-dev@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Jan Maslak <jan.maslak@intel.com>
Subject: [i-g-t] lib/xe: set hwconfig NULL for unsupported platforms
Date: Mon,  9 Dec 2024 14:27:09 +0530	[thread overview]
Message-ID: <20241209085709.1979242-1-tejas.upadhyay@intel.com> (raw)

There are hardware platforms which are not supporting
hwconfig table, for example ADLS. Querying hwconfig
on unsupported platforms leads to assert and failure
for some of tests like,
./build/tests/xe_module_load --r load

https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3683

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Jan Maslak <jan.maslak@intel.com>
Fixes: 37a230e50 ("lib/xe_query: add hwconfig to xe_device")
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
---
 lib/xe/xe_query.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c
index f3731d9d3..8f0a5392c 100644
--- a/lib/xe/xe_query.c
+++ b/lib/xe/xe_query.c
@@ -51,7 +51,8 @@ static uint32_t *xe_query_hwconfig_new(int fd, uint32_t *hwconfig_size)
 
 	/* Perform the initial query to get the size */
 	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), 0);
-	igt_assert_neq(query.size, 0);
+	if (!query.size)
+		return NULL;
 
 	hwconfig = malloc(query.size);
 	igt_assert(hwconfig);
@@ -858,7 +859,8 @@ uint32_t *xe_hwconfig_lookup_value(int fd, enum intel_hwconfig attribute, uint32
 	igt_assert(xe_dev);
 
 	hwconfig = xe_dev->hwconfig;
-	igt_assert(hwconfig);
+	if (!hwconfig)
+		return NULL;
 
 	/* Extract the value from the hwconfig */
 	pos = 0;
-- 
2.34.1


             reply	other threads:[~2024-12-09  8:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09  8:57 Tejas Upadhyay [this message]
2024-12-09 10:39 ` [i-g-t] lib/xe: set hwconfig NULL for unsupported platforms Hajda, Andrzej
2024-12-09 14:28 ` ✗ CI.Patch_applied: failure for " Patchwork
2024-12-09 16:04 ` [i-g-t] " Matt Roper
2024-12-09 19:20 ` John Harrison
2024-12-09 20:38   ` Matt Roper
2024-12-10  8:39     ` Upadhyay, Tejas
2024-12-11  9:13     ` Upadhyay, Tejas
2024-12-12 18:54       ` Kamil Konieczny

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=20241209085709.1979242-1-tejas.upadhyay@intel.com \
    --to=tejas.upadhyay@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jan.maslak@intel.com \
    --cc=matthew.d.roper@intel.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