Skip to contentSkip to conversation

intel_reg: ensure "intel_reg help" always works

PATCH In review Thomas Wood 2 participants 3 messages Sep 7, 2015 – Sep 9, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel_reg: ensure "intel_reg help" always works

---
 tools/intel_reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/intel_reg.c +1 -1
index 95760db..2b3c686 100644
@@ -865,7 +865,7 @@ int main(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
-	if (help)
+	if (help || (argc > 0 && strcmp(argv[0], "help") == 0))
 		return intel_reg_help(&config, argc, argv);
 
 	if (argc == 0) {
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 1 line · Thomas Wood

I'm lagging behind with my mails, and I see you already pushed this... but care to explain the scenario where 'intel_reg help' does not work? Should be part of the commit message...

BR,
Jani.

Quoted 24 lines
---
 tools/intel_reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/intel_reg.c +1 -1
index 95760db..2b3c686 100644
@@ -865,7 +865,7 @@ int main(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
-	if (help)
+	if (help || (argc > 0 && strcmp(argv[0], "help") == 0))
 		return intel_reg_help(&config, argc, argv);
 
 	if (argc == 0) {
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 6 lines · Jani Nikula
Quoted 1 line · Thomas Wood

I'm lagging behind with my mails, and I see you already pushed this... but care to explain the scenario where 'intel_reg help' does not work? Should be part of the commit message...

The "help" variable is only set by the --help option, so if the user specified "help" as a command, some initialisation takes place that would cause an assert on (for example) platforms without an Intel GPU. There are a few other commands that could work on systems without an Intel GPU such as decoding register values, but this will need a bit more work to implement.

Quoted 24 lines

BR,
Jani.

Quoted 20 lines
---
 tools/intel_reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/intel_reg.c +1 -2
index 95760db..2b3c686 100644
@@ -865,7 +865,7 @@ int main(int argc, char *argv[])
      argc -= optind;
      argv += optind;
 
-     if (help)
+     if (help || (argc > 0 && strcmp(argv[0], "help") == 0))
              return intel_reg_help(&config, argc, argv);
 
      if (argc == 0) {
--

1.9.1

Quoted 7 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx