Top |
igt_spin_t * | igt_spin_batch_factory () |
#define | igt_spin_batch_new() |
void | igt_spin_batch_set_timeout () |
void | igt_spin_batch_end () |
void | igt_spin_batch_free () |
void | igt_terminate_spin_batches () |
#define | IGT_CORK() |
#define | IGT_CORK_HANDLE() |
#define | IGT_CORK_FENCE() |
uint32_t | igt_cork_plug () |
void | igt_cork_unplug () |
igt_spin_t | |
struct | igt_spin_factory |
#define | IGT_SPIN_FENCE_OUT |
#define | IGT_SPIN_POLL_RUN |
#define | IGT_SPIN_FAST |
#define | IGT_SPIN_NO_PREEMPTION |
enum | igt_cork_type |
struct | igt_cork_vgem |
struct | igt_cork_sw_sync |
struct | igt_cork |
A lot of igt testcases need some GPU workload to make sure a race window is big enough. Unfortunately having a fixed amount of workload leads to spurious test failures or overly long runtimes on some fast/slow platforms. This library contains functionality to submit GPU workloads that should consume exactly a specific amount of time.
igt_spin_t * igt_spin_batch_factory (int fd
,const struct igt_spin_factory *opts
);
Start a recursive batch on a ring. Immediately returns a igt_spin_t that
contains the batch's handle that can be waited upon. The returned structure
must be passed to igt_spin_batch_free()
for post-processing.
void igt_spin_batch_set_timeout (igt_spin_t *spin
,int64_t ns
);
Specify a timeout. This ends the recursive batch associated with spin
after
the timeout has elapsed.
spin |
spin batch state from |
|
ns |
amount of time in nanoseconds the batch continues to execute before finishing. |
void
igt_spin_batch_end (igt_spin_t *spin
);
End the recursive batch associated with spin
manually.
void igt_spin_batch_free (int fd
,igt_spin_t *spin
);
This function does the necessary post-processing after starting a recursive
batch with igt_spin_batch_new()
.
uint32_t igt_cork_plug (struct igt_cork *cork
,int fd
);
This function provides a mechanism to stall submission. It provides two blocking methods:
VGEM_BO. Imports a vgem bo with a fence attached to it. This bo can be used as a dependency during submission to stall execution until the fence is signaled.
SW_SYNC: Creates a timeline and then a fence on that timeline. The fence can be used as an input fence to a request, the request will be stalled until the fence is signaled.
The parameters required to unblock the execution and to cleanup are stored in the provided cork structure.
typedef struct { unsigned int handle; timer_t timer; struct igt_list link; uint32_t *batch; int out_fence; struct drm_i915_gem_exec_object2 obj[2]; struct drm_i915_gem_execbuffer2 execbuf; uint32_t poll_handle; bool *running; } igt_spin_t;
struct igt_spin_factory { uint32_t ctx; uint32_t dependency; unsigned int engine; unsigned int flags; };