Chris Wilson | 16bafdf | 2014-09-04 09:26:24 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2014 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 | #ifndef IGT_GT_H |
| 25 | #define IGT_GT_H |
| 26 | |
Daniel Vetter | 3cd45de | 2015-02-10 17:46:43 +0100 | [diff] [blame] | 27 | #include "igt_debugfs.h" |
| 28 | |
Daniel Vetter | c66b242 | 2015-02-06 10:49:20 +0100 | [diff] [blame] | 29 | void igt_require_hang_ring(int fd, int ring); |
Chris Wilson | 16bafdf | 2014-09-04 09:26:24 +0100 | [diff] [blame] | 30 | |
Daniel Vetter | 3cd45de | 2015-02-10 17:46:43 +0100 | [diff] [blame] | 31 | typedef struct igt_hang_ring { |
Chris Wilson | 16bafdf | 2014-09-04 09:26:24 +0100 | [diff] [blame] | 32 | unsigned handle; |
| 33 | unsigned ban; |
Daniel Vetter | 3cd45de | 2015-02-10 17:46:43 +0100 | [diff] [blame] | 34 | } igt_hang_ring_t; |
| 35 | |
| 36 | struct igt_hang_ring igt_hang_ring(int fd, int ring); |
Thomas Wood | 26f4081 | 2015-02-20 11:31:01 +0000 | [diff] [blame] | 37 | void igt_post_hang_ring(int fd, struct igt_hang_ring arg); |
Chris Wilson | 16bafdf | 2014-09-04 09:26:24 +0100 | [diff] [blame] | 38 | |
Daniel Vetter | d8d1eab | 2015-12-03 07:45:34 +0100 | [diff] [blame^] | 39 | void igt_fork_hang_helper(void); |
Daniel Vetter | 3cd45de | 2015-02-10 17:46:43 +0100 | [diff] [blame] | 40 | void igt_stop_hang_helper(void); |
| 41 | |
| 42 | int igt_open_forcewake_handle(void); |
| 43 | |
| 44 | /** |
| 45 | * stop_ring_flags: |
| 46 | * @STOP_RING_NONE: Can be used to clear the pending stop (warning: hang might |
| 47 | * be declared already). Returned by igt_get_stop_rings() if there is |
| 48 | * no currently stopped rings. |
| 49 | * @STOP_RING_RENDER: Render ring |
| 50 | * @STOP_RING_BSD: Video encoding/decoding ring |
| 51 | * @STOP_RING_BLT: Blitter ring |
| 52 | * @STOP_RING_VEBOX: Video enhancement ring |
| 53 | * @STOP_RING_ALL: All rings |
| 54 | * @STOP_RING_ALLOW_ERRORS: Driver will not omit expected DRM_ERRORS |
| 55 | * @STOP_RING_ALLOW_BAN: Driver will use context ban policy |
| 56 | * @STOP_RING_DEFAULTS: STOP_RING_ALL | STOP_RING_ALLOW_ERRORS |
| 57 | * |
| 58 | * Enumeration of all supported flags for igt_set_stop_rings(). |
| 59 | * |
| 60 | */ |
| 61 | enum stop_ring_flags { |
| 62 | STOP_RING_NONE = 0x00, |
| 63 | STOP_RING_RENDER = (1 << 0), |
| 64 | STOP_RING_BSD = (1 << 1), |
| 65 | STOP_RING_BLT = (1 << 2), |
| 66 | STOP_RING_VEBOX = (1 << 3), |
| 67 | STOP_RING_ALL = 0xff, |
| 68 | STOP_RING_ALLOW_ERRORS = (1 << 30), |
| 69 | STOP_RING_ALLOW_BAN = (1 << 31), |
| 70 | STOP_RING_DEFAULTS = STOP_RING_ALL | STOP_RING_ALLOW_ERRORS, |
| 71 | }; |
| 72 | |
| 73 | enum stop_ring_flags igt_to_stop_ring_flag(int ring); |
| 74 | void igt_set_stop_rings(enum stop_ring_flags flags); |
| 75 | enum stop_ring_flags igt_get_stop_rings(void); |
| 76 | |
Chris Wilson | 16bafdf | 2014-09-04 09:26:24 +0100 | [diff] [blame] | 77 | #endif /* IGT_GT_H */ |