Skip to content
Snippets Groups Projects
Commit 9d1c1d56 authored by Tejas Upadhyay's avatar Tejas Upadhyay Committed by Kamil Konieczny
Browse files

lib/xe: set hwconfig NULL for unsupported platforms

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

drm/xe/kernel#3683



Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Jan Maslak <jan.maslak@intel.com>
Fixes: 37a230e5 ("lib/xe_query: add hwconfig to xe_device")
Signed-off-by: default avatarTejas Upadhyay <tejas.upadhyay@intel.com>
Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
parent 84ede1e6
No related branches found
No related tags found
No related merge requests found
Pipeline #1328782 passed
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment