From 9690d0aeedff96ebf761252966aa19471ac93bc1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 6 Apr 2016 21:50:12 +0100 Subject: lib: Add support for DROP_FREED in igt_drop_caches_set() Signed-off-by: Chris Wilson --- lib/drmtest.c | 2 +- lib/igt_debugfs.c | 2 +- lib/igt_debugfs.h | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index e7656800..40bbff6e 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -180,7 +180,7 @@ void gem_quiescent_gpu(int fd) gem_sync(fd, obj.handle); gem_close(fd, obj.handle); - igt_drop_caches_set(DROP_RETIRE); + igt_drop_caches_set(DROP_RETIRE | DROP_FREED); } /** diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index cd70ea1d..fb13a88b 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -737,7 +737,7 @@ static int get_object_count(void) FILE *file; int ret, scanned; - igt_drop_caches_set(DROP_RETIRE | DROP_ACTIVE); + igt_drop_caches_set(DROP_RETIRE | DROP_ACTIVE | DROP_FREED); file = igt_debugfs_fopen("i915_gem_objects", "r"); diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h index 988025f9..8289e9d0 100644 --- a/lib/igt_debugfs.h +++ b/lib/igt_debugfs.h @@ -156,6 +156,12 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc); * Also drop active objects once retired. */ #define DROP_ACTIVE 0x8 +/** + * DROP_FREED: + * + * Also drop freed objects. + */ +#define DROP_FREED 0x10 /** * DROP_ALL: * @@ -164,7 +170,8 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc); #define DROP_ALL (DROP_UNBOUND | \ DROP_BOUND | \ DROP_RETIRE | \ - DROP_ACTIVE) + DROP_ACTIVE | \ + DROP_FREED) void igt_drop_caches_set(uint64_t val); -- cgit v1.2.3