Merge tag 'lsk-v3.10-15.04-android'
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / rogue / include / servicesext.h
1 /*************************************************************************/ /*!
2 @File
3 @Title          Services definitions required by external drivers
4 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description    Provides services data structures, defines and prototypes
6                 required by external drivers
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 #if !defined (__SERVICESEXT_H__)
46 #define __SERVICESEXT_H__
47
48 /* include/ */
49 #include "pvrsrv_error.h"
50 #include "img_types.h"
51 #include "pvrsrv_device_types.h"
52
53
54 /*
55  * Lock buffer read/write flags
56  */
57 #define PVRSRV_LOCKFLG_READONLY         (1)             /*!< The locking process will only read the locked surface */
58
59 /*!
60  *****************************************************************************
61  *      Services State
62  *****************************************************************************/
63 typedef enum _PVRSRV_SERVICES_STATE_
64 {
65         PVRSRV_SERVICES_STATE_OK = 0,
66         PVRSRV_SERVICES_STATE_BAD,
67 } PVRSRV_SERVICES_STATE;
68
69
70 /*!
71  *****************************************************************************
72  *      States for power management
73  *****************************************************************************/
74 /*!
75   System Power State Enum
76  */
77 typedef enum _PVRSRV_SYS_POWER_STATE_
78 {
79         PVRSRV_SYS_POWER_STATE_Unspecified              = -1,   /*!< Unspecified : Uninitialised */
80         PVRSRV_SYS_POWER_STATE_OFF                              = 0,    /*!< Off */
81         PVRSRV_SYS_POWER_STATE_ON                               = 1,    /*!< On */
82
83         PVRSRV_SYS_POWER_STATE_FORCE_I32 = 0x7fffffff   /*!< Force enum to be at least 32-bits wide */
84
85 } PVRSRV_SYS_POWER_STATE, *PPVRSRV_SYS_POWER_STATE; /*!< Typedef for ptr to PVRSRV_SYS_POWER_STATE */
86
87 /*!
88   Device Power State Enum
89  */
90 typedef enum _PVRSRV_DEV_POWER_STATE_
91 {
92         PVRSRV_DEV_POWER_STATE_DEFAULT  = -1,   /*!< Default state for the device */
93         PVRSRV_DEV_POWER_STATE_OFF              = 0,    /*!< Unpowered */
94         PVRSRV_DEV_POWER_STATE_ON               = 1,    /*!< Running */
95
96         PVRSRV_DEV_POWER_STATE_FORCE_I32 = 0x7fffffff   /*!< Force enum to be at least 32-bits wide */
97
98 } PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE;     /*!< Typedef for ptr to PVRSRV_DEV_POWER_STATE */ /* PRQA S 3205 */
99
100
101 /* Power transition handler prototypes */
102
103 /*! 
104   Typedef for a pointer to a Function that will be called before a transition
105   from one power state to another. See also PFN_POST_POWER.
106  */
107 typedef PVRSRV_ERROR (*PFN_PRE_POWER) (IMG_HANDLE                               hDevHandle,
108                                                                            PVRSRV_DEV_POWER_STATE       eNewPowerState,
109                                                                            PVRSRV_DEV_POWER_STATE       eCurrentPowerState,
110                                                                            IMG_BOOL                                     bForced);
111 /*! 
112   Typedef for a pointer to a Function that will be called after a transition
113   from one power state to another. See also PFN_PRE_POWER.
114  */
115 typedef PVRSRV_ERROR (*PFN_POST_POWER) (IMG_HANDLE                              hDevHandle,
116                                                                                 PVRSRV_DEV_POWER_STATE  eNewPowerState,
117                                                                                 PVRSRV_DEV_POWER_STATE  eCurrentPowerState,
118                                                                                 IMG_BOOL                                bForced);
119
120 /* Clock speed handler prototypes */
121
122 /*!
123   Typedef for a pointer to a Function that will be caled before a transition
124   from one clockspeed to another. See also PFN_POST_CLOCKSPEED_CHANGE.
125  */
126 typedef PVRSRV_ERROR (*PFN_PRE_CLOCKSPEED_CHANGE) (IMG_HANDLE                           hDevHandle,
127                                                                                                    IMG_BOOL                                     bIdleDevice,
128                                                                                                    PVRSRV_DEV_POWER_STATE       eCurrentPowerState);
129
130 /*!
131   Typedef for a pointer to a Function that will be caled after a transition
132   from one clockspeed to another. See also PFN_PRE_CLOCKSPEED_CHANGE.
133  */
134 typedef PVRSRV_ERROR (*PFN_POST_CLOCKSPEED_CHANGE) (IMG_HANDLE                          hDevHandle,
135                                                                                                         IMG_BOOL                                bIdleDevice,
136                                                                                                         PVRSRV_DEV_POWER_STATE  eCurrentPowerState);
137
138 /*!
139  *****************************************************************************
140  * Enumeration of possible alpha types.
141  *****************************************************************************/
142 typedef enum _PVRSRV_COLOURSPACE_FORMAT_ {
143         PVRSRV_COLOURSPACE_FORMAT_UNKNOWN               =  0x00000000,  /*!< Colourspace Format: Unknown */
144         PVRSRV_COLOURSPACE_FORMAT_LINEAR                =  0x00010000,  /*!< Colourspace Format: Linear */
145         PVRSRV_COLOURSPACE_FORMAT_NONLINEAR             =  0x00020000,  /*!< Colourspace Format: Non-Linear */
146         PVRSRV_COLOURSPACE_FORMAT_MASK                  =  0x000F0000,  /*!< Colourspace Format Mask */
147 } PVRSRV_COLOURSPACE_FORMAT;
148
149
150 /*!
151  * Drawable orientation (in degrees clockwise).
152  */
153 typedef enum _PVRSRV_ROTATION_ {
154         PVRSRV_ROTATE_0         =       0,  /*!< Rotate by 0 degres */
155         PVRSRV_ROTATE_90        =       1,  /*!< Rotate by 90 degrees */
156         PVRSRV_ROTATE_180       =       2,  /*!< Rotate by 180 degrees */
157         PVRSRV_ROTATE_270       =       3,  /*!< Rotate by 270 degrees */
158         PVRSRV_FLIP_Y           =       4,  /*!< Flip in Y axis */
159
160 } PVRSRV_ROTATION;
161
162 /*!
163  *****************************************************************************
164  * This structure is used for OS independent registry (profile) access
165  *****************************************************************************/
166
167 typedef struct _PVRSRV_REGISTRY_INFO
168 {
169         IMG_UINT32                      ui32DevCookie;
170         IMG_PCHAR                       pszKey;
171         IMG_PCHAR                       pszValue;
172         IMG_PCHAR                       pszBuf;
173         IMG_UINT32                      ui32BufSize;
174 } PVRSRV_REGISTRY_INFO, *PPVRSRV_REGISTRY_INFO;
175
176 #endif /* __SERVICESEXT_H__ */
177 /*****************************************************************************
178  End of file (servicesext.h)
179 *****************************************************************************/
180