From 9c15167c611bbac1e702eb064044ec687bfa3703 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 7 Aug 2015 14:57:19 -0700 Subject: tools/aubdump: Get PCI ID from getparam ioctl when we can MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of doing an extra getparam ioctl to discover the PCI ID, we can snoop it when the application queries it. Signed-off-by: Kristian Høgsberg --- tools/aubdump.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools/aubdump.c') diff --git a/tools/aubdump.c b/tools/aubdump.c index 6501ee02..73334a30 100644 --- a/tools/aubdump.c +++ b/tools/aubdump.c @@ -428,7 +428,17 @@ ioctl(int fd, unsigned long request, ...) *getparam->value = device; return 0; } - return libc_ioctl(fd, request, argp); + + ret = libc_ioctl(fd, request, argp); + + /* If the application looks up chipset_id + * (they typically do), we'll piggy-back on + * their ioctl and store the id for later + * use. */ + if (getparam->param == I915_PARAM_CHIPSET_ID) + device = *getparam->value; + + return ret; } case DRM_IOCTL_I915_GEM_EXECBUFFER: { -- cgit v1.2.3