cf7bf1b35dc59e7c6c0a2aa1a3fcbb9f436150f8
[GitHub/LineageOS/G12/android_hardware_amlogic_kernel-modules_mali-driver.git] / t83x / kernel / drivers / gpu / arm / midgard / mali_kbase_hwcnt_reader.h
1 /*
2 *
3 * (C) COPYRIGHT 2015 ARM Limited. All rights reserved.
4 *
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
8 * of such GNU licence.
9 *
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
13 *
14 */
15
16
17
18 #ifndef _KBASE_HWCNT_READER_H_
19 #define _KBASE_HWCNT_READER_H_
20
21 /* The ids of ioctl commands. */
22 #define KBASE_HWCNT_READER 0xBE
23 #define KBASE_HWCNT_READER_GET_HWVER _IOR(KBASE_HWCNT_READER, 0x00, u32)
24 #define KBASE_HWCNT_READER_GET_BUFFER_SIZE _IOR(KBASE_HWCNT_READER, 0x01, u32)
25 #define KBASE_HWCNT_READER_DUMP _IOW(KBASE_HWCNT_READER, 0x10, u32)
26 #define KBASE_HWCNT_READER_CLEAR _IOW(KBASE_HWCNT_READER, 0x11, u32)
27 #define KBASE_HWCNT_READER_GET_BUFFER _IOR(KBASE_HWCNT_READER, 0x20,\
28 struct kbase_hwcnt_reader_metadata)
29 #define KBASE_HWCNT_READER_PUT_BUFFER _IOW(KBASE_HWCNT_READER, 0x21,\
30 struct kbase_hwcnt_reader_metadata)
31 #define KBASE_HWCNT_READER_SET_INTERVAL _IOW(KBASE_HWCNT_READER, 0x30, u32)
32 #define KBASE_HWCNT_READER_ENABLE_EVENT _IOW(KBASE_HWCNT_READER, 0x40, u32)
33 #define KBASE_HWCNT_READER_DISABLE_EVENT _IOW(KBASE_HWCNT_READER, 0x41, u32)
34 #define KBASE_HWCNT_READER_GET_API_VERSION _IOW(KBASE_HWCNT_READER, 0xFF, u32)
35
36 /**
37 * struct kbase_hwcnt_reader_metadata - hwcnt reader sample buffer metadata
38 * @timestamp: time when sample was collected
39 * @event_id: id of an event that triggered sample collection
40 * @buffer_idx: position in sampling area where sample buffer was stored
41 */
42 struct kbase_hwcnt_reader_metadata {
43 u64 timestamp;
44 u32 event_id;
45 u32 buffer_idx;
46 };
47
48 /**
49 * enum base_hwcnt_reader_event - hwcnt dumping events
50 * @BASE_HWCNT_READER_EVENT_MANUAL: manual request for dump
51 * @BASE_HWCNT_READER_EVENT_PERIODIC: periodic dump
52 * @BASE_HWCNT_READER_EVENT_PREJOB: prejob dump request
53 * @BASE_HWCNT_READER_EVENT_POSTJOB: postjob dump request
54 * @BASE_HWCNT_READER_EVENT_COUNT: number of supported events
55 */
56 enum base_hwcnt_reader_event {
57 BASE_HWCNT_READER_EVENT_MANUAL,
58 BASE_HWCNT_READER_EVENT_PERIODIC,
59 BASE_HWCNT_READER_EVENT_PREJOB,
60 BASE_HWCNT_READER_EVENT_POSTJOB,
61
62 BASE_HWCNT_READER_EVENT_COUNT
63 };
64
65 #endif /* _KBASE_HWCNT_READER_H_ */
66