drm/GPU: Add support Imagination PowerVR GPU driver v1.17
[platform/kernel/linux-starfive.git] / drivers / gpu / drm / img / img-rogue / generated / rogue / rgxtq_bridge / common_rgxtq_bridge.h
1 /*******************************************************************************
2 @File
3 @Title          Common bridge header for rgxtq
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 rgxtq
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_RGXTQ_BRIDGE_H
46 #define COMMON_RGXTQ_BRIDGE_H
47
48 #include <powervr/mem_types.h>
49
50 #include "img_defs.h"
51 #include "img_types.h"
52 #include "pvrsrv_error.h"
53
54 #include "rgx_bridge.h"
55 #include "pvrsrv_sync_km.h"
56
57 #define PVRSRV_BRIDGE_RGXTQ_CMD_FIRST                   0
58 #define PVRSRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT                    PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+0
59 #define PVRSRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT                   PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+1
60 #define PVRSRV_BRIDGE_RGXTQ_RGXSETTRANSFERCONTEXTPRIORITY                       PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+2
61 #define PVRSRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER2                  PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+3
62 #define PVRSRV_BRIDGE_RGXTQ_RGXSETTRANSFERCONTEXTPROPERTY                       PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+4
63 #define PVRSRV_BRIDGE_RGXTQ_CMD_LAST                    (PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+4)
64
65 /*******************************************
66             RGXCreateTransferContext
67  *******************************************/
68
69 /* Bridge in structure for RGXCreateTransferContext */
70 typedef struct PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT_TAG
71 {
72         IMG_UINT64 ui64RobustnessAddress;
73         IMG_HANDLE hPrivData;
74         IMG_BYTE *pui8FrameworkCmd;
75         IMG_UINT32 ui32ContextFlags;
76         IMG_UINT32 ui32FrameworkCmdize;
77         IMG_UINT32 ui32PackedCCBSizeU8888;
78         IMG_UINT32 ui32Priority;
79 } __packed PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT;
80
81 /* Bridge out structure for RGXCreateTransferContext */
82 typedef struct PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT_TAG
83 {
84         IMG_HANDLE hCLIPMRMem;
85         IMG_HANDLE hTransferContext;
86         IMG_HANDLE hUSCPMRMem;
87         PVRSRV_ERROR eError;
88 } __packed PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT;
89
90 /*******************************************
91             RGXDestroyTransferContext
92  *******************************************/
93
94 /* Bridge in structure for RGXDestroyTransferContext */
95 typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT_TAG
96 {
97         IMG_HANDLE hTransferContext;
98 } __packed PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT;
99
100 /* Bridge out structure for RGXDestroyTransferContext */
101 typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT_TAG
102 {
103         PVRSRV_ERROR eError;
104 } __packed PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT;
105
106 /*******************************************
107             RGXSetTransferContextPriority
108  *******************************************/
109
110 /* Bridge in structure for RGXSetTransferContextPriority */
111 typedef struct PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY_TAG
112 {
113         IMG_HANDLE hTransferContext;
114         IMG_UINT32 ui32Priority;
115 } __packed PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY;
116
117 /* Bridge out structure for RGXSetTransferContextPriority */
118 typedef struct PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY_TAG
119 {
120         PVRSRV_ERROR eError;
121 } __packed PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY;
122
123 /*******************************************
124             RGXSubmitTransfer2
125  *******************************************/
126
127 /* Bridge in structure for RGXSubmitTransfer2 */
128 typedef struct PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER2_TAG
129 {
130         IMG_HANDLE hTransferContext;
131         IMG_UINT32 *pui32ClientUpdateCount;
132         IMG_UINT32 *pui32CommandSize;
133         IMG_UINT32 *pui32SyncPMRFlags;
134         IMG_UINT32 *pui32TQPrepareFlags;
135         IMG_UINT32 **pui32UpdateSyncOffset;
136         IMG_UINT32 **pui32UpdateValue;
137         IMG_UINT8 **pui8FWCommand;
138         IMG_CHAR *puiUpdateFenceName;
139         IMG_HANDLE *phSyncPMRs;
140         IMG_HANDLE **phUpdateUFOSyncPrimBlock;
141         PVRSRV_TIMELINE h2DUpdateTimeline;
142         PVRSRV_TIMELINE h3DUpdateTimeline;
143         PVRSRV_FENCE hCheckFenceFD;
144         IMG_UINT32 ui32ExtJobRef;
145         IMG_UINT32 ui32PrepareCount;
146         IMG_UINT32 ui32SyncPMRCount;
147 } __packed PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER2;
148
149 /* Bridge out structure for RGXSubmitTransfer2 */
150 typedef struct PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER2_TAG
151 {
152         PVRSRV_ERROR eError;
153         PVRSRV_FENCE h2DUpdateFence;
154         PVRSRV_FENCE h3DUpdateFence;
155 } __packed PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER2;
156
157 /*******************************************
158             RGXSetTransferContextProperty
159  *******************************************/
160
161 /* Bridge in structure for RGXSetTransferContextProperty */
162 typedef struct PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPROPERTY_TAG
163 {
164         IMG_UINT64 ui64Input;
165         IMG_HANDLE hTransferContext;
166         IMG_UINT32 ui32Property;
167 } __packed PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPROPERTY;
168
169 /* Bridge out structure for RGXSetTransferContextProperty */
170 typedef struct PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPROPERTY_TAG
171 {
172         IMG_UINT64 ui64Output;
173         PVRSRV_ERROR eError;
174 } __packed PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPROPERTY;
175
176 #endif /* COMMON_RGXTQ_BRIDGE_H */