mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-03 19:47:15 +00:00 
			
		
		
		
	tests/gem_evict_*: Add interruptible modes
Also I've stumbled over igt_fixture again. Somehow gcc loves to wreak havoc with stack variables set up in igt_fixtures ... Duct-tape in the form of moving fd out to global scope applied. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
		
							parent
							
								
									1b6480114e
								
							
						
					
					
						commit
						09d9089ead
					
				@ -22,6 +22,8 @@ TESTS_progs_M = \
 | 
			
		||||
	gem_cs_tlb \
 | 
			
		||||
	gem_ctx_bad_exec \
 | 
			
		||||
	gem_dummy_reloc_loop \
 | 
			
		||||
	gem_evict_alignment \
 | 
			
		||||
	gem_evict_everything \
 | 
			
		||||
	gem_exec_bad_domains \
 | 
			
		||||
	gem_exec_nop \
 | 
			
		||||
	gem_fence_thrash \
 | 
			
		||||
@ -63,8 +65,6 @@ TESTS_progs = \
 | 
			
		||||
	gem_ctx_create \
 | 
			
		||||
	gem_ctx_exec \
 | 
			
		||||
	gem_double_irq_loop \
 | 
			
		||||
	gem_evict_alignment \
 | 
			
		||||
	gem_evict_everything \
 | 
			
		||||
	gem_exec_big \
 | 
			
		||||
	gem_exec_blt \
 | 
			
		||||
	gem_exec_faulting_reloc \
 | 
			
		||||
 | 
			
		||||
@ -175,22 +175,47 @@ static void major_evictions(int fd, int size, int count)
 | 
			
		||||
	free(bo);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int fd;
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
	int fd, size, count;
 | 
			
		||||
	int size, count;
 | 
			
		||||
 | 
			
		||||
	igt_subtest_init(argc, argv);
 | 
			
		||||
 | 
			
		||||
	igt_skip_on_simulation();
 | 
			
		||||
 | 
			
		||||
	fd = drm_open_any();
 | 
			
		||||
	igt_fixture
 | 
			
		||||
		fd = drm_open_any();
 | 
			
		||||
 | 
			
		||||
	size = 1024 * 1024;
 | 
			
		||||
	count = 3*gem_aperture_size(fd) / size / 4;
 | 
			
		||||
	minor_evictions(fd, size, count);
 | 
			
		||||
	igt_subtest("minor-normal") {
 | 
			
		||||
		size = 1024 * 1024;
 | 
			
		||||
		count = 3*gem_aperture_size(fd) / size / 4;
 | 
			
		||||
		minor_evictions(fd, size, count);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	size = 3*gem_aperture_size(fd) / 4;
 | 
			
		||||
	count = 4;
 | 
			
		||||
	major_evictions(fd, size, count);
 | 
			
		||||
	igt_subtest("major-normal") {
 | 
			
		||||
		size = 3*gem_aperture_size(fd) / 4;
 | 
			
		||||
		count = 4;
 | 
			
		||||
		major_evictions(fd, size, count);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	close(fd);
 | 
			
		||||
	return 0;
 | 
			
		||||
	igt_fork_signal_helper();
 | 
			
		||||
	igt_subtest("minor-interruptible") {
 | 
			
		||||
		size = 1024 * 1024;
 | 
			
		||||
		count = 3*gem_aperture_size(fd) / size / 4;
 | 
			
		||||
		minor_evictions(fd, size, count);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	igt_subtest("major-interruptible") {
 | 
			
		||||
		size = 3*gem_aperture_size(fd) / 4;
 | 
			
		||||
		count = 4;
 | 
			
		||||
		major_evictions(fd, size, count);
 | 
			
		||||
	}
 | 
			
		||||
	igt_stop_signal_helper();
 | 
			
		||||
 | 
			
		||||
	igt_fixture
 | 
			
		||||
		close(fd);
 | 
			
		||||
 | 
			
		||||
	igt_exit();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -168,22 +168,49 @@ static void major_evictions(int fd, int size, int count)
 | 
			
		||||
	free(bo);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int fd;
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
	int fd, size, count;
 | 
			
		||||
	int size, count;
 | 
			
		||||
 | 
			
		||||
	igt_subtest_init(argc, argv);
 | 
			
		||||
 | 
			
		||||
	igt_skip_on_simulation();
 | 
			
		||||
 | 
			
		||||
	fd = drm_open_any();
 | 
			
		||||
	igt_fixture
 | 
			
		||||
		fd = drm_open_any();
 | 
			
		||||
 | 
			
		||||
	size = 1024 * 1024;
 | 
			
		||||
	count = 3*gem_aperture_size(fd) / size / 4;
 | 
			
		||||
	minor_evictions(fd, size, count);
 | 
			
		||||
	igt_subtest("minor-normal") {
 | 
			
		||||
		size = 1024 * 1024;
 | 
			
		||||
		count = 3*gem_aperture_size(fd) / size / 4;
 | 
			
		||||
		minor_evictions(fd, size, count);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	size = 3*gem_aperture_size(fd) / 4;
 | 
			
		||||
	count = 4;
 | 
			
		||||
	major_evictions(fd, size, count);
 | 
			
		||||
	igt_subtest("major-normal") {
 | 
			
		||||
		size = 3*gem_aperture_size(fd) / 4;
 | 
			
		||||
		count = 4;
 | 
			
		||||
		major_evictions(fd, size, count);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	close(fd);
 | 
			
		||||
	return 0;
 | 
			
		||||
	igt_fork_signal_helper();
 | 
			
		||||
	igt_subtest("minor-interruptible") {
 | 
			
		||||
		size = 1024 * 1024;
 | 
			
		||||
		count = 3*gem_aperture_size(fd) / size / 4;
 | 
			
		||||
		minor_evictions(fd, size, count);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	igt_subtest("major-interruptible") {
 | 
			
		||||
		size = 3*gem_aperture_size(fd) / 4;
 | 
			
		||||
		count = 4;
 | 
			
		||||
		major_evictions(fd, size, count);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	igt_stop_signal_helper();
 | 
			
		||||
 | 
			
		||||
	igt_fixture {
 | 
			
		||||
		close(fd);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	igt_exit();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user