From: Damien Lespiau Subject: [PATCH 2/2] intel_dump_decode: Support the INTEL_DEVID_OVERRIDE env variable Date: Fri, 22 Nov 2013 17:33:42 +0000 Message-ID: <1385141622-30241-2-git-send-email-damien.lespiau@intel.com> References: <1385141622-30241-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 21169FAC62 for ; Fri, 22 Nov 2013 09:33:46 -0800 (PST) In-Reply-To: <1385141622-30241-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org This is the one that already works in libdrm, so don't disappoint people coming with expectations. Signed-off-by: Damien Lespiau --- tools/intel_dump_decode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/intel_dump_decode.c b/tools/intel_dump_decode.c index 959ec87..a8dcca0 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) { -- 1.8.3.1