aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Balagopalakrishnan2015-02-01 23:05:54 -0600
committerAnand Balagopalakrishnan2015-02-26 01:33:13 -0600
commitc2456ec3f03da022fb7489d6b381a4ac26a68203 (patch)
treeec75957bb7fe78ef498b80915371da6620d77d23
parent709ea149e064859f97bb421c16199138cb24b918 (diff)
downloadimg-pvr-sdk-c2456ec3f03da022fb7489d6b381a4ac26a68203.tar.gz
img-pvr-sdk-c2456ec3f03da022fb7489d6b381a4ac26a68203.tar.xz
img-pvr-sdk-c2456ec3f03da022fb7489d6b381a4ac26a68203.zip
Imagination PowerVR(tm) SDK v3.3_r2 binaries for TI OMAP5/Jacinto6 platform
Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
-rwxr-xr-xJacinto6-IMG-PowerVR-SDK-Manifest.docbin0 -> 98304 bytes
-rwxr-xr-xJacinto6-IMG-PowerVR-SDK-Manifest.pdfbin0 -> 190386 bytes
-rwxr-xr-xLegalNotice.txt16
-rwxr-xr-xMakefile10
-rwxr-xr-xdocs/PVRHub.User Manual.pdfbin0 -> 648602 bytes
-rwxr-xr-xdocs/PVRScope.User Manual.Developer.pdfbin0 -> 368433 bytes
-rwxr-xr-xdocs/PVRTune.User Manual.Developer.pdfbin0 -> 1552457 bytes
-rw-r--r--patch/0001-Adding-DRM-build-support-to-PVR-Demos.patch846
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2BinaryShaderbin0 -> 49395 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2ChameleonManbin0 -> 2688856 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2Coverflowbin0 -> 2379788 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2DeferredShadingbin0 -> 4884049 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2ExampleUIbin0 -> 3222522 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2FilmTVbin0 -> 2184037 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2Fractalbin0 -> 1675636 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2Glassbin0 -> 3970979 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2MagicLanternbin0 -> 4799661 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2Navigationbin0 -> 4037032 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2Navigation3Dbin0 -> 48649442 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2ParticleSystembin0 -> 1755767 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2PhantomMaskbin0 -> 2085672 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2Shadersbin0 -> 2248055 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2Skybox2bin0 -> 3295180 bytes
-rwxr-xr-xtargetfs/Examples/Advanced/OGLES2Waterbin0 -> 21170364 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2AlphaBlendbin0 -> 2069061 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2AlphaTestbin0 -> 1741921 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2AnisotropicLightingbin0 -> 1887167 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2Bloombin0 -> 1938835 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2Bumpmapbin0 -> 2169151 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2CellShadingbin0 -> 1808374 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2ComplexLightingbin0 -> 1874013 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2DisplacementMapbin0 -> 2615754 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2EdgeDetectionbin0 -> 2051576 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2FastTnLbin0 -> 1877971 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2Fogbin0 -> 1873870 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2FresnelReflectionsbin0 -> 2046311 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2Iridescencebin0 -> 1935543 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2LevelOfDetailbin0 -> 2157089 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2LightMapbin0 -> 1969196 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2MaximumIntensityProjectionbin0 -> 2299018 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2MultiThreadingbin0 -> 1679956 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2MultipleRenderTargetsbin0 -> 2002161 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2OcclusionQueriesbin0 -> 3099159 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2ParallaxBumpMapbin0 -> 2084111 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2Reflectionsbin0 -> 1939803 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2Refractionbin0 -> 2006653 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2RenderToTexturebin0 -> 1854327 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2ShadowMappingbin0 -> 2113236 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2ShadowVolumebin0 -> 2017172 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2Skinningbin0 -> 1940023 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2StencilBufferbin0 -> 2260192 bytes
-rwxr-xr-xtargetfs/Examples/Intermediate/OGLES2ToneMappingbin0 -> 18537579 bytes
-rwxr-xr-xtargetfs/PVRHub/PVRPerfServer/PVRPerfServerDeveloperbin0 -> 202812 bytes
-rwxr-xr-xtargetfs/PVRHub/PVRTrace/Recorder/_SKELETON_CONFIG.json32
-rwxr-xr-xtargetfs/PVRHub/PVRTrace/Recorder/libEGL.sobin0 -> 15170 bytes
-rwxr-xr-xtargetfs/PVRHub/PVRTrace/Recorder/libGLES_CM.sobin0 -> 47498 bytes
-rwxr-xr-xtargetfs/PVRHub/PVRTrace/Recorder/libGLESv1_CM.sobin0 -> 39377 bytes
-rwxr-xr-xtargetfs/PVRHub/PVRTrace/Recorder/libGLESv2.sobin0 -> 64815 bytes
-rwxr-xr-xtargetfs/PVRHub/PVRTrace/Recorder/libPVRTrace.sobin0 -> 1418920 bytes
-rwxr-xr-xtargetfs/PVRHub/Scripts/create_default_cfg.sh39
-rwxr-xr-xtargetfs/PVRHub/Scripts/envsetup.sh53
-rwxr-xr-xtargetfs/PVRHub/Scripts/pvr_profile27
-rwxr-xr-xtargetfs/PVRHub/Scripts/pvr_trace15
-rwxr-xr-xtargetfs/PVRHub/Scripts/start_tracing.sh24
-rwxr-xr-xtargetfs/PVRHub/Scripts/stop_tracing.sh12
-rwxr-xr-xtargetfs/PVRScopeDeveloper/PVRScopeComms.h237
-rwxr-xr-xtargetfs/PVRScopeDeveloper/PVRScopeStats.h199
-rwxr-xr-xtargetfs/PVRScopeDeveloper/libPVRScopeDeveloper.abin0 -> 309780 bytes
68 files changed, 1510 insertions, 0 deletions
diff --git a/Jacinto6-IMG-PowerVR-SDK-Manifest.doc b/Jacinto6-IMG-PowerVR-SDK-Manifest.doc
new file mode 100755
index 0000000..cb770a4
--- /dev/null
+++ b/Jacinto6-IMG-PowerVR-SDK-Manifest.doc
Binary files differ
diff --git a/Jacinto6-IMG-PowerVR-SDK-Manifest.pdf b/Jacinto6-IMG-PowerVR-SDK-Manifest.pdf
new file mode 100755
index 0000000..877b6f5
--- /dev/null
+++ b/Jacinto6-IMG-PowerVR-SDK-Manifest.pdf
Binary files differ
diff --git a/LegalNotice.txt b/LegalNotice.txt
new file mode 100755
index 0000000..fdaa4c1
--- /dev/null
+++ b/LegalNotice.txt
@@ -0,0 +1,16 @@
1LEGAL NOTICE - SDK
2
3
4Imagination Technologies Ltd ('IMGTEC') hereby grant you permission to use, copy and distribute documents, related graphics and software delivered from this SDK (PowerVR(r) Software) provided that you do not decompile, reverse engineer, or disassemble such software.
5
6All Third Party Materials found on this SDK, including without limitation, artwork, graphics, game demos and patches, are the sole and exclusive property of such third parties. IMGTEC make no representations or warranties about the accuracy, usability or validity of any Third Party Materials, and disclaim all liabilities, as more fully enumerated below, in connection with such Third Party Materials. Third Party Materials may be changed, amended, altered or removed at such third party's request and discretion. IMGTEC assume no responsibility or liability for any use of any Third Party Materials contained herein, and all persons or entities gaining access to this SDK are hereby notified that such persons or entities using Third Party Materials found herein do so at their own risk. Legal disclaimers found below pertain additionally to relevant Third Party Materials which are accessible from this SDK.
7
8Nothing contained on this Server shall be construed as conferring by implication, estoppel or otherwise any license or right under any patent or trademark of IMGTEC, or any third party. Except as expressly provided above, nothing contained herein shall be construed as conferring any license or right under any IMGTEC copyright; provided however, that PowerVR Software (where applicable) may be governed by an End-user License Agreement accompanying such software. PowerVR Software may not be downloaded unless you agree to the terms provided therein, and the corresponding End-user License Agreement, if any.
9
10ALL POWERVR MATERIALS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IMGTEC HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO POWERVR MATERIALS, INCLUDING ALL WARRANTIES, IMPLIED OR EXPRESS, OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL IMGTEC BE LIABLE FOR ANY DAMAGES WHATSOEVER, (INCLUDING, WITHOUT LIMITATION, DAMAGES RESULTING FROM LOSS OF USE, DATA OR PROFITS), WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORT RELATED ACTION, ARISING OUT OF, OR IN CONNECTION WITH, OR IN CONTEMPLATION OF THE USE OR PERFORMANCE OF MATERIALS PROVIDED FROM THIS SERVER, EVEN IF IMGTEC HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
11
12You are also advised that (1) any of the PowerVR or Third Party Materials may contain errors or omissions; (2) IMGTEC or relevant third parties may remove, replace, or make changes in the PowerVR or Third Party Materials without notice at any time; and (3) IMGTEC or relevant third parties are under no obligation to update the PowerVR or Third Party Materials. Any feedback, comments, suggestions, or the like provided to IMGTEC in connection with any IMGTEC or PowerVR web site or any PowerVR or Third Party Materials from this SDK shall be considered as non-confidential information and IMGTEC and/or relevant third parties shall be free to use such information on an unrestricted basis.
13
14PowerVR Technologies, the PowerVR Technologies logo, Imagination Technologies and the Imagination Technologies logo are trademarks or registered trademarks of Imagination Technologies Ltd. All rights reserved. Used with permission only from IMGTEC.
15
16(c) Copyright Imagination Technologies Ltd
diff --git a/Makefile b/Makefile
new file mode 100755
index 0000000..6c665a0
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,10 @@
1DESTDIR ?= ${DISCIMAGE}
2
3SRCDIR = ./targetfs
4INSTALL_DIR = ${DESTDIR}/opt/img-powervr-sdk
5
6all:
7
8install:
9 mkdir -p ${INSTALL_DIR}
10 cp -ar ${SRCDIR}/* ${INSTALL_DIR}
diff --git a/docs/PVRHub.User Manual.pdf b/docs/PVRHub.User Manual.pdf
new file mode 100755
index 0000000..69e3b30
--- /dev/null
+++ b/docs/PVRHub.User Manual.pdf
Binary files differ
diff --git a/docs/PVRScope.User Manual.Developer.pdf b/docs/PVRScope.User Manual.Developer.pdf
new file mode 100755
index 0000000..048bce1
--- /dev/null
+++ b/docs/PVRScope.User Manual.Developer.pdf
Binary files differ
diff --git a/docs/PVRTune.User Manual.Developer.pdf b/docs/PVRTune.User Manual.Developer.pdf
new file mode 100755
index 0000000..0d74c5e
--- /dev/null
+++ b/docs/PVRTune.User Manual.Developer.pdf
Binary files differ
diff --git a/patch/0001-Adding-DRM-build-support-to-PVR-Demos.patch b/patch/0001-Adding-DRM-build-support-to-PVR-Demos.patch
new file mode 100644
index 0000000..cda3c47
--- /dev/null
+++ b/patch/0001-Adding-DRM-build-support-to-PVR-Demos.patch
@@ -0,0 +1,846 @@
1From f800de8a3224683b60f4d4aca390d7b9bfdfa585 Mon Sep 17 00:00:00 2001
2From: Subhajit Paul <subhajit_paul@ti.com>
3Date: Sun, 12 Oct 2014 16:38:29 +0530
4Subject: [PATCH] Adding DRM build support to PVR Demos
5
6Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
7---
8 Builds/Linux/platform.mak | 8 +
9 Shell/OS/LinuxDrm/PVRShellOS.cpp | 651 ++++++++++++++++++++++++++++++++++++++
10 Shell/OS/LinuxDrm/PVRShellOS.h | 116 +++++++
11 Shell/PVRShell.cpp | 4 +
12 Shell/PVRShell.h | 3 +-
13 5 files changed, 781 insertions(+), 1 deletion(-)
14 create mode 100755 Shell/OS/LinuxDrm/PVRShellOS.cpp
15 create mode 100755 Shell/OS/LinuxDrm/PVRShellOS.h
16
17diff --git a/Builds/Linux/platform.mak b/Builds/Linux/platform.mak
18index 4168688..5351e05 100755
19--- a/Builds/Linux/platform.mak
20+++ b/Builds/Linux/platform.mak
21@@ -29,6 +29,14 @@ endif
22 include $(SDKDIR)/Builds/Linux/$(PLAT_SUFFIX)/ws.mak
23 endif
24
25+ifeq "$(WS)" "Drm"
26+ifndef DRMROOT
27+$(error When building a DRM build you must set DRMROOT to point at the location where your DRM headers and libs can be found.)
28+endif
29+PLAT_CFLAGS += -I$(DRMROOT)/include/libdrm -I$(DRMROOT)/include/gbm
30+PLAT_LINK += -L$(DRMROOT)/lib -ldrm -lgbm -ldl -Wl,--rpath-link,$(DRMROOT)/lib
31+endif
32+
33 PLAT_OBJPATH ?= ../$(PLATFORM)/$(DEBUG_RELEASE)$(WS)
34
35 ifneq (,$(filter OGL,$(APIS)))
36diff --git a/Shell/OS/LinuxDrm/PVRShellOS.cpp b/Shell/OS/LinuxDrm/PVRShellOS.cpp
37new file mode 100755
38index 0000000..91043be
39--- /dev/null
40+++ b/Shell/OS/LinuxDrm/PVRShellOS.cpp
41@@ -0,0 +1,651 @@
42+/******************************************************************************
43+
44+ @File LinuxDrm/PVRShellOS.cpp
45+
46+ @Title LinuxDrm/PVRShellOS
47+
48+ @Version
49+
50+ @Copyright Copyright (c) Imagination Technologies Limited.
51+ Copyright (c) Texas Instruments Incorporated.
52+
53+ @Platform DRM support for any Linux
54+
55+ @Description Makes programming for 3D APIs easier by wrapping window creation
56+ and other functions for use by a demo.
57+
58+******************************************************************************/
59+
60+#include "PVRShell.h"
61+#include "PVRShellAPI.h"
62+#include "PVRShellOS.h"
63+#include "PVRShellImpl.h"
64+
65+#include <sys/types.h>
66+#include <sys/stat.h>
67+#include <sys/ipc.h>
68+#include <sys/time.h>
69+#include <fcntl.h>
70+
71+#include <sys/ioctl.h>
72+#include <linux/fb.h>
73+#include <sys/types.h>
74+#include <sys/stat.h>
75+#include <fcntl.h>
76+
77+#include <stdio.h>
78+#include <stdlib.h>
79+#include <stdarg.h>
80+#include <time.h>
81+#include <string.h>
82+#include <signal.h>
83+#include <errno.h>
84+
85+#include <xf86drm.h>
86+#include <xf86drmMode.h>
87+#include <gbm.h>
88+
89+// No Doxygen for CPP files, due to documentation duplication
90+/// @cond NO_DOXYGEN
91+
92+#if !defined(CONNAME)
93+#define CONNAME "/dev/tty"
94+#endif
95+
96+#define DRIDEVNAME "/dev/dri/card0"
97+
98+
99+/*!***************************************************************************
100+ Defines
101+*****************************************************************************/
102+
103+/*!***************************************************************************
104+ Declarations
105+*****************************************************************************/
106+
107+/*!***************************************************************************
108+ Class: PVRShellInit
109+*****************************************************************************/
110+
111+/*!***********************************************************************
112+@Function PVRShellOutputDebug
113+@Input format printf style format followed by arguments it requires
114+@Description Writes the resultant string to the debug output (e.g. using
115+ printf(), OutputDebugString(), ...). Check the SDK release notes for
116+ details on how the string is output.
117+*************************************************************************/
118+void PVRShell::PVRShellOutputDebug(char const * const format, ...) const
119+{
120+ if(!format)
121+ return;
122+
123+ va_list arg;
124+ char buf[1024];
125+
126+ va_start(arg, format);
127+ vsnprintf(buf, 1024, format, arg);
128+ va_end(arg);
129+
130+ // Passes the data to a platform dependant function
131+ m_pShellInit->OsDisplayDebugString(buf);
132+}
133+
134+/*!***********************************************************************
135+ @Function OsInit
136+ @description Initialisation for OS-specific code.
137+*************************************************************************/
138+void PVRShellInit::OsInit()
139+{
140+ int retval;
141+
142+ // In case we're in the background ignore SIGTTIN and SIGTTOU
143+ signal( SIGTTIN, SIG_IGN );
144+ signal( SIGTTOU, SIG_IGN );
145+
146+ m_pShell->m_pShellData->bFullScreen= true; // linux overrides default to use fullscreen
147+
148+ m_ui32NativeDisplay = 0;
149+
150+ // Keyboard handling
151+ if((devfd=open(CONNAME, O_RDWR|O_NDELAY)) <= 0)
152+ {
153+ m_pShell->PVRShellOutputDebug("Can't open tty (%s)\n",CONNAME);
154+ }
155+ else
156+ {
157+ tcgetattr(devfd,&termio_orig);
158+ tcgetattr(devfd,&termio);
159+ cfmakeraw(&termio);
160+ termio.c_oflag |= OPOST | ONLCR; // Turn back on cr-lf expansion on output
161+ termio.c_cc[VMIN]=1;
162+ termio.c_cc[VTIME]=0;
163+
164+ if(tcsetattr(devfd,TCSANOW,&termio) == -1)
165+ {
166+ m_pShell->PVRShellOutputDebug("Can't set tty attributes for %s\n",CONNAME);
167+ }
168+ }
169+
170+
171+ // Construct the binary path for GetReadPath() and GetWritePath()
172+
173+ // Get PID (Process ID)
174+ pid_t ourPid = getpid();
175+ char *pszExePath, pszSrcLink[64];
176+ int len = 64;
177+ int res;
178+
179+ sprintf(pszSrcLink, "/proc/%d/exe", ourPid);
180+ pszExePath = 0;
181+
182+ do
183+ {
184+ len *= 2;
185+ delete[] pszExePath;
186+ pszExePath = new char[len];
187+ res = readlink(pszSrcLink, pszExePath, len);
188+
189+ if(res < 0)
190+ {
191+ m_pShell->PVRShellOutputDebug("Warning Readlink %s failed. The application name, read path and write path have not been set.\n", pszExePath);
192+ break;
193+ }
194+ } while(res >= len);
195+
196+ if(res >= 0)
197+ {
198+ pszExePath[res] = '\0'; // Null-terminate readlink's result
199+ SetReadPath(pszExePath);
200+ SetWritePath(pszExePath);
201+ SetAppName(pszExePath);
202+ }
203+
204+ delete[] pszExePath;
205+
206+ /*
207+ Get rid of the blinking cursor on a screen.
208+
209+ It's an equivalent of:
210+ <CODE> echo -n -e "\033[?25l" > /dev/tty0 </CODE>
211+ if you do the above command then you can undo it with:
212+ <CODE> echo -n -e "\033[?25h" > /dev/tty0 </CODE>
213+ */
214+ const char txt[] = { 27 /* the ESCAPE ASCII character */
215+ , '['
216+ , '?'
217+ , '2'
218+ , '5'
219+ , 'l'
220+ , 0
221+ };
222+ retval = write(devfd, &txt[0], 7);
223+
224+ gettimeofday(&m_StartTime,NULL);
225+
226+ m_pShell->m_pShellData->nShellDimX = -1;
227+ m_pShell->m_pShellData->nShellDimY = -1;
228+ m_ui32DrmDisplayId = 0;
229+
230+
231+}
232+
233+static void pfnCallbackDrmFbDestroy(struct gbm_bo *bo, void *data)
234+{
235+ struct SDrmFbWrapper *psFb = (struct SDrmFbWrapper *)data;
236+
237+ if (psFb->ui32FbId)
238+ drmModeRmFB(psFb->i32Fd, psFb->ui32FbId);
239+
240+ delete psFb;
241+}
242+
243+static void pfnCallbackDrmPageFlip(int fd, unsigned int frame,
244+ unsigned int sec, unsigned int usec, void *data)
245+{
246+ int *pi32WaitFlip = (int *)data;
247+ *pi32WaitFlip = 0;
248+}
249+
250+struct SDrmFbWrapper *PVRShellInitOS::DrmFbGetFromBo(struct gbm_bo *bo)
251+{
252+ struct SDrmFbWrapper *fb = (struct SDrmFbWrapper *)gbm_bo_get_user_data(bo);
253+ uint32_t width, height, stride, handle;
254+ int ret;
255+
256+ if (fb)
257+ return fb;
258+
259+ fb = new struct SDrmFbWrapper;
260+ fb->psGbmBo = bo;
261+ fb->i32Fd = m_i32DrmFile;
262+
263+ width = gbm_bo_get_width(bo);
264+ height = gbm_bo_get_height(bo);
265+ stride = gbm_bo_get_stride(bo);
266+ handle = gbm_bo_get_handle(bo).u32;
267+
268+ ret = drmModeAddFB(m_i32DrmFile, width, height, 24, 32, stride, handle, &fb->ui32FbId);
269+ if (ret) {
270+ //m_pShell->PVRShellOutputDebug("failed to create fb: %s\n", strerror(errno));
271+ delete fb;
272+ return NULL;
273+ }
274+
275+ gbm_bo_set_user_data(bo, fb, pfnCallbackDrmFbDestroy);
276+
277+ return fb;
278+}
279+
280+/*!***********************************************************************
281+ @Function OsInitOS
282+ @description Saves instance handle and creates main window
283+ In this function, we save the instance handle in a global variable and
284+ create and display the main program window.
285+*************************************************************************/
286+bool PVRShellInit::OsInitOS()
287+{
288+ bool bFound;
289+
290+ /*We could be fancy here by getting drm device from udev*/
291+ /*Or, user could pass drm device node through CMDLINE */
292+ /*For the time being lets keep calm and use card0 */
293+ if((m_i32DrmFile = open(DRIDEVNAME, O_RDWR)) < 0) {
294+ m_pShell->PVRShellOutputDebug("failed to open drm device %s : %s\n", DRIDEVNAME, strerror(errno));
295+ return false;
296+ }
297+
298+ m_psDrmResources = drmModeGetResources(m_i32DrmFile);
299+ if (!m_psDrmResources) {
300+ m_pShell->PVRShellOutputDebug("drmModeGetResources failed: %s\n", strerror(errno));
301+ return false;
302+ }
303+
304+ /* find a connected connector: */
305+ bFound = false;
306+ for (int i = 0; i < m_psDrmResources->count_connectors; i++) {
307+ m_psDrmConnector = drmModeGetConnector(m_i32DrmFile, m_psDrmResources->connectors[i]);
308+
309+ if (m_psDrmConnector->connection != DRM_MODE_CONNECTED) {
310+ drmModeFreeConnector(m_psDrmConnector);
311+ continue;
312+ }
313+
314+ if(m_ui32DrmDisplayId == 0) {
315+ bFound = true;
316+ break;
317+ }
318+
319+ if(m_ui32DrmDisplayId == m_psDrmConnector->connector_id) {
320+ bFound = true;
321+ break;
322+ }
323+ }
324+
325+ if(bFound == false) {
326+ m_pShell->PVRShellOutputDebug("No Connector found for requested device\n");
327+ return false;
328+ }
329+
330+ m_ui32DrmConnectorId = m_psDrmConnector->connector_id;
331+ m_psDrmMode = &m_psDrmConnector->modes[0];
332+
333+ bFound = false;
334+ for (int j=0; j<m_psDrmResources->count_encoders; j++) {
335+ m_psDrmEncoder = drmModeGetEncoder(m_i32DrmFile, m_psDrmResources->encoders[j]);
336+ if (m_psDrmEncoder->encoder_id == m_psDrmConnector->encoder_id) {
337+ bFound = true;
338+ break;
339+ }
340+ drmModeFreeEncoder(m_psDrmEncoder);
341+ }
342+
343+ if(bFound == false) {
344+ m_pShell->PVRShellOutputDebug("No Encoder found for requested Connector\n");
345+ return false;
346+ }
347+
348+ m_ui32DrmEncoderId = m_psDrmEncoder->encoder_id;
349+
350+ m_ui32DrmCrtcId = m_psDrmEncoder->crtc_id;
351+ for (int j=0; j<m_psDrmResources->count_crtcs; j++) {
352+ m_psDrmCrtc = drmModeGetCrtc(m_i32DrmFile, m_psDrmResources->crtcs[j]);
353+ if (m_psDrmCrtc->crtc_id == m_ui32DrmCrtcId) {
354+ break;
355+ }
356+ drmModeFreeCrtc(m_psDrmCrtc);
357+ }
358+
359+
360+ m_pShell->m_pShellData->nShellDimX = m_psDrmMode->hdisplay;
361+ m_pShell->m_pShellData->nShellDimY = m_psDrmMode->vdisplay;
362+
363+ m_psGbmDev = gbm_create_device(m_i32DrmFile);
364+ m_psGbmSurface = gbm_surface_create(m_psGbmDev,
365+ m_pShell->m_pShellData->nShellDimX,
366+ m_pShell->m_pShellData->nShellDimY,
367+ GBM_FORMAT_XRGB8888,
368+ GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
369+ if (!m_psGbmSurface) {
370+ m_pShell->PVRShellOutputDebug("failed to create gbm surface\n");
371+ return false;
372+ }
373+
374+ m_ui32NativeDisplay = (unsigned int)m_psGbmDev;
375+ m_ui32NativeWindow = (unsigned int)m_psGbmSurface;
376+ m_ui32CurrentFb = 0;
377+ return true;
378+}
379+
380+/*!***********************************************************************
381+ @Function OsReleaseOS
382+ @description Destroys main window
383+*************************************************************************/
384+void PVRShellInit::OsReleaseOS()
385+{
386+ gbm_surface_destroy(m_psGbmSurface);
387+ gbm_device_destroy(m_psGbmDev);
388+ drmModeFreeCrtc(m_psDrmCrtc);
389+ drmModeFreeEncoder(m_psDrmEncoder);
390+ drmModeFreeConnector(m_psDrmConnector);
391+ drmModeFreeResources(m_psDrmResources);
392+ drmClose(m_i32DrmFile);
393+}
394+
395+/*!***********************************************************************
396+ @Function OsExit
397+ @description Destroys main window
398+*************************************************************************/
399+void PVRShellInit::OsExit()
400+{
401+ // Show the exit message to the user
402+ m_pShell->PVRShellOutputDebug((const char*)m_pShell->PVRShellGet(prefExitMessage));
403+}
404+
405+/*!***********************************************************************
406+ @Function OsDoInitAPI
407+ @Return true on success
408+ @description Perform API initialisation and bring up window / fullscreen
409+*************************************************************************/
410+bool PVRShellInit::OsDoInitAPI()
411+{
412+ if(!ApiInitAPI())
413+ {
414+ return false;
415+ }
416+
417+ // No problem occured
418+ return true;
419+}
420+
421+/*!***********************************************************************
422+ @Function OsDoReleaseAPI
423+ @description Clean up after we're done
424+*************************************************************************/
425+void PVRShellInit::OsDoReleaseAPI()
426+{
427+ ApiReleaseAPI();
428+}
429+
430+/*!***********************************************************************
431+ @Function OsRenderComplete
432+ @Returns false when the app should quit
433+ @description Main message loop / render loop
434+*************************************************************************/
435+void PVRShellInit::OsRenderComplete()
436+{
437+ int ckb = 0;
438+ size_t bytes_read;
439+ int ret, i;
440+ struct gbm_bo *bo;
441+ struct SDrmFbWrapper *fb;
442+ int waiting_for_flip = 1;
443+ fd_set fds;
444+ drmEventContext evctx;
445+ evctx.version = DRM_EVENT_CONTEXT_VERSION;
446+ evctx.page_flip_handler = pfnCallbackDrmPageFlip;
447+
448+ bo = gbm_surface_lock_front_buffer(m_psGbmSurface);
449+ fb = DrmFbGetFromBo(bo);
450+ if(!m_ui32CurrentFb) {
451+ ret = drmModeSetCrtc(m_i32DrmFile, m_ui32DrmCrtcId, fb->ui32FbId, 0, 0,
452+ &m_ui32DrmConnectorId, 1, m_psDrmMode);
453+ if (ret) {
454+ m_pShell->PVRShellOutputDebug("display failed to set mode: %s\n", strerror(errno));
455+ return;
456+ }
457+ } else {
458+ ret = drmModePageFlip(m_i32DrmFile, m_ui32DrmCrtcId, fb->ui32FbId,
459+ DRM_MODE_PAGE_FLIP_EVENT, &waiting_for_flip);
460+ if (ret) {
461+ m_pShell->PVRShellOutputDebug("display failed to flip page: %s\n", strerror(errno));
462+ return;
463+ }
464+ FD_ZERO(&fds);
465+ FD_SET(m_i32DrmFile, &fds);
466+ while (waiting_for_flip) {
467+ ret = select(m_i32DrmFile + 1, &fds, NULL, NULL, NULL);
468+ if (ret < 0) {
469+ m_pShell->PVRShellOutputDebug("Select Error: %s\n", strerror(errno));
470+ return;
471+ } else if (ret == 0) {
472+ m_pShell->PVRShellOutputDebug("Select Timeout\n");
473+ return;
474+ } else if (FD_ISSET(0, &fds)) {
475+ continue;
476+ }
477+ drmHandleEvent(m_i32DrmFile, &evctx);
478+ }
479+ }
480+ // Check keyboard and keypad
481+
482+ // Keyboard.
483+ if(devfd > 0)
484+ {
485+ while ((bytes_read = read(devfd, &ckb, 1)) == 1);
486+
487+ switch(ckb)
488+ {
489+ case '0':
490+ case 'q':
491+ case 'Q':
492+ nLastKeyPressed = PVRShellKeyNameQUIT;
493+ break;
494+ case 13:
495+ nLastKeyPressed = PVRShellKeyNameSELECT;
496+ break;
497+ case ' ':
498+ case '1':
499+ nLastKeyPressed = PVRShellKeyNameACTION1;
500+ break;
501+ case '2':
502+ nLastKeyPressed = PVRShellKeyNameACTION2;
503+ break;
504+ case 65: // Up Arrow
505+ nLastKeyPressed = m_eKeyMapUP;
506+ break;
507+ case 66: // Down Arrow
508+ nLastKeyPressed = m_eKeyMapDOWN;
509+ break;
510+ case 68: // Left Arrow
511+ nLastKeyPressed = m_eKeyMapLEFT;
512+ break;
513+ case 67: // Right Arrow
514+ nLastKeyPressed = m_eKeyMapRIGHT;
515+ break;
516+ default:;
517+
518+ }
519+
520+ }
521+
522+
523+}
524+
525+/*!***********************************************************************
526+ @Function OsPixmapCopy
527+ @Return true if the copy succeeded
528+ @description When using pixmaps, copy the render to the display
529+*************************************************************************/
530+bool PVRShellInit::OsPixmapCopy()
531+{
532+ return false;
533+}
534+
535+/*!***********************************************************************
536+ @Function OsGetNativeDisplayType
537+ @Return The 'NativeDisplayType' for EGL
538+ @description Called from InitAPI() to get the NativeDisplayType
539+*************************************************************************/
540+void *PVRShellInit::OsGetNativeDisplayType()
541+{
542+ return (void*) m_ui32NativeDisplay;
543+}
544+
545+/*!***********************************************************************
546+ @Function OsGetNativePixmapType
547+ @Return The 'NativePixmapType' for EGL
548+ @description Called from InitAPI() to get the NativePixmapType
549+*************************************************************************/
550+void *PVRShellInit::OsGetNativePixmapType()
551+{
552+ // Pixmap support: return the pixmap
553+ return NULL;
554+}
555+
556+/*!***********************************************************************
557+ @Function OsGetNativeWindowType
558+ @Return The 'NativeWindowType' for EGL
559+ @description Called from InitAPI() to get the NativeWindowType
560+*************************************************************************/
561+void *PVRShellInit::OsGetNativeWindowType()
562+{
563+ return (void *) m_ui32NativeWindow;
564+}
565+
566+/*!***********************************************************************
567+ @Function OsGet
568+ @Input prefName Name of value to get
569+ @Modified pn A pointer set to the value asked for
570+ @Returns true on success
571+ @Description Retrieves OS-specific data
572+*************************************************************************/
573+bool PVRShellInit::OsGet(const prefNameIntEnum prefName, int *pn)
574+{
575+ switch(prefName)
576+ {
577+ case prefNativeDisplay:
578+ *pn = m_ui32NativeDisplay;
579+ return true;
580+ default:
581+ return false;
582+ };
583+}
584+
585+/*!***********************************************************************
586+ @Function OsGet
587+ @Input prefName Name of value to get
588+ @Modified pp A pointer set to the value asked for
589+ @Returns true on success
590+ @Description Retrieves OS-specific data
591+*************************************************************************/
592+bool PVRShellInit::OsGet(const prefNamePtrEnum prefName, void **pp)
593+{
594+ return false;
595+}
596+
597+
598+/*!***********************************************************************
599+ @Function OsSet
600+ @Input prefName Name of preference to set to value
601+ @Input value Value
602+ @Return true for success
603+ @Description Sets OS-specific data
604+*************************************************************************/
605+bool PVRShellInit::OsSet(const prefNameBoolEnum prefName, const bool value)
606+{
607+ return false;
608+}
609+
610+/*!***********************************************************************
611+ @Function OsSet
612+ @Input prefName Name of value to set
613+ @Input i32Value The value to set our named value to
614+ @Returns true on success
615+ @Description Sets OS-specific data
616+*************************************************************************/
617+bool PVRShellInit::OsSet(const prefNameIntEnum prefName, const int i32Value)
618+{
619+ switch(prefName)
620+ {
621+ case prefDisplayConnector:
622+ m_ui32DrmDisplayId = i32Value;
623+ return true;
624+ default:
625+ return false;
626+ };
627+}
628+
629+/*!***********************************************************************
630+ @Function OsDisplayDebugString
631+ @Input str string to output
632+ @Description Prints a debug string
633+*************************************************************************/
634+void PVRShellInit::OsDisplayDebugString(char const * const str)
635+{
636+ printf("%s",str);
637+}
638+
639+/*!***********************************************************************
640+ @Function OsGetTime
641+ @Return An incrementing time value measured in milliseconds
642+ @Description Returns an incrementing time value measured in milliseconds
643+*************************************************************************/
644+unsigned long PVRShellInit::OsGetTime()
645+{
646+ timeval tv;
647+ gettimeofday(&tv,NULL);
648+
649+ if(tv.tv_sec < m_StartTime.tv_sec)
650+ m_StartTime.tv_sec = 0;
651+
652+ unsigned long sec = tv.tv_sec - m_StartTime.tv_sec;
653+ return (unsigned long)((sec*(unsigned long)1000) + (tv.tv_usec/1000.0));
654+}
655+
656+/*****************************************************************************
657+ Class: PVRShellInitOS
658+*****************************************************************************/
659+
660+/*****************************************************************************
661+ Global code
662+*****************************************************************************/
663+
664+/*!***************************************************************************
665+@function main
666+@input argc count of args from OS
667+@input argv array of args from OS
668+@returns result code to OS
669+@description Main function of the program
670+*****************************************************************************/
671+int main(int argc, char **argv)
672+{
673+ PVRShellInit init;
674+
675+ // Initialise the demo, process the command line, create the OS initialiser.
676+ if(!init.Init())
677+ return EXIT_ERR_CODE;
678+
679+ init.CommandLine((argc-1),&argv[1]);
680+
681+ // Initialise/run/shutdown
682+ while(init.Run());
683+
684+ return EXIT_NOERR_CODE;
685+}
686+
687+/// @endcond
688+
689+/*****************************************************************************
690+ End of file (PVRShellOS.cpp)
691+*****************************************************************************/
692+
693diff --git a/Shell/OS/LinuxDrm/PVRShellOS.h b/Shell/OS/LinuxDrm/PVRShellOS.h
694new file mode 100755
695index 0000000..3009597
696--- /dev/null
697+++ b/Shell/OS/LinuxDrm/PVRShellOS.h
698@@ -0,0 +1,116 @@
699+/*!****************************************************************************
700+
701+ @file LinuxDrm/PVRShellOS.h
702+ @ingroup OS_LinuxDrm
703+ @copyright Copyright (c) Imagination Technologies Limited.
704+ Copyright (c) Texas Instruments Incorporated
705+ @brief Initialization for the shell for LinuxDrm.
706+ @details Makes programming for 3D APIs easier by wrapping surface
707+ initialization, Texture allocation and other functions for use by a demo.
708+
709+******************************************************************************/
710+#ifndef _PVRSHELLOS_
711+#define _PVRSHELLOS_
712+
713+#include <termios.h>
714+#include <unistd.h>
715+#include <stdint.h>
716+#include <xf86drmMode.h>
717+#include <gbm.h>
718+
719+#define PVRSHELL_DIR_SYM '/'
720+#define _stricmp strcasecmp
721+
722+/*!***********************************************************************
723+ @struct SDrmFbWrapper
724+ @brief Stores DRM FB and associated GBM BO for freeup.
725+ ************************************************************************/
726+struct SDrmFbWrapper {
727+ struct gbm_bo *psGbmBo;
728+ unsigned int ui32FbId;
729+ int i32Fd;
730+};
731+
732+/*!
733+ @addtogroup OS_LinuxDrm
734+ @brief LinuxDrm OS
735+ @details The following table illustrates how key codes are mapped in LinuxDrm:
736+ <table>
737+ <tr><th> Key code </th><th> nLastKeyPressed (PVRShell) </th></tr>
738+ <tr><td> 0 </td><td> PVRShellKeyNameQUIT </td></tr>
739+ <tr><td> Q </td><td> PVRShellKeyNameQUIT </td></tr>
740+ <tr><td> S </td><td> PVRShellKeyNameScreenshot </td></tr>
741+ <tr><td> Enter </td><td> PVRShellKeyNameSELECT </td></tr>
742+ <tr><td> Space </td><td> PVRShellKeyNameACTION1 </td></tr>
743+ <tr><td> 1 </td><td> PVRShellKeyNameACTION1 </td></tr>
744+ <tr><td> 2 </td><td> PVRShellKeyNameACTION2 </td></tr>
745+ <tr><td> Up arrow </td><td> m_eKeyMapUP </td></tr>
746+ <tr><td> Down arrow </td><td> m_eKeyMapDOWN </td></tr>
747+ <tr><td> Left arrow </td><td> m_eKeyMapLEFT </td></tr>
748+ <tr><td> Right arrow </td><td> m_eKeyMapRIGHT </td></tr>
749+ </table>
750+ @{
751+*/
752+
753+/*!***************************************************************************
754+ @class PVRShellInitOS
755+ @brief Interface with specific Operating System.
756+*****************************************************************************/
757+class PVRShellInitOS
758+{
759+public:
760+ ~PVRShellInitOS() {
761+ /* recover tty state */
762+ int retval;
763+ const char txt[] = {
764+ 27 /* the ESCAPE ASCII character */
765+ , '['
766+ , '?'
767+ , '2'
768+ , '5'
769+ , 'h'
770+ , 0
771+ };
772+ retval = write(devfd, &txt[0], 7);
773+ tcsetattr(devfd, TCSANOW, &termio_orig);
774+
775+ }
776+
777+public:
778+ // Key handling
779+ int devfd;
780+ struct termios termio;
781+ struct termios termio_orig;
782+
783+
784+ timeval m_StartTime;
785+
786+ unsigned int m_ui32NativeDisplay;
787+ unsigned int m_ui32NativeWindow;
788+
789+ unsigned int m_ui32DrmDisplayId;
790+ int m_i32DrmFile;
791+ unsigned int m_ui32DrmCrtcId;
792+ unsigned int m_ui32DrmConnectorId;
793+ unsigned int m_ui32DrmEncoderId;
794+ drmModeResPtr m_psDrmResources;
795+ drmModeCrtcPtr m_psDrmCrtc;
796+ drmModeEncoderPtr m_psDrmEncoder;
797+ drmModeModeInfoPtr m_psDrmMode;
798+ drmModeConnectorPtr m_psDrmConnector;
799+
800+ struct gbm_device *m_psGbmDev;
801+ struct gbm_surface *m_psGbmSurface;
802+
803+ unsigned int m_ui32CurrentFb;
804+
805+ struct SDrmFbWrapper *DrmFbGetFromBo(struct gbm_bo *bo);
806+};
807+
808+/*! @} */
809+
810+#endif /* _PVRSHELLOS_ */
811+/*****************************************************************************
812+ End of file (PVRShellOS.h)
813+*****************************************************************************/
814+
815diff --git a/Shell/PVRShell.cpp b/Shell/PVRShell.cpp
816index 1d24090..6a4db51 100755
817--- a/Shell/PVRShell.cpp
818+++ b/Shell/PVRShell.cpp
819@@ -1151,6 +1151,10 @@ void PVRShellCommandLine::Apply(PVRShell &shell)
820 {
821 shell.PVRShellSet(prefDiscardStencil, (atoi(val) != 0));
822 }
823+ else if(_stricmp(arg, "-connector") == 0)
824+ {
825+ shell.PVRShellSet(prefDisplayConnector, atoi(val));
826+ }
827 }
828 else
829 {
830diff --git a/Shell/PVRShell.h b/Shell/PVRShell.h
831index eda31a1..6c5194e 100755
832--- a/Shell/PVRShell.h
833+++ b/Shell/PVRShell.h
834@@ -313,7 +313,8 @@ enum prefNameIntEnum
835 prefConfig, /*!< EGL: Get the chosen EGL config. */
836 prefRequestedConfig, /*!< EGL: Force the shell to use a particular EGL config. */
837 prefNativeDisplay, /*!< EGL: Allows you to specify the native display to use if the device has more that one. */
838- prefFrameTimeValue /*!< An integer value to say how long you wish one frame to last for (in ms) when force frame time is enabled. */
839+ prefFrameTimeValue, /*!< An integer value to say how long you wish one frame to last for (in ms) when force frame time is enabled. */
840+ prefDisplayConnector /*!< DRM: Display to happen on the connector. Default: first connector*/
841 };
842
843 /*!***********************************************************************
844--
8451.7.9.5
846
diff --git a/targetfs/Examples/Advanced/OGLES2BinaryShader b/targetfs/Examples/Advanced/OGLES2BinaryShader
new file mode 100755
index 0000000..e869443
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2BinaryShader
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2ChameleonMan b/targetfs/Examples/Advanced/OGLES2ChameleonMan
new file mode 100755
index 0000000..f33d372
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2ChameleonMan
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2Coverflow b/targetfs/Examples/Advanced/OGLES2Coverflow
new file mode 100755
index 0000000..49ee923
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2Coverflow
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2DeferredShading b/targetfs/Examples/Advanced/OGLES2DeferredShading
new file mode 100755
index 0000000..3db0b06
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2DeferredShading
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2ExampleUI b/targetfs/Examples/Advanced/OGLES2ExampleUI
new file mode 100755
index 0000000..7e62bee
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2ExampleUI
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2FilmTV b/targetfs/Examples/Advanced/OGLES2FilmTV
new file mode 100755
index 0000000..a6a8f86
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2FilmTV
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2Fractal b/targetfs/Examples/Advanced/OGLES2Fractal
new file mode 100755
index 0000000..86a02c8
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2Fractal
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2Glass b/targetfs/Examples/Advanced/OGLES2Glass
new file mode 100755
index 0000000..d56a966
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2Glass
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2MagicLantern b/targetfs/Examples/Advanced/OGLES2MagicLantern
new file mode 100755
index 0000000..f893a9f
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2MagicLantern
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2Navigation b/targetfs/Examples/Advanced/OGLES2Navigation
new file mode 100755
index 0000000..f54aaf3
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2Navigation
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2Navigation3D b/targetfs/Examples/Advanced/OGLES2Navigation3D
new file mode 100755
index 0000000..6bc997f
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2Navigation3D
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2ParticleSystem b/targetfs/Examples/Advanced/OGLES2ParticleSystem
new file mode 100755
index 0000000..a4b671c
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2ParticleSystem
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2PhantomMask b/targetfs/Examples/Advanced/OGLES2PhantomMask
new file mode 100755
index 0000000..8d238fe
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2PhantomMask
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2Shaders b/targetfs/Examples/Advanced/OGLES2Shaders
new file mode 100755
index 0000000..f1e060c
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2Shaders
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2Skybox2 b/targetfs/Examples/Advanced/OGLES2Skybox2
new file mode 100755
index 0000000..47cc27d
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2Skybox2
Binary files differ
diff --git a/targetfs/Examples/Advanced/OGLES2Water b/targetfs/Examples/Advanced/OGLES2Water
new file mode 100755
index 0000000..5e67408
--- /dev/null
+++ b/targetfs/Examples/Advanced/OGLES2Water
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2AlphaBlend b/targetfs/Examples/Intermediate/OGLES2AlphaBlend
new file mode 100755
index 0000000..80ad959
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2AlphaBlend
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2AlphaTest b/targetfs/Examples/Intermediate/OGLES2AlphaTest
new file mode 100755
index 0000000..854060f
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2AlphaTest
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2AnisotropicLighting b/targetfs/Examples/Intermediate/OGLES2AnisotropicLighting
new file mode 100755
index 0000000..e16ac74
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2AnisotropicLighting
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2Bloom b/targetfs/Examples/Intermediate/OGLES2Bloom
new file mode 100755
index 0000000..dd26996
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2Bloom
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2Bumpmap b/targetfs/Examples/Intermediate/OGLES2Bumpmap
new file mode 100755
index 0000000..1ecc3e8
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2Bumpmap
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2CellShading b/targetfs/Examples/Intermediate/OGLES2CellShading
new file mode 100755
index 0000000..76f203d
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2CellShading
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2ComplexLighting b/targetfs/Examples/Intermediate/OGLES2ComplexLighting
new file mode 100755
index 0000000..41eaba5
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2ComplexLighting
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2DisplacementMap b/targetfs/Examples/Intermediate/OGLES2DisplacementMap
new file mode 100755
index 0000000..961be70
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2DisplacementMap
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2EdgeDetection b/targetfs/Examples/Intermediate/OGLES2EdgeDetection
new file mode 100755
index 0000000..c9f7a2c
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2EdgeDetection
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2FastTnL b/targetfs/Examples/Intermediate/OGLES2FastTnL
new file mode 100755
index 0000000..48fc216
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2FastTnL
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2Fog b/targetfs/Examples/Intermediate/OGLES2Fog
new file mode 100755
index 0000000..1a055c3
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2Fog
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2FresnelReflections b/targetfs/Examples/Intermediate/OGLES2FresnelReflections
new file mode 100755
index 0000000..f2c6dd9
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2FresnelReflections
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2Iridescence b/targetfs/Examples/Intermediate/OGLES2Iridescence
new file mode 100755
index 0000000..a05bd4a
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2Iridescence
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2LevelOfDetail b/targetfs/Examples/Intermediate/OGLES2LevelOfDetail
new file mode 100755
index 0000000..c2850d3
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2LevelOfDetail
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2LightMap b/targetfs/Examples/Intermediate/OGLES2LightMap
new file mode 100755
index 0000000..5e5bb60
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2LightMap
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2MaximumIntensityProjection b/targetfs/Examples/Intermediate/OGLES2MaximumIntensityProjection
new file mode 100755
index 0000000..ac48530
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2MaximumIntensityProjection
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2MultiThreading b/targetfs/Examples/Intermediate/OGLES2MultiThreading
new file mode 100755
index 0000000..cdf0000
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2MultiThreading
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2MultipleRenderTargets b/targetfs/Examples/Intermediate/OGLES2MultipleRenderTargets
new file mode 100755
index 0000000..d90b292
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2MultipleRenderTargets
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2OcclusionQueries b/targetfs/Examples/Intermediate/OGLES2OcclusionQueries
new file mode 100755
index 0000000..aa9a308
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2OcclusionQueries
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2ParallaxBumpMap b/targetfs/Examples/Intermediate/OGLES2ParallaxBumpMap
new file mode 100755
index 0000000..4a65a1a
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2ParallaxBumpMap
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2Reflections b/targetfs/Examples/Intermediate/OGLES2Reflections
new file mode 100755
index 0000000..fb47c02
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2Reflections
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2Refraction b/targetfs/Examples/Intermediate/OGLES2Refraction
new file mode 100755
index 0000000..9c0135e
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2Refraction
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2RenderToTexture b/targetfs/Examples/Intermediate/OGLES2RenderToTexture
new file mode 100755
index 0000000..01d1870
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2RenderToTexture
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2ShadowMapping b/targetfs/Examples/Intermediate/OGLES2ShadowMapping
new file mode 100755
index 0000000..3b1d80b
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2ShadowMapping
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2ShadowVolume b/targetfs/Examples/Intermediate/OGLES2ShadowVolume
new file mode 100755
index 0000000..8dc8b72
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2ShadowVolume
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2Skinning b/targetfs/Examples/Intermediate/OGLES2Skinning
new file mode 100755
index 0000000..17aa3cc
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2Skinning
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2StencilBuffer b/targetfs/Examples/Intermediate/OGLES2StencilBuffer
new file mode 100755
index 0000000..dd5a077
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2StencilBuffer
Binary files differ
diff --git a/targetfs/Examples/Intermediate/OGLES2ToneMapping b/targetfs/Examples/Intermediate/OGLES2ToneMapping
new file mode 100755
index 0000000..25f9d3f
--- /dev/null
+++ b/targetfs/Examples/Intermediate/OGLES2ToneMapping
Binary files differ
diff --git a/targetfs/PVRHub/PVRPerfServer/PVRPerfServerDeveloper b/targetfs/PVRHub/PVRPerfServer/PVRPerfServerDeveloper
new file mode 100755
index 0000000..9468776
--- /dev/null
+++ b/targetfs/PVRHub/PVRPerfServer/PVRPerfServerDeveloper
Binary files differ
diff --git a/targetfs/PVRHub/PVRTrace/Recorder/_SKELETON_CONFIG.json b/targetfs/PVRHub/PVRTrace/Recorder/_SKELETON_CONFIG.json
new file mode 100755
index 0000000..710ed10
--- /dev/null
+++ b/targetfs/PVRHub/PVRTrace/Recorder/_SKELETON_CONFIG.json
@@ -0,0 +1,32 @@
1{
2 "Debug": {
3 "Level": 1
4 },
5 "Host": {
6 "EglLibraryPath": "__EGL_PATH__",
7 "Es1LibraryPath": "__ES1_PATH__",
8 "Es2LibraryPath": "__ES2_PATH__",
9 "Es3LibraryPath": "__ES3_PATH__"
10 },
11 "Tracing": {
12 "OutputFilename": "__OUTPUT_FILE__",
13 "RecordData": true,
14 "OptimiseFileSize": false,
15 "StartFrame": 0,
16 "EndFrame": 9999,
17 "ExitOnLastFrame": true,
18 "ClientBufferRecordFrequency": 1,
19 "SaveFrameBuffer": false
20 },
21 "Profiling": {
22 "SoftwareCounters": true,
23 "FunctionTimelineLevel": 1,
24 "Enabled": __PROFILING_ENABLED__,
25 "RenderstateOverride": true
26 },
27 "Network": {
28 "Wait": true,
29 "Enabled": false,
30 "BufferSize": 256
31 }
32}
diff --git a/targetfs/PVRHub/PVRTrace/Recorder/libEGL.so b/targetfs/PVRHub/PVRTrace/Recorder/libEGL.so
new file mode 100755
index 0000000..46d8bf3
--- /dev/null
+++ b/targetfs/PVRHub/PVRTrace/Recorder/libEGL.so
Binary files differ
diff --git a/targetfs/PVRHub/PVRTrace/Recorder/libGLES_CM.so b/targetfs/PVRHub/PVRTrace/Recorder/libGLES_CM.so
new file mode 100755
index 0000000..c128e11
--- /dev/null
+++ b/targetfs/PVRHub/PVRTrace/Recorder/libGLES_CM.so
Binary files differ
diff --git a/targetfs/PVRHub/PVRTrace/Recorder/libGLESv1_CM.so b/targetfs/PVRHub/PVRTrace/Recorder/libGLESv1_CM.so
new file mode 100755
index 0000000..cac4cb3
--- /dev/null
+++ b/targetfs/PVRHub/PVRTrace/Recorder/libGLESv1_CM.so
Binary files differ
diff --git a/targetfs/PVRHub/PVRTrace/Recorder/libGLESv2.so b/targetfs/PVRHub/PVRTrace/Recorder/libGLESv2.so
new file mode 100755
index 0000000..dffc4ea
--- /dev/null
+++ b/targetfs/PVRHub/PVRTrace/Recorder/libGLESv2.so
Binary files differ
diff --git a/targetfs/PVRHub/PVRTrace/Recorder/libPVRTrace.so b/targetfs/PVRHub/PVRTrace/Recorder/libPVRTrace.so
new file mode 100755
index 0000000..c69da0b
--- /dev/null
+++ b/targetfs/PVRHub/PVRTrace/Recorder/libPVRTrace.so
Binary files differ
diff --git a/targetfs/PVRHub/Scripts/create_default_cfg.sh b/targetfs/PVRHub/Scripts/create_default_cfg.sh
new file mode 100755
index 0000000..5e63c0a
--- /dev/null
+++ b/targetfs/PVRHub/Scripts/create_default_cfg.sh
@@ -0,0 +1,39 @@
1#!/bin/sh
2
3if [ !$TO_PROFILE ]; then
4 echo "TO_PROFILE has not been defined, assuming TO_PROFILE = 0"
5 export TO_PROFILE=0
6fi
7
8EGL_LIB_DIR=`ldconfig -p | grep libEGL | cut -f4 -d' ' | head -n 1`
9GLES1_LIB_DIR=`ldconfig -p | grep libGLES_CM | cut -f4 -d' ' | head -n 1`
10GLES2_LIB_DIR=`ldconfig -p | grep libGLESv2 | cut -f4 -d' ' | head -n 1`
11GLES3_LIB_DIR=`ldconfig -p | grep libGLESv3 | cut -f4 -d' ' | head -n 1`
12
13#Configure PVRTRace config file
14cp $PVRHUB_DIR/PVRTrace/Recorder/_SKELETON_CONFIG.json $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
15
16if [ ! $EGL_LIB_DIR ]; then
17 echo "
18 OpenGL ES libraries not found!
19 You will need to manually change the $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json file in order to point to the OpenGL ES drivers."
20else
21 echo "
22 OpenGL ES libraries found on the system!
23 Changing the base configuration file..."
24
25 sed -i "s,__EGL_PATH__,$EGL_LIB_DIR,g" $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
26 sed -i "s,__ES1_PATH__,$GLES1_LIB_DIR,g" $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
27 sed -i "s,__ES2_PATH__,$GLES2_LIB_DIR,g" $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
28 sed -i "s,__ES3_PATH__,$GLES3_LIB_DIR,g" $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
29 sed -i "s,__OUTPUT_FILE__,$PVRHUB_DIR/recordings/trace-%pid.pvrt,g" $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
30 sed -i "s,__PROFILING_ENABLED__,$TO_PROFILE,g" $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
31
32 echo " PVRTrace config file has been updated:"
33 sed -n "s,\"EglLibraryPath\":, EglLibraryPath set to ,p" < $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
34 sed -n "s,\"Es1LibraryPath\":, Es1LibraryPath set to ,p" < $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
35 sed -n "s,\"Es2LibraryPath\":, Es2LibraryPath set to ,p" < $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
36fi
37
38echo "
39 NOTE: To edit the pvrtraceconfig.json just use a text editor of your choice"
diff --git a/targetfs/PVRHub/Scripts/envsetup.sh b/targetfs/PVRHub/Scripts/envsetup.sh
new file mode 100755
index 0000000..0b17570
--- /dev/null
+++ b/targetfs/PVRHub/Scripts/envsetup.sh
@@ -0,0 +1,53 @@
1#!/bin/sh
2
3#PVRHub envsetup.sh
4#This script will setup the environment for Linux systems
5#NOTE: It must be sourced from the PVRHub root directory: . Scripts/envsetup.sh
6
7echo "Setting the shell to use PVRTrace..."
8
9#Check that this script has not ben run before
10if [ $PVRHUB_DIR ]; then
11 echo "ERROR: PVRHUB_DIR is already set. Have you sourced that script already?"
12# return
13fi
14
15#Set PVRHUB_DIR as the current directory
16export PVRHUB_DIR=`pwd`
17echo "
18 PVRHub directory set up as $PVRHUB_DIR"
19
20#Check if PVRHUB_DIR looks as it should
21#TODO: Make a more robust checking
22if [ ! -f $PVRHUB_DIR/PVRTrace/Recorder/_SKELETON_CONFIG.json ]; then
23 echo "ERROR: Cannot find PVRTrace/Recorder/_SKELETON_CONFIG.json. Are you sourcing this script from the PVRHub root?"
24 return
25fi
26
27#Create the recordings/ directory if it does not exist
28if [ ! -d $PVRHUB_DIR/recordings ]; then
29 mkdir $PVRHUB_DIR/recordings/
30fi
31
32#Create config
33$PVRHUB_DIR/Scripts/create_default_cfg.sh
34
35#Update the PATH
36export PATH=$PVRHUB_DIR/Scripts/:$PATH
37echo "
38 Path updated with the Scripts/ directory"
39
40#Save the LD_LIBRARY_PATH
41export OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
42echo "
43 NOTE: The old LD_LIBRARY_PATH has been saved to OLD_LD_LIBRARY_PATH"
44
45#Dump some useful information
46echo "
47 Instructions:
48 Run: \"source Scripts/start_tracing.sh\" to start a system wide trace.
49 Run: \"source Scripts/stop_tracing.sh\" to stop the system wide trace.
50 Run: \"pvr_trace Application\" to trace the desired application.
51 Run: \"pvr_profile Application\" to profile the desired application."
52echo "
53Environment setup OK"
diff --git a/targetfs/PVRHub/Scripts/pvr_profile b/targetfs/PVRHub/Scripts/pvr_profile
new file mode 100755
index 0000000..28ae937
--- /dev/null
+++ b/targetfs/PVRHub/Scripts/pvr_profile
@@ -0,0 +1,27 @@
1#!/bin/sh
2
3echo "Profiling $*..."
4
5#Enable profiling in the PVRTrace config file
6export TO_PROFILE=1
7$PVRHUB_DIR/Scripts/create_default_cfg.sh
8unset TO_PROFILE
9
10#Sets 1 (or more) if PVRPerfServer is running already on the system
11IS_PVRPERFSERVER_RUNNING=`ps -ea | grep PVRPerfServer`
12
13if [ ! $IS_PVRPERFSERVER_RUNNING ]; then
14 #Kill PVRPerfServerDeveloper at the end of the script
15 trap "killall -9 PVRPerfServerDeveloper" EXIT
16 #Start PVRPerfServer
17 echo " Starting PVRPerfServer"
18 $PVRHUB_DIR/PVRPerfServer/PVRPerfServerDeveloper --disable-user-input > /dev/null &
19else
20 echo " PVRPerfServer already running on the system, it will not be started or killed"
21fi
22
23#Start to profile the application
24echo " Starting to profile the application..."
25LD_LIBRARY_PATH=$PVRHUB_DIR/PVRTrace/Recorder/:$LD_LIBRARY_PATH $*
26
27echo " Profiling ended"
diff --git a/targetfs/PVRHub/Scripts/pvr_trace b/targetfs/PVRHub/Scripts/pvr_trace
new file mode 100755
index 0000000..65c80e8
--- /dev/null
+++ b/targetfs/PVRHub/Scripts/pvr_trace
@@ -0,0 +1,15 @@
1#!/bin/sh
2
3echo "Launching $*..."
4
5#Disable profiling in the PVRTrace config file
6export TO_PROFILE=0
7$PVRHUB_DIR/Scripts/create_default_cfg.sh
8unset TO_PROFILE
9
10#Start tracing the application
11echo "
12 Starting to trace the application..."
13LD_LIBRARY_PATH=$PVRHUB_DIR/PVRTrace/Recorder/:$LD_LIBRARY_PATH $*
14echo "
15 Tracing ended"
diff --git a/targetfs/PVRHub/Scripts/start_tracing.sh b/targetfs/PVRHub/Scripts/start_tracing.sh
new file mode 100755
index 0000000..9ec4e99
--- /dev/null
+++ b/targetfs/PVRHub/Scripts/start_tracing.sh
@@ -0,0 +1,24 @@
1#!/bin/sh
2
3echo "Enabling system wide tracing..."
4
5#Check for the environment
6if [ ! $PVRHUB_DIR ]; then
7 echo "PVRHUB_DIR is NOT set. Have you sourced the envsetup.sh script?"
8 return
9fi
10
11#Set the trace envrionment
12export LD_LIBRARY_PATH=$PVRHUB_DIR/PVRTrace/Recorder/:$LD_LIBRARY_PATH
13
14#Print out the trace configuration
15echo "
16 PVRTrace configuration:"
17sed -n "s,\"EglLibraryPath\":, EglLibraryPath set to ,p" < $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
18sed -n "s,\"Es1LibraryPath\":, Es1LibraryPath set to ,p" < $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
19sed -n "s,\"Es2LibraryPath\":, Es2LibraryPath set to ,p" < $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
20sed -n "s,\"Es3LibraryPath\":, Es3LibraryPath set to ,p" < $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
21sed -n "s,\"OutputFilename\":, OutputFilename set to ,p" < $PVRHUB_DIR/PVRTrace/Recorder/pvrtraceconfig.json
22
23echo "
24 NOTE: pvrtrace.cfg can be edited with any text editor."
diff --git a/targetfs/PVRHub/Scripts/stop_tracing.sh b/targetfs/PVRHub/Scripts/stop_tracing.sh
new file mode 100755
index 0000000..cf2722d
--- /dev/null
+++ b/targetfs/PVRHub/Scripts/stop_tracing.sh
@@ -0,0 +1,12 @@
1#!/bin/sh
2
3echo "Disabling system wide tracing..."
4
5#Check for the environment
6if [ ! $PVRHUB_DIR ]; then
7 echo "PVRHUB_DIR is NOT set. Have you sourced the envsetup.sh script?"
8 return
9fi
10
11#Restore the LD_LIBRARY_PATH
12export LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH
diff --git a/targetfs/PVRScopeDeveloper/PVRScopeComms.h b/targetfs/PVRScopeDeveloper/PVRScopeComms.h
new file mode 100755
index 0000000..2b560f7
--- /dev/null
+++ b/targetfs/PVRScopeDeveloper/PVRScopeComms.h
@@ -0,0 +1,237 @@
1/*!***********************************************************************
2
3 @file PVRScopeComms.h
4 @copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved.
5 @brief PVRScopeComms header file. @copybrief ScopeComms
6
7**************************************************************************/
8
9#ifndef _PVRSCOPE_H_
10#define _PVRSCOPE_H_
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/*
17 SGSPerfServer and PVRTune communications
18*/
19
20/*!
21 @addtogroup ScopeComms PVRScopeComms
22 @brief The PVRScopeComms functionality of PVRScope allows an application to send user defined information to
23 PVRTune via PVRPerfServer, both as counters and marks, or as editable data that can be
24 passed back to the application.
25 @details PVRScopeComms has the following limitations:
26 \li PVRPerfServer must be running on the host device if a @ref ScopeComms enabled
27 application wishes to send custom counters or marks to PVRTune. If the application in
28 question also wishes to communicate with PVRScopeServices without experiencing any
29 undesired behaviour PVRPerfServer should be run with the '--disable-hwperf' flag.
30 \li The following types may be sent: Boolean, Enumerator, Float, Integer, String.
31 @{
32*/
33
34/****************************************************************************
35** Enums
36****************************************************************************/
37
38/*!**************************************************************************
39 @enum ESPSCommsLibType
40 @brief Each editable library item has a data type associated with it
41****************************************************************************/
42///
43enum ESPSCommsLibType
44{
45 eSPSCommsLibTypeString, ///< data is string (NOT NULL-terminated, use length parameter)
46 eSPSCommsLibTypeFloat, ///< data is SSPSCommsLibraryTypeFloat
47 eSPSCommsLibTypeInt, ///< data is SSPSCommsLibraryTypeInt
48 eSPSCommsLibTypeEnum, ///< data is string (NOT NULL-terminated, use length parameter). First line is selection number, subsequent lines are available options.
49 eSPSCommsLibTypeBool ///< data is SSPSCommsLibraryTypeBool
50};
51
52/****************************************************************************
53** Structures
54****************************************************************************/
55
56// Internal implementation data
57struct SSPSCommsData;
58
59/*!**************************************************************************
60 @struct SSPSCommsLibraryItem
61 @brief Definition of one editable library item
62****************************************************************************/
63struct SSPSCommsLibraryItem
64{
65
66 const char *pszName; ///< Item name. If dots are used, PVRTune could show these as a foldable tree view.
67 unsigned int nNameLength; ///< Item name length
68
69 ESPSCommsLibType eType; ///< Item type
70
71 const char *pData; ///< Item data
72 unsigned int nDataLength; ///< Item data length
73};
74
75/*!**************************************************************************
76 @struct SSPSCommsLibraryTypeFloat
77 @brief Current, minimum and maximum values for an editable library item of type float
78****************************************************************************/
79struct SSPSCommsLibraryTypeFloat
80{
81 float fCurrent; ///< Current value
82 float fMin; ///< Minimal value
83 float fMax; ///< Maximum value
84};
85
86/*!**************************************************************************
87 @struct SSPSCommsLibraryTypeInt
88 @brief Current, minimum and maximum values for an editable library item of type int
89****************************************************************************/
90struct SSPSCommsLibraryTypeInt
91{
92 int nCurrent; ///< Current value
93 int nMin; ///< Minimal value
94 int nMax; ///< Maximum value
95};
96
97/*!**************************************************************************
98 @struct SSPSCommsLibraryTypeBool
99 @brief Current value for an editable library item of type bool
100****************************************************************************/
101struct SSPSCommsLibraryTypeBool
102{
103 bool bValue; ///< Boolean value
104};
105
106/*!**************************************************************************
107 @struct SSPSCommsCounterDef
108 @brief Definition of one custom counter
109****************************************************************************/
110struct SSPSCommsCounterDef
111{
112 const char *pszName; ///< Custom counter name
113 unsigned int nNameLength; ///< Custom counter name length
114};
115
116/****************************************************************************
117** Declarations
118****************************************************************************/
119
120
121/*!**************************************************************************
122 @brief Initialise @ref ScopeComms
123 @return @ref ScopeComms data.
124****************************************************************************/
125SSPSCommsData *pplInitialise(
126 const char * const pszName, ///< String to describe the application
127 const unsigned int nNameLen ///< String length
128);
129
130/*!**************************************************************************
131 @brief Shutdown or de-initialise the remote control section of PVRScope.
132****************************************************************************/
133void pplShutdown(
134 SSPSCommsData *psData ///< Context data
135);
136
137/*!**************************************************************************
138 @brief Query for the time. Units are microseconds, resolution is undefined.
139****************************************************************************/
140unsigned int pplGetTimeUS(
141 SSPSCommsData &sData ///< Context data
142);
143
144/*!**************************************************************************
145 @brief Send a time-stamped string marker to be displayed in PVRTune.
146 @details Examples might be:
147 \li switching to outdoor renderer
148 \li starting benchmark test N
149****************************************************************************/
150bool pplSendMark(
151 SSPSCommsData &sData, ///< Context data
152 const char * const pszString, ///< Time-stamped string
153 const unsigned int nLen ///< String length
154);
155
156/*!**************************************************************************
157 @brief Send a time-stamped begin marker to PVRTune.
158 @details Every begin must be followed by an end; they cannot be interleaved or
159 nested. PVRTune will show these as an activity timeline.
160****************************************************************************/
161bool pplSendProcessingBegin(
162 SSPSCommsData &sData, ///< Context data
163 const char * const pszString, ///< Name of the processing block
164 const unsigned int nLen, ///< String length
165 const unsigned int nFrame=0 ///< Iteration (or frame) number, by which processes can be grouped.
166);
167
168/*!**************************************************************************
169 @brief Send a time-stamped end marker to PVRTune.
170 @details Every end must be preceeded by a begin; they cannot be interleaved or
171 nested. PVRTune will show these as an activity timeline.
172****************************************************************************/
173bool pplSendProcessingEnd(
174 SSPSCommsData &sData ///< Context data
175);
176
177/*!**************************************************************************
178 @brief Create a library of remotely editable items
179****************************************************************************/
180bool pplLibraryCreate(
181 SSPSCommsData &sData, ///< Context data
182 const SSPSCommsLibraryItem * const pItems, ///< Editable items
183 const unsigned int nItemCount ///< Number of items
184);
185
186/*!**************************************************************************
187 @brief Query to see whether a library item has been edited, and also retrieve the new data.
188****************************************************************************/
189bool pplLibraryDirtyGetFirst(
190 SSPSCommsData &sData, ///< Context data
191 unsigned int &nItem, ///< Item number
192 unsigned int &nNewDataLen, ///< New data length
193 const char **ppData ///< New data
194);
195
196/*!**************************************************************************
197 @brief Specify the number of custom counters and their definitions
198****************************************************************************/
199bool pplCountersCreate(
200 SSPSCommsData &sData, ///< Context data
201 const SSPSCommsCounterDef * const psCounterDefs, ///< Counter definitions
202 const unsigned int nCount ///< Number of counters
203);
204
205/*!**************************************************************************
206 @brief Send an update for all the custom counters. The psCounterReadings array must be
207 nCount long.
208****************************************************************************/
209bool pplCountersUpdate(
210 SSPSCommsData &sData, ///< Context data
211 const unsigned int * const psCounterReadings ///< Counter readings array
212);
213
214/*!**************************************************************************
215 @brief Force a cache flush.
216 @details Some implementations store data sends in the cache. If the data rate is low, the real
217 send of data can be significantly delayed.
218 If it is necessary to flush the cache, the best results are likely to be
219 achieved by calling this function with a frequency between once per second up to once per
220 frame. If data is sent extremely infrequently, this function could be
221 called once at the end of each bout of data send.
222****************************************************************************/
223bool pplSendFlush(
224 SSPSCommsData &sData ///< Context data
225);
226
227/*! @} */
228
229#ifdef __cplusplus
230}
231#endif
232
233#endif /* _PVRSCOPE_H_ */
234
235/*****************************************************************************
236 End of file (PVRScopeComms.h)
237*****************************************************************************/
diff --git a/targetfs/PVRScopeDeveloper/PVRScopeStats.h b/targetfs/PVRScopeDeveloper/PVRScopeStats.h
new file mode 100755
index 0000000..7d2f6c8
--- /dev/null
+++ b/targetfs/PVRScopeDeveloper/PVRScopeStats.h
@@ -0,0 +1,199 @@
1/*!***********************************************************************
2
3 @file PVRScopeStats.h
4 @copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved.
5 @brief PVRScopeStats header file. @copybrief ScopeStats
6
7**************************************************************************/
8
9/*! @mainpage PVRScope
10
11 @section overview Library Overview
12*****************************
13PVRScope is a utility library which has two functionalities:
14 \li @ref ScopeStats is used to access the hardware performance counters in
15 PowerVR hardware via a driver library called PVRScopeServices.
16 \li @ref ScopeComms allows an application to send user defined information to
17 PVRTune via PVRPerfServer, both as counters and marks, or as editable data that can be
18 passed back to the application.
19
20PVRScope is supplied in the PVRScope.h header file. Your application also needs to link to the PVRScope
21library file, either a <tt>.lib</tt>, <tt>.so</tt>, or <tt>.dy</tt> file, depending on your platform.
22
23For more information on PVRScope, see the <em>PVRScope User Manual</em>.
24
25 @subsection limitStats PVRScopeStats Limitations
26*****************************
27@copydetails ScopeStats
28
29 @subsection limitComms PVRScopeComms Limitations
30*****************************
31@copydetails ScopeComms
32*/
33
34#ifndef _PVRSCOPE_H_
35#define _PVRSCOPE_H_
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41/*!
42 @addtogroup ScopeStats PVRScopeStats
43 @brief The PVRScopeStats functionality of PVRScope is used to access the hardware performance counters in
44 PowerVR hardware via a driver library called PVRScopeServices.
45 @details PVRScopeStats has the following limitations:
46 \li Only one instance of @ref ScopeStats may communicate with PVRScopeServices at any
47 given time. If a PVRScope enabled application attempts to communicate with
48 PVRScopeServices at the same time as another such application, or at the same time as
49 PVRPerfServer, conflicts can occur that may make performance data unreliable.
50 \li Performance counters can only be read on devices whose drivers have been built with
51 hardware profiling enabled. This configuration is the default in most production drivers due to negligible overhead.
52 \li Performance counters contain the average value of that counter since the last time the counter was interrogated.
53 @{
54*/
55
56
57/****************************************************************************
58** Enums
59****************************************************************************/
60/*!**************************************************************************
61 @enum EPVRScopeInitCode
62 @brief PVRScope initialisation return codes.
63****************************************************************************/
64enum EPVRScopeInitCode
65{
66 ePVRScopeInitCodeOk, ///< Initialisation OK
67 ePVRScopeInitCodeOutOfMem, ///< Out of memory
68 ePVRScopeInitCodeDriverSupportNotFound, ///< Driver support not found
69 ePVRScopeInitCodeDriverSupportInsufficient, ///< Driver support insufficient
70 ePVRScopeInitCodeDriverSupportInitFailed, ///< Driver support initialisation failed
71 ePVRScopeInitCodeDriverSupportQueryInfoFailed ///< Driver support information query failed
72};
73
74/****************************************************************************
75** Structures
76****************************************************************************/
77
78// Internal implementation data
79struct SPVRScopeImplData;
80
81/*!**************************************************************************
82 @struct SPVRScopeCounterDef
83 @brief Definition of a counter that PVRScope calculates.
84****************************************************************************/
85struct SPVRScopeCounterDef
86{
87 const char *pszName; ///< Counter name, null terminated
88 bool bPercentage; ///< true if the counter is a percentage
89 unsigned int nGroup; ///< The counter group that the counter is in.
90};
91
92/*!**************************************************************************
93 @struct SPVRScopeCounterReading
94 @brief A set of return values resulting from querying the counter values.
95****************************************************************************/
96struct SPVRScopeCounterReading
97{
98 float *pfValueBuf; ///< Array of returned values
99 unsigned int nValueCnt; ///< Number of values set in the above array
100 unsigned int nReadingActiveGroup; ///< Group that was active when counters were sampled
101};
102
103/*!**************************************************************************
104 @struct SPVRScopeGetInfo
105 @brief A set of return values holding miscellaneous PVRScope information.
106****************************************************************************/
107struct SPVRScopeGetInfo
108{
109 unsigned int nGroupMax; ///< Highest group number of any counter
110};
111
112/****************************************************************************
113** Declarations
114****************************************************************************/
115
116const char *PVRScopeGetDescription(); ///< Query the PVRScope library description
117
118
119/*!**************************************************************************
120 @brief Initialise @ref ScopeStats, to access the HW performance counters in PowerVR.
121 @return EPVRScopeInitCodeOk on success.
122****************************************************************************/
123EPVRScopeInitCode PVRScopeInitialise(
124 SPVRScopeImplData **ppsData ///< Context data
125);
126
127/*!**************************************************************************
128 @brief Shutdown or de-initalise @ref ScopeStats and free the allocated memory.
129***************************************************************************/
130void PVRScopeDeInitialise(
131 SPVRScopeImplData **ppsData, ///< Context data
132 SPVRScopeCounterDef **ppsCounters, ///< Array of counters
133 SPVRScopeCounterReading * const psReading ///< Results memory area
134);
135
136/*!**************************************************************************
137 @brief Query for @ref ScopeStats information. This function should only be called during initialisation.
138****************************************************************************/
139void PVRScopeGetInfo(
140 SPVRScopeImplData * const psData, ///< Context data
141 SPVRScopeGetInfo * const psInfo ///< Returned information
142);
143
144/*!**************************************************************************
145 @brief Query for the list of @ref ScopeStats HW performance counters, and
146 allocate memory in which the counter values will be received. This function
147 should only be called during initialisation.
148****************************************************************************/
149bool PVRScopeGetCounters(
150 SPVRScopeImplData * const psData, ///< Context data
151 unsigned int * const pnCount, ///< Returned number of counters
152 SPVRScopeCounterDef **ppsCounters, ///< Returned counter array
153 SPVRScopeCounterReading * const psReading ///< Pass a pointer to the structure to be initialised
154);
155
156/*!**************************************************************************
157 @brief Call regularly to allow PVRScope to track the latest hardware
158 performance data. If psReading is not NULL, PVRScope will also
159 calculate and return counter values to the application.
160 @details This function should be called "regularly"; two use cases are
161 considered:
162 1) A 3D application rendering a performance HUD (e.g. the on-
163 screen graphs in PVRScopeExample). Such an application should
164 call this function at least once per frame in order to gather
165 new counter values. If slower HUD updates are desired,
166 psReading may be NULL until a new reading is required, in
167 order to smooth out values across longer time periods, perhaps
168 a number of frames.
169 2) A standalone performance monitor (e.g. PVRMonitor) or
170 logging application. Such an application should idle and
171 regularly wake up to call this function; suggested rates are
172 100Hz (10ms delays) or 200Hz (5ms delays). If counter updates
173 are required at a lower rate, set psReading to NULL on all
174 calls except when new counter values are desired.
175
176 Changing the Active HW Group: the API is designed to allow the
177 HW group to be changed immediately after gathering a reading.
178 Typically the group ID should be 0xffffffff in order to leave
179 the active group unchanged; if it is desired to change it then
180 pass the new group ID.
181****************************************************************************/
182bool PVRScopeReadCountersThenSetGroup(
183 SPVRScopeImplData * const psData, ///< Context data
184 SPVRScopeCounterReading * const psReading, ///< Returned data will be filled into the pointed-to structure
185 const unsigned int nTimeUS, ///< Current time, in microseconds. Ignored if psReading is NULL.
186 const unsigned int nGroup ///< New group; 0xffffffff to leave it unchanged
187);
188
189/*! @} */
190
191#ifdef __cplusplus
192}
193#endif
194
195#endif /* _PVRSCOPE_H_ */
196
197/*****************************************************************************
198 End of file (PVRScopeStats.h)
199*****************************************************************************/
diff --git a/targetfs/PVRScopeDeveloper/libPVRScopeDeveloper.a b/targetfs/PVRScopeDeveloper/libPVRScopeDeveloper.a
new file mode 100755
index 0000000..9546e58
--- /dev/null
+++ b/targetfs/PVRScopeDeveloper/libPVRScopeDeveloper.a
Binary files differ