From 6acadd495c30678f603c69b8bca456aa3cc8bf38 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Wed, 18 Jan 2023 14:28:35 +0100 Subject: [PATCH] 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: ::= "@" ":" "x" ( )? ::= "+" "+" ( )? ::= "*" ( )? ::= "@" ::= ( "," )* ( "@" )? ":" ( "@" )? ::= | | ::= "#" ::= "x" ( "-" )? ::= "," "," "," "," "," "," "," "-" ::= ":" ":" ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ( "." [0-9]+ ) ::= ( [A-Z] | [0-9] )+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= [0-9]+ ::= ( [A-Z] | [0-9] | "_" )+ ::= [0-9]+ with the https://bnfplayground.pauliankline.com/ service Reviewed-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong --- tests/modetest/modetest.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index cc96015f..d9e761e6 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -2137,13 +2137,16 @@ static void usage(char *name) fprintf(stderr, "\t-p\tlist CRTCs and planes (pipes)\n"); fprintf(stderr, "\n Test options:\n\n"); - fprintf(stderr, "\t-P @:x[++][*][@]\tset a plane\n"); - fprintf(stderr, "\t-s [,][@]:[#][-][@]\tset a mode\n"); - fprintf(stderr, "\t\tcustom mode can be specified as ,,,,,,,\n"); + fprintf(stderr, "\t-P @:x[++][*][@]\tset a plane, see 'plane-topology'\n"); + fprintf(stderr, "\t-s [,][@]:mode[@]\tset a mode, see 'mode-topology'\n"); + fprintf(stderr, "\t\twhere mode can be specified as:\n"); + fprintf(stderr, "\t\tx[-]\n"); + fprintf(stderr, "\t\t,,,,,,,-\n"); + fprintf(stderr, "\t\t#\n"); fprintf(stderr, "\t-C\ttest hw cursor\n"); fprintf(stderr, "\t-v\ttest vsynced page flipping\n"); fprintf(stderr, "\t-r\tset the preferred mode for all connectors\n"); - fprintf(stderr, "\t-w ::\tset property\n"); + fprintf(stderr, "\t-w ::\tset property, see 'property'\n"); fprintf(stderr, "\t-a \tuse atomic API\n"); fprintf(stderr, "\t-F pattern1,pattern2\tspecify fill patterns\n"); fprintf(stderr, "\t-o \t Dump writeback output buffer to file\n"); @@ -2154,6 +2157,25 @@ static void usage(char *name) fprintf(stderr, "\t-D device\tuse the given device\n"); fprintf(stderr, "\n\tDefault is to dump all info.\n"); + + fprintf(stderr, "\n"); + fprintf(stderr, "Plane Topology is defined as:\n"); + fprintf(stderr, "\tplane-topology\t::= plane-id '@' crtc-id ':' width 'x' height ( )? ;\n"); + fprintf(stderr, "\tplane-offsets\t::= '+' x-offset '+' y-offset ( )? ;\n"); + fprintf(stderr, "\tplane-scale\t::= '*' scale ( )? ;\n"); + fprintf(stderr, "\tplane-format\t::= '@' format ;\n"); + + fprintf(stderr, "\n"); + fprintf(stderr, "Mode Topology is defined as:\n"); + fprintf(stderr, "\tmode-topology\t::= connector-id ( ',' connector-id )* ( '@' crtc-id )? ':' ( '@' format )? ;\n"); + fprintf(stderr, "\tmode-selection\t::= | | ;\n"); + fprintf(stderr, "\tindexed-mode\t::= '#' mode-index ;\n"); + fprintf(stderr, "\tnamed-mode\t::= width 'x' height ( '-' vrefresh )? ;\n"); + fprintf(stderr, "\tcustom-mode\t::= hdisplay ',' hsyncstart ',' hsyncend ',' htotal ',' vdisplay ',' vsyncstart ',' vsyncend ',' vtotal '-' vrefresh ;\n"); + + fprintf(stderr, "\n"); + fprintf(stderr, "Property is defined as:\n"); + fprintf(stderr, "\tproperty\t::= object-id ':' property-name ':' value ;\n"); exit(0); }