summaryrefslogtreecommitdiff
path: root/tools/intel_display_poller.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-09-09 16:47:29 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2015-09-11 15:33:28 +0300
commita8b85ea21b053145527a848b51b57f5c0cfa003e (patch)
treeadea9088b73f07cbaccbf503b8bbcaec15485d7c /tools/intel_display_poller.c
parent01a2a4d85d71b1b7f6f4d5239d207b821ae01b55 (diff)
tools/intel_display_poller: Make pipe name alphabetic
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@linux.intel.com>
Diffstat (limited to 'tools/intel_display_poller.c')
-rw-r--r--tools/intel_display_poller.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/intel_display_poller.c b/tools/intel_display_poller.c
index 8b66b53e..99fd5929 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;