[Intel-gfx] [PATCH i-g-t 1/2] aubdump: initialize on descriptor interception

Lionel Landwerlin lionel.g.landwerlin at intel.com
Sun Jan 29 23:35:41 UTC 2017


Nothing should happen before than given that drm_fd will be set to -1.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 tools/aubdump.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/aubdump.c b/tools/aubdump.c
index 6715a5d7..d53addc2 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -594,14 +594,13 @@ ioctl(int fd, unsigned long request, ...)
 	if (_IOC_TYPE(request) == DRM_IOCTL_BASE &&
 	    drm_fd != fd && fstat(fd, &buf) == 0 &&
 	    (buf.st_mode & S_IFMT) == S_IFCHR && major(buf.st_rdev) == DRM_MAJOR) {
+		maybe_init();
 		drm_fd = fd;
 		if (verbose)
 			printf("[intel_aubdump: intercept drm ioctl on fd %d]\n", fd);
 	}
 
 	if (fd == drm_fd) {
-		maybe_init();
-
 		switch (request) {
 		case DRM_IOCTL_I915_GETPARAM: {
 			struct drm_i915_getparam *getparam = argp;
-- 
2.11.0



More information about the Intel-gfx mailing list