[PATCH i-g-t 1/2] intel_reg: Reorder commands and annotate ones needing reg spec

Lucas De Marchi lucas.demarchi at intel.com
Fri Apr 26 15:33:51 UTC 2024


Group together the commands that operate with a reg spec and annotate
those that will implicitly enable a future --decode option.

Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 tools/intel_reg.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index aae5a2395..8f585e4bd 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -967,10 +967,16 @@ struct command {
 	const char *name;
 	const char *description;
 	const char *synopsis;
+	bool decode;
 	int (*function)(struct config *config, int argc, char *argv[]);
 };
 
 static const struct command commands[] = {
+	{
+		.name = "help",
+		.function = intel_reg_help,
+		.description = "show this help",
+	},
 	{
 		.name = "read",
 		.function = intel_reg_read,
@@ -983,31 +989,29 @@ static const struct command commands[] = {
 		.synopsis = "[--post] REGISTER VALUE [REGISTER VALUE ...]",
 		.description = "write value(s) to specified register(s)",
 	},
+	{
+		.name = "snapshot",
+		.function = intel_reg_snapshot,
+		.description = "create a snapshot of the MMIO bar to stdout",
+	},
 	{
 		.name = "dump",
 		.function = intel_reg_dump,
 		.description = "dump all known registers",
+		.decode = true,
 	},
 	{
 		.name = "decode",
 		.function = intel_reg_decode,
 		.synopsis = "REGISTER VALUE [REGISTER VALUE ...]",
 		.description = "decode value(s) for specified register(s)",
-	},
-	{
-		.name = "snapshot",
-		.function = intel_reg_snapshot,
-		.description = "create a snapshot of the MMIO bar to stdout",
+		.decode = true,
 	},
 	{
 		.name = "list",
 		.function = intel_reg_list,
 		.description = "list all known register names",
-	},
-	{
-		.name = "help",
-		.function = intel_reg_help,
-		.description = "show this help",
+		.decode = true,
 	},
 };
 
-- 
2.43.0



More information about the igt-dev mailing list