1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 /* 3 * 4 * (C) COPYRIGHT 2014, 2016, 2018-2022 ARM Limited. All rights reserved. 5 * 6 * This program is free software and is provided to you under the terms of the 7 * GNU General Public License version 2 as published by the Free Software 8 * Foundation, and any use by you of this program is subject to the terms 9 * of such GNU license. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, you can access it online at 18 * http://www.gnu.org/licenses/gpl-2.0.html. 19 * 20 */ 21 22 /* 23 * Backend-specific instrumentation definitions 24 */ 25 26 #ifndef _KBASE_INSTR_DEFS_H_ 27 #define _KBASE_INSTR_DEFS_H_ 28 29 #include <hwcnt/mali_kbase_hwcnt_gpu.h> 30 31 /* 32 * Instrumentation State Machine States 33 */ 34 enum kbase_instr_state { 35 /* State where instrumentation is not active */ 36 KBASE_INSTR_STATE_DISABLED = 0, 37 /* State machine is active and ready for a command. */ 38 KBASE_INSTR_STATE_IDLE, 39 /* Hardware is currently dumping a frame. */ 40 KBASE_INSTR_STATE_DUMPING, 41 /* An error has occurred during DUMPING (page fault). */ 42 KBASE_INSTR_STATE_FAULT, 43 /* An unrecoverable error has occurred, a reset is the only way to exit 44 * from unrecoverable error state. 45 */ 46 KBASE_INSTR_STATE_UNRECOVERABLE_ERROR, 47 }; 48 49 /* Structure used for instrumentation and HW counters dumping */ 50 struct kbase_instr_backend { 51 wait_queue_head_t wait; 52 int triggered; 53 #ifdef CONFIG_MALI_PRFCNT_SET_SELECT_VIA_DEBUG_FS 54 enum kbase_hwcnt_physical_set override_counter_set; 55 #endif 56 57 enum kbase_instr_state state; 58 }; 59 60 #endif /* _KBASE_INSTR_DEFS_H_ */ 61