xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/mali400/mali/linux/mali_memory_cow.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright (C) 2013-2017 ARM Limited. All rights reserved.
3  *
4  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6  *
7  * A copy of the licence is included with the program, and can also be obtained from Free Software
8  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9  */
10 
11 #ifndef __MALI_MEMORY_COW_H__
12 #define __MALI_MEMORY_COW_H__
13 
14 #include "mali_osk.h"
15 #include "mali_session.h"
16 #include "mali_memory_types.h"
17 
18 int mali_mem_cow_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma);
19 _mali_osk_errcode_t mali_mem_cow_cpu_map_pages_locked(mali_mem_backend *mem_bkend,
20 		struct vm_area_struct *vma,
21 		unsigned long vaddr,
22 		int num);
23 
24 _mali_osk_errcode_t mali_memory_do_cow(mali_mem_backend *target_bk,
25 				       u32 target_offset,
26 				       u32 target_size,
27 				       mali_mem_backend *backend,
28 				       u32 range_start,
29 				       u32 range_size);
30 
31 _mali_osk_errcode_t mali_memory_cow_modify_range(mali_mem_backend *backend,
32 		u32 range_start,
33 		u32 range_size);
34 
35 _mali_osk_errcode_t mali_memory_cow_os_memory(mali_mem_backend *target_bk,
36 		u32 target_offset,
37 		u32 target_size,
38 		mali_mem_backend *backend,
39 		u32 range_start,
40 		u32 range_size);
41 
42 void _mali_mem_cow_copy_page(mali_page_node *src_node, mali_page_node *dst_node);
43 
44 int mali_mem_cow_mali_map(mali_mem_backend *mem_bkend, u32 range_start, u32 range_size);
45 u32 mali_mem_cow_release(mali_mem_backend *mem_bkend, mali_bool is_mali_mapped);
46 _mali_osk_errcode_t mali_mem_cow_allocate_on_demand(mali_mem_backend *mem_bkend, u32 offset_page);
47 #endif
48 
49