[PATCH i-g-t 3/4] tools/intel_display_poller: Make pipe name alphabetic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Instead of raw numbers the user can now specify the pipe
as 'a',b'... or 'A','B'...

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 tools/intel_display_poller.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/intel_display_poller.c b/tools/intel_display_poller.c
index 8b66b53..99fd592 100644
--- a/tools/intel_display_poller.c
+++ b/tools/intel_display_poller.c
@@ -1010,7 +1010,17 @@ int main(int argc, char *argv[])
 				usage(argv[0]);
 			break;
 		case 'p':
-			pipe = atoi(optarg);
+			if (optarg[1] != '\0')
+				usage(argv[0]);
+			pipe = optarg[0];
+			if (pipe >= 'a')
+				pipe -= 'a';
+			else if (pipe >= 'A')
+				pipe -= 'A';
+			else if (pipe >= '0')
+				pipe -= '0';
+			else
+				usage(argv[0]);
 			if (pipe < 0 || pipe > 2)
 				usage(argv[0]);
 			break;
-- 
2.4.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux