]>
Commit | Line | Data |
---|---|---|
46bc9043 TG |
1 | /* |
2 | **************************************************************************** | |
3 | * Copyright 2011 Broadcom Corporation. All rights reserved. | |
4 | * | |
5 | * Unless you and Broadcom execute a separate written software license | |
6 | * agreement governing use of this software, this software is licensed to you | |
7 | * under the terms of the GNU General Public License version 2, available at | |
8 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | |
9 | * | |
10 | * Notwithstanding the above, under no circumstances may you combine this | |
11 | * software in any way with any other Broadcom software provided under a | |
12 | * license other than the GPL, without Broadcom's express prior written | |
13 | * consent. | |
14 | **************************************************************************** | |
15 | */ | |
16 | ||
17 | #ifndef __VC_SM_KNL_H__INCLUDED__ | |
18 | #define __VC_SM_KNL_H__INCLUDED__ | |
19 | ||
20 | #if !defined(__KERNEL__) | |
21 | #error "This interface is for kernel use only..." | |
22 | #endif | |
23 | ||
24 | /* Type of memory to be locked (ie mapped) */ | |
25 | enum vc_sm_lock_cache_mode { | |
26 | VC_SM_LOCK_CACHED, | |
27 | VC_SM_LOCK_NON_CACHED, | |
28 | }; | |
29 | ||
46bc9043 TG |
30 | /* Allocate a shared memory handle and block. */ |
31 | int vc_sm_alloc(struct vc_sm_alloc_t *alloc, int *handle); | |
32 | ||
33 | /* Free a previously allocated shared memory handle and block. */ | |
34 | int vc_sm_free(int handle); | |
35 | ||
36 | /* Lock a memory handle for use by kernel. */ | |
37 | int vc_sm_lock(int handle, enum vc_sm_lock_cache_mode mode, | |
38 | unsigned long *data); | |
39 | ||
40 | /* Unlock a memory handle in use by kernel. */ | |
41 | int vc_sm_unlock(int handle, int flush, int no_vc_unlock); | |
42 | ||
43 | /* Get an internal resource handle mapped from the external one. */ | |
44 | int vc_sm_int_handle(int handle); | |
45 | ||
46 | /* Map a shared memory region for use by kernel. */ | |
47 | int vc_sm_map(int handle, unsigned int sm_addr, | |
48 | enum vc_sm_lock_cache_mode mode, unsigned long *data); | |
49 | ||
50 | /* Import a block of memory into the GPU space. */ | |
51 | int vc_sm_import_dmabuf(struct dma_buf *dmabuf, int *handle); | |
52 | ||
53 | #endif /* __VC_SM_KNL_H__INCLUDED__ */ |