diff options
author | Marius Vlad <marius.c.vlad@intel.com> | 2016-12-01 14:23:57 +0200 |
---|---|---|
committer | Petri Latvala <petri.latvala@intel.com> | 2016-12-02 16:31:17 +0200 |
commit | 2fea8d26e589a9d256eca9f3d561750ecb3fb681 (patch) | |
tree | e85bb1d46f2cb50f4232c2ae74f424b0dce7d933 /tools/intel_gem_info.c | |
parent | b7e51f995c35ac4d74923654e641efe93fc307ba (diff) |
tests/drv_module_reload: Convert sh script to C version.
v5:
- reword gem_info to gem_sanitychecks (Chris Wilson)
- remove subgroups/subtests for gem_exec_store and gem_sanitycheck
(Chris Wilson)
v4:
- adjust test to make use of lib/igt_kmod
- replaced SW_FINISH with SET_CACHEING (Chris Wilson)
v3:
- fix passing boolean value as flags to igt_kmod_unload().
v2:
- embedded gem_alive and gem_exec_store into test (Chris Wilson)
- int main() to igt_main (Chris Wilson)
- moved tests/gem_alive -> tools/gem_info (Chris Wilson)
- added to intel-ci/fast-feedback.testlist (Petri Latvala)
- added hda_dynamic_debug() (Petri Latvala)
- renamed from tests/drv_module_reload_basic to tests/drv_module_reload
(all subtests are basic and have been added to fast-feedback.testlist)
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tools/intel_gem_info.c')
-rw-r--r-- | tools/intel_gem_info.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/intel_gem_info.c b/tools/intel_gem_info.c new file mode 100644 index 00000000..75444438 --- /dev/null +++ b/tools/intel_gem_info.c @@ -0,0 +1,35 @@ +#include "igt.h" +#include <sys/ioctl.h> +#include <fcntl.h> +#include <errno.h> +#include <string.h> +#include <signal.h> +#include <i915_drm.h> + + +int main(void) +{ + struct drm_i915_gem_sw_finish arg = { 0 }; + int fd; + + signal(SIGALRM, SIG_IGN); + + fd = __drm_open_driver(DRIVER_INTEL); + if (fd < 0) + return IGT_EXIT_SKIP; + + alarm(1); + if (ioctl(fd, DRM_IOCTL_I915_GEM_SW_FINISH, &arg) == 0) + return IGT_EXIT_SKIP; + + switch (errno) { + case ENOENT: + return 0; + case EIO: + return 1; + case EINTR: + return 2; + default: + return 3; + } +} |