Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: [PATCH i-g-t 1/2] intel_reg: Reorder commands and annotate ones needing reg spec
Date: Fri, 26 Apr 2024 08:33:51 -0700	[thread overview]
Message-ID: <20240426153352.3209972-1-lucas.demarchi@intel.com> (raw)

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@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


             reply	other threads:[~2024-04-26 15:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 15:33 Lucas De Marchi [this message]
2024-04-26 15:33 ` [PATCH i-g-t 2/2] intel_reg: Move decoding behind an option Lucas De Marchi
2024-04-26 17:40 ` ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] intel_reg: Reorder commands and annotate ones needing reg spec Patchwork
2024-04-26 17:57 ` ✓ CI.xeBAT: " Patchwork
2024-04-26 22:47 ` ✗ CI.xeFULL: failure " Patchwork
2024-04-26 23:23 ` ✗ Fi.CI.IGT: " Patchwork
2024-04-29  9:06 ` [PATCH i-g-t 1/2] " Jani Nikula
2024-04-29 13:31   ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240426153352.3209972-1-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox