tools/aubdump: Get PCI ID from getparam ioctl when we can

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 <krh@cryptic-dragon.jf.intel.com>
This commit is contained in:
Kristian Høgsberg 2015-08-07 14:57:19 -07:00 committed by Kristian Høgsberg Kristensen
parent 5f4fad3182
commit 9c15167c61

View File

@ -428,7 +428,17 @@ ioctl(int fd, unsigned long request, ...)
*getparam->value = device; *getparam->value = device;
return 0; 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: { case DRM_IOCTL_I915_GEM_EXECBUFFER: {