From 86f7b724ef18986bc58d35558d22e1ed3f8df4f9 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 13 Jul 2018 12:34:45 +0100 Subject: lib: Move trash_bos to their only user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only pm_rpm still uses the igt_trash_aperture() and so we can remove it from the lib and in the process convert it over from the legacy libdrm_intel. Signed-off-by: Chris Wilson Cc: Michał Winiarski Reviewed-by: Michał Winiarski --- lib/igt_aux.c | 57 --------------------------------------------------------- lib/igt_aux.h | 10 +--------- 2 files changed, 1 insertion(+), 66 deletions(-) (limited to 'lib') diff --git a/lib/igt_aux.c b/lib/igt_aux.c index d9dbf7ce..1250d5c5 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -682,63 +682,6 @@ void igt_print_activity(void) igt_interactive_info("."); } -/* mappable aperture trasher helper */ -drm_intel_bo **trash_bos; -int num_trash_bos; - -/** - * igt_init_aperture_trashers: - * @bufmgr: libdrm buffer manager - * - * Initialize the aperture trasher using @bufmgr, which can then be run with - * igt_trash_aperture(). - */ -void igt_init_aperture_trashers(drm_intel_bufmgr *bufmgr) -{ - int i; - - num_trash_bos = gem_mappable_aperture_size() / (1024*1024); - - trash_bos = malloc(num_trash_bos * sizeof(drm_intel_bo *)); - igt_assert(trash_bos); - - for (i = 0; i < num_trash_bos; i++) - trash_bos[i] = drm_intel_bo_alloc(bufmgr, "trash bo", 1024*1024, 4096); -} - -/** - * igt_trash_aperture: - * - * Trash the aperture by walking a set of GTT memory mapped objects. - */ -void igt_trash_aperture(void) -{ - int i; - uint8_t *gtt_ptr; - - for (i = 0; i < num_trash_bos; i++) { - drm_intel_gem_bo_map_gtt(trash_bos[i]); - gtt_ptr = trash_bos[i]->virtual; - *gtt_ptr = 0; - drm_intel_gem_bo_unmap_gtt(trash_bos[i]); - } -} - -/** - * igt_cleanup_aperture_trashers: - * - * Clean up all aperture trasher state set up with igt_init_aperture_trashers(). - */ -void igt_cleanup_aperture_trashers(void) -{ - int i; - - for (i = 0; i < num_trash_bos; i++) - drm_intel_bo_unreference(trash_bos[i]); - - free(trash_bos); -} - static int autoresume_delay; static const char *suspend_state_name[] = { diff --git a/lib/igt_aux.h b/lib/igt_aux.h index 639a9077..ef89faa9 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -28,16 +28,13 @@ #ifndef IGT_AUX_H #define IGT_AUX_H -#include #include #include +#include #include #include -extern drm_intel_bo **trash_bos; -extern int num_trash_bos; - /* signal interrupt helpers */ #define gettid() syscall(__NR_gettid) #define sigev_notify_thread_id _sigev_un._tid @@ -122,11 +119,6 @@ bool igt_check_boolean_env_var(const char *env_var, bool default_value); bool igt_aub_dump_enabled(void); -/* helpers based upon the libdrm buffer manager */ -void igt_init_aperture_trashers(drm_intel_bufmgr *bufmgr); -void igt_trash_aperture(void); -void igt_cleanup_aperture_trashers(void); - /* suspend/hibernate and auto-resume system */ /** -- cgit v1.2.3