[PATCH 5/7] radeontool regmatch: print name before reading each register

Jonathan Nieder jrnieder at gmail.com
Tue Mar 23 19:54:48 PDT 2010


Register reads might take a long time or lock up the system.  Let the
user know which register before such an event occurs.

Signed-off-by: Jonathan Nieder <jrnieder at gmail.com>
---
 radeontool.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/radeontool.c b/radeontool.c
index 1351c70..e715a18 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -734,9 +734,15 @@ void radeon_reg_match(const char *pattern)
     else {
         for (i = 0; i < sizeof(reg_list) / sizeof(reg_list[0]); i++) {
             if (fnmatch(pattern, reg_list[i].name, 0) == 0) {
+                printf("%s (%s%04x)\t", reg_list[i].name,
+                       reg_list[i].type, reg_list[i].address);
+
+                /* Force output in case the register read locks up. */
+                fflush(stdout);
+                fsync(STDOUT_FILENO);
+
                 value = reg_list[i].get(reg_list[i].address, reg_list[i].name);
-                printf("%s (%s%04x)\t0x%08x (%d)\n", reg_list[i].name,
-                       reg_list[i].type, reg_list[i].address, value, value);
+                printf("0x%08x (%d)\n", value, value);
             }
         }
 	for (i = 0; i < 0x2f; i++) {
-- 
1.7.0.3



More information about the xorg-driver-ati mailing list