]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/char/broadcom/vc_sm/vc_sm_knl.h
vcsm: Define cache operation constants in user header
[mirror_ubuntu-bionic-kernel.git] / drivers / char / broadcom / vc_sm / vc_sm_knl.h
CommitLineData
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) */
25enum 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. */
31int vc_sm_alloc(struct vc_sm_alloc_t *alloc, int *handle);
32
33/* Free a previously allocated shared memory handle and block. */
34int vc_sm_free(int handle);
35
36/* Lock a memory handle for use by kernel. */
37int 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. */
41int vc_sm_unlock(int handle, int flush, int no_vc_unlock);
42
43/* Get an internal resource handle mapped from the external one. */
44int vc_sm_int_handle(int handle);
45
46/* Map a shared memory region for use by kernel. */
47int 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. */
51int vc_sm_import_dmabuf(struct dma_buf *dmabuf, int *handle);
52
53#endif /* __VC_SM_KNL_H__INCLUDED__ */