summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-10-06 18:54:24 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-12-13 12:01:31 +0000
commitc4bcb417c368f01f108f29a0222d53908028aef1 (patch)
treecd2ad10c9722e09df0bad888c3a1a97d1896a28b
parent7b97292ba7f70df98e38b925e715d86096ce98f9 (diff)
lib: Propagate error from writing to drop-caches
We almost always do not care whether the write to drop-caches succeeds or not, it is just to clear residual state and so try to isolate individual tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--lib/igt_debugfs.c9
-rw-r--r--lib/igt_debugfs.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 2f58519a..ac9f1522 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -1095,14 +1095,15 @@ bool igt_drop_caches_has(int drm_fd, uint64_t val)
* This calls the debugfs interface the drm/i915 GEM driver exposes to drop or
* evict certain classes of gem buffer objects.
*/
-void igt_drop_caches_set(int drm_fd, uint64_t val)
+bool igt_drop_caches_set(int drm_fd, uint64_t val)
{
- int dir;
+ int dir, ret;
dir = igt_debugfs_dir(drm_fd);
- igt_assert(igt_sysfs_printf(dir, "i915_gem_drop_caches",
- "0x%" PRIx64, val) > 0);
+ ret = igt_sysfs_printf(dir, "i915_gem_drop_caches", "0x%" PRIx64, val);
close(dir);
+
+ return ret > 0;
}
static int get_object_count(int fd)
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index d43ba6c6..08d8d044 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -199,7 +199,7 @@ void igt_require_hpd_storm_ctl(int fd);
void igt_reset_fifo_underrun_reporting(int drm_fd);
bool igt_drop_caches_has(int fd, uint64_t val);
-void igt_drop_caches_set(int fd, uint64_t val);
+bool igt_drop_caches_set(int fd, uint64_t val);
static inline void rcu_barrier(int fd)
{