RK3368 GPU: Rogue N Init.
[firefly-linux-kernel-4.4.55.git] / drivers / staging / imgtec / rogue / generated / dmabuf_bridge / common_dmabuf_bridge.h
1 /*************************************************************************/ /*!
2 @File
3 @Title          Common bridge header for dmabuf
4 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description    Declares common defines and structures used by both the client
6                 and server side of the bridge for dmabuf
7 @License        Dual MIT/GPLv2
8
9 The contents of this file are subject to the MIT license as set out below.
10
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13 in the Software without restriction, including without limitation the rights
14 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom the Software is
16 furnished to do so, subject to the following conditions:
17
18 The above copyright notice and this permission notice shall be included in
19 all copies or substantial portions of the Software.
20
21 Alternatively, the contents of this file may be used under the terms of
22 the GNU General Public License Version 2 ("GPL") in which case the provisions
23 of GPL are applicable instead of those above.
24
25 If you wish to allow use of your version of this file only under the terms of
26 GPL, and not to allow others to use your version of this file under the terms
27 of the MIT license, indicate your decision by deleting the provisions above
28 and replace them with the notice and other provisions required by GPL as set
29 out in the file called "GPL-COPYING" included in this distribution. If you do
30 not delete the provisions above, a recipient may use your version of this file
31 under the terms of either the MIT license or GPL.
32
33 This License is also included in this distribution in the file called
34 "MIT-COPYING".
35
36 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
37 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
38 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
39 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
40 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
41 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
42 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43 */ /**************************************************************************/
44
45 #ifndef COMMON_DMABUF_BRIDGE_H
46 #define COMMON_DMABUF_BRIDGE_H
47
48 #include <powervr/mem_types.h>
49
50 #include "img_types.h"
51 #include "pvrsrv_error.h"
52
53 #include "pvrsrv_memallocflags.h"
54
55
56 #define PVRSRV_BRIDGE_DMABUF_CMD_FIRST                  0
57 #define PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF                        PVRSRV_BRIDGE_DMABUF_CMD_FIRST+0
58 #define PVRSRV_BRIDGE_DMABUF_PHYSMEMEXPORTDMABUF                        PVRSRV_BRIDGE_DMABUF_CMD_FIRST+1
59 #define PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTSPARSEDMABUF                  PVRSRV_BRIDGE_DMABUF_CMD_FIRST+2
60 #define PVRSRV_BRIDGE_DMABUF_CMD_LAST                   (PVRSRV_BRIDGE_DMABUF_CMD_FIRST+2)
61
62
63 /*******************************************
64             PhysmemImportDmaBuf          
65  *******************************************/
66
67 /* Bridge in structure for PhysmemImportDmaBuf */
68 typedef struct PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF_TAG
69 {
70         IMG_INT ifd;
71         PVRSRV_MEMALLOCFLAGS_T uiFlags;
72 } __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF;
73
74 /* Bridge out structure for PhysmemImportDmaBuf */
75 typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF_TAG
76 {
77         IMG_HANDLE hPMRPtr;
78         IMG_DEVMEM_SIZE_T uiSize;
79         IMG_DEVMEM_ALIGN_T sAlign;
80         PVRSRV_ERROR eError;
81 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF;
82
83
84 /*******************************************
85             PhysmemExportDmaBuf          
86  *******************************************/
87
88 /* Bridge in structure for PhysmemExportDmaBuf */
89 typedef struct PVRSRV_BRIDGE_IN_PHYSMEMEXPORTDMABUF_TAG
90 {
91         IMG_HANDLE hPMR;
92 } __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMEXPORTDMABUF;
93
94 /* Bridge out structure for PhysmemExportDmaBuf */
95 typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMEXPORTDMABUF_TAG
96 {
97         IMG_INT iFd;
98         PVRSRV_ERROR eError;
99 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMEXPORTDMABUF;
100
101
102 /*******************************************
103             PhysmemImportSparseDmaBuf          
104  *******************************************/
105
106 /* Bridge in structure for PhysmemImportSparseDmaBuf */
107 typedef struct PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSPARSEDMABUF_TAG
108 {
109         IMG_INT ifd;
110         PVRSRV_MEMALLOCFLAGS_T uiFlags;
111         IMG_DEVMEM_SIZE_T uiChunkSize;
112         IMG_UINT32 ui32NumPhysChunks;
113         IMG_UINT32 ui32NumVirtChunks;
114         IMG_UINT32 * pui32MappingTable;
115 } __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSPARSEDMABUF;
116
117 /* Bridge out structure for PhysmemImportSparseDmaBuf */
118 typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSPARSEDMABUF_TAG
119 {
120         IMG_HANDLE hPMRPtr;
121         IMG_DEVMEM_SIZE_T uiSize;
122         IMG_DEVMEM_ALIGN_T sAlign;
123         PVRSRV_ERROR eError;
124 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSPARSEDMABUF;
125
126
127 #endif /* COMMON_DMABUF_BRIDGE_H */