mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 21:32:56 +00:00
tests: use drmtest_skip() in caching ioctl helpers
This way we can rip out all the skip handling from the test control flow, and additionally (by using drmtest_retval()) even get correct exit codes. The only tricky part is that when we only want ot skip parts of a test (like for gem_pread and gem_pwrite) we need to split out those parts as subtests. But no addition of control-flow is required, the set/longjmp magic in the helpers all makes it happen. Also we make extensive use of the behaviour of drmtest_skip to skip all subsequent subtests if it is called outside of a subtest. This allows us to re-flatten the control flow a lot. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
+1
-4
@@ -118,10 +118,7 @@ int main(int argc, char **argv)
|
||||
|
||||
fd = drm_open_any();
|
||||
|
||||
if (!gem_has_caching(fd)) {
|
||||
printf("no set_caching support detected\n");
|
||||
return 77;
|
||||
}
|
||||
gem_check_caching(fd);
|
||||
|
||||
devid = intel_get_drm_devid(fd);
|
||||
if (IS_GEN2(devid)) /* chipset only handles cached -> uncached */
|
||||
|
||||
Reference in New Issue
Block a user