[Intel-gfx] [PATCH i-g-t] tools/intel_reg: enable quiet option for mmio

clinton.a.taylor at intel.com clinton.a.taylor at intel.com
Tue Jul 19 22:43:35 UTC 2016


From: Clint Taylor <clinton.a.taylor at intel.com>

Skip decode options and formatting when the quiet option is used during
mmio reads. Makes intel_reg usable by scripts to return MMIO values.

Signed-off-by: Clint Taylor <clinton.a.taylor at intel.com>
---
 tools/intel_reg.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index 73fbd6d..e869292 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -202,7 +202,9 @@ static void dump_decode(struct config *config, struct reg *reg, uint32_t val)
 
 	if (reg->port_desc.port == PORT_MMIO) {
 		/* Omit port name for MMIO, optionally include MMIO offset. */
-		if (reg->mmio_offset)
+		if (config->verbosity < 0)
+			printf("0x%08x\n", val);
+		else if (reg->mmio_offset)
 			printf("%24s (0x%08x:0x%08x): 0x%08x%s",
 			       reg->name ?: "",
 			       reg->mmio_offset, reg->addr,
@@ -706,6 +708,9 @@ static int read_reg_spec(struct config *config)
 	struct stat st;
 	int r;
 
+	if (config->verbosity < 0)
+		goto builtin;
+
 	path = config->specfile;
 	if (!path)
 		path = getenv("INTEL_REG_SPEC");
-- 
2.1.2



More information about the Intel-gfx mailing list