blob: 215425f7c6c02287895e9548eda51b2950f15aec [file] [log] [blame]
Abdiel Janulgue35fa2ca2016-10-11 21:30:08 +03001/*
2 * Copyright © 2016 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 */
24
25#ifndef __IGT_DUMMYLOAD_H__
26#define __IGT_DUMMYLOAD_H__
27
28#include <stdint.h>
29#include <time.h>
30
31#include "igt_aux.h"
32
33typedef struct igt_spin {
34 unsigned int handle;
35 timer_t timer;
Abdiel Janulgue35fa2ca2016-10-11 21:30:08 +030036 struct igt_list link;
37 uint32_t *batch;
38} igt_spin_t;
39
Chris Wilsona3801342017-07-16 16:28:41 +010040igt_spin_t *__igt_spin_batch_new(int fd,
41 uint32_t ctx,
42 unsigned engine,
43 uint32_t dep);
44igt_spin_t *igt_spin_batch_new(int fd,
45 uint32_t ctx,
46 unsigned engine,
47 uint32_t dep);
Abdiel Janulgue35fa2ca2016-10-11 21:30:08 +030048void igt_spin_batch_set_timeout(igt_spin_t *spin, int64_t ns);
49void igt_spin_batch_end(igt_spin_t *spin);
50void igt_spin_batch_free(int fd, igt_spin_t *spin);
51
52void igt_terminate_spin_batches(void);
53
54#endif /* __IGT_DUMMYLOAD_H__ */