summaryrefslogtreecommitdiff
path: root/dvalin/kernel/drivers/gpu/arm/midgard/mmu/mali_kbase_mmu_internal.h
blob: b8cd55f9cb64430b084e22830059f67efa40e0de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 *
 * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved.
 *
 * This program is free software and is provided to you under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation, and any use by you of this program is subject to the terms
 * of such GNU license.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you can access it online at
 * http://www.gnu.org/licenses/gpl-2.0.html.
 *
 */

#ifndef _KBASE_MMU_INTERNAL_H_
#define _KBASE_MMU_INTERNAL_H_

void kbase_mmu_get_as_setup(struct kbase_mmu_table *mmut,
		struct kbase_mmu_setup * const setup);

/**
 * kbase_mmu_report_mcu_as_fault_and_reset - Report page fault for all
 *                                           address spaces and reset the GPU.
 * @kbdev:   The kbase_device the fault happened on
 * @fault:   Data relating to the fault
 */
void kbase_mmu_report_mcu_as_fault_and_reset(struct kbase_device *kbdev,
		struct kbase_fault *fault);

void kbase_gpu_report_bus_fault_and_kill(struct kbase_context *kctx,
		struct kbase_as *as, struct kbase_fault *fault);

void kbase_mmu_report_fault_and_kill(struct kbase_context *kctx,
		struct kbase_as *as, const char *reason_str,
		struct kbase_fault *fault);

/**
 * kbase_mmu_switch_to_ir() - Switch to incremental rendering if possible
 * @kctx:	kbase_context for the faulting address space.
 * @reg:	of a growable GPU memory region in the same context.
 *		Takes ownership of the reference if successful.
 *
 * Used to switch to incremental rendering if we have nearly run out of
 * virtual address space in a growable memory region.
 *
 * Return 0 if successful, otherwise a negative error code.
 */
int kbase_mmu_switch_to_ir(struct kbase_context *kctx,
	struct kbase_va_region *reg);

/**
 * kbase_mmu_page_fault_worker() - Process a page fault.
 *
 * @data:  work_struct passed by queue_work()
 */
void kbase_mmu_page_fault_worker(struct work_struct *data);

/**
 * kbase_mmu_bus_fault_worker() - Process a bus fault.
 *
 * @data:  work_struct passed by queue_work()
 */
void kbase_mmu_bus_fault_worker(struct work_struct *data);

#endif /* _KBASE_MMU_INTERNAL_H_ */