[PATCH i-g-t] tests/intel/xe_eu_stall: Skip test if feature is not supported

Harish Chegondi harish.chegondi at intel.com
Wed Jun 4 06:03:29 UTC 2025


On Tue, Jun 03, 2025 at 04:07:18PM +0000, Jakub Kolakowski wrote:

Hi Jakub,

Thanks for sending this patch. Recently I have been working on a
different but related issue:
https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/5131
I have come up with a similar patch with the difference that I have used
a EU stall query IOCTL to check for EU stall support. The query IOCTL is
already being used in the test so I reused the query IOCTL to check for
EU stall support too. I copied you and others on that patch. Can you
please let me know your comments.

> Add a helper to check for feature support. If feature isn't supported
> skip the test.
> 
> Cc: Harish Chegondi <harish.chegondi at intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit at intel.com>
> Cc: Adam Miszczak <adam.miszczak at linux.intel.com>
> Cc: Lukasz Laguna <lukasz.laguna at intel.com>
> Cc: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>
> Signed-off-by: Jakub Kolakowski <jakub1.kolakowski at intel.com>
> ---
>  tests/intel/xe_eu_stall.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/tests/intel/xe_eu_stall.c b/tests/intel/xe_eu_stall.c
> index 411c30871..f3d7c1974 100644
> --- a/tests/intel/xe_eu_stall.c
> +++ b/tests/intel/xe_eu_stall.c
> @@ -267,6 +267,31 @@ static void xe_eu_stall_ioctl_err(int fd, enum drm_xe_observation_op op, void *a
>  	errno = 0;
>  }
>  
> +static bool is_eu_stall_supported(int drm_fd)
> +{
> +	int stream_fd;
> +	uint64_t properties[] = {
> +		DRM_XE_EU_STALL_PROP_GT_ID, p_gt_id,
> +		DRM_XE_EU_STALL_PROP_SAMPLE_RATE, DEFAULT_SAMPLE_RATE,
> +		DRM_XE_EU_STALL_PROP_WAIT_NUM_REPORTS, p_num_reports,
> +	};
> +
> +	struct xe_eu_stall_open_prop props = {
> +		.num_properties = ARRAY_SIZE(properties) / 2,
> +		.properties_ptr = to_user_pointer(properties),
> +	};
> +
> +	stream_fd = xe_eu_stall_ioctl(drm_fd, DRM_XE_OBSERVATION_OP_STREAM_OPEN, &props);
> +
> +	if(stream_fd == -1 && errno == ENODEV) {
> +		close(stream_fd);
> +		return false;
> +	}
> +
> +	close(stream_fd);
> +	return true;
> +}
> +
>  static uint64_t read_u64_file(const char *path)
>  {
>  	FILE *f;
> @@ -654,6 +679,7 @@ igt_main_args("e:g:o:r:u:w:", long_options, help_str, opt_handler, NULL)
>  		igt_require_fd(drm_fd);
>  		devid = intel_get_drm_devid(drm_fd);
>  		igt_require(IS_PONTEVECCHIO(devid) || intel_graphics_ver(devid) >= IP_VER(20, 0));
This check would no longer be needed.
> +		igt_require_f(is_eu_stall_supported(drm_fd), "EU stall sampling not supported\n");
>  		igt_require_f(igt_get_gpgpu_fillfunc(devid), "no gpgpu-fill function\n");
>  		igt_require_f(!stat(OBSERVATION_PARANOID, &sb), "no observation_paranoid file\n");
>  		if (output_file) {
> -- 
> 2.34.1
> 
Thank You
Harish.


More information about the igt-dev mailing list