Top | ![]() |
![]() |
![]() |
![]() |
void | igt_require_hang_ring () |
struct igt_hang_ring | igt_hang_ring () |
void | igt_post_hang_ring () |
int | igt_fork_hang_helper () |
void | igt_stop_hang_helper () |
int | igt_open_forcewake_handle () |
enum stop_ring_flags | igt_to_stop_ring_flag () |
void | igt_set_stop_rings () |
enum stop_ring_flags | igt_get_stop_rings () |
This library provides various auxiliary helper functions to handle general interactions with the GT like forcewake handling, injecting hangs or stopping engines.
void igt_require_hang_ring (int fd
,int ring
);
Convenience helper to check whether advanced hang injection is supported by the kernel. Uses igt_skip to automatically skip the test/subtest if this isn't the case.
struct igt_hang_ring igt_hang_ring (int fd
,int ring
);
This helper function injects a hanging batch into ring
. It returns a
igt_hang_ring_t structure which must be passed to igt_post_hang_ring()
for
hang post-processing (after the gpu hang interaction has been tested.
void igt_post_hang_ring (int fd
,struct igt_hang_ring arg
);
This function does the necessary post-processing after a gpu hang injected
with igt_hang_ring()
.
int
igt_fork_hang_helper (void
);
Fork a child process using igt_fork_helper to hang the default engine of the GPU at regular intervals.
This is useful to exercise slow running code (such as aperture placement) which needs to be robust against a GPU reset.
In tests with subtests this function can be called outside of failure catching code blocks like igt_fixture or igt_subtest.
void
igt_stop_hang_helper (void
);
Stops the child process spawned with igt_fork_hang_helper()
.
In tests with subtests this function can be called outside of failure catching code blocks like igt_fixture or igt_subtest.
int
igt_open_forcewake_handle (void
);
This functions opens the debugfs forcewake file and so prevents the GT from suspending. The reference is automatically dropped when the is closed.
enum stop_ring_flags
igt_to_stop_ring_flag (int ring
);
This converts the specified ring to a ring flag to be used
with igt_get_stop_rings()
and igt_set_stop_rings()
.
void
igt_set_stop_rings (enum stop_ring_flags flags
);
This writes flags
to 'i915_ring_stop' debugfs entry. Driver will
prevent the CPU from writing tail pointer for the ring that flags
specify. Note that the ring is not stopped right away. Instead any
further command emissions won't be executed after the flag is set.
This is the least invasive way to make the GPU stuck. Hence you must set this after a batch submission with it's own invalid or endless looping instructions. In this case it is merely for giving notification for the driver that this was simulated hang, as the batch would have caused hang in any case. On the other hand if you use a valid or noop batch and want to hang the ring (GPU), you must set corresponding flag before submitting the batch.
Driver checks periodically if a ring is making any progress, and if it is not, it will declare the ring to be hung and will reset the GPU. After reset, the driver will clear flags in 'i915_ring_stop'
Note: Always when hanging the GPU, use igt_set_stop_rings()
to
notify the driver. Driver controls hang log messaging based on
these flags and thus prevents false positives on logs.
enum stop_ring_flags
igt_get_stop_rings (void
);
Read current ring flags from 'i915_ring_stop' debugfs entry.
Enumeration of all supported flags for igt_set_stop_rings()
.
Can be used to clear the pending stop (warning: hang might
be declared already). Returned by |
||
Render ring |
||
Video encoding/decoding ring |
||
Blitter ring |
||
Video enhancement ring |
||
All rings |
||
Driver will not omit expected DRM_ERRORS |
||
Driver will use context ban policy |
||
STOP_RING_ALL | STOP_RING_ALLOW_ERRORS |