gpu: update midgard r21p0 kernel driver
[GitHub/LineageOS/G12/android_hardware_amlogic_kernel-modules_mali-driver.git] / t83x / kernel / drivers / gpu / arm / midgard / backend / gpu / mali_kbase_device_internal.h
1 /*
2 *
3 * (C) COPYRIGHT 2014 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
19
20 /*
21 * Backend-specific HW access device APIs
22 */
23
24 #ifndef _KBASE_DEVICE_INTERNAL_H_
25 #define _KBASE_DEVICE_INTERNAL_H_
26
27 /**
28 * kbase_reg_write - write to GPU register
29 * @kbdev: Kbase device pointer
30 * @offset: Offset of register
31 * @value: Value to write
32 * @kctx: Kbase context pointer. May be NULL
33 *
34 * Caller must ensure the GPU is powered (@kbdev->pm.gpu_powered != false). If
35 * @kctx is not NULL then the caller must ensure it is scheduled (@kctx->as_nr
36 * != KBASEP_AS_NR_INVALID).
37 */
38 void kbase_reg_write(struct kbase_device *kbdev, u16 offset, u32 value,
39 struct kbase_context *kctx);
40
41 /**
42 * kbase_reg_read - read from GPU register
43 * @kbdev: Kbase device pointer
44 * @offset: Offset of register
45 * @kctx: Kbase context pointer. May be NULL
46 *
47 * Caller must ensure the GPU is powered (@kbdev->pm.gpu_powered != false). If
48 * @kctx is not NULL then the caller must ensure it is scheduled (@kctx->as_nr
49 * != KBASEP_AS_NR_INVALID).
50 *
51 * Return: Value in desired register
52 */
53 u32 kbase_reg_read(struct kbase_device *kbdev, u16 offset,
54 struct kbase_context *kctx);
55
56
57 /**
58 * kbase_gpu_interrupt - GPU interrupt handler
59 * @kbdev: Kbase device pointer
60 * @val: The value of the GPU IRQ status register which triggered the call
61 *
62 * This function is called from the interrupt handler when a GPU irq is to be
63 * handled.
64 */
65 void kbase_gpu_interrupt(struct kbase_device *kbdev, u32 val);
66
67 #endif /* _KBASE_DEVICE_INTERNAL_H_ */