i965: perf: ensure reading config IDs from sysfs isn't interrupted
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 7 Feb 2018 10:48:32 +0000 (10:48 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 23 Feb 2018 01:44:07 +0000 (01:44 +0000)
Fixes: 458468c136e "i965: Expose OA counters via INTEL_performance_query"
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/mesa/drivers/dri/i965/brw_performance_query.c

index c0bb4442bec55fc8812f1bc86a2c1aa73590fdcb..613e61653fe222eb1b586e5b6e37d30f7a95e32d 100644 (file)
@@ -1720,7 +1720,8 @@ read_file_uint64(const char *file, uint64_t *val)
     fd = open(file, 0);
     if (fd < 0)
        return false;
-    n = read(fd, buf, sizeof (buf) - 1);
+    while ((n = read(fd, buf, sizeof (buf) - 1)) < 0 &&
+           errno == EINTR);
     close(fd);
     if (n < 0)
        return false;