[Intel-gfx] [PATCH 1/2] drm/i915/params: add i915 parameters to debugfs

Chris Wilson chris at chris-wilson.co.uk
Wed Jan 8 14:45:48 UTC 2020


Quoting Jani Nikula (2019-12-05 15:43:40)
> +static int i915_param_int_open(struct inode *inode, struct file *file)
> +{
> +       return single_open(file, i915_param_int_show, inode->i_private);

What I've always wanted with this style of approach was a means that the
parameter is only set while the debugfs remained open.

	fd = open("/debug/my_parameter", O_WRONLY | O_EXCL);
	write(fd, "1", 1);

	... run test ..

System reverts to default on process termination, or explicit close(fd).

I'd make the open implicitly O_EXCL, i.e. return -EBUSY if something
else already holds the parameter set. Or, you can use the O_EXCL to
select between the different modes of operation.

Moving the parameters to debugfs is more than worth it imo if we can
enable this mode of operation.
-Chris


More information about the Intel-gfx mailing list