summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-11-22 17:29:02 +0000
committerDamien Lespiau <damien.lespiau@intel.com>2013-11-28 14:33:37 +0000
commitb333d23e3ae1ee3d971446464bd02c4a8f1695da (patch)
tree282779d4f7e2fdb9834e94fb1a07cc481c1b98bb
parentb226f43fe854ba1d0d8be7fe94f8692a93fa8aa8 (diff)
intel_dump_decode: Support the INTEL_DEVID_OVERRIDE env variable
This is the one that already works in libdrm, so don't disappoint people coming with expectations. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
-rw-r--r--tools/intel_dump_decode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/intel_dump_decode.c b/tools/intel_dump_decode.c
index 959ec87d..a8dcca06 100644
--- a/tools/intel_dump_decode.c
+++ b/tools/intel_dump_decode.c
@@ -158,6 +158,7 @@ int
main (int argc, char *argv[])
{
uint32_t devid = 0xa011;
+ char *devid_str = NULL;
int i, c;
int option_index = 0;
int binary = -1;
@@ -168,11 +169,13 @@ main (int argc, char *argv[])
{"binary", 0, 0, 'b'}
};
+ devid_str = getenv("INTEL_DEVID_OVERRIDE");
+
while((c = getopt_long(argc, argv, "ad:b",
long_options, &option_index)) != -1) {
switch(c) {
case 'd':
- devid = strtoul(optarg, NULL, 0);
+ devid_str = optarg;
break;
case 'b':
binary = 1;
@@ -186,6 +189,9 @@ main (int argc, char *argv[])
}
}
+ if (devid_str)
+ devid = strtoul(devid_str, NULL, 0);
+
ctx = drm_intel_decode_context_alloc(devid);
if (optind == argc) {