From 46c35f25d777f7992d87ea44f038035a6eaec2c2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 31 Aug 2018 13:14:42 +0100 Subject: lib: Stop caching __drm_device_id In a multi-device system there is no guarantee that the fd being probed in intel_get_drm_devid() is the same as was opened earlier. Any cache may outlive the fd, so is frought with lifetime issues. The primary reason for caching the devid was to avoid extra ioctls in the dmesg/strace, but hopefully all users now grab the id in their fixture and not inside every function. Signed-off-by: Chris Wilson Cc: Katarzyna Dec Reviewed-by: Katarzyna Dec --- lib/drmtest.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/drmtest.c') diff --git a/lib/drmtest.c b/lib/drmtest.c index fae6f86f..ecb535f5 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -75,8 +75,6 @@ * and [batchbuffer](igt-gpu-tools-intel-batchbuffer.html) libraries as dependencies. */ -uint16_t __drm_device_id; - static int __get_drm_device_name(int fd, char *name) { drm_version_t version; @@ -142,7 +140,6 @@ static bool has_known_intel_chipset(int fd) if (!intel_gen(devid)) return false; - __drm_device_id = devid; return true; } -- cgit v1.2.3