098ce1412738029ad315bb72760774b6418796e8
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / mali400 / ump / common / ump_kernel_types.h
1 /*
2  * Copyright (C) 2010-2015 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 __UMP_KERNEL_TYPES_H__
12 #define __UMP_KERNEL_TYPES_H__
13
14 #include "ump_kernel_interface.h"
15 #include "mali_osk.h"
16
17 #include <linux/rbtree.h>
18
19 typedef enum {
20         UMP_USED_BY_CPU = 0,
21         UMP_USED_BY_MALI = 1,
22         UMP_USED_BY_UNKNOWN_DEVICE = 100,
23 } ump_hw_usage;
24
25 typedef enum {
26         UMP_NOT_LOCKED = 0,
27         UMP_READ = 1,
28         UMP_READ_WRITE = 3,
29 } ump_lock_usage;
30
31 /*
32  * This struct is what is "behind" a ump_dd_handle
33  */
34 typedef struct ump_dd_mem {
35         struct rb_node node;
36         ump_secure_id secure_id;
37         _mali_osk_atomic_t ref_count;
38         unsigned long size_bytes;
39         unsigned long nr_blocks;
40         ump_dd_physical_block *block_array;
41         void (*release_func)(void *ctx, struct ump_dd_mem *descriptor);
42         void *ctx;
43         void *backend_info;
44         int is_cached;
45         ump_hw_usage hw_device;
46         ump_lock_usage lock_usage;
47 } ump_dd_mem;
48
49
50
51 #endif /* __UMP_KERNEL_TYPES_H__ */