mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 17:36:11 +00:00
tests: add reloc, pread, pwrite slow path subtest
the reloc, pread, pwrite slow path will be prevented by prefault, these subtests will disable prefault first, then do reloc, pread, pwrite, finally enable prefault. Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
This commit is contained in:
parent
7ea2983b11
commit
fc5c693014
@ -220,7 +220,15 @@ static void run(int object_size)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
run(OBJECT_SIZE);
|
||||
drmtest_subtest_init(argc, argv);
|
||||
|
||||
if (drmtest_run_subtest("normal"))
|
||||
run(OBJECT_SIZE);
|
||||
if (drmtest_run_subtest("no-prefault")) {
|
||||
drmtest_disable_prefault();
|
||||
run(OBJECT_SIZE);
|
||||
drmtest_enable_prefault();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -144,6 +144,15 @@ test_read(int fd)
|
||||
munmap(dst, OBJECT_SIZE);
|
||||
}
|
||||
|
||||
static void
|
||||
run_without_prefault(int fd,
|
||||
void (*func)(int fd))
|
||||
{
|
||||
drmtest_disable_prefault();
|
||||
func(fd);
|
||||
drmtest_enable_prefault();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
@ -163,6 +172,12 @@ int main(int argc, char **argv)
|
||||
test_write(fd);
|
||||
if (drmtest_run_subtest("write-gtt"))
|
||||
test_write_gtt(fd);
|
||||
if (drmtest_run_subtest("read-no-prefault"))
|
||||
run_without_prefault(fd, test_read);
|
||||
if (drmtest_run_subtest("write-no-prefault"))
|
||||
run_without_prefault(fd, test_write);
|
||||
if (drmtest_run_subtest("write-gtt-no-prefault"))
|
||||
run_without_prefault(fd, test_write_gtt);
|
||||
|
||||
close(fd);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user