1 /*************************************************************************/ /*!
3 @Title Device class external
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Defines DC specific structures which are externally visible
6 (i.e. visible to clients of services), but are also required
8 @License Dual MIT/GPLv2
10 The contents of this file are subject to the MIT license as set out below.
12 Permission is hereby granted, free of charge, to any person obtaining a copy
13 of this software and associated documentation files (the "Software"), to deal
14 in the Software without restriction, including without limitation the rights
15 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16 copies of the Software, and to permit persons to whom the Software is
17 furnished to do so, subject to the following conditions:
19 The above copyright notice and this permission notice shall be included in
20 all copies or substantial portions of the Software.
22 Alternatively, the contents of this file may be used under the terms of
23 the GNU General Public License Version 2 ("GPL") in which case the provisions
24 of GPL are applicable instead of those above.
26 If you wish to allow use of your version of this file only under the terms of
27 GPL, and not to allow others to use your version of this file under the terms
28 of the MIT license, indicate your decision by deleting the provisions above
29 and replace them with the notice and other provisions required by GPL as set
30 out in the file called "GPL-COPYING" included in this distribution. If you do
31 not delete the provisions above, a recipient may use your version of this file
32 under the terms of either the MIT license or GPL.
34 This License is also included in this distribution in the file called
37 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
38 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
39 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
40 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
41 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
42 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
43 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44 */ /**************************************************************************/
46 #ifndef _PVRSRV_SURFACE_H_
47 #define _PVRSRV_SURFACE_H_
49 #include "img_types.h"
50 #include "fbc_types.h"
52 #define PVRSRV_SURFACE_TRANSFORM_NONE (0 << 0)
53 #define PVRSRV_SURFACE_TRANSFORM_FLIP_H (1 << 0)
54 #define PVRSRV_SURFACE_TRANSFORM_FLIP_V (1 << 1)
55 #define PVRSRV_SURFACE_TRANSFORM_ROT_90 (1 << 2)
56 #define PVRSRV_SURFACE_TRANSFORM_ROT_180 ((1 << 0) + (1 << 1))
57 #define PVRSRV_SURFACE_TRANSFORM_ROT_270 ((1 << 0) + (1 << 1) + (1 << 2))
59 #define PVRSRV_SURFACE_BLENDING_NONE 0
60 #define PVRSRV_SURFACE_BLENDING_PREMULT 1
61 #define PVRSRV_SURFACE_BLENDING_COVERAGE 2
63 typedef enum _PVRSRV_SURFACE_MEMLAYOUT_ {
64 PVRSRV_SURFACE_MEMLAYOUT_STRIDED = 0, /*!< Strided memory buffer */
65 PVRSRV_SURFACE_MEMLAYOUT_FBC, /*!< Frame buffer compressed buffer */
66 PVRSRV_SURFACE_MEMLAYOUT_BIF_PAGE_TILED, /*!< BIF page tiled buffer */
67 } PVRSRV_SURFACE_MEMLAYOUT;
69 typedef struct _PVRSRV_SURFACE_FBC_LAYOUT_ {
70 FB_COMPRESSION eFBCompressionMode;
71 } PVRSRV_SURFACE_FBC_LAYOUT;
73 typedef struct _PVRSRV_SURFACE_FORMAT_
75 IMG_UINT32 ePixFormat;
76 PVRSRV_SURFACE_MEMLAYOUT eMemLayout;
78 PVRSRV_SURFACE_FBC_LAYOUT sFBCLayout;
80 } PVRSRV_SURFACE_FORMAT;
82 typedef struct _PVRSRV_SURFACE_DIMS_
85 IMG_UINT32 ui32Height;
86 } PVRSRV_SURFACE_DIMS;
88 typedef struct _PVRSRV_SURFACE_INFO_
90 PVRSRV_SURFACE_DIMS sDims;
91 PVRSRV_SURFACE_FORMAT sFormat;
92 } PVRSRV_SURFACE_INFO;
94 typedef struct _PVRSRV_SURFACE_RECT_
98 PVRSRV_SURFACE_DIMS sDims;
99 } PVRSRV_SURFACE_RECT;
101 typedef struct _PVRSRV_SURFACE_CONFIG_INFO_
103 /*!< Crop applied to surface (BEFORE transformation) */
104 PVRSRV_SURFACE_RECT sCrop;
106 /*!< Region of screen to display surface in (AFTER scaling) */
107 PVRSRV_SURFACE_RECT sDisplay;
109 /*!< Surface rotation / flip / mirror */
110 IMG_UINT32 ui32Transform;
112 /*!< Alpha blending mode e.g. none / premult / coverage */
113 IMG_UINT32 eBlendType;
115 /*!< Custom data for the display engine */
116 IMG_UINT32 ui32Custom;
119 IMG_UINT8 ui8PlaneAlpha;
120 IMG_UINT8 ui8Reserved1[3];
121 } PVRSRV_SURFACE_CONFIG_INFO;
123 typedef struct _PVRSRV_PANEL_INFO_
125 PVRSRV_SURFACE_INFO sSurfaceInfo;
126 IMG_UINT32 ui32RefreshRate;
132 Helper function to create a Config Info based on a Surface Info
133 to do a flip with no scale, transformation etc.
135 static INLINE IMG_VOID SurfaceConfigFromSurfInfo(PVRSRV_SURFACE_INFO *psSurfaceInfo,
136 PVRSRV_SURFACE_CONFIG_INFO *psConfigInfo)
138 psConfigInfo->sCrop.sDims = psSurfaceInfo->sDims;
139 psConfigInfo->sCrop.i32XOffset = 0;
140 psConfigInfo->sCrop.i32YOffset = 0;
141 psConfigInfo->sDisplay.sDims = psSurfaceInfo->sDims;
142 psConfigInfo->sDisplay.i32XOffset = 0;
143 psConfigInfo->sDisplay.i32YOffset = 0;
144 psConfigInfo->ui32Transform = PVRSRV_SURFACE_TRANSFORM_NONE;
145 psConfigInfo->eBlendType = PVRSRV_SURFACE_BLENDING_NONE;
146 psConfigInfo->ui32Custom = 0;
147 psConfigInfo->ui8PlaneAlpha = 0xff;
150 #endif /* _PVRSRV_SURFACE_H_ */