modetest: switch usage to proper options grammar
authorNeil Armstrong <neil.armstrong@linaro.org>
Wed, 18 Jan 2023 13:28:35 +0000 (14:28 +0100)
committerDmitry Baryshkov <dbaryshkov@gmail.com>
Wed, 15 Nov 2023 09:11:48 +0000 (09:11 +0000)
commit6acadd495c30678f603c69b8bca456aa3cc8bf38
tree879f49a102ab27a7af43b5ad8af50104aa0598a9
parenta0b011439d44e7d79ffed6dd2d372e60dc7f3b1b
modetest: switch usage to proper options grammar

It was unclear how #mode could be used, so fixup the usage string and print
the struct grammar of the -s and -P options to clarify the usage.

The following grammar was compiled:
<plane_topology> ::= <plane_id> "@" <crtc_id> ":" <width> "x" <height> ( <plane_offsets> )?
<plane_offsets> ::= "+" <x_offset> "+" <y_offset> ( <plane_scale> )?
<plane_scale> ::= "*" <scale> ( <plane_format> )?
<plane_format> ::= "@" <format>

<mode_topology> ::= <connector_id> ( "," <connector_id> )* ( "@" <crtc_id> )? ":" <mode_selection> ( "@" <format> )?
<mode_selection> ::=  <indexed_mode> | <named_mode> | <custom_mode>
<indexed_mode> ::=  "#" <mode_index>
<named_mode> ::=  <width> "x" <height> ( "-" <vrefresh> )?
<custom_mode> ::=  <hdisplay> "," <hsyncstart> "," <hsyncend> "," <htotal> "," <vdisplay> "," <vsyncstart> "," <vsyncend> "," <vtotal>  "-" <vrefresh>
<property>  ::= <object_id> ":" <property_name> ":" <value>

<plane_id> ::= [0-9]+
<crtc_id> ::= [0-9]+
<width> ::= [0-9]+
<height> ::= [0-9]+
<x_offset> ::= [0-9]+
<y_offset> ::= [0-9]+
<scale> ::= [0-9]+ ( "." [0-9]+ )
<format> ::= ( [A-Z] | [0-9] )+
<connector_id> ::= [0-9]+
<mode_index> ::= [0-9]+
<hdisplay> ::= [0-9]+
<hsyncstart> ::= [0-9]+
<hsyncend> ::= [0-9]+
<htotal> ::= [0-9]+
<vdisplay> ::= [0-9]+
<vsyncstart> ::= [0-9]+
<vsyncend> ::= [0-9]+
<vtotal> ::= [0-9]+
<object_id> ::= [0-9]+
<vrefresh> ::= [0-9]+
<property_name> ::= ( [A-Z] | [0-9] | "_" )+
<value> ::= [0-9]+

with the https://bnfplayground.pauliankline.com/ service

Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
tests/modetest/modetest.c