[i-g-t] lib/xe: set hwconfig NULL for unsupported platforms

Matt Roper matthew.d.roper at intel.com
Mon Dec 9 16:04:18 UTC 2024


On Mon, Dec 09, 2024 at 02:27:09PM +0530, Tejas Upadhyay wrote:
> 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

This should be provided as a git trailer:

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

Then gitlab will automatically update that ticket once this patch lands.


Matt

> 
> Cc: Matt Roper <matthew.d.roper at intel.com>
> Cc: Jan Maslak <jan.maslak at intel.com>
> Fixes: 37a230e50 ("lib/xe_query: add hwconfig to xe_device")
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay at 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
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the igt-dev mailing list