[igt-dev] [PATCH i-g-t 07/31] i915/perf: Enable tests to run on specific engines

Dixit, Ashutosh ashutosh.dixit at intel.com
Mon Mar 6 22:19:50 UTC 2023


On Tue, 14 Feb 2023 16:46:24 -0800, Umesh Nerlige Ramappa wrote:
>
> @@ -5115,22 +5234,15 @@ test_sysctl_defaults(void)
>	igt_assert_eq(max_freq, 100000);
>  }
>
> -static int i915_perf_revision(int fd)
> -{
> -	drm_i915_getparam_t gp;
> -	int value = 1, ret;
> +#define __for_each_perf_enabled_engine(fd__, e__) \
> +	for_each_physical_engine(fd__, e__) \
> +		if (perf_supports_engine(e__)) \

Some tests are using for_each_if() in this case (and the one below) but
it's identical so:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>

> +			igt_dynamic_f("%s", e__->name)
>
> -	gp.param = I915_PARAM_PERF_REVISION;
> -	gp.value = &value;
> -	ret = igt_ioctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp);
> -	if (ret == -1) {
> -		/* If the param is missing, consider version 1. */
> -		igt_assert_eq(errno, EINVAL);
> -		return 1;
> -	}
> -
> -	return value;
> -}
> +#define __for_each_render_engine(fd__, e__) \
> +	for_each_physical_engine(fd__, e__) \
> +		if (e__->class == I915_ENGINE_CLASS_RENDER) \
> +			igt_dynamic_f("%s", e__->name)
>


More information about the igt-dev mailing list