[igt-dev] [PATCH i-g-t v8 3/4] tests/xe/xe_guc_pc: Change the sysfs paths

Dixit, Ashutosh ashutosh.dixit at intel.com
Sat Jul 8 19:30:34 UTC 2023


On Fri, 07 Jul 2023 04:30:54 -0700, Himal Prasad Ghimiray wrote:
> diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c
> index 827693eb4..e20ab5f88 100644
> --- a/tests/xe/xe_guc_pc.c
> +++ b/tests/xe/xe_guc_pc.c
> @@ -133,25 +133,38 @@ static void exec_basic(int fd, struct drm_xe_engine_class_instance *eci,
>	xe_vm_destroy(fd, vm);
>  }
>
> -static int set_freq(int sysfs, int gt_id, const char *freq_name, uint32_t freq)
> +static int set_freq(int fd, int gt_id, const char *freq_name, uint32_t freq)
>  {
>	int ret = -EAGAIN;
> -	char path[32];
> +	char freq_attr[16];
> +	int gt_fd;
> +
> +	snprintf(freq_attr, sizeof(freq_attr), "freq_%s", freq_name);
> +	gt_fd = xe_sysfs_gt_open(fd, gt_id);
> +	igt_assert(gt_fd != -1);

nit: probably doesn't matter and ok as is too, but I'd change this assert
to:

	igt_assert(gt_fd >= 0);

Since that's the convention followed in the code.

It's there in several places in the file.


More information about the igt-dev mailing list