1 #include "igt.h" 2 #include <sys/ioctl.h> 3 #include <fcntl.h> 4 #include <errno.h> 5 #include <string.h> 6 #include <signal.h> 7 #include <i915_drm.h> 8 9 main(void)10int main(void) 11 { 12 struct drm_i915_gem_sw_finish arg = { 0 }; 13 int fd; 14 15 signal(SIGALRM, SIG_IGN); 16 17 fd = __drm_open_driver(DRIVER_INTEL); 18 if (fd < 0) 19 return IGT_EXIT_SKIP; 20 21 alarm(1); 22 if (ioctl(fd, DRM_IOCTL_I915_GEM_SW_FINISH, &arg) == 0) 23 return IGT_EXIT_SKIP; 24 25 switch (errno) { 26 case ENOENT: 27 return 0; 28 case EIO: 29 return 1; 30 case EINTR: 31 return 2; 32 default: 33 return 3; 34 } 35 } 36