[Intel-gfx] [PATCH] [v2] intel_frequency: A tool to manipulate Intel GPU frequency

Dave Gordon david.s.gordon at intel.com
Thu Jan 15 09:24:21 PST 2015


On 15/01/15 14:00, Dave Gordon wrote:
[snip]

> Finally, I think the choice of command names (especially --set vs
> --custom) is confusing. I'd like to propose the following:
> 
> # Reading:
> 	--get		# get all
> 	--get namelist	# get specified
> 	-g [namelist]	# synonym for -g
> 
> # Set one parameter:
> 	--set name=freq	# set the specified parameter (min or max)
> 			# may or may not affect 'cur'
> 	-s name=freq	# synonym
> 
> # Reset (all) parameters:
> 	--defaults	# Reset all r/w parameters to h/w defaults
> 	-d		# synonym
> 
> # Lock to specific frequency:
> 	--max		# Lock to (h/w defined) max
> 	-m		# synonym
> 	--min		# Lock to (h/w defined) min
> 	-i		# synonym
> 	--eff		# Lock to (h/w defined) RPe
> 	-e		# synonym
> 	--lock freq	# Lock to custom frequency
> 	-l freq		# synonym

I thought of one more variation: the command set above doesn't let you
read the defaults after changing the current parameters, except by
resetting them all to defaults. So for more flexibility, how about:

# Reading (in name=value format):
	--default		# get default values of all parameters
	--default [list]	# get default values of specified
	-d [list]		# synonym

	--get			# get current values of all parameters
	--get list		# get specified
	-g [list]		# synonym

# Reset parameter(s) to default:
	--reset			# Reset all parameters to h/w defaults
	--reset [list]		# reset only specified
	-r [list]		# synonym

# Set one parameter:
	--set name=freq		# set the specified parameter [min|max]
				# may or may not have an effect on 'cur'
	-s name=freq		# synonym

# Lock (by setting both min & max) to specific frequency:
	--max			# Lock to (h/w defined) max
	-m			# synonym
	--min			# Lock to (h/w defined) min
	-i			# synonym
	--eff			# Lock to (h/w defined) RPe
	-e			# synonym
	--lock freq		# Lock to custom frequency
	-l freq			# synonym

This makes the syntax as simple as possible and the functional
operations as orthogonal as possible. Note that several of the above are
(intentionally) simply shortcuts for combinations of others e.g.
	# intel_frequency --reset max
is equivalent to
	# intel_frequency --set $(intel_frequency --default max)
and
	# intel_frequency --eff
could be implemented with the sequence
	# e=$(intel_frequency -d eff)
	# intel_frequency -l ${e/eff=/}
or even
	# e=$(intel_frequency -d eff)
	# intel_frequency -s ${e/eff/min}
	# intel_frequency -s ${e/eff/max}

.Dave.


More information about the Intel-gfx mailing list