RK3368 GPU: Rogue N Init.
[firefly-linux-kernel-4.4.55.git] / drivers / staging / imgtec / rogue / rgxlayer.h
1 /*************************************************************************/ /*!
2 @File
3 @Title          Header for Services abstraction layer
4 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description    Declaration of an interface layer used to abstract code that
6                 can be compiled outside of the DDK, potentially in a
7                 completely different OS.
8                 All the headers included by this file must also be copied to
9                 the alternative source tree.
10                 All the functions declared here must have a DDK implementation
11                 inside the DDK source tree (e.g. rgxlayer_impl.h/.c) and
12                 another different implementation in case they are used outside
13                 of the DDK.
14                 All of the functions accept as a first parameter a
15                 "const void *hPrivate" argument. It should be used to pass
16                 around any implementation specific data required.
17 @License        Dual MIT/GPLv2
18
19 The contents of this file are subject to the MIT license as set out below.
20
21 Permission is hereby granted, free of charge, to any person obtaining a copy
22 of this software and associated documentation files (the "Software"), to deal
23 in the Software without restriction, including without limitation the rights
24 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 copies of the Software, and to permit persons to whom the Software is
26 furnished to do so, subject to the following conditions:
27
28 The above copyright notice and this permission notice shall be included in
29 all copies or substantial portions of the Software.
30
31 Alternatively, the contents of this file may be used under the terms of
32 the GNU General Public License Version 2 ("GPL") in which case the provisions
33 of GPL are applicable instead of those above.
34
35 If you wish to allow use of your version of this file only under the terms of
36 GPL, and not to allow others to use your version of this file under the terms
37 of the MIT license, indicate your decision by deleting the provisions above
38 and replace them with the notice and other provisions required by GPL as set
39 out in the file called "GPL-COPYING" included in this distribution. If you do
40 not delete the provisions above, a recipient may use your version of this file
41 under the terms of either the MIT license or GPL.
42
43 This License is also included in this distribution in the file called
44 "MIT-COPYING".
45
46 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
47 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
48 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
49 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
50 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
51 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
52 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
53 */ /**************************************************************************/
54
55 #if !defined (__RGXLAYER_H__)
56 #define __RGXLAYER_H__
57
58 #if defined (__cplusplus)
59 extern "C" {
60 #endif
61
62
63 #include "img_defs.h"
64 #include "img_types.h"
65 #include "pvrsrv_error.h" /* includes pvrsrv_errors.h */
66 #if defined(SUPPORT_KERNEL_SRVINIT)
67 #include "rgx_bvnc_defs_km.h"
68 #endif
69
70 #include "rgx_firmware_processor.h"
71 /* includes:
72  * rgx_meta.h and rgx_mips.h,
73  * rgxdefs_km.h,
74  * rgx_cr_defs_km.h (under SUPPORT_KERNEL_SRVINIT),
75  * RGX_BVNC_CORE_KM_HEADER (rgxcore_km_B.V.N.C.h),
76  * RGX_BNC_CONFIG_KM_HEADER (rgxconfig_km_B.V.N.C.h)
77  */
78
79 #include "rgx_fwif_shared.h"
80 /* FIXME required because of RGXFWIF_DEV_VIRTADDR but this header
81  * includes a lot of other headers..  RGXFWIF_DEV_VIRTADDR must be moved
82  * somewhere else (either img_types.h or a new header) */
83
84
85 /*!
86 *******************************************************************************
87
88  @Function       RGXMemCopy
89
90  @Description    MemCopy implementation
91
92  @Input          hPrivate   : Implementation specific data
93  @Input          pvDst      : Pointer to the destination
94  @Input          pvSrc      : Pointer to the source location
95  @Input          uiSize     : The amount of memory to copy in bytes
96
97  @Return         void
98
99 ******************************************************************************/
100 IMG_INTERNAL
101 void RGXMemCopy(const void *hPrivate,
102                 void *pvDst,
103                 void *pvSrc,
104                 size_t uiSize);
105
106 /*!
107 *******************************************************************************
108
109  @Function       RGXMemSet
110
111  @Description    MemSet implementation
112
113  @Input          hPrivate   : Implementation specific data
114  @Input          pvDst      : Pointer to the start of the memory region
115  @Input          ui8Value   : The value to be written
116  @Input          uiSize     : The number of bytes to be set to ui8Value
117
118  @Return         void
119
120 ******************************************************************************/
121 IMG_INTERNAL
122 void RGXMemSet(const void *hPrivate,
123                void *pvDst,
124                IMG_UINT8 ui8Value,
125                size_t uiSize);
126
127 /*!
128 *******************************************************************************
129
130  @Function       RGXCommentLogInit
131
132  @Description    Generic log function used for debugging or other purposes
133
134  @Input          hPrivate   : Implementation specific data
135  @Input          pszString  : Message to be printed
136  @Input          ...        : Variadic arguments
137
138  @Return         void
139
140 ******************************************************************************/
141 IMG_INTERNAL
142 void RGXCommentLogInit(const void *hPrivate,
143                        const IMG_CHAR *pszString,
144                        ...) __printf(2, 3);
145
146 /*!
147 *******************************************************************************
148
149  @Function       RGXErrorLogInit
150
151  @Description    Generic error log function used for debugging or other purposes
152
153  @Input          hPrivate   : Implementation specific data
154  @Input          pszString  : Message to be printed
155  @Input          ...        : Variadic arguments
156
157  @Return         void
158
159 ******************************************************************************/
160 IMG_INTERNAL
161 void RGXErrorLogInit(const void *hPrivate,
162                      const IMG_CHAR *pszString,
163                      ...) __printf(2, 3);
164
165 #if defined(SUPPORT_KERNEL_SRVINIT)
166 /*!
167 *******************************************************************************
168
169  @Function       RGXDeviceHasFeatureInit
170
171  @Description    Checks if a device has a particular feature
172
173  @Input          hPrivate     : Implementation specific data
174  @Input          ui64Feature  : Feature to check
175
176  @Return         IMG_TRUE if the given feature is available, IMG_FALSE otherwise
177
178 ******************************************************************************/
179 IMG_INTERNAL
180 IMG_BOOL RGXDeviceHasFeatureInit(const void *hPrivate, IMG_UINT64 ui64Feature);
181 #endif
182
183 /*!
184 *******************************************************************************
185
186  @Function       RGXGetFWCorememSize
187
188  @Description    Get the FW coremem size
189
190  @Input          hPrivate   : Implementation specific data
191
192  @Return         FW coremem size
193
194 ******************************************************************************/
195 IMG_INTERNAL
196 IMG_UINT32 RGXGetFWCorememSize(const void *hPrivate);
197
198
199 #if defined (__cplusplus)
200 }
201 #endif
202
203 #endif /* !defined (__RGXLAYER_H__) */
204