tizen 2.4 release
[kernel/linux-3.0.git] / drivers / gpu / arm / mali400 / ump / common / ump_kernel_types.h
1 /*
2  * Copyright (C) 2011-2012 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
18 typedef enum
19 {
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 {
27         UMP_NOT_LOCKED = 0,
28         UMP_READ = 1,
29         UMP_READ_WRITE = 3,
30 } ump_lock_usage;
31
32
33 /*
34  * This struct is what is "behind" a ump_dd_handle
35  */
36 typedef struct ump_dd_mem
37 {
38         ump_secure_id secure_id;
39         _mali_osk_atomic_t ref_count;
40         unsigned long size_bytes;
41         unsigned long nr_blocks;
42         ump_dd_physical_block * block_array;
43         void (*release_func)(void * ctx, struct ump_dd_mem * descriptor);
44         void * ctx;
45         void * backend_info;
46         int is_cached;
47         ump_hw_usage hw_device;
48         ump_lock_usage lock_usage;
49 /* MALI_SEC */
50 #ifdef CONFIG_DMA_SHARED_BUFFER
51         struct dma_buf_attachment *import_attach;
52         struct sg_table *sgt;
53 #endif
54 } ump_dd_mem;
55
56
57
58 #endif /* __UMP_KERNEL_TYPES_H__ */