Advertisement
Guest User

Patch_qt_wsegl_v1_to_v4.patch

a guest
May 21st, 2014
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.18 KB | None | 0 0
  1. diff -uNr qt-everywhere-opensource-src-4.8.5.org/src/3rdparty/powervr/pvr2d.h qt-everywhere-opensource-src-4.8.5/src/3rdparty/powervr/pvr2d.h
  2. --- qt-everywhere-opensource-src-4.8.5.org/src/3rdparty/powervr/pvr2d.h 2013-06-07 07:16:52.000000000 +0200
  3. +++ qt-everywhere-opensource-src-4.8.5/src/3rdparty/powervr/pvr2d.h 2013-12-16 13:53:10.800503804 +0100
  4. @@ -1,16 +1,43 @@
  5. -/*!****************************************************************************
  6. -@File pvr2d.h
  7. -@Title PVR2D external header file
  8. -@Author Imagination Technologies
  9. -@Copyright Copyright (c) by Imagination Technologies Limited.
  10. - This specification is protected by copyright laws and contains
  11. - material proprietary to Imagination Technologies Limited.
  12. - You may use and distribute this specification free of charge for implementing
  13. - the functionality therein, without altering or removing any trademark, copyright,
  14. - or other notice from the specification.
  15. -@Platform Generic
  16. -@Description PVR2D definitions for PVR2D clients
  17. -******************************************************************************/
  18. +/*************************************************************************/ /*!
  19. +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
  20. +@License Dual MIT/GPLv2
  21. +
  22. +The contents of this file are subject to the MIT license as set out below.
  23. +
  24. +Permission is hereby granted, free of charge, to any person obtaining a copy
  25. +of this software and associated documentation files (the "Software"), to deal
  26. +in the Software without restriction, including without limitation the rights
  27. +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  28. +copies of the Software, and to permit persons to whom the Software is
  29. +furnished to do so, subject to the following conditions:
  30. +
  31. +The above copyright notice and this permission notice shall be included in
  32. +all copies or substantial portions of the Software.
  33. +
  34. +Alternatively, the contents of this file may be used under the terms of
  35. +the GNU General Public License Version 2 ("GPL") in which case the provisions
  36. +of GPL are applicable instead of those above.
  37. +
  38. +If you wish to allow use of your version of this file only under the terms of
  39. +GPL, and not to allow others to use your version of this file under the terms
  40. +of the MIT license, indicate your decision by deleting the provisions above
  41. +and replace them with the notice and other provisions required by GPL as set
  42. +out in the file called "GPL-COPYING" included in this distribution. If you do
  43. +not delete the provisions above, a recipient may use your version of this file
  44. +under the terms of either the MIT license or GPL.
  45. +
  46. +This License is also included in this distribution in the file called
  47. +"MIT-COPYING".
  48. +
  49. +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
  50. +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
  51. +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  52. +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
  53. +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  54. +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  55. +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  56. +
  57. +*/ /**************************************************************************/
  58.  
  59.  
  60. /******************************************************************************
  61. @@ -23,22 +50,46 @@
  62.  
  63. #ifdef __cplusplus
  64. extern "C" {
  65. -#endif
  66. +#endif
  67.  
  68. /* PVR2D Platform-specific definitions */
  69. +#if defined (__linux__)
  70. +#define PVR2D_EXPORT __attribute__((visibility("default")))
  71. +#define PVR2D_IMPORT
  72. +#else
  73. #define PVR2D_EXPORT
  74. #define PVR2D_IMPORT
  75. +#endif
  76.  
  77. +/* PVR2D header revision */
  78. +#define PVR2D_REV_MAJOR 3
  79. +#define PVR2D_REV_MINOR 6
  80.  
  81. -#define PVR2D_REV_MAJOR 2
  82. -#define PVR2D_REV_MINOR 1
  83. -
  84. +/* Basic types */
  85. typedef enum
  86. {
  87. PVR2D_FALSE = 0,
  88. PVR2D_TRUE
  89. } PVR2D_BOOL;
  90.  
  91. +typedef void* PVR2D_HANDLE;
  92. +
  93. +typedef char PVR2D_CHAR, *PVR2D_PCHAR;
  94. +typedef unsigned char PVR2D_UCHAR, *PVR2D_PUCHAR;
  95. +
  96. +typedef int PVR2D_INT, *PVR2D_PINT;
  97. +typedef unsigned int PVR2D_UINT, *PVR2D_PUINT;
  98. +
  99. +typedef unsigned short PVR2D_UINT16, *PVR2D_PUINT16;
  100. +typedef signed short PVR2D_INT16, *PVR2D_PINT16;
  101. +
  102. +typedef long PVR2D_LONG, *PVR2D_PLONG;
  103. +typedef unsigned long PVR2D_ULONG, *PVR2D_PULONG;
  104. +
  105. +typedef void PVR2D_VOID, *PVR2D_PVOID;
  106. +
  107. +/* services/stream ID */
  108. +typedef unsigned int PVR2D_SID;
  109.  
  110. /* error codes */
  111. typedef enum
  112. @@ -57,52 +108,107 @@
  113. PVR2DERROR_MAPPING_FAILED = -11
  114. }PVR2DERROR;
  115.  
  116. +/* 32 bit PVR2D pixel format specifier */
  117. +typedef unsigned long PVR2DFORMAT;
  118.  
  119. -/* pixel formats */
  120. -typedef enum
  121. -{
  122. - PVR2D_1BPP = 0,
  123. - PVR2D_RGB565,
  124. - PVR2D_ARGB4444,
  125. - PVR2D_RGB888,
  126. - PVR2D_ARGB8888,
  127. - PVR2D_ARGB1555,
  128. - PVR2D_ALPHA8,
  129. - PVR2D_ALPHA4,
  130. - PVR2D_PAL2,
  131. - PVR2D_PAL4,
  132. - PVR2D_PAL8,
  133. - PVR2D_VGAEMU
  134. -
  135. -}PVR2DFORMAT;
  136. -
  137. +/* Standard PVR2D pixel formats */
  138. +#define PVR2D_1BPP 0x00UL // 1bpp mask surface or palletized 1 bit source with 2x32 bit CLUT
  139. +#define PVR2D_RGB565 0x01UL // Common rgb 565 format
  140. +#define PVR2D_ARGB4444 0x02UL // Common argb 4444 format
  141. +#define PVR2D_RGB888 0x03UL // Common rgb 888 format
  142. +#define PVR2D_ARGB8888 0x04UL // Common argb 8888 format
  143. +#define PVR2D_ARGB1555 0x05UL // Common argb 1555 format
  144. +#define PVR2D_ALPHA8 0x06UL // Alpha-only 8 bit per pixel (used with a constant fill colour)
  145. +#define PVR2D_ALPHA4 0x07UL // Alpha-only 4 bits per pixel (used with a constant fill colour)
  146. +#define PVR2D_PAL2 0x08UL // Palletized 2 bit format (requires 4x32 bit CLUT)
  147. +#define PVR2D_PAL4 0x09UL // Palletized 4 bit format (requires 16x32 bit CLUT)
  148. +#define PVR2D_PAL8 0x0AUL // Palletized 8 bit format (requires 256x32 bit CLUT)
  149. +#define PVR2D_U8 0x10UL // monochrome unsigned 8 bit
  150. +#define PVR2D_U88 0x11UL // monochrome unsigned 16 bit
  151. +#define PVR2D_S8 0x12UL // signed 8 bit
  152. +#define PVR2D_YUV422_YUYV 0x13UL // YUV 422 low-high byte order Y0UY1V
  153. +#define PVR2D_YUV422_UYVY 0x14UL // YUV 422 low-high byte order UY0VY1
  154. +#define PVR2D_YUV422_YVYU 0x15UL // YUV 422 low-high byte order Y0VY1U
  155. +#define PVR2D_YUV422_VYUY 0x16UL // YUV 422 low-high byte order VY0UY1
  156. +#define PVR2D_YUV420_2PLANE 0x17UL // YUV420 2 Plane with UV interleaved in plane 2
  157. +#define PVR2D_YUV420_3PLANE 0x18UL // YUV420 3 Plane
  158. +#define PVR2D_2101010ARGB 0x19UL // 32 bit 2 10 10 10
  159. +#define PVR2D_888RSGSBS 0x1AUL // 3 channel signed 8 bit
  160. +#define PVR2D_16BPP_RAW 0x1BUL // 16 bit raw (no format conversion)
  161. +#define PVR2D_32BPP_RAW 0x1CUL // 32 bit raw
  162. +#define PVR2D_64BPP_RAW 0x1DUL // 64 bit raw
  163. +#define PVR2D_128BPP_RAW 0x1EUL // 128 bit raw
  164. +#define PVR2D_AYUV8888 0x1FUL
  165. +#define PVR2D_F16 0x20UL
  166. +#define PVR2D_NO_OF_FORMATS 0x21UL
  167. +
  168. +/* Format modifier bit field (DstFormat and SrcFormat bits 16..23) */
  169. +#define PVR2D_FORMAT_MASK 0x0000FFFFUL // PVR2D Format bits
  170. +#define PVR2D_FORMAT_LAYOUT_MASK 0x000F0000UL // Format layout (strided / twiddled / tiled)
  171. +#define PVR2D_FORMAT_FLAGS_MASK 0x0FF00000UL // Surface Flags mask
  172. +
  173. +/* Layout */
  174. +#define PVR2D_FORMAT_LAYOUT_SHIFT 16
  175. +#define PVR2D_FORMAT_LAYOUT_STRIDED 0x00000000UL
  176. +#define PVR2D_FORMAT_LAYOUT_TILED 0x00010000UL
  177. +#define PVR2D_FORMAT_LAYOUT_TWIDDLED 0x00020000UL
  178. +
  179. +/*
  180. + PVR2D_SURFACE_PDUMP
  181. + This flag requests a surface pdump, to capture the pixel state after host writes.
  182. + Not needed if the surface state has resulted from previous SGX 2D/3D core writes.
  183. +*/
  184. +#define PVR2D_SURFACE_PDUMP 0x00100000UL // calls PVRSRVPDumpMem to capture the surface (pdump builds only)
  185. +#define PVR2D_BLTRECT_PDUMP 0x00200000UL // calls PVRSRVPDumpMem to capture the blt rectangle (pdump builds only)
  186. +
  187. +/*
  188. + Low level 3D format extension - for blts via the 3D core only.
  189. + If the top bit of the format field is set then PVR2D reads it as a PVRSRV_PIXEL_FORMAT.
  190. + The outcome is hardware dependant.
  191. + There is no guarantee that any specific PVRSRV format will be supported.
  192. +*/
  193. +#define PVR2D_FORMAT_PVRSRV 0x80000000
  194.  
  195. /* wrap surface type */
  196. typedef enum
  197. {
  198. PVR2D_WRAPFLAG_NONCONTIGUOUS = 0,
  199. - PVR2D_WRAPFLAG_CONTIGUOUS = 1,
  200. -
  201. + PVR2D_WRAPFLAG_CONTIGUOUS = 1
  202. }PVR2DWRAPFLAGS;
  203.  
  204. +#define PVR2D_CONTEXT_FLAGS_PRIORITY_MASK 0x00000003
  205. +
  206. +#define PVR2D_CONTEXT_FLAGS_LOW_PRIORITY_CONTEXT 1
  207. +#define PVR2D_CONTEXT_FLAGS_NORMAL_PRIORITY_CONTEXT 0
  208. +#define PVR2D_CONTEXT_FLAGS_HIGH_PRIORITY_CONTEXT 2
  209. +
  210. /* flags for control information of additional blits */
  211. typedef enum
  212. {
  213. - PVR2D_BLIT_DISABLE_ALL = 0x0000, /* disable all additional controls */
  214. - PVR2D_BLIT_CK_ENABLE = 0x0001, /* enable colour key */
  215. - PVR2D_BLIT_GLOBAL_ALPHA_ENABLE = 0x0002, /* enable standard global alpha */
  216. - PVR2D_BLIT_PERPIXEL_ALPHABLEND_ENABLE = 0x0004, /* enable per-pixel alpha bleding */
  217. - PVR2D_BLIT_PAT_SURFACE_ENABLE = 0x0008, /* enable pattern surf (disable fill) */
  218. - PVR2D_BLIT_FULLY_SPECIFIED_ALPHA_ENABLE = 0x0010, /* enable fully specified alpha */
  219. - PVR2D_BLIT_ROT_90 = 0x0020, /* apply 90 degree rotation to the blt */
  220. - PVR2D_BLIT_ROT_180 = 0x0040, /* apply 180 degree rotation to the blt */
  221. - PVR2D_BLIT_ROT_270 = 0x0080, /* apply 270 degree rotation to the blt */
  222. - PVR2D_BLIT_COPYORDER_TL2BR = 0x0100, /* copy order overrides */
  223. - PVR2D_BLIT_COPYORDER_BR2TL = 0x0200,
  224. - PVR2D_BLIT_COPYORDER_TR2BL = 0x0400,
  225. - PVR2D_BLIT_COPYORDER_BL2TR = 0x0800,
  226. - PVR2D_BLIT_COLKEY_SOURCE = 0x1000, /* Key colour is on the source surface */
  227. - PVR2D_BLIT_COLKEY_DEST = 0x2000 /* Key colour is on the destination surface */
  228. + PVR2D_BLIT_DISABLE_ALL = 0x00000000, /* disable all additional controls */
  229. + PVR2D_BLIT_CK_ENABLE = 0x00000001, /* enable colour key */
  230. + PVR2D_BLIT_GLOBAL_ALPHA_ENABLE = 0x00000002, /* enable standard global alpha */
  231. + PVR2D_BLIT_PERPIXEL_ALPHABLEND_ENABLE = 0x00000004, /* enable per-pixel alpha blending */
  232. + PVR2D_BLIT_PAT_SURFACE_ENABLE = 0x00000008, /* enable pattern surf (disable fill) */
  233. + PVR2D_BLIT_FULLY_SPECIFIED_ALPHA_ENABLE = 0x00000010, /* enable fully specified alpha */
  234. + PVR2D_BLIT_ROT_90 = 0x00000020, /* apply 90 degree rotation to the blt */
  235. + PVR2D_BLIT_ROT_180 = 0x00000040, /* apply 180 degree rotation to the blt */
  236. + PVR2D_BLIT_ROT_270 = 0x00000080, /* apply 270 degree rotation to the blt */
  237. + PVR2D_BLIT_COPYORDER_TL2BR = 0x00000100, /* copy order overrides */
  238. + PVR2D_BLIT_COPYORDER_BR2TL = 0x00000200,
  239. + PVR2D_BLIT_COPYORDER_TR2BL = 0x00000400,
  240. + PVR2D_BLIT_COPYORDER_BL2TR = 0x00000800,
  241. + PVR2D_BLIT_COLKEY_SOURCE = 0x00001000, /* Key colour is on the source surface */
  242. + PVR2D_BLIT_COLKEY_DEST = 0x00002000, /* Key colour is on the destination surface */
  243. + PVR2D_BLIT_COLKEY_MASKED = 0x00004000, /* Mask enabled for colour key */
  244. + PVR2D_BLIT_COLKEY_OP_PASS = 0x00008000, /* Colour key op = pass */
  245. + PVR2D_BLIT_COLKEY_OP_REJECT = 0x00010000, /* Colour key op = reject */
  246. + PVR2D_BLIT_ROP4 = 0x00020000, /* rop4 pattern support */
  247. + PVR2D_BLIT_PATH_2DCORE = 0x00100000, /* Blt via dedicated 2D Core or PTLA */
  248. + PVR2D_BLIT_PATH_3DCORE = 0x00200000, /* Blt via 3D Core */
  249. + PVR2D_BLIT_PATH_SWBLT = 0x00400000, /* Blt via host software */
  250. + PVR2D_BLIT_NO_SRC_SYNC_INFO = 0x00800000, /* Dont send a source sync info*/
  251. + PVR2D_BLIT_ISSUE_STATUS_UPDATES = 0x01000000, /* Issue SyncInfo status updates */
  252.  
  253. } PVR2DBLITFLAGS;
  254.  
  255. @@ -113,7 +219,7 @@
  256. PVR2D_ALPHA_OP_SRCP_DSTINV = 2 /* premultiplied source alpha : Cdst = Csrc + Cdst*(1-Asrc) */
  257. } PVR2D_ALPHABLENDFUNC;
  258.  
  259. -/* blend ops for fully specified alpha */
  260. +/* blend ops for fully specified alpha (SGX 2D Core only) */
  261. typedef enum
  262. {
  263. PVR2D_BLEND_OP_ZERO = 0,
  264. @@ -125,11 +231,7 @@
  265. PVR2D_BLEND_OP_DST_PLUS_GLOBAL = 6
  266. }PVR2D_BLEND_OP;
  267.  
  268. -
  269. -typedef void* PVR2D_HANDLE;
  270. -
  271. -
  272. -/* Fully specified alpha blend : pAlpha field of PVR2DBLTINFO structure */
  273. +/* SGX 2D Core Fully specified alpha blend : pAlpha field of PVR2DBLTINFO structure */
  274. /* a fully specified Alpha Blend operation is defined as */
  275. /* DST (ALPHA) = (ALPHA_1 * SRC (ALPHA)) + (ALPHA_3 * DST (ALPHA)) */
  276. /* DST (RGB) = (ALPHA_2 * SRC (RGB)) + (ALPHA_4 * DST (RGB)) */
  277. @@ -152,10 +254,10 @@
  278. PVR2D_BOOL bPremulAlpha; /* enable pre-multiplication stage */
  279. PVR2D_BOOL bTransAlpha; /* enable transparent source alpha stage */
  280. PVR2D_BOOL bUpdateAlphaLookup; /* enable and update the 1555-Lookup alpha table */
  281. - unsigned char uAlphaLookup0; /* 8 bit alpha when A=0 in a 1555-Lookup surface */
  282. - unsigned char uAlphaLookup1; /* 8 bit alpha when A=1 in a 1555-Lookup surface */
  283. - unsigned char uGlobalRGB; /* Global Alpha Value for RGB, 0=transparent 255=opaque */
  284. - unsigned char uGlobalA; /* Global Alpha Value for Alpha */
  285. + PVR2D_UCHAR uAlphaLookup0; /* 8 bit alpha when A=0 in a 1555-Lookup surface */
  286. + PVR2D_UCHAR uAlphaLookup1; /* 8 bit alpha when A=1 in a 1555-Lookup surface */
  287. + PVR2D_UCHAR uGlobalRGB; /* Global Alpha Value for RGB, 0=transparent 255=opaque */
  288. + PVR2D_UCHAR uGlobalA; /* Global Alpha Value for Alpha */
  289.  
  290. } PVR2D_ALPHABLT, *PPVR2D_ALPHABLT;
  291.  
  292. @@ -163,12 +265,12 @@
  293. /* surface memory info structure */
  294. typedef struct _PVR2DMEMINFO
  295. {
  296. - void *pBase;
  297. - unsigned long ui32MemSize;
  298. - unsigned long ui32DevAddr;
  299. - unsigned long ulFlags;
  300. - void *hPrivateData;
  301. - void *hPrivateMapData;
  302. + PVR2D_VOID *pBase;
  303. + PVR2D_ULONG ui32MemSize;
  304. + PVR2D_ULONG ui32DevAddr;
  305. + PVR2D_ULONG ulFlags;
  306. + PVR2D_VOID *hPrivateData;
  307. + PVR2D_VOID *hPrivateMapData;
  308.  
  309. }PVR2DMEMINFO, *PPVR2DMEMINFO;
  310.  
  311. @@ -177,88 +279,117 @@
  312.  
  313. typedef struct _PVR2DDEVICEINFO
  314. {
  315. - unsigned long ulDevID;
  316. - char szDeviceName[PVR2D_MAX_DEVICE_NAME];
  317. + PVR2D_ULONG ulDevID;
  318. + PVR2D_CHAR szDeviceName[PVR2D_MAX_DEVICE_NAME];
  319. }PVR2DDEVICEINFO;
  320.  
  321.  
  322. typedef struct _PVR2DISPLAYINFO
  323. {
  324. - unsigned long ulMaxFlipChains;
  325. - unsigned long ulMaxBuffersInChain;
  326. - PVR2DFORMAT eFormat;
  327. - unsigned long ulWidth;
  328. - unsigned long ulHeight;
  329. - long lStride;
  330. - unsigned long ulMinFlipInterval;
  331. - unsigned long ulMaxFlipInterval;
  332. + PVR2D_ULONG ulMaxFlipChains;
  333. + PVR2D_ULONG ulMaxBuffersInChain;
  334. + PVR2DFORMAT eFormat;
  335. + PVR2D_ULONG ulWidth;
  336. + PVR2D_ULONG ulHeight;
  337. + PVR2D_LONG lStride;
  338. + PVR2D_ULONG ulMinFlipInterval;
  339. + PVR2D_ULONG ulMaxFlipInterval;
  340.  
  341. }PVR2DDISPLAYINFO;
  342.  
  343.  
  344. +typedef struct _PVR2MISCDISPLAYINFO
  345. +{
  346. + PVR2D_ULONG ulPhysicalWidthmm;
  347. + PVR2D_ULONG ulPhysicalHeightmm;
  348. + PVR2D_ULONG ulUnused[10];
  349. +
  350. +}PVR2DMISCDISPLAYINFO;
  351. +
  352. +typedef struct
  353. +{
  354. + PVR2DMEMINFO *pSurfMemInfo; /* surface memory */
  355. + PVR2D_ULONG SurfOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */
  356. + PVR2D_LONG Stride; /* signed stride */
  357. + PVR2DFORMAT Format; /* format */
  358. + PVR2D_ULONG SurfWidth; /* surface width in pixels */
  359. + PVR2D_ULONG SurfHeight; /* surface height in pixels */
  360. +
  361. +} PVR2D_SURFACE, *PPVR2D_SURFACE;
  362. +
  363. +
  364. typedef struct _PVR2DBLTINFO
  365. {
  366. - unsigned long CopyCode; /* rop code */
  367. - unsigned long Colour; /* fill colour */
  368. - unsigned long ColourKey; /* colour key */
  369. - unsigned char GlobalAlphaValue; /* global alpha blending */
  370. - unsigned char AlphaBlendingFunc; /* per-pixel alpha-blending function */
  371. + PVR2D_ULONG CopyCode; /* rop code */
  372. + PVR2D_ULONG Colour; /* fill colour */
  373. + PVR2D_ULONG ColourKey; /* colour key argb8888 (see CKEY_ defs below) */
  374. + PVR2D_UCHAR GlobalAlphaValue; /* global alpha blending */
  375. + PVR2D_UCHAR AlphaBlendingFunc; /* per-pixel alpha-blending function */
  376.  
  377. PVR2DBLITFLAGS BlitFlags; /* additional blit control information */
  378.  
  379. PVR2DMEMINFO *pDstMemInfo; /* destination memory */
  380. - unsigned long DstOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */
  381. - long DstStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */
  382. - long DstX, DstY; /* pixel offset from start of dest surface to start of blt rectangle */
  383. - long DSizeX,DSizeY; /* blt size */
  384. + PVR2D_ULONG DstOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */
  385. + PVR2D_LONG DstStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */
  386. + PVR2D_LONG DstX, DstY; /* pixel offset from start of dest surface to start of blt rectangle */
  387. + PVR2D_LONG DSizeX,DSizeY; /* blt size */
  388. PVR2DFORMAT DstFormat; /* dest format */
  389. - unsigned long DstSurfWidth; /* size of dest surface in pixels */
  390. - unsigned long DstSurfHeight; /* size of dest surface in pixels */
  391. + PVR2D_ULONG DstSurfWidth; /* size of dest surface in pixels */
  392. + PVR2D_ULONG DstSurfHeight; /* size of dest surface in pixels */
  393.  
  394. PVR2DMEMINFO *pSrcMemInfo; /* source mem, (source fields are also used for patterns) */
  395. - unsigned long SrcOffset; /* byte offset from start of allocation to src/pat surface pixel 0,0 */
  396. - long SrcStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */
  397. - long SrcX, SrcY; /* pixel offset from start of surface to start of source rectangle */
  398. + PVR2D_ULONG SrcOffset; /* byte offset from start of allocation to src/pat surface pixel 0,0 */
  399. + PVR2D_LONG SrcStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */
  400. + PVR2D_LONG SrcX, SrcY; /* pixel offset from start of surface to start of source rectangle */
  401. /* for patterns this is the start offset within the pattern */
  402. - long SizeX,SizeY; /* source rectangle size or pattern size in pixels */
  403. + PVR2D_LONG SizeX,SizeY; /* source rectangle size or pattern size in pixels */
  404. PVR2DFORMAT SrcFormat; /* source/pattern format */
  405. PVR2DMEMINFO *pPalMemInfo; /* source/pattern palette memory containing argb8888 colour table */
  406. - unsigned long PalOffset; /* byte offset from start of allocation to start of palette */
  407. - unsigned long SrcSurfWidth; /* size of source surface in pixels */
  408. - unsigned long SrcSurfHeight; /* size of source surface in pixels */
  409. + PVR2D_ULONG PalOffset; /* byte offset from start of allocation to start of palette */
  410. + PVR2D_ULONG SrcSurfWidth; /* size of source surface in pixels */
  411. + PVR2D_ULONG SrcSurfHeight; /* size of source surface in pixels */
  412.  
  413. PVR2DMEMINFO *pMaskMemInfo; /* mask memory, 1bpp format implied */
  414. - unsigned long MaskOffset; /* byte offset from start of allocation to mask surface pixel 0,0 */
  415. - long MaskStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */
  416. - long MaskX, MaskY; /* mask rect top left (mask size = blt size) */
  417. - unsigned long MaskSurfWidth; /* size of mask surface in pixels */
  418. - unsigned long MaskSurfHeight; /* size of mask surface in pixels */
  419. + PVR2D_ULONG MaskOffset; /* byte offset from start of allocation to mask surface pixel 0,0 */
  420. + PVR2D_LONG MaskStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */
  421. + PVR2D_LONG MaskX, MaskY; /* mask rect top left (mask size = blt size) */
  422. + PVR2D_ULONG MaskSurfWidth; /* size of mask surface in pixels */
  423. + PVR2D_ULONG MaskSurfHeight; /* size of mask surface in pixels */
  424. +
  425. + PPVR2D_ALPHABLT pAlpha; /* fully specified alpha blend (2DCore only) */
  426.  
  427. - PPVR2D_ALPHABLT pAlpha; /* fully specified alpha blend */
  428. + PVR2D_ULONG uSrcChromaPlane1; /* mem offset from start of source alloc to chroma plane 1 */
  429. + PVR2D_ULONG uSrcChromaPlane2; /* mem offset from start of source alloc to chroma plane 2 */
  430. + PVR2D_ULONG uDstChromaPlane1; /* mem offset from start of dest alloc to chroma plane 1 */
  431. + PVR2D_ULONG uDstChromaPlane2; /* mem offset from start of dest alloc to chroma plane 2 */
  432. +
  433. + PVR2D_ULONG ColourKeyMask; /* 32 bit colour key mask, only valid when PVR2D_BLIT_COLKEY_MASKED is set */
  434. +
  435. + PPVR2D_SURFACE pPat; /* full rop4 support for patterns if PVR2D_BLIT_ROP4 set (2D Core hardware only) */
  436. + PVR2D_LONG PatX, PatY; /* pattern start offset if PVR2D_BLIT_ROP4 set (2D Core hardware only) */
  437.  
  438. }PVR2DBLTINFO, *PPVR2DBLTINFO;
  439.  
  440. +
  441. typedef struct _PVR2DRECT
  442. {
  443. - long left, top;
  444. - long right, bottom;
  445. -} PVR2DRECT;
  446. + PVR2D_LONG left, top;
  447. + PVR2D_LONG right, bottom;
  448. +} PVR2DRECT, *PPVR2DRECT;
  449. +
  450.  
  451. typedef struct
  452. {
  453. - PVR2DMEMINFO *pSurfMemInfo; /* surface memory */
  454. - unsigned long SurfOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */
  455. - long Stride; /* signed stride */
  456. - PVR2DFORMAT Format;
  457. - unsigned long SurfWidth; /* surface size in pixels */
  458. - unsigned long SurfHeight;
  459. + PVR2D_ULONG uChromaPlane1; /* YUV multiplane - byte offset from start of alloc to chroma plane 1 */
  460. + PVR2D_ULONG uChromaPlane2; /* YUV multiplane - byte offset from start of alloc to chroma plane 2 */
  461. + PVR2D_LONG Reserved[2]; /* Reserved, must be zero */
  462.  
  463. -} PVR2D_SURFACE, *PPVR2D_SURFACE;
  464. +} PVR2D_SURFACE_EXT, *PPVR2D_SURFACE_EXT;
  465.  
  466. typedef struct
  467. {
  468. - unsigned long *pUseCode; /* USSE code */
  469. - unsigned long UseCodeSize; /* usse code size in bytes */
  470. + PVR2D_ULONG *pUseCode; /* USSE code */
  471. + PVR2D_ULONG UseCodeSize; /* usse code size in bytes */
  472.  
  473. } PVR2D_USECODE, *PPVR2D_USECODE;
  474.  
  475. @@ -269,10 +400,28 @@
  476. PVR2DRECT rcDest; /* destination rectangle */
  477. PVR2DRECT rcSource; /* source rectangle */
  478. PVR2D_HANDLE hUseCode; /* custom USE code (NULL implies source copy) */
  479. - unsigned long UseParams[2]; /* per-blt params for use code */
  480. + PVR2D_ULONG UseParams[2]; /* per-blt params for use code */
  481.  
  482. } PVR2D_3DBLT, *PPVR2D_3DBLT;
  483.  
  484. +typedef struct
  485. +{
  486. + PVR2D_SURFACE sDst; /* destination surface */
  487. + PVR2DRECT rcDest; /* destination rectangle; scaling is supported */
  488. + PVR2D_SURFACE sSrc; /* source surface */
  489. + PVR2DRECT rcSource; /* source rectangle; scaling is supported */
  490. + PPVR2D_SURFACE pSrc2; /* optional second source surface (NULL if not required) */
  491. + PVR2DRECT* prcSource2; /* optional pSrc2 rectangle */
  492. + PVR2D_HANDLE hUseCode; /* custom USSE shader code (NULL implies default source copy) */
  493. + PVR2D_ULONG UseParams[2]; /* per-blt params for usse code */
  494. + PVR2D_ULONG uiNumTemporaryRegisters; /* no. of temporary registers used in custom shader code */
  495. + PVR2D_BOOL bDisableDestInput; /* set true if the destination is output only */
  496. + PPVR2D_SURFACE_EXT pDstExt; /* Extended format params for dest */
  497. + PPVR2D_SURFACE_EXT pSrcExt[2]; /* Extended format params for source 1 and 2 */
  498. + PVR2D_LONG Reserved[4]; /* Reserved, must be zero */
  499. +
  500. +} PVR2D_3DBLT_EXT, *PPVR2D_3DBLT_EXT;
  501. +
  502.  
  503. #define MAKE_COPY_BLIT(src,soff,dest,doff,sx,sy,dx,dy,sz)
  504.  
  505. @@ -345,25 +494,50 @@
  506. /* Heap number for PVR2DGetFrameBuffer */
  507. #define PVR2D_FB_PRIMARY_SURFACE 0
  508.  
  509. -#define PVR2D_PRESENT_PROPERTY_SRCSTRIDE (1 << 0)
  510. -#define PVR2D_PRESENT_PROPERTY_DSTSIZE (1 << 1)
  511. -#define PVR2D_PRESENT_PROPERTY_DSTPOS (1 << 2)
  512. -#define PVR2D_PRESENT_PROPERTY_CLIPRECTS (1 << 3)
  513. -#define PVR2D_PRESENT_PROPERTY_INTERVAL (1 << 4)
  514. -
  515. -
  516. -#define PVR2D_CREATE_FLIPCHAIN_SHARED (1 << 0)
  517. -#define PVR2D_CREATE_FLIPCHAIN_QUERY (1 << 1)
  518. +#define PVR2D_PRESENT_PROPERTY_SRCSTRIDE (1UL << 0)
  519. +#define PVR2D_PRESENT_PROPERTY_DSTSIZE (1UL << 1)
  520. +#define PVR2D_PRESENT_PROPERTY_DSTPOS (1UL << 2)
  521. +#define PVR2D_PRESENT_PROPERTY_CLIPRECTS (1UL << 3)
  522. +#define PVR2D_PRESENT_PROPERTY_INTERVAL (1UL << 4)
  523. +
  524. +#define PVR2D_CREATE_FLIPCHAIN_SHARED (1UL << 0)
  525. +#define PVR2D_CREATE_FLIPCHAIN_QUERY (1UL << 1)
  526. +#define PVR2D_CREATE_FLIPCHAIN_OEMOVERLAY (1UL << 2)
  527. +#define PVR2D_CREATE_FLIPCHAIN_AS_BLITCHAIN (1UL << 3)
  528. +
  529. +/* Colour-key colour must be translated into argb8888 format */
  530. +#define CKEY_8888(P) (P)
  531. +#define CKEY_4444(P) (((P&0xF000UL)<<16) | ((P&0x0F00UL)<<12) | ((P&0x00F0UL)<<8) | ((P&0x000FUL)<<4))
  532. +#define CKEY_1555(P) (((P&0x8000UL)<<16) | ((P&0x7C00UL)<<9) | ((P&0x3E0UL)<<6) | ((P&0x1FUL)<<3))
  533. +#define CKEY_565(P) (((P&0xF800UL)<<8) | ((P&0x7E0UL)<<5) | ((P&0x1FUL)<<3))
  534. +#define CKEY_MASK_8888 0x00FFFFFFUL
  535. +#define CKEY_MASK_4444 0x00F0F0F0UL
  536. +#define CKEY_MASK_1555 0x00F8F8F8UL /* Alpha is not normally included in the key test */
  537. +#define CKEY_MASK_565 0x00F8FCF8UL
  538. +
  539. +/* Fill colours must be translated into argb8888 format */
  540. +#define CFILL_4444(P) (((P&0xF000UL)<<16) | ((P&0x0F00UL)<<12) | ((P&0x00F0UL)<<8) | ((P&0x000FUL)<<4))
  541. +#define CFILL_1555(P) (((P&0x8000UL)<<16) | ((P&0x7C00UL)<<9) | ((P&0x3E0UL)<<6) | ((P&0x1FUL)<<3))
  542. +#define CFILL_565(P) (((P&0xF800UL)<<8) | ((P&0x7E0UL)<<5) | ((P&0x1FUL)<<3))
  543. +
  544. +/* PVR2DCreateDeviceContext flags */
  545. +#define PVR2D_XSERVER_PROC 0x00000001UL /* Set for the Xserver connection */
  546. +#define PVR2D_FLAGS_PDUMP_ACTIVE 0x00000002UL /* Set when pdumping from multiple processes */
  547. +
  548. +/* PVR2DMemAlloc flags */
  549. +#define PVR2D_MEM_UNCACHED 0x00000000UL /* Default */
  550. +#define PVR2D_MEM_CACHED 0x00000001UL /* Caller must flush and sync when necessary */
  551. +#define PVR2D_MEM_WRITECOMBINE 0x00000002UL
  552.  
  553. /* Functions that the library exports */
  554.  
  555. PVR2D_IMPORT
  556. -int PVR2DEnumerateDevices(PVR2DDEVICEINFO *pDevInfo);
  557. +PVR2D_INT PVR2DEnumerateDevices(PVR2DDEVICEINFO *pDevInfo);
  558.  
  559. PVR2D_IMPORT
  560. -PVR2DERROR PVR2DCreateDeviceContext(unsigned long ulDevID,
  561. +PVR2DERROR PVR2DCreateDeviceContext(PVR2D_ULONG ulDevID,
  562. PVR2DCONTEXTHANDLE* phContext,
  563. - unsigned long ulFlags);
  564. + PVR2D_ULONG ulFlags);
  565.  
  566. PVR2D_IMPORT
  567. PVR2DERROR PVR2DDestroyDeviceContext(PVR2DCONTEXTHANDLE hContext);
  568. @@ -373,37 +547,47 @@
  569. PVR2DDISPLAYINFO *pDisplayInfo);
  570.  
  571. PVR2D_IMPORT
  572. +PVR2DERROR PVR2DGetMiscDisplayInfo(PVR2DCONTEXTHANDLE hContext,
  573. + PVR2DMISCDISPLAYINFO *pMiscDisplayInfo);
  574. +
  575. +PVR2D_IMPORT
  576. PVR2DERROR PVR2DGetScreenMode(PVR2DCONTEXTHANDLE hContext,
  577. PVR2DFORMAT *pFormat,
  578. - long *plWidth,
  579. - long *plHeight,
  580. - long *plStride,
  581. - int *piRefreshRate);
  582. + PVR2D_LONG *plWidth,
  583. + PVR2D_LONG *plHeight,
  584. + PVR2D_LONG *plStride,
  585. + PVR2D_INT *piRefreshRate);
  586.  
  587. PVR2D_IMPORT
  588. PVR2DERROR PVR2DGetFrameBuffer(PVR2DCONTEXTHANDLE hContext,
  589. - int nHeap,
  590. + PVR2D_INT nHeap,
  591. PVR2DMEMINFO **ppsMemInfo);
  592.  
  593. PVR2D_IMPORT
  594. PVR2DERROR PVR2DMemAlloc(PVR2DCONTEXTHANDLE hContext,
  595. - unsigned long ulBytes,
  596. - unsigned long ulAlign,
  597. - unsigned long ulFlags,
  598. + PVR2D_ULONG ulBytes,
  599. + PVR2D_ULONG ulAlign,
  600. + PVR2D_ULONG ulFlags,
  601. PVR2DMEMINFO **ppsMemInfo);
  602.  
  603. PVR2D_IMPORT
  604. +PVR2DERROR PVR2DMemExport(PVR2DCONTEXTHANDLE hContext,
  605. + PVR2D_ULONG ulFlags,
  606. + PVR2DMEMINFO *psMemInfo,
  607. + PVR2D_HANDLE *phMemHandle);
  608. +
  609. +PVR2D_IMPORT
  610. PVR2DERROR PVR2DMemWrap(PVR2DCONTEXTHANDLE hContext,
  611. - void *pMem,
  612. - unsigned long ulFlags,
  613. - unsigned long ulBytes,
  614. - unsigned long alPageAddress[],
  615. + PVR2D_VOID *pMem,
  616. + PVR2D_ULONG ulFlags,
  617. + PVR2D_ULONG ulBytes,
  618. + PVR2D_ULONG alPageAddress[],
  619. PVR2DMEMINFO **ppsMemInfo);
  620.  
  621. PVR2D_IMPORT
  622. PVR2DERROR PVR2DMemMap(PVR2DCONTEXTHANDLE hContext,
  623. - unsigned long ulFlags,
  624. - void *hPrivateMapData,
  625. + PVR2D_ULONG ulFlags,
  626. + PVR2D_HANDLE hMemHandle,
  627. PVR2DMEMINFO **ppsDstMem);
  628.  
  629. PVR2D_IMPORT
  630. @@ -417,40 +601,44 @@
  631. PVR2D_IMPORT
  632. PVR2DERROR PVR2DBltClipped(PVR2DCONTEXTHANDLE hContext,
  633. PVR2DBLTINFO *pBltInfo,
  634. - unsigned long ulNumClipRects,
  635. + PVR2D_ULONG ulNumClipRects,
  636. PVR2DRECT *pClipRects);
  637.  
  638. +PVR2D_EXPORT
  639. +PVR2DERROR PVR2DSet1555Alpha (PVR2DCONTEXTHANDLE hContext,
  640. + PVR2D_UCHAR Alpha0, PVR2D_UCHAR Alpha1);
  641. +
  642. PVR2D_IMPORT
  643. PVR2DERROR PVR2DQueryBlitsComplete(PVR2DCONTEXTHANDLE hContext,
  644. - PVR2DMEMINFO *pMemInfo,
  645. - unsigned int uiWaitForComplete);
  646. + const PVR2DMEMINFO *pMemInfo,
  647. + PVR2D_UINT uiWaitForComplete);
  648.  
  649. PVR2D_IMPORT
  650. PVR2DERROR PVR2DSetPresentBltProperties(PVR2DCONTEXTHANDLE hContext,
  651. - unsigned long ulPropertyMask,
  652. - long lSrcStride,
  653. - unsigned long ulDstWidth,
  654. - unsigned long ulDstHeight,
  655. - long lDstXPos,
  656. - long lDstYPos,
  657. - unsigned long ulNumClipRects,
  658. + PVR2D_ULONG ulPropertyMask,
  659. + PVR2D_LONG lSrcStride,
  660. + PVR2D_ULONG ulDstWidth,
  661. + PVR2D_ULONG ulDstHeight,
  662. + PVR2D_LONG lDstXPos,
  663. + PVR2D_LONG lDstYPos,
  664. + PVR2D_ULONG ulNumClipRects,
  665. PVR2DRECT *pClipRects,
  666. - unsigned long ulSwapInterval);
  667. + PVR2D_ULONG ulSwapInterval);
  668.  
  669. PVR2D_IMPORT
  670. PVR2DERROR PVR2DPresentBlt(PVR2DCONTEXTHANDLE hContext,
  671. PVR2DMEMINFO *pMemInfo,
  672. - long lRenderID);
  673. + PVR2D_LONG lRenderID);
  674.  
  675. PVR2D_IMPORT
  676. PVR2DERROR PVR2DCreateFlipChain(PVR2DCONTEXTHANDLE hContext,
  677. - unsigned long ulFlags,
  678. - unsigned long ulNumBuffers,
  679. - unsigned long ulWidth,
  680. - unsigned long ulHeight,
  681. + PVR2D_ULONG ulFlags,
  682. + PVR2D_ULONG ulNumBuffers,
  683. + PVR2D_ULONG ulWidth,
  684. + PVR2D_ULONG ulHeight,
  685. PVR2DFORMAT eFormat,
  686. - long *plStride,
  687. - unsigned long *pulFlipChainID,
  688. + PVR2D_LONG *plStride,
  689. + PVR2D_ULONG *pulFlipChainID,
  690. PVR2DFLIPCHAINHANDLE *phFlipChain);
  691.  
  692. PVR2D_IMPORT
  693. @@ -460,37 +648,78 @@
  694. PVR2D_IMPORT
  695. PVR2DERROR PVR2DGetFlipChainBuffers(PVR2DCONTEXTHANDLE hContext,
  696. PVR2DFLIPCHAINHANDLE hFlipChain,
  697. - unsigned long *pulNumBuffers,
  698. + PVR2D_ULONG *pulNumBuffers,
  699. PVR2DMEMINFO *psMemInfo[]);
  700.  
  701. PVR2D_IMPORT
  702. PVR2DERROR PVR2DSetPresentFlipProperties(PVR2DCONTEXTHANDLE hContext,
  703. PVR2DFLIPCHAINHANDLE hFlipChain,
  704. - unsigned long ulPropertyMask,
  705. - long lDstXPos,
  706. - long lDstYPos,
  707. - unsigned long ulNumClipRects,
  708. + PVR2D_ULONG ulPropertyMask,
  709. + PVR2D_LONG lDstXPos,
  710. + PVR2D_LONG lDstYPos,
  711. + PVR2D_ULONG ulNumClipRects,
  712. PVR2DRECT *pClipRects,
  713. - unsigned long ulSwapInterval);
  714. + PVR2D_ULONG ulSwapInterval);
  715.  
  716. PVR2D_IMPORT
  717. PVR2DERROR PVR2DPresentFlip(PVR2DCONTEXTHANDLE hContext,
  718. PVR2DFLIPCHAINHANDLE hFlipChain,
  719. PVR2DMEMINFO *psMemInfo,
  720. - long lRenderID);
  721. + PVR2D_LONG lRenderID);
  722.  
  723. PVR2D_IMPORT
  724. -PVR2DERROR PVR2DGetAPIRev(long *lRevMajor, long *lRevMinor);
  725. +PVR2DERROR PVR2DGetAPIRev(PVR2D_LONG *lRevMajor, PVR2D_LONG *lRevMinor);
  726.  
  727. PVR2D_IMPORT
  728. -PVR2DERROR PVR2DLoadUseCode (const PVR2DCONTEXTHANDLE hContext, const unsigned char *pUseCode,
  729. - const unsigned long UseCodeSize, PVR2D_HANDLE *pUseCodeHandle);
  730. +PVR2DERROR PVR2DLoadUseCode (const PVR2DCONTEXTHANDLE hContext, const PVR2D_UCHAR *pUseCode,
  731. + const PVR2D_ULONG UseCodeSize, PVR2D_HANDLE *pUseCodeHandle);
  732. PVR2D_IMPORT
  733. PVR2DERROR PVR2DFreeUseCode (const PVR2DCONTEXTHANDLE hContext, const PVR2D_HANDLE hUseCodeHandle);
  734.  
  735. PVR2D_IMPORT
  736. PVR2DERROR PVR2DBlt3D (const PVR2DCONTEXTHANDLE hContext, const PPVR2D_3DBLT pBlt3D);
  737.  
  738. +PVR2D_IMPORT
  739. +PVR2DERROR PVR2DBlt3DExt (const PVR2DCONTEXTHANDLE hContext, const PPVR2D_3DBLT_EXT pBlt3D);
  740. +
  741. +
  742. +PVR2D_IMPORT
  743. +PVR2DERROR PVR2DModifyPendingOps(const PVR2DCONTEXTHANDLE hContext,
  744. + PVR2D_HANDLE *phSyncModObj,
  745. + PVR2DMEMINFO *psMemInfo,
  746. + PVR2D_BOOL bIsWriteOp,
  747. + PVR2D_ULONG *pulReadOpsPending,
  748. + PVR2D_ULONG *pulWriteOpsPending);
  749. +
  750. +PVR2D_IMPORT
  751. +PVR2DERROR PVR2DModifyCompleteOps(const PVR2DCONTEXTHANDLE hContext,
  752. + PVR2D_HANDLE hSyncModObj);
  753. +
  754. +PVR2D_IMPORT
  755. +PVR2DERROR PVR2DFlushToSyncModObj(const PVR2DCONTEXTHANDLE hContext,
  756. + PVR2D_HANDLE hSyncModObj,
  757. + PVR2D_BOOL bWait);
  758. +
  759. +PVR2D_IMPORT
  760. +PVR2DERROR PVR2DTakeSyncToken(const PVR2DCONTEXTHANDLE hContext,
  761. + PVR2DMEMINFO *psMemInfo,
  762. + PVR2D_HANDLE *phSyncToken,
  763. + PVR2D_ULONG *pulReadOpsPending,
  764. + PVR2D_ULONG *pulWriteOpsPending);
  765. +
  766. +PVR2D_IMPORT
  767. +PVR2DERROR PVR2DReleaseSyncToken(const PVR2DCONTEXTHANDLE hContext,
  768. + PVR2D_HANDLE hSyncToken);
  769. +
  770. +PVR2D_IMPORT
  771. +PVR2DERROR PVR2DFlushToSyncToken(const PVR2DCONTEXTHANDLE hContext,
  772. + PVR2DMEMINFO *psMemInfo,
  773. + PVR2D_HANDLE hSyncToken,
  774. + PVR2D_BOOL bWait);
  775. +
  776. +PVR2D_IMPORT
  777. +PVR2DERROR PVR2DWaitForNextHardwareEvent(const PVR2DCONTEXTHANDLE hContext);
  778. +
  779. #ifdef __cplusplus
  780. }
  781. #endif
  782. diff -uNr qt-everywhere-opensource-src-4.8.5.org/src/3rdparty/powervr/wsegl.h qt-everywhere-opensource-src-4.8.5/src/3rdparty/powervr/wsegl.h
  783. --- qt-everywhere-opensource-src-4.8.5.org/src/3rdparty/powervr/wsegl.h 2013-06-07 07:16:52.000000000 +0200
  784. +++ qt-everywhere-opensource-src-4.8.5/src/3rdparty/powervr/wsegl.h 2013-12-16 13:53:14.268554868 +0100
  785. @@ -1,33 +1,67 @@
  786. -/******************************************************************************
  787. - Name : wsegl.h
  788. - Copyright : Copyright (c) Imagination Technologies Limited.
  789. - This specification is protected by copyright laws and contains
  790. - material proprietary to Imagination Technologies Limited.
  791. - You may use and distribute this specification free of charge for implementing
  792. - the functionality therein, without altering or removing any trademark, copyright,
  793. - or other notice from the specification.
  794. - Platform : ANSI
  795. -*****************************************************************************/
  796. +/*************************************************************************/ /*!
  797. +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
  798. +@License Dual MIT/GPLv2
  799. +
  800. +The contents of this file are subject to the MIT license as set out below.
  801. +
  802. +Permission is hereby granted, free of charge, to any person obtaining a copy
  803. +of this software and associated documentation files (the "Software"), to deal
  804. +in the Software without restriction, including without limitation the rights
  805. +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  806. +copies of the Software, and to permit persons to whom the Software is
  807. +furnished to do so, subject to the following conditions:
  808. +
  809. +The above copyright notice and this permission notice shall be included in
  810. +all copies or substantial portions of the Software.
  811. +
  812. +Alternatively, the contents of this file may be used under the terms of
  813. +the GNU General Public License Version 2 ("GPL") in which case the provisions
  814. +of GPL are applicable instead of those above.
  815. +
  816. +If you wish to allow use of your version of this file only under the terms of
  817. +GPL, and not to allow others to use your version of this file under the terms
  818. +of the MIT license, indicate your decision by deleting the provisions above
  819. +and replace them with the notice and other provisions required by GPL as set
  820. +out in the file called "GPL-COPYING" included in this distribution. If you do
  821. +not delete the provisions above, a recipient may use your version of this file
  822. +under the terms of either the MIT license or GPL.
  823. +
  824. +This License is also included in this distribution in the file called
  825. +"MIT-COPYING".
  826. +
  827. +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
  828. +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
  829. +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  830. +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
  831. +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  832. +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  833. +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  834.  
  835. +*/ /**************************************************************************/
  836.  
  837. #if !defined(__WSEGL_H__)
  838. #define __WSEGL_H__
  839.  
  840. #ifdef __cplusplus
  841. extern "C" {
  842. -#endif
  843. +#endif
  844.  
  845. /*
  846. // WSEGL Platform-specific definitions
  847. */
  848. +#if defined(__linux__)
  849. +#define WSEGL_EXPORT __attribute__((visibility("default")))
  850. +#define WSEGL_IMPORT
  851. +#else
  852. #define WSEGL_EXPORT
  853. #define WSEGL_IMPORT
  854. +#endif
  855.  
  856. /*
  857. // WSEGL API Version Number
  858. */
  859.  
  860. -#define WSEGL_VERSION 1
  861. +#define WSEGL_VERSION 4
  862. #define WSEGL_DEFAULT_DISPLAY 0
  863. #define WSEGL_DEFAULT_NATIVE_ENGINE 0
  864.  
  865. @@ -54,6 +88,11 @@
  866. WSEGL_CAP_WINDOWS_USE_HW_SYNC = 3, /* System default value = 0 (FALSE) */
  867. WSEGL_CAP_PIXMAPS_USE_HW_SYNC = 4, /* System default value = 0 (FALSE) */
  868.  
  869. + /* When this capability is set, the EGL lock is not taken around calls
  870. + to WSEGL functions. The WSEGL module is responsible for performing
  871. + its own locking in this case. */
  872. + WSEGL_CAP_UNLOCKED = 5, /* System default value = 0 */
  873. +
  874. } WSEGLCapsType;
  875.  
  876. /*
  877. @@ -73,16 +112,50 @@
  878. #define WSEGL_DRAWABLE_WINDOW 0x1
  879. #define WSEGL_DRAWABLE_PIXMAP 0x2
  880.  
  881. +/*
  882. +// YUV format flags and sync
  883. +*/
  884. +#define WSEGL_FLAGS_YUV_CONFORMANT_RANGE (0 << 0)
  885. +#define WSEGL_FLAGS_YUV_FULL_RANGE (1 << 0)
  886. +#define WSEGL_FLAGS_YUV_BT601 (0 << 1)
  887. +#define WSEGL_FLAGS_YUV_BT709 (1 << 1)
  888. +#define WSEGL_FLAGS_EGLIMAGE_COMPOSITION_SYNC (1 << 2)
  889. +
  890. +/*
  891. +// Maximum number of optional PowerVR Services 4 SYNCINFO objects
  892. +*/
  893. +#define WSEGL_MAX_SRC_SYNCS 32
  894.  
  895. /*
  896. // Pixel format of display/drawable
  897. */
  898. typedef enum WSEGLPixelFormat_TAG
  899. {
  900. - WSEGL_PIXELFORMAT_565 = 0,
  901. - WSEGL_PIXELFORMAT_4444 = 1,
  902. - WSEGL_PIXELFORMAT_8888 = 2,
  903. - WSEGL_PIXELFORMAT_1555 = 3
  904. + /* These must not be re-ordered */
  905. + WSEGL_PIXELFORMAT_RGB565 = 0,
  906. + WSEGL_PIXELFORMAT_ARGB4444 = 1,
  907. + WSEGL_PIXELFORMAT_ARGB8888 = 2,
  908. + WSEGL_PIXELFORMAT_ARGB1555 = 3,
  909. + WSEGL_PIXELFORMAT_ABGR8888 = 4,
  910. + WSEGL_PIXELFORMAT_XBGR8888 = 5,
  911. + WSEGL_PIXELFORMAT_NV12 = 6,
  912. + WSEGL_PIXELFORMAT_YUYV = 7,
  913. + WSEGL_PIXELFORMAT_YV12 = 8,
  914. + WSEGL_PIXELFORMAT_XRGB8888 = 9,
  915. + WSEGL_PIXELFORMAT_UYVY = 10,
  916. + WSEGL_PIXELFORMAT_NV12_4KALIGN = 11,
  917. + WSEGL_PIXELFORMAT_NV21_4KALIGN = 12,
  918. + WSEGL_PIXELFORMAT_R8 = 13,
  919. + WSEGL_PIXELFORMAT_R8G8 = 14,
  920. + WSEGL_PIXELFORMAT_NV21 = 15,
  921. +
  922. + /* These are compatibility names only; new WSEGL
  923. + * modules should not use them.
  924. + */
  925. + WSEGL_PIXELFORMAT_565 = WSEGL_PIXELFORMAT_RGB565,
  926. + WSEGL_PIXELFORMAT_4444 = WSEGL_PIXELFORMAT_ARGB4444,
  927. + WSEGL_PIXELFORMAT_8888 = WSEGL_PIXELFORMAT_ARGB8888,
  928. + WSEGL_PIXELFORMAT_1555 = WSEGL_PIXELFORMAT_ARGB1555,
  929.  
  930. } WSEGLPixelFormat;
  931.  
  932. @@ -105,29 +178,31 @@
  933. // Type of drawables this configuration applies to -
  934. // OR'd values of drawable types.
  935. */
  936. - unsigned long ui32DrawableType;
  937. + unsigned long ui32DrawableType;
  938.  
  939. /* Pixel format */
  940. - WSEGLPixelFormat ePixelFormat;
  941. + WSEGLPixelFormat ePixelFormat;
  942.  
  943. /* Native Renderable - set to WSEGL_TRUE if native renderable */
  944. - unsigned long ulNativeRenderable;
  945. + unsigned long ulNativeRenderable;
  946.  
  947. /* FrameBuffer Level Parameter */
  948. - unsigned long ulFrameBufferLevel;
  949. + unsigned long ulFrameBufferLevel;
  950.  
  951. /* Native Visual ID */
  952. - unsigned long ulNativeVisualID;
  953. + unsigned long ulNativeVisualID;
  954.  
  955. /* Native Visual */
  956. - void *hNativeVisual;
  957. + unsigned long ulNativeVisualType;
  958.  
  959. /* Transparent Type */
  960. - WSEGLTransparentType eTransparentType;
  961. + WSEGLTransparentType eTransparentType;
  962.  
  963. /* Transparent Color - only used if transparent type is COLOR_KEY */
  964. - unsigned long ulTransparentColor; /* packed as 0x00RRGGBB */
  965. + unsigned long ulTransparentColor; /* packed as 0x00RRGGBB */
  966.  
  967. + /* Framebuffer Target - set to WSEGL_TRUE if config compatible with framebuffer */
  968. + unsigned long ulFramebufferTarget;
  969.  
  970. } WSEGLConfig;
  971.  
  972. @@ -143,8 +218,14 @@
  973. WSEGL_BAD_NATIVE_PIXMAP = 4,
  974. WSEGL_BAD_NATIVE_ENGINE = 5,
  975. WSEGL_BAD_DRAWABLE = 6,
  976. - WSEGL_BAD_CONFIG = 7,
  977. - WSEGL_OUT_OF_MEMORY = 8
  978. + WSEGL_BAD_MATCH = 7,
  979. + WSEGL_OUT_OF_MEMORY = 8,
  980. + WSEGL_RETRY = 9,
  981. +
  982. + /* These are compatibility names only; new WSEGL
  983. + * modules should not use them.
  984. + */
  985. + WSEGL_BAD_CONFIG = WSEGL_BAD_MATCH,
  986.  
  987. } WSEGLError;
  988.  
  989. @@ -166,25 +247,46 @@
  990. typedef struct WSEGLDrawableParams_TAG
  991. {
  992. /* Width in pixels of the drawable */
  993. - unsigned long ui32Width;
  994. + unsigned long ui32Width;
  995.  
  996. /* Height in pixels of the drawable */
  997. - unsigned long ui32Height;
  998. + unsigned long ui32Height;
  999.  
  1000. /* Stride in pixels of the drawable */
  1001. - unsigned long ui32Stride;
  1002. + unsigned long ui32Stride;
  1003.  
  1004. /* Pixel format of the drawable */
  1005. - WSEGLPixelFormat ePixelFormat;
  1006. + WSEGLPixelFormat ePixelFormat;
  1007.  
  1008. /* User space cpu virtual address of the drawable */
  1009. - void *pvLinearAddress;
  1010. + void *pvLinearAddress;
  1011.  
  1012. /* HW address of the drawable */
  1013. - unsigned long ui32HWAddress;
  1014. + unsigned long ui32HWAddress;
  1015. +
  1016. + /* Override display's HW_SYNC mode */
  1017. + unsigned long bWaitForRender;
  1018.  
  1019. - /* Private data for the drawable */
  1020. - void *hPrivateData;
  1021. + /* Flags */
  1022. + unsigned long ulFlags;
  1023. +
  1024. + /* Rotation angle of drawable (presently source only) */
  1025. + WSEGLRotationAngle eRotationAngle;
  1026. +
  1027. + /*
  1028. + // Optional PowerVR Services 4 MEMINFO pointer. This may be used for
  1029. + // internal (implicit) synchronization purposes, and by PDUMP. It should
  1030. + // refer to the same object as the other fields in this structure.
  1031. + */
  1032. + void *hMemInfo;
  1033. +
  1034. + /*
  1035. + // Optional PowerVR Services 4 SYNCINFO pointers to sent down as source
  1036. + // surface (texture) dependencies of a render. If these are provided
  1037. + // when not applicable, they will be ignored. If a sync is not needed,
  1038. + // it should be passed as NULL.
  1039. + */
  1040. + void *ahSyncInfo[WSEGL_MAX_SRC_SYNCS];
  1041.  
  1042. } WSEGLDrawableParams;
  1043.  
  1044. @@ -221,8 +323,18 @@
  1045.  
  1046. WSEGLError (*pfnWSEGL_CopyFromPBuffer)(void *, unsigned long, unsigned long, unsigned long, WSEGLPixelFormat, NativePixmapType);
  1047.  
  1048. - WSEGLError (*pfnWSEGL_GetDrawableParameters)(WSEGLDrawableHandle, WSEGLDrawableParams *, WSEGLDrawableParams *);
  1049. + WSEGLError (*pfnWSEGL_GetDrawableParameters)(WSEGLDrawableHandle, WSEGLDrawableParams *, WSEGLDrawableParams *, unsigned long);
  1050. +
  1051. + WSEGLError (*pfnWSEGL_ConnectDrawable)(WSEGLDrawableHandle);
  1052. +
  1053. + WSEGLError (*pfnWSEGL_DisconnectDrawable)(WSEGLDrawableHandle);
  1054. +
  1055. + WSEGLError (*pfnWSEGL_FlagStartFrame)(void);
  1056. +
  1057.  
  1058. +#if defined (__QNXNTO__)
  1059. + WSEGLError (*pfnWSEGL_WaitForDrawableRenderBuffer)(WSEGLDrawableHandle);
  1060. +#endif
  1061.  
  1062. } WSEGL_FunctionTable;
  1063.  
  1064. diff -uNr qt-everywhere-opensource-src-4.8.5.org/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c
  1065. --- qt-everywhere-opensource-src-4.8.5.org/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c 2013-06-07 07:17:00.000000000 +0200
  1066. +++ qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c 2013-12-16 13:51:28.795001808 +0100
  1067. @@ -336,12 +336,17 @@
  1068. /* Return the parameters of a drawable that are needed by the EGL layer */
  1069. static WSEGLError wseglGetDrawableParameters
  1070. (WSEGLDrawableHandle _drawable, WSEGLDrawableParams *sourceParams,
  1071. - WSEGLDrawableParams *renderParams)
  1072. + WSEGLDrawableParams *renderParams,unsigned long ulPlaneOffset)
  1073. {
  1074. PvrQwsDrawable *drawable = (PvrQwsDrawable *)_drawable;
  1075. PVR2DMEMINFO *source, *render;
  1076. WSEGLPixelFormat pixelFormat;
  1077.  
  1078. + WSEGL_UNREFERENCED_PARAMETER(ulPlaneOffset);
  1079. +
  1080. + memset(renderParams, 0, sizeof(*renderParams));
  1081. + memset(sourceParams, 0, sizeof(*sourceParams));
  1082. +
  1083. if (!pvrQwsGetBuffers(drawable, &source, &render))
  1084. return WSEGL_BAD_DRAWABLE;
  1085.  
  1086. @@ -366,7 +371,7 @@
  1087. sourceParams->ePixelFormat = pixelFormat;
  1088. sourceParams->pvLinearAddress = source->pBase;
  1089. sourceParams->ui32HWAddress = source->ui32DevAddr;
  1090. - sourceParams->hPrivateData = source->hPrivateData;
  1091. + sourceParams->hMemInfo = source->hPrivateData;
  1092.  
  1093. renderParams->ui32Width = drawable->rect.width;
  1094. renderParams->ui32Height = drawable->rect.height;
  1095. @@ -374,11 +379,34 @@
  1096. renderParams->ePixelFormat = pixelFormat;
  1097. renderParams->pvLinearAddress = render->pBase;
  1098. renderParams->ui32HWAddress = render->ui32DevAddr;
  1099. - renderParams->hPrivateData = render->hPrivateData;
  1100. + renderParams->hMemInfo = render->hPrivateData;
  1101. +
  1102. + return WSEGL_SUCCESS;
  1103. +}
  1104.  
  1105. +static WSEGLError wseglConnectDrawable(WSEGLDrawableHandle hDrawable){
  1106. + WSEGL_UNREFERENCED_PARAMETER(hDrawable);
  1107. return WSEGL_SUCCESS;
  1108. }
  1109.  
  1110. +static WSEGLError wseglDisconnectDrawable(WSEGLDrawableHandle hDrawable){
  1111. + WSEGL_UNREFERENCED_PARAMETER(hDrawable);
  1112. + return WSEGL_SUCCESS;
  1113. +}
  1114. +/***********************************************************************************
  1115. + Function Name : WSEGL_FlagStartFrame
  1116. + Inputs : hDrawable
  1117. + Outputs : None
  1118. + Returns : Error code
  1119. + Description : Indicates that there have been rendering commands submitted
  1120. + by a client driver
  1121. +************************************************************************************/
  1122. +static WSEGLError wseglFlagStartFrame(void)
  1123. +{
  1124. + return WSEGL_SUCCESS;
  1125. +}
  1126. +
  1127. +
  1128. static WSEGL_FunctionTable const wseglFunctions = {
  1129. WSEGL_VERSION,
  1130. wseglIsDisplayValid,
  1131. @@ -392,7 +420,10 @@
  1132. wseglWaitNative,
  1133. wseglCopyFromDrawable,
  1134. wseglCopyFromPBuffer,
  1135. - wseglGetDrawableParameters
  1136. + wseglGetDrawableParameters,
  1137. + wseglConnectDrawable,
  1138. + wseglDisconnectDrawable,
  1139. + wseglFlagStartFrame
  1140. };
  1141.  
  1142. /* Return the table of WSEGL functions to the EGL implementation */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement