Top | ![]() |
![]() |
![]() |
![]() |
#define | ARRAY_SIZE() |
#define | ALIGN() |
int | drm_get_card () |
int | drm_open_any () |
int | drm_open_any_master () |
int | drm_open_any_render () |
void | gem_quiescent_gpu () |
#define | do_or_die() |
#define | do_ioctl() |
This library contains the basic support for writing tests, with the most important part being the helper function to open drm device nodes.
But there's also a bit of other assorted stuff here.
Note that this library's header pulls in the i-g-t core and batchbuffer libraries as dependencies.
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
Macro to compute the size of the static array arr
.
#define ALIGN(v, a) (((v) + (a)-1) & ~((a)-1))
Macro to align a value v
to a specified unit a
.
int
drm_get_card (void
);
Get an i915 drm card index number for use in /dev or /sys. The minor index of the legacy node is returned, not of the control or render node.
int
drm_open_any_master (void
);
Open an i915 drm legacy device node and ensure that it is drm master.
void
gem_quiescent_gpu (int fd
);
Ensure the gpu is idle by launching a nop execbuf and stalling for it. This is automatically run when opening a drm device node and is also installed as an exit handler to have the best assurance that the test is run in a pristine and controlled environment.
This function simply allows tests to make additional calls in-between, if so desired.
#define do_or_die(x) igt_assert((x) == 0)
Simple macro to execute x and check that it's return value is 0. Presumes
that in any failure case the return value is non-zero and a precise error is
logged into errno. Uses igt_assert()
internally.