projects
/
platform
/
upstream
/
intel-gpu-tools.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
packaging: only on x86* arch
[platform/upstream/intel-gpu-tools.git]
/
tests
/
gem_alive.c
1
#include <sys/ioctl.h>
2
#include <fcntl.h>
3
#include <errno.h>
4
#include <string.h>
5
#include <signal.h>
6
#include <i915_drm.h>
7
8
#include "drmtest.h"
9
10
int 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_any();
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
}