IMG code drop 840215 plus local changes (new kernel part)
authorDale Stimson <dale.b.stimson@intel.com>
Thu, 15 Mar 2012 23:39:17 +0000 (16:39 -0700)
committerbuildbot <buildbot@intel.com>
Sat, 28 Apr 2012 12:32:57 +0000 (05:32 -0700)
BZ: 27656

Change-Id: I65467fcfd54e2ff51b58022cc1dbf3d6fb4c6994
Signed-off-by: Dale Stimson <dale.b.stimson@intel.com>
Signed-off-by: Tong, Bo <box.tong@intel.com>
Reviewed-on: http://android.intel.com:8080/46344
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
161 files changed:
drivers/staging/mrst/pvr/COPYING [changed mode: 0755->0644]
drivers/staging/mrst/pvr/INSTALL [changed mode: 0755->0644]
drivers/staging/mrst/pvr/README [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/dbgdrvif.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/img_defs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/img_types.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/pdumpdefs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/pvr_debug.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/pvrmodule.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/pvrversion.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/services.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/servicesext.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/sgx_options.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/sgxapi_km.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/include4/sgxscript.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/bufferclass_example/bufferclass_example.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/bufferclass_example/bufferclass_example.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/bufferclass_example/bufferclass_example_linux.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/bufferclass_example/bufferclass_example_linux.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/bufferclass_example/bufferclass_example_private.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/bufferclass_example/bufferclass_example_private.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/linux_framebuffer_drm/Linux.mk [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/linux_framebuffer_drm/Medfield.mk [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/linux_framebuffer_drm/drmlfb.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/linux_framebuffer_drm/drmlfb_displayclass.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/linux_framebuffer_drm/drmlfb_linux.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/3rdparty/linux_framebuffer_drm/makefile.linux.common [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/env/linux/pvr_drm_shared.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/kernelbuffer.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/kerneldisplay.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/pdump.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/pvr_bridge.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/pvr_bridge_km.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/pvrmmap.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/pvrsrv_errors.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/servicesint.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/sgx_bridge.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/sgx_mkif_km.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/include/sgxinfo.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/bridged/bridged_pvr_bridge.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/bridged/bridged_pvr_bridge.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/bridged/bridged_support.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/bridged/bridged_support.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/bridged/sgx/bridged_sgx_bridge.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/bridged/sgx/bridged_sgx_bridge.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/buffer_manager.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/deviceclass.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/deviceid.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/devicemem.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/handle.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/hash.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/lists.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/mem.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/mem_debug.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/metrics.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/osfunc_common.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/pdump_common.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/perproc.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/power.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/pvrsrv.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/queue.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/ra.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/refcount.c
drivers/staging/mrst/pvr/services4/srvkm/common/resman.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/common/ttrace.c [new file with mode: 0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/mmu.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/mmu.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/pb.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgx_bridge_km.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxconfig.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinfokm.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxkick.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxpower.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxreset.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxtransfer.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxutils.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxutils.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/Kbuild.mk [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/env_data.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/env_perproc.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/event.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/event.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/ion.c
drivers/staging/mrst/pvr/services4/srvkm/env/linux/ion.h
drivers/staging/mrst/pvr/services4/srvkm/env/linux/linkage.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/lock.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/mm.c
drivers/staging/mrst/pvr/services4/srvkm/env/linux/mm.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/mmap.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/mmap.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/module.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/mutex.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/mutex.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/mutils.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/mutils.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/osfunc.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/osperproc.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/pdump.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/private_data.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/proc.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/proc.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/pvr_bridge_k.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/pvr_debug.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/pvr_drm.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/env/linux/pvr_drm.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/ocpdefs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgx530defs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgx540defs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgx543_v1.164defs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgx544defs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgx545defs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgxdefs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgxerrata.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgxfeaturedefs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgxmmu.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/hwdefs/sgxmpdefs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/buffer_manager.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/device.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/handle.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/hash.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/lists.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/metrics.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/osfunc.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/osperproc.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/pdump_int.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/pdump_km.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/pdump_osfunc.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/perfkm.h
drivers/staging/mrst/pvr/services4/srvkm/include/perproc.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/power.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/queue.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/ra.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/refcount.h
drivers/staging/mrst/pvr/services4/srvkm/include/resman.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/services_headers.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/srvkm.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/ttrace.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/ttrace_common.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/srvkm/include/ttrace_tokens.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/include/syscommon.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/intel_drm/oemfuncs.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/intel_drm/sys_pvr_drm_export.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/intel_drm/sys_pvr_drm_export.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/intel_drm/sys_pvr_drm_import.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/intel_drm/sysconfig.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/intel_drm/sysconfig.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/intel_drm/sysinfo.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/intel_drm/syslocal.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/services4/system/intel_drm/sysutils.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/client/linuxsrv.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/common/dbgdriv.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/common/dbgdriv.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/common/dbgdriv_ioctl.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/common/handle.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/common/hostfunc.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/common/hotkey.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/common/hotkey.h [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/common/ioctl.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/linux/hostfunc.c [changed mode: 0755->0644]
drivers/staging/mrst/pvr/tools/intern/debug/dbgdriv/linux/main.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index edba256..5c2a2eb
@@ -4,43 +4,43 @@ Copyright (C) Imagination Technologies Ltd. All rights reserved.
 ======================================================================
 
 This file covers how to build and install the Imagination Technologies
-SGX DDK for the Linux kernel. 
+SGX DDK for the Linux kernel.
 
 
 Build System Environment Variables
 -------------------------------------------
 
-The SGX DDK Build scripts depend on a number of environment variables 
-being setup before compilation or installation of DDK software can 
+The SGX DDK Build scripts depend on a number of environment variables
+being setup before compilation or installation of DDK software can
 commence:
 
 $DISCIMAGE
-The DDK Build scripts install files to the location specified by the 
-DISCIMAGE environment variable, when the make install target is used. 
+The DDK Build scripts install files to the location specified by the
+DISCIMAGE environment variable, when the make install target is used.
 This should point to the target filesystem.
 $ export DISCIMAGE=/path/to/filesystem
 
 $KERNELDIR
-When building the SGX DDK kernel module, the build needs access 
-to the headers of the Linux kernel 
+When building the SGX DDK kernel module, the build needs access
+to the headers of the Linux kernel
 $ export KERNELDIR=/path/to/kernel
 
 $PATH
-If a cross compiler is being used make sure the PATH environment variable 
+If a cross compiler is being used make sure the PATH environment variable
 includes the path to the toolchain
 $ export PATH=$PATH:/path/to/toolchain
 
 $CROSS_COMPILE
-Since the SGX DDK Build scripts are geared toward a cross-compilation 
-workflow, the CROSS_COMPILE environment variable needs to be set 
+Since the SGX DDK Build scripts are geared toward a cross-compilation
+workflow, the CROSS_COMPILE environment variable needs to be set
 $ export CROSS_COMPILE=toolchain-prefix-
 
 
 Build and Install Instructions
 -------------------------------------------
 
-The SGX DDK configures different target builds within directories under 
-eurasiacon/build/linux/. 
+The SGX DDK configures different target builds within directories under
+eurasiacon/build/linux/.
 
 The supported build targets are:
 
@@ -49,12 +49,12 @@ The supported build targets are:
        clobber Removes all binaries for all builds as well.
        install Runs the install script generated by the build.
 
-The following variables may be set on the command line to influence a build. 
+The following variables may be set on the command line to influence a build.
 
-       BUILD   The type of build being performed. 
-                       Alternatives are release, timing or debug. 
-       CFLAGS  Build dependent optimisations and debug information flags.  
-       SILENT  Determines whether text of commands is produced during build.  
+       BUILD   The type of build being performed.
+                       Alternatives are release, timing or debug.
+       CFLAGS  Build dependent optimisations and debug information flags.
+       SILENT  Determines whether text of commands is produced during build.
 
 To build for, change to the appropriate target directory, e.g.:
 $ cd eurasiacon/build/linux/platform/kbuild
old mode 100755 (executable)
new mode 100644 (file)
index 8d31e51..f10a9de
@@ -4,10 +4,10 @@ Copyright (C) Imagination Technologies Ltd. All rights reserved.
 ======================================================================
 
 
-About 
+About
 -------------------------------------------
 
-This is the Imagination Technologies SGX DDK for the Linux kernel. 
+This is the Imagination Technologies SGX DDK for the Linux kernel.
 
 
 License
@@ -16,7 +16,7 @@ License
 You may use, distribute and copy this software under the terms of
 GNU General Public License version 2.
 
-The full GNU General Public License version 2 is included in this 
+The full GNU General Public License version 2 is included in this
 distribution in the file called "COPYING".
 
 
@@ -45,4 +45,4 @@ Contact information:
 -------------------------------------------
 
 Imagination Technologies Ltd. <gpl-support@imgtec.com>
-Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
old mode 100755 (executable)
new mode 100644 (file)
index 09c1608..ab32ca8
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
 
 *****************************************************************************/
@@ -34,7 +34,7 @@
 #define METHOD_BUFFERED                 0
 #define FILE_ANY_ACCESS                 0
 
-#define CTL_CODE( DeviceType, Function, Method, Access ) (Function) 
+#define CTL_CODE( DeviceType, Function, Method, Access ) (Function)
 #define MAKEIOCTLINDEX(i)      ((i) & 0xFFF)
 
 #else
old mode 100755 (executable)
new mode 100644 (file)
index d5408cf..7473abe
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
 *******************************************************************************/
 #if !defined (__IMG_DEFS_H__)
old mode 100755 (executable)
new mode 100644 (file)
index 807b6f9..3b7b7db
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
 ******************************************************************************/
 
@@ -103,7 +103,7 @@ typedef IMG_PVOID       IMG_HANDLE;
 
 typedef void**          IMG_HVOID,     * IMG_PHVOID;
 
-#define IMG_NULL        0 
+#define IMG_NULL        0
 
 /* services/stream ID */
 typedef IMG_UINT32      IMG_SID;
@@ -167,7 +167,7 @@ typedef struct _IMG_DEV_VIRTADDR
        /* device virtual addresses are 32bit for now */
        IMG_UINT32  uiAddr;
 #define IMG_CAST_TO_DEVVADDR_UINT(var)         (IMG_UINT32)(var)
-       
+
 } IMG_DEV_VIRTADDR;
 
 typedef IMG_UINT32 IMG_DEVMEM_SIZE_T;
old mode 100755 (executable)
new mode 100644 (file)
index e43ce2f..e8e23d8
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
 *****************************************************************************/
 
@@ -77,7 +77,7 @@ typedef enum _PDUMP_PIXEL_FORMAT_
        PVRSRV_PDUMP_PIXEL_FORMAT_BGRA5551 = 45,
        PVRSRV_PDUMP_PIXEL_FORMAT_BGR565 = 46,
        PVRSRV_PDUMP_PIXEL_FORMAT_A8 = 47,
-       
+
        PVRSRV_PDUMP_PIXEL_FORMAT_FORCE_I32 = 0x7fffffff
 
 } PDUMP_PIXEL_FORMAT;
@@ -89,7 +89,7 @@ typedef enum _PDUMP_MEM_FORMAT_
        PVRSRV_PDUMP_MEM_FORMAT_TILED = 8,
        PVRSRV_PDUMP_MEM_FORMAT_TWIDDLED = 9,
        PVRSRV_PDUMP_MEM_FORMAT_HYBRID = 10,
-       
+
        PVRSRV_PDUMP_MEM_FORMAT_FORCE_I32 = 0x7fffffff
 } PDUMP_MEM_FORMAT;
 
old mode 100755 (executable)
new mode 100644 (file)
index e66fdab..31edcc1
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
 ******************************************************************************/
 
old mode 100755 (executable)
new mode 100644 (file)
index 3dd5845..8060498
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -28,4 +28,4 @@
 #define        _PVRMODULE_H_
 MODULE_AUTHOR("Imagination Technologies Ltd. <gpl-support@imgtec.com>");
 MODULE_LICENSE("GPL");
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 5982d0e..fa84a9b
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
 */ /**************************************************************************/
 
@@ -36,7 +36,7 @@
 
 #define PVRVERSION_FAMILY           "sgxddk"
 #define PVRVERSION_BRANCHNAME       "1.8"
-#define PVRVERSION_BUILD             793010
+#define PVRVERSION_BUILD             840215
 #define PVRVERSION_BSCONTROL        "intel_android_sgx_ogles1_ogles2_GPL"
 
 #define PVRVERSION_STRING           "intel_android_sgx_ogles1_ogles2_GPL sgxddk 18 1.8@" PVR_STR2(PVRVERSION_BUILD)
@@ -44,8 +44,8 @@
 
 #define COPYRIGHT_TXT               "Copyright (c) Imagination Technologies Ltd. All Rights Reserved."
 
-#define PVRVERSION_BUILD_HI          79
-#define PVRVERSION_BUILD_LO          3010
+#define PVRVERSION_BUILD_HI          84
+#define PVRVERSION_BUILD_LO          215
 #define PVRVERSION_STRING_NUMERIC    PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO)
 
 #endif /* _PVRVERSION_H_ */
old mode 100755 (executable)
new mode 100644 (file)
index 4e6d05f..d7a1b37
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -40,7 +40,7 @@ extern "C" {
 
 #define PVRSRV_MAX_CMD_SIZE            1024
 
-#define PVRSRV_MAX_DEVICES             16      
+#define PVRSRV_MAX_DEVICES             16
 
 #define EVENTOBJNAME_MAXLENGTH (50)
 
@@ -85,12 +85,12 @@ extern "C" {
 #define PVRSRV_MEM_ION                                         (1U<<29)
 #define PVRSRV_MEM_ALLOCATENONCACHEDMEM                (1UL<<30)
 
-#define PVRSRV_NO_CONTEXT_LOSS                                 0               
-#define PVRSRV_SEVERE_LOSS_OF_CONTEXT                  1               
-#define PVRSRV_PRE_STATE_CHANGE_MASK                   0x80    
+#define PVRSRV_NO_CONTEXT_LOSS                                 0
+#define PVRSRV_SEVERE_LOSS_OF_CONTEXT                  1
+#define PVRSRV_PRE_STATE_CHANGE_MASK                   0x80
 
 
-#define PVRSRV_DEFAULT_DEV_COOKIE                      (1)      
+#define PVRSRV_DEFAULT_DEV_COOKIE                      (1)
 
 
 #define PVRSRV_MISC_INFO_TIMER_PRESENT                         (1U<<0)
@@ -138,7 +138,7 @@ typedef enum _PVRSRV_DEVICE_TYPE_
        PVRSRV_DEVICE_TYPE_VGX                          = 8,
        PVRSRV_DEVICE_TYPE_TOPAZ                        = 9,
 
-       
+
        PVRSRV_DEVICE_TYPE_EXT                          = 10,
 
        PVRSRV_DEVICE_TYPE_LAST                         = 10,
@@ -194,64 +194,64 @@ typedef struct _PVRSRV_DEV_DATA_ *PPVRSRV_DEV_DATA;
 
 typedef struct _PVRSRV_DEVICE_IDENTIFIER_
 {
-       PVRSRV_DEVICE_TYPE              eDeviceType;            
-       PVRSRV_DEVICE_CLASS             eDeviceClass;           
-       IMG_UINT32                              ui32DeviceIndex;        
-       IMG_CHAR                                *pszPDumpDevName;       
-       IMG_CHAR                                *pszPDumpRegName;       
+       PVRSRV_DEVICE_TYPE              eDeviceType;
+       PVRSRV_DEVICE_CLASS             eDeviceClass;
+       IMG_UINT32                              ui32DeviceIndex;
+       IMG_CHAR                                *pszPDumpDevName;
+       IMG_CHAR                                *pszPDumpRegName;
 
 } PVRSRV_DEVICE_IDENTIFIER;
 
 
 typedef struct _PVRSRV_CLIENT_DEV_DATA_
 {
-       IMG_UINT32              ui32NumDevices;                         
-       PVRSRV_DEVICE_IDENTIFIER asDevID[PVRSRV_MAX_DEVICES];           
-       PVRSRV_ERROR    (*apfnDevConnect[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA);        
-       PVRSRV_ERROR    (*apfnDumpTrace[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA);         
+       IMG_UINT32              ui32NumDevices;
+       PVRSRV_DEVICE_IDENTIFIER asDevID[PVRSRV_MAX_DEVICES];
+       PVRSRV_ERROR    (*apfnDevConnect[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA);
+       PVRSRV_ERROR    (*apfnDumpTrace[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA);
 
 } PVRSRV_CLIENT_DEV_DATA;
 
 
 typedef struct _PVRSRV_CONNECTION_
 {
-       IMG_HANDLE hServices;                                   
-       IMG_UINT32 ui32ProcessID;                               
-       PVRSRV_CLIENT_DEV_DATA  sClientDevData; 
-       IMG_UINT32 ui32SrvFlags;                                
+       IMG_HANDLE hServices;
+       IMG_UINT32 ui32ProcessID;
+       PVRSRV_CLIENT_DEV_DATA  sClientDevData;
+       IMG_UINT32 ui32SrvFlags;
 }PVRSRV_CONNECTION;
 
 
 typedef struct _PVRSRV_DEV_DATA_
 {
-       IMG_CONST PVRSRV_CONNECTION      *psConnection; 
+       IMG_CONST PVRSRV_CONNECTION      *psConnection;
 #if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID                 hDevCookie;                             
+       IMG_SID                 hDevCookie;
 #else
-       IMG_HANDLE                      hDevCookie;                             
+       IMG_HANDLE                      hDevCookie;
 #endif
 
 } PVRSRV_DEV_DATA;
 
 typedef struct _PVRSRV_MEMUPDATE_
 {
-       IMG_UINT32                      ui32UpdateAddr;         
-       IMG_UINT32                      ui32UpdateVal;          
+       IMG_UINT32                      ui32UpdateAddr;
+       IMG_UINT32                      ui32UpdateVal;
 } PVRSRV_MEMUPDATE;
 
 typedef struct _PVRSRV_HWREG_
 {
-       IMG_UINT32                      ui32RegAddr;    
-       IMG_UINT32                      ui32RegVal;             
+       IMG_UINT32                      ui32RegAddr;
+       IMG_UINT32                      ui32RegVal;
 } PVRSRV_HWREG;
 
 typedef struct _PVRSRV_MEMBLK_
 {
-       IMG_DEV_VIRTADDR        sDevVirtAddr;                   
-       IMG_HANDLE                      hOSMemHandle;                   
-       IMG_HANDLE                      hOSWrapMem;                             
-       IMG_HANDLE                      hBuffer;                                
-       IMG_HANDLE                      hResItem;                               
+       IMG_DEV_VIRTADDR        sDevVirtAddr;
+       IMG_HANDLE                      hOSMemHandle;
+       IMG_HANDLE                      hOSWrapMem;
+       IMG_HANDLE                      hBuffer;
+       IMG_HANDLE                      hResItem;
        IMG_SYS_PHYADDR         *psIntSysPAddr;
 
 } PVRSRV_MEMBLK;
@@ -260,68 +260,68 @@ typedef struct _PVRSRV_KERNEL_MEM_INFO_ *PPVRSRV_KERNEL_MEM_INFO;
 
 typedef struct _PVRSRV_CLIENT_MEM_INFO_
 {
-       
+
        IMG_PVOID                               pvLinAddr;
 
-       
+
        IMG_PVOID                               pvLinAddrKM;
 
-       
+
        IMG_DEV_VIRTADDR                sDevVAddr;
 
-       
+
 
 
 
 
        IMG_CPU_PHYADDR                 sCpuPAddr;
 
-       
+
        IMG_UINT32                              ui32Flags;
 
-       
+
 
 
        IMG_UINT32                              ui32ClientFlags;
 
-       
+
        IMG_SIZE_T                              uAllocSize;
 
 
-       
+
        struct _PVRSRV_CLIENT_SYNC_INFO_        *psClientSyncInfo;
 
 #if defined (SUPPORT_SID_INTERFACE)
-       
+
        IMG_SID                                                         hMappingInfo;
 
-       
+
        IMG_SID                                                         hKernelMemInfo;
 
-       
+
        IMG_SID                                                         hResItem;
 #else
-       
+
        IMG_HANDLE                                                      hMappingInfo;
 
-       
+
        IMG_HANDLE                                                      hKernelMemInfo;
 
-       
+
        IMG_HANDLE                                                      hResItem;
 #endif
 
 #if defined(SUPPORT_MEMINFO_IDS)
        #if !defined(USE_CODE)
-       
+
        IMG_UINT64                                                      ui64Stamp;
-       #else 
+       #else
        IMG_UINT32                                                      dummy1;
        IMG_UINT32                                                      dummy2;
-       #endif 
-#endif 
+       #endif
+#endif
+
 
-       
 
 
        struct _PVRSRV_CLIENT_MEM_INFO_         *psNext;
@@ -349,9 +349,9 @@ typedef struct _PVRSRV_HEAP_INFO_
 
 typedef struct _PVRSRV_EVENTOBJECT_
 {
-       
+
        IMG_CHAR        szName[EVENTOBJNAME_MAXLENGTH];
-       
+
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID     hOSEventKM;
 #else
@@ -369,10 +369,10 @@ typedef enum
 
 typedef struct _PVRSRV_MISC_INFO_
 {
-       IMG_UINT32      ui32StateRequest;               
-       IMG_UINT32      ui32StatePresent;               
+       IMG_UINT32      ui32StateRequest;
+       IMG_UINT32      ui32StatePresent;
+
 
-       
        IMG_VOID        *pvSOCTimerRegisterKM;
        IMG_VOID        *pvSOCTimerRegisterUM;
 #if defined (SUPPORT_SID_INTERFACE)
@@ -383,15 +383,15 @@ typedef struct _PVRSRV_MISC_INFO_
        IMG_HANDLE      hSOCTimerRegisterMappingInfo;
 #endif
 
-       
+
        IMG_VOID        *pvSOCClockGateRegs;
        IMG_UINT32      ui32SOCClockGateRegsSize;
 
-       
+
        IMG_CHAR        *pszMemoryStr;
        IMG_UINT32      ui32MemoryStrLen;
 
-       
+
        PVRSRV_EVENTOBJECT      sGlobalEventObject;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_EVENTSID            hOSGlobalEvent;
@@ -399,60 +399,60 @@ typedef struct _PVRSRV_MISC_INFO_
        IMG_HANDLE                      hOSGlobalEvent;
 #endif
 
-       
+
        IMG_UINT32      aui32DDKVersion[4];
 
-       
+
        struct
        {
-               
+
                IMG_BOOL bDeferOp;
 
-               
+
                PVRSRV_MISC_INFO_CPUCACHEOP_TYPE eCacheOpType;
 
-               
+
 #if !defined (SUPPORT_SID_INTERFACE)
                union
                {
-                       
+
                        PVRSRV_CLIENT_MEM_INFO *psClientMemInfo;
 
-                       
+
                        struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo;
                } u;
 #endif
 
-               
+
                IMG_VOID *pvBaseVAddr;
 
-               
+
                IMG_UINT32      ui32Length;
        } sCacheOpCtl;
 
-       
+
        struct
        {
-               
+
 #if !defined(SUPPORT_SID_INTERFACE)
                union
                {
-                       
+
                        PVRSRV_CLIENT_MEM_INFO *psClientMemInfo;
 
-                       
+
                        struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo;
                } u;
 #endif
 
-               
+
                IMG_UINT32 ui32RefCount;
        } sGetRefCountCtl;
 } PVRSRV_MISC_INFO;
 
 typedef struct _PVRSRV_SYNC_TOKEN_
 {
-       
+
 
        struct
        {
@@ -708,7 +708,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemory2(IMG_CONST PVRSRV_DEV_DATA  *psDe
                                                                                                 IMG_HANDLE                                     hDstDevMemHeap,
 #endif
                                                                                                 PVRSRV_CLIENT_MEM_INFO         **ppsDstMemInfo);
-#endif 
+#endif
 
 #if defined(SUPPORT_ION)
 PVRSRV_ERROR PVRSRVMapIonHandle(const PVRSRV_DEV_DATA *psDevData,
@@ -724,7 +724,7 @@ PVRSRV_ERROR PVRSRVMapIonHandle(const PVRSRV_DEV_DATA *psDevData,
 
 PVRSRV_ERROR PVRSRVUnmapIonHandle(const PVRSRV_DEV_DATA *psDevData,
                                                                  PVRSRV_CLIENT_MEM_INFO *psMemInfo);
-#endif 
+#endif
 
 typedef enum _PVRSRV_SYNCVAL_MODE_
 {
@@ -958,7 +958,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMemPol(IMG_CONST PVRSRV_CONNECTION *psConne
                                                                                  IMG_SID    hKernelMemInfo,
 #else
                                                                                  PVRSRV_CLIENT_MEM_INFO *psMemInfo,
-#endif                                                                           
+#endif
                                                                                  IMG_UINT32 ui32Offset,
                                                                                  IMG_UINT32 ui32Value,
                                                                                  IMG_UINT32 ui32Mask,
@@ -1213,7 +1213,7 @@ static INLINE IMG_VOID PVRSRVPostSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore, I
        PVR_UNREFERENCED_PARAMETER(iPostCount);
 }
 
-#endif 
+#endif
 
 
 #if (defined(DEBUG) && defined(__linux__))
@@ -1223,9 +1223,9 @@ IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMemTracking(IMG_SIZE_T ui3
 
 IMG_IMPORT IMG_VOID  IMG_CALLCONV PVRSRVFreeUserModeMemTracking(IMG_VOID *pvMem);
 
-IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem, IMG_SIZE_T ui32NewSize, 
+IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem, IMG_SIZE_T ui32NewSize,
                                                                                                          IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber);
-#endif 
+#endif
 
 IMG_IMPORT PVRSRV_ERROR PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnection,
 #if defined (SUPPORT_SID_INTERFACE)
@@ -1325,5 +1325,5 @@ const IMG_CHAR *PVRSRVGetErrorString(PVRSRV_ERROR eError);
 #if defined (__cplusplus)
 }
 #endif
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 4c5de43..c31138d
@@ -1,33 +1,33 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #if !defined (__SERVICESEXT_H__)
 #define __SERVICESEXT_H__
 
-#define PVRSRV_LOCKFLG_READONLY        (1)             
+#define PVRSRV_LOCKFLG_READONLY        (1)
 
 typedef enum _PVRSRV_ERROR_
 {
@@ -279,12 +279,12 @@ typedef enum _PVRSRV_DEVICE_CLASS_
 
 typedef enum _PVRSRV_SYS_POWER_STATE_
 {
-       PVRSRV_SYS_POWER_STATE_Unspecified              = -1,   
-       PVRSRV_SYS_POWER_STATE_D0                               = 0,    
-       PVRSRV_SYS_POWER_STATE_D1                               = 1,    
-       PVRSRV_SYS_POWER_STATE_D2                               = 2,    
-       PVRSRV_SYS_POWER_STATE_D3                               = 3,    
-       PVRSRV_SYS_POWER_STATE_D4                               = 4,    
+       PVRSRV_SYS_POWER_STATE_Unspecified              = -1,
+       PVRSRV_SYS_POWER_STATE_D0                               = 0,
+       PVRSRV_SYS_POWER_STATE_D1                               = 1,
+       PVRSRV_SYS_POWER_STATE_D2                               = 2,
+       PVRSRV_SYS_POWER_STATE_D3                               = 3,
+       PVRSRV_SYS_POWER_STATE_D4                               = 4,
 
        PVRSRV_SYS_POWER_STATE_FORCE_I32 = 0x7fffffff
 
@@ -293,14 +293,14 @@ typedef enum _PVRSRV_SYS_POWER_STATE_
 
 typedef enum _PVRSRV_DEV_POWER_STATE_
 {
-       PVRSRV_DEV_POWER_STATE_DEFAULT  = -1,   
-       PVRSRV_DEV_POWER_STATE_ON               = 0,    
-       PVRSRV_DEV_POWER_STATE_IDLE             = 1,    
-       PVRSRV_DEV_POWER_STATE_OFF              = 2,    
+       PVRSRV_DEV_POWER_STATE_DEFAULT  = -1,
+       PVRSRV_DEV_POWER_STATE_ON               = 0,
+       PVRSRV_DEV_POWER_STATE_IDLE             = 1,
+       PVRSRV_DEV_POWER_STATE_OFF              = 2,
 
        PVRSRV_DEV_POWER_STATE_FORCE_I32 = 0x7fffffff
 
-} PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE;    
+} PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE;
 
 
 typedef PVRSRV_ERROR (*PFN_PRE_POWER) (IMG_HANDLE                              hDevHandle,
@@ -319,12 +319,12 @@ typedef PVRSRV_ERROR (*PFN_POST_CLOCKSPEED_CHANGE) (IMG_HANDLE                            hDevHandle,
 
 
 typedef enum _PVRSRV_PIXEL_FORMAT_ {
-       
+
        PVRSRV_PIXEL_FORMAT_UNKNOWN                             =  0,
        PVRSRV_PIXEL_FORMAT_RGB565                              =  1,
        PVRSRV_PIXEL_FORMAT_RGB555                              =  2,
-       PVRSRV_PIXEL_FORMAT_RGB888                              =  3,   
-       PVRSRV_PIXEL_FORMAT_BGR888                              =  4,   
+       PVRSRV_PIXEL_FORMAT_RGB888                              =  3,
+       PVRSRV_PIXEL_FORMAT_BGR888                              =  4,
        PVRSRV_PIXEL_FORMAT_GREY_SCALE                  =  8,
        PVRSRV_PIXEL_FORMAT_PAL12                               = 13,
        PVRSRV_PIXEL_FORMAT_PAL8                                = 14,
@@ -343,8 +343,8 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_BGRA8888                    = 28,
        PVRSRV_PIXEL_FORMAT_XRGB4444                    = 29,
        PVRSRV_PIXEL_FORMAT_ARGB8332                    = 30,
-       PVRSRV_PIXEL_FORMAT_A2RGB10                             = 31,   
-       PVRSRV_PIXEL_FORMAT_A2BGR10                             = 32,   
+       PVRSRV_PIXEL_FORMAT_A2RGB10                             = 31,
+       PVRSRV_PIXEL_FORMAT_A2BGR10                             = 32,
        PVRSRV_PIXEL_FORMAT_P8                                  = 33,
        PVRSRV_PIXEL_FORMAT_L8                                  = 34,
        PVRSRV_PIXEL_FORMAT_A8L8                                = 35,
@@ -360,7 +360,7 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_D24S8                               = 45,
        PVRSRV_PIXEL_FORMAT_D24X8                               = 46,
 
-       
+
        PVRSRV_PIXEL_FORMAT_ABGR16                              = 47,
        PVRSRV_PIXEL_FORMAT_ABGR16F                             = 48,
        PVRSRV_PIXEL_FORMAT_ABGR32                              = 49,
@@ -371,22 +371,22 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_GR32                                = 54,
        PVRSRV_PIXEL_FORMAT_E5BGR9                              = 55,
 
-       
+
        PVRSRV_PIXEL_FORMAT_RESERVED1                   = 56,
        PVRSRV_PIXEL_FORMAT_RESERVED2                   = 57,
        PVRSRV_PIXEL_FORMAT_RESERVED3                   = 58,
        PVRSRV_PIXEL_FORMAT_RESERVED4                   = 59,
        PVRSRV_PIXEL_FORMAT_RESERVED5                   = 60,
 
-       
+
        PVRSRV_PIXEL_FORMAT_R8G8_B8G8                   = 61,
        PVRSRV_PIXEL_FORMAT_G8R8_G8B8                   = 62,
 
-       
+
        PVRSRV_PIXEL_FORMAT_NV11                                = 63,
        PVRSRV_PIXEL_FORMAT_NV12                                = 64,
 
-       
+
        PVRSRV_PIXEL_FORMAT_YUY2                                = 65,
        PVRSRV_PIXEL_FORMAT_YUV420                              = 66,
        PVRSRV_PIXEL_FORMAT_YUV444                              = 67,
@@ -396,107 +396,107 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_UYVY                                = 71,
        PVRSRV_PIXEL_FORMAT_VYUY                                = 72,
 
-       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY             = 73,   
-       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV             = 74,   
-       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU             = 75,   
-       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY             = 76,   
-       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_AYUV             = 77,   
-
-       
-       PVRSRV_PIXEL_FORMAT_A32B32G32R32                = 78,   
-       PVRSRV_PIXEL_FORMAT_A32B32G32R32F               = 79,   
-       PVRSRV_PIXEL_FORMAT_A32B32G32R32_UINT   = 80,   
-       PVRSRV_PIXEL_FORMAT_A32B32G32R32_SINT   = 81,   
-
-       
-       PVRSRV_PIXEL_FORMAT_B32G32R32                   = 82,   
-       PVRSRV_PIXEL_FORMAT_B32G32R32F                  = 83,   
-       PVRSRV_PIXEL_FORMAT_B32G32R32_UINT              = 84,   
-       PVRSRV_PIXEL_FORMAT_B32G32R32_SINT              = 85,   
-
-       
-       PVRSRV_PIXEL_FORMAT_G32R32                              = 86,   
-       PVRSRV_PIXEL_FORMAT_G32R32F                             = 87,   
-       PVRSRV_PIXEL_FORMAT_G32R32_UINT                 = 88,   
-       PVRSRV_PIXEL_FORMAT_G32R32_SINT                 = 89,   
-
-       
-       PVRSRV_PIXEL_FORMAT_D32F                                = 90,   
-       PVRSRV_PIXEL_FORMAT_R32                                 = 91,   
-       PVRSRV_PIXEL_FORMAT_R32F                                = 92,   
-       PVRSRV_PIXEL_FORMAT_R32_UINT                    = 93,   
-       PVRSRV_PIXEL_FORMAT_R32_SINT                    = 94,   
-
-       
-       PVRSRV_PIXEL_FORMAT_A16B16G16R16                = 95,   
-       PVRSRV_PIXEL_FORMAT_A16B16G16R16F               = 96,   
-       PVRSRV_PIXEL_FORMAT_A16B16G16R16_SINT   = 97,   
-       PVRSRV_PIXEL_FORMAT_A16B16G16R16_SNORM  = 98,   
-       PVRSRV_PIXEL_FORMAT_A16B16G16R16_UINT   = 99,   
-       PVRSRV_PIXEL_FORMAT_A16B16G16R16_UNORM  = 100,  
-
-       
-       PVRSRV_PIXEL_FORMAT_G16R16                              = 101,  
-       PVRSRV_PIXEL_FORMAT_G16R16F                             = 102,  
-       PVRSRV_PIXEL_FORMAT_G16R16_UINT                 = 103,  
-       PVRSRV_PIXEL_FORMAT_G16R16_UNORM                = 104,  
-       PVRSRV_PIXEL_FORMAT_G16R16_SINT                 = 105,  
-       PVRSRV_PIXEL_FORMAT_G16R16_SNORM                = 106,  
-
-       
-       PVRSRV_PIXEL_FORMAT_R16                                 = 107,  
-       PVRSRV_PIXEL_FORMAT_R16F                                = 108,  
-       PVRSRV_PIXEL_FORMAT_R16_UINT                    = 109,  
-       PVRSRV_PIXEL_FORMAT_R16_UNORM                   = 110,  
-       PVRSRV_PIXEL_FORMAT_R16_SINT                    = 111,  
-       PVRSRV_PIXEL_FORMAT_R16_SNORM                   = 112,  
-
-       
-       PVRSRV_PIXEL_FORMAT_X8R8G8B8                    = 113,  
-       PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM              = 114,  
-       PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM_SRGB = 115,  
-
-       PVRSRV_PIXEL_FORMAT_A8R8G8B8                    = 116,  
-       PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM              = 117,  
-       PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM_SRGB = 118,  
-
-       PVRSRV_PIXEL_FORMAT_A8B8G8R8                    = 119,  
-       PVRSRV_PIXEL_FORMAT_A8B8G8R8_UINT               = 120,  
-       PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM              = 121,  
-       PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM_SRGB = 122,  
-       PVRSRV_PIXEL_FORMAT_A8B8G8R8_SINT               = 123,  
-       PVRSRV_PIXEL_FORMAT_A8B8G8R8_SNORM              = 124,  
-
-       
-       PVRSRV_PIXEL_FORMAT_G8R8                                = 125,  
-       PVRSRV_PIXEL_FORMAT_G8R8_UINT                   = 126,  
-       PVRSRV_PIXEL_FORMAT_G8R8_UNORM                  = 127,  
-       PVRSRV_PIXEL_FORMAT_G8R8_SINT                   = 128,  
-       PVRSRV_PIXEL_FORMAT_G8R8_SNORM                  = 129,  
-
-       
-       PVRSRV_PIXEL_FORMAT_A8                                  = 130,  
-       PVRSRV_PIXEL_FORMAT_R8                                  = 131,  
-       PVRSRV_PIXEL_FORMAT_R8_UINT                             = 132,  
-       PVRSRV_PIXEL_FORMAT_R8_UNORM                    = 133,  
-       PVRSRV_PIXEL_FORMAT_R8_SINT                             = 134,  
-       PVRSRV_PIXEL_FORMAT_R8_SNORM                    = 135,  
-
-       
-       PVRSRV_PIXEL_FORMAT_A2B10G10R10                 = 136,  
-       PVRSRV_PIXEL_FORMAT_A2B10G10R10_UNORM   = 137,  
-       PVRSRV_PIXEL_FORMAT_A2B10G10R10_UINT    = 138,  
-
-       
-       PVRSRV_PIXEL_FORMAT_B10G11R11                   = 139,  
-       PVRSRV_PIXEL_FORMAT_B10G11R11F                  = 140,  
-
-       
-       PVRSRV_PIXEL_FORMAT_X24G8R32                    = 141,  
-       PVRSRV_PIXEL_FORMAT_G8R24                               = 142,  
+       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY             = 73,
+       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV             = 74,
+       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU             = 75,
+       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY             = 76,
+       PVRSRV_PIXEL_FORMAT_FOURCC_ORG_AYUV             = 77,
+
+
+       PVRSRV_PIXEL_FORMAT_A32B32G32R32                = 78,
+       PVRSRV_PIXEL_FORMAT_A32B32G32R32F               = 79,
+       PVRSRV_PIXEL_FORMAT_A32B32G32R32_UINT   = 80,
+       PVRSRV_PIXEL_FORMAT_A32B32G32R32_SINT   = 81,
+
+
+       PVRSRV_PIXEL_FORMAT_B32G32R32                   = 82,
+       PVRSRV_PIXEL_FORMAT_B32G32R32F                  = 83,
+       PVRSRV_PIXEL_FORMAT_B32G32R32_UINT              = 84,
+       PVRSRV_PIXEL_FORMAT_B32G32R32_SINT              = 85,
+
+
+       PVRSRV_PIXEL_FORMAT_G32R32                              = 86,
+       PVRSRV_PIXEL_FORMAT_G32R32F                             = 87,
+       PVRSRV_PIXEL_FORMAT_G32R32_UINT                 = 88,
+       PVRSRV_PIXEL_FORMAT_G32R32_SINT                 = 89,
+
+
+       PVRSRV_PIXEL_FORMAT_D32F                                = 90,
+       PVRSRV_PIXEL_FORMAT_R32                                 = 91,
+       PVRSRV_PIXEL_FORMAT_R32F                                = 92,
+       PVRSRV_PIXEL_FORMAT_R32_UINT                    = 93,
+       PVRSRV_PIXEL_FORMAT_R32_SINT                    = 94,
+
+
+       PVRSRV_PIXEL_FORMAT_A16B16G16R16                = 95,
+       PVRSRV_PIXEL_FORMAT_A16B16G16R16F               = 96,
+       PVRSRV_PIXEL_FORMAT_A16B16G16R16_SINT   = 97,
+       PVRSRV_PIXEL_FORMAT_A16B16G16R16_SNORM  = 98,
+       PVRSRV_PIXEL_FORMAT_A16B16G16R16_UINT   = 99,
+       PVRSRV_PIXEL_FORMAT_A16B16G16R16_UNORM  = 100,
+
+
+       PVRSRV_PIXEL_FORMAT_G16R16                              = 101,
+       PVRSRV_PIXEL_FORMAT_G16R16F                             = 102,
+       PVRSRV_PIXEL_FORMAT_G16R16_UINT                 = 103,
+       PVRSRV_PIXEL_FORMAT_G16R16_UNORM                = 104,
+       PVRSRV_PIXEL_FORMAT_G16R16_SINT                 = 105,
+       PVRSRV_PIXEL_FORMAT_G16R16_SNORM                = 106,
+
+
+       PVRSRV_PIXEL_FORMAT_R16                                 = 107,
+       PVRSRV_PIXEL_FORMAT_R16F                                = 108,
+       PVRSRV_PIXEL_FORMAT_R16_UINT                    = 109,
+       PVRSRV_PIXEL_FORMAT_R16_UNORM                   = 110,
+       PVRSRV_PIXEL_FORMAT_R16_SINT                    = 111,
+       PVRSRV_PIXEL_FORMAT_R16_SNORM                   = 112,
+
+
+       PVRSRV_PIXEL_FORMAT_X8R8G8B8                    = 113,
+       PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM              = 114,
+       PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM_SRGB = 115,
+
+       PVRSRV_PIXEL_FORMAT_A8R8G8B8                    = 116,
+       PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM              = 117,
+       PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM_SRGB = 118,
+
+       PVRSRV_PIXEL_FORMAT_A8B8G8R8                    = 119,
+       PVRSRV_PIXEL_FORMAT_A8B8G8R8_UINT               = 120,
+       PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM              = 121,
+       PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM_SRGB = 122,
+       PVRSRV_PIXEL_FORMAT_A8B8G8R8_SINT               = 123,
+       PVRSRV_PIXEL_FORMAT_A8B8G8R8_SNORM              = 124,
+
+
+       PVRSRV_PIXEL_FORMAT_G8R8                                = 125,
+       PVRSRV_PIXEL_FORMAT_G8R8_UINT                   = 126,
+       PVRSRV_PIXEL_FORMAT_G8R8_UNORM                  = 127,
+       PVRSRV_PIXEL_FORMAT_G8R8_SINT                   = 128,
+       PVRSRV_PIXEL_FORMAT_G8R8_SNORM                  = 129,
+
+
+       PVRSRV_PIXEL_FORMAT_A8                                  = 130,
+       PVRSRV_PIXEL_FORMAT_R8                                  = 131,
+       PVRSRV_PIXEL_FORMAT_R8_UINT                             = 132,
+       PVRSRV_PIXEL_FORMAT_R8_UNORM                    = 133,
+       PVRSRV_PIXEL_FORMAT_R8_SINT                             = 134,
+       PVRSRV_PIXEL_FORMAT_R8_SNORM                    = 135,
+
+
+       PVRSRV_PIXEL_FORMAT_A2B10G10R10                 = 136,
+       PVRSRV_PIXEL_FORMAT_A2B10G10R10_UNORM   = 137,
+       PVRSRV_PIXEL_FORMAT_A2B10G10R10_UINT    = 138,
+
+
+       PVRSRV_PIXEL_FORMAT_B10G11R11                   = 139,
+       PVRSRV_PIXEL_FORMAT_B10G11R11F                  = 140,
+
+
+       PVRSRV_PIXEL_FORMAT_X24G8R32                    = 141,
+       PVRSRV_PIXEL_FORMAT_G8R24                               = 142,
        PVRSRV_PIXEL_FORMAT_X8R24                               = 143,
-       PVRSRV_PIXEL_FORMAT_E5B9G9R9                    = 144,  
-       PVRSRV_PIXEL_FORMAT_R1                                  = 145,  
+       PVRSRV_PIXEL_FORMAT_E5B9G9R9                    = 144,
+       PVRSRV_PIXEL_FORMAT_R1                                  = 145,
 
        PVRSRV_PIXEL_FORMAT_RESERVED6                   = 146,
        PVRSRV_PIXEL_FORMAT_RESERVED7                   = 147,
@@ -514,20 +514,20 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_RESERVED19                  = 159,
        PVRSRV_PIXEL_FORMAT_RESERVED20                  = 160,
 
-       
-       PVRSRV_PIXEL_FORMAT_UBYTE4                              = 161,  
-       PVRSRV_PIXEL_FORMAT_SHORT4                              = 162,  
-       PVRSRV_PIXEL_FORMAT_SHORT4N                             = 163,  
-       PVRSRV_PIXEL_FORMAT_USHORT4N                    = 164,  
-       PVRSRV_PIXEL_FORMAT_SHORT2N                             = 165,  
-       PVRSRV_PIXEL_FORMAT_SHORT2                              = 166,  
-       PVRSRV_PIXEL_FORMAT_USHORT2N                    = 167,  
-       PVRSRV_PIXEL_FORMAT_UDEC3                               = 168,  
-       PVRSRV_PIXEL_FORMAT_DEC3N                               = 169,  
-       PVRSRV_PIXEL_FORMAT_F16_2                               = 170,  
-       PVRSRV_PIXEL_FORMAT_F16_4                               = 171,  
-
-       
+
+       PVRSRV_PIXEL_FORMAT_UBYTE4                              = 161,
+       PVRSRV_PIXEL_FORMAT_SHORT4                              = 162,
+       PVRSRV_PIXEL_FORMAT_SHORT4N                             = 163,
+       PVRSRV_PIXEL_FORMAT_USHORT4N                    = 164,
+       PVRSRV_PIXEL_FORMAT_SHORT2N                             = 165,
+       PVRSRV_PIXEL_FORMAT_SHORT2                              = 166,
+       PVRSRV_PIXEL_FORMAT_USHORT2N                    = 167,
+       PVRSRV_PIXEL_FORMAT_UDEC3                               = 168,
+       PVRSRV_PIXEL_FORMAT_DEC3N                               = 169,
+       PVRSRV_PIXEL_FORMAT_F16_2                               = 170,
+       PVRSRV_PIXEL_FORMAT_F16_4                               = 171,
+
+
        PVRSRV_PIXEL_FORMAT_L_F16                               = 172,
        PVRSRV_PIXEL_FORMAT_L_F16_REP                   = 173,
        PVRSRV_PIXEL_FORMAT_L_F16_A_F16                 = 174,
@@ -538,7 +538,7 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_A_F32                               = 178,
        PVRSRV_PIXEL_FORMAT_L_F32_A_F32                 = 179,
 
-       
+
        PVRSRV_PIXEL_FORMAT_PVRTC2                              = 180,
        PVRSRV_PIXEL_FORMAT_PVRTC4                              = 181,
        PVRSRV_PIXEL_FORMAT_PVRTCII2                    = 182,
@@ -555,7 +555,7 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_MONO8                               = 193,
        PVRSRV_PIXEL_FORMAT_MONO16                              = 194,
 
-       
+
        PVRSRV_PIXEL_FORMAT_C0_YUYV                             = 195,
        PVRSRV_PIXEL_FORMAT_C0_UYVY                             = 196,
        PVRSRV_PIXEL_FORMAT_C0_YVYU                             = 197,
@@ -565,7 +565,7 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_C1_YVYU                             = 201,
        PVRSRV_PIXEL_FORMAT_C1_VYUY                             = 202,
 
-       
+
        PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_UV             = 203,
        PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_VU             = 204,
        PVRSRV_PIXEL_FORMAT_C0_YUV420_3P                = 205,
@@ -576,18 +576,18 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_A2B10G10R10F                = 209,
        PVRSRV_PIXEL_FORMAT_B8G8R8_SINT                 = 210,
        PVRSRV_PIXEL_FORMAT_PVRF32SIGNMASK              = 211,
-       
-       PVRSRV_PIXEL_FORMAT_ABGR4444                    = 212,  
+
+       PVRSRV_PIXEL_FORMAT_ABGR4444                    = 212,
        PVRSRV_PIXEL_FORMAT_ABGR1555                    = 213,
-       PVRSRV_PIXEL_FORMAT_BGR565                              = 214,                  
+       PVRSRV_PIXEL_FORMAT_BGR565                              = 214,
+
 
-       
        PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_UV   = 215,
        PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_VU   = 216,
        PVRSRV_PIXEL_FORMAT_C1_4KYUV420_2P_UV   = 217,
        PVRSRV_PIXEL_FORMAT_C1_4KYUV420_2P_VU   = 218,
-       PVRSRV_PIXEL_FORMAT_P208                                = 219,                  
-       PVRSRV_PIXEL_FORMAT_A8P8                                = 220,                  
+       PVRSRV_PIXEL_FORMAT_P208                                = 219,
+       PVRSRV_PIXEL_FORMAT_A8P8                                = 220,
 
        PVRSRV_PIXEL_FORMAT_A4                                  = 221,
        PVRSRV_PIXEL_FORMAT_AYUV8888                    = 222,
@@ -629,15 +629,15 @@ typedef enum _PVRSRV_ROTATION_ {
 
 typedef struct _PVRSRV_SYNC_DATA_
 {
-       
+
        IMG_UINT32                                      ui32WriteOpsPending;
        volatile IMG_UINT32                     ui32WriteOpsComplete;
 
-       
+
        IMG_UINT32                                      ui32ReadOpsPending;
        volatile IMG_UINT32                     ui32ReadOpsComplete;
 
-       
+
        IMG_UINT32                                      ui32ReadOps2Pending;
        volatile IMG_UINT32                     ui32ReadOps2Complete;
 
@@ -649,31 +649,31 @@ typedef struct _PVRSRV_SYNC_DATA_
 
 typedef struct _PVRSRV_CLIENT_SYNC_INFO_
 {
-       
+
        PVRSRV_SYNC_DATA                *psSyncData;
 
-       
+
 
 
 
        IMG_DEV_VIRTADDR                sWriteOpsCompleteDevVAddr;
 
-       
+
        IMG_DEV_VIRTADDR                sReadOpsCompleteDevVAddr;
 
-       
+
        IMG_DEV_VIRTADDR                sReadOps2CompleteDevVAddr;
 
 
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hMappingInfo;
 
-       
+
        IMG_SID                                 hKernelSyncInfo;
 #else
        IMG_HANDLE                                      hMappingInfo;
 
-       
+
        IMG_HANDLE                                      hKernelSyncInfo;
 #endif
 
@@ -731,52 +731,52 @@ typedef struct DISPLAY_DIMS_TAG
 
 typedef struct DISPLAY_FORMAT_TAG
 {
-       
+
        PVRSRV_PIXEL_FORMAT             pixelformat;
 } DISPLAY_FORMAT;
 
 typedef struct DISPLAY_SURF_ATTRIBUTES_TAG
 {
-       
+
        PVRSRV_PIXEL_FORMAT             pixelformat;
-       
+
        DISPLAY_DIMS                    sDims;
 } DISPLAY_SURF_ATTRIBUTES;
 
 
 typedef struct DISPLAY_MODE_INFO_TAG
 {
-       
+
        PVRSRV_PIXEL_FORMAT             pixelformat;
-       
+
        DISPLAY_DIMS                    sDims;
-       
+
        IMG_UINT32                              ui32RefreshHZ;
-       
+
        IMG_UINT32                              ui32OEMFlags;
 } DISPLAY_MODE_INFO;
 
 
 
-#define MAX_DISPLAY_NAME_SIZE  (50) 
+#define MAX_DISPLAY_NAME_SIZE  (50)
 
 typedef struct DISPLAY_INFO_TAG
 {
-       
+
        IMG_UINT32 ui32MaxSwapChains;
-       
+
        IMG_UINT32 ui32MaxSwapChainBuffers;
-       
+
        IMG_UINT32 ui32MinSwapInterval;
-       
+
        IMG_UINT32 ui32MaxSwapInterval;
-       
+
        IMG_UINT32 ui32PhysicalWidthmm;
        IMG_UINT32 ui32PhysicalHeightmm;
-       
+
        IMG_CHAR        szDisplayName[MAX_DISPLAY_NAME_SIZE];
 #if defined(SUPPORT_HW_CURSOR)
-       
+
        IMG_UINT16      ui32CursorWidth;
        IMG_UINT16      ui32CursorHeight;
 #endif
@@ -786,7 +786,7 @@ typedef struct ACCESS_INFO_TAG
 {
        IMG_UINT32              ui32Size;
        IMG_UINT32      ui32FBPhysBaseAddress;
-       IMG_UINT32              ui32FBMemAvailable;                     
+       IMG_UINT32              ui32FBMemAvailable;
        IMG_UINT32      ui32SysPhysBaseAddress;
        IMG_UINT32              ui32SysSize;
        IMG_UINT32              ui32DevIRQ;
@@ -803,7 +803,7 @@ typedef struct {
 #define PVRSRV_PDUMP_SUSPEND_Q_NAME "PVRSRVPDumpSuspendMsgQ"
 #define PVRSRV_PDUMP_SUSPEND_Q_LENGTH 8
 
-#endif 
+#endif
 
 
 typedef struct _PVRSRV_REGISTRY_INFO_
@@ -826,7 +826,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVWriteRegistryString (PPVRSRV_REGISTRY_INFO psReg
 #define PVRSRV_BC_FLAGS_YUVCSC_BT601                   (0 << 1)
 #define PVRSRV_BC_FLAGS_YUVCSC_BT709                   (1 << 1)
 
-#define MAX_BUFFER_DEVICE_NAME_SIZE    (50) 
+#define MAX_BUFFER_DEVICE_NAME_SIZE    (50)
 
 typedef struct BUFFER_INFO_TAG
 {
@@ -848,4 +848,4 @@ typedef enum _OVERLAY_DEINTERLACE_MODE_
        BOB_EVEN_NONINTERLEAVED
 } OVERLAY_DEINTERLACE_MODE;
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 77ff8b7..35423db
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
 ******************************************************************************/
 
old mode 100755 (executable)
new mode 100644 (file)
index c3416b0..c51dfcc
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
 ******************************************************************************/
 
@@ -80,7 +80,7 @@ extern "C" {
  * their ISP controll stream to.
  */
 #if (defined(SUPPORT_PERCONTEXT_PB) || defined(SUPPORT_HYBRID_PB))
-#define SGX_3DPARAMETERS_HEAP_ID                       SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID     
+#define SGX_3DPARAMETERS_HEAP_ID                       SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID
 #else
 #define SGX_3DPARAMETERS_HEAP_ID                       SGX_SHARED_3DPARAMETERS_HEAP_ID
 #endif
@@ -336,7 +336,7 @@ typedef struct _PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS
 {
        /* See PVRSRV_SGX_HWPERF_STATUS_* */
        IMG_UINT32      ui32NewHWPerfStatus;
-       
+
        #if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS)
        /* Specifies the HW's active group selectors */
        IMG_UINT32      aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
@@ -445,7 +445,7 @@ typedef struct _SGX_KICKTA_DUMP_BUFFER_
 #if defined(SUPPORT_SGX_NEW_STATUS_VALS)
        IMG_HANDLE                      hCtrlKernelMemInfo;                                     /*< MemInfo handle for the control structure of the
                                                                                                                                circular buffer */
-       IMG_DEV_VIRTADDR        sCtrlDevVAddr;                                          /*< Device virtual address of the memory in the 
+       IMG_DEV_VIRTADDR        sCtrlDevVAddr;                                          /*< Device virtual address of the memory in the
                                                                                                                                control structure to be checked */
 #endif
        IMG_PCHAR                       pszName;                                                        /*< Name of buffer */
old mode 100755 (executable)
new mode 100644 (file)
index 94eb453..7c4a5dc
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
 *****************************************************************************/
 #ifndef __SGXSCRIPT_H__
@@ -58,11 +58,11 @@ typedef union _SGX_INIT_COMMAND
                IMG_UINT32 ui32Value;
        } sPDumpHWReg;
 #endif
-#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)                   
+#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
        struct {
                SGX_INIT_OPERATION eOp;
        } sWorkaroundBRN22997;
-#endif 
+#endif
 } SGX_INIT_COMMAND;
 
 typedef struct _SGX_INIT_SCRIPTS_
old mode 100755 (executable)
new mode 100644 (file)
index 5ac75ee..7f25a63
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -53,15 +53,15 @@ static void SetAnchorPtr(BC_EXAMPLE_DEVINFO *psDevInfo)
 static PVRSRV_ERROR OpenBCDevice(IMG_UINT32 ui32DeviceID, IMG_HANDLE *phDevice)
 {
        BC_EXAMPLE_DEVINFO *psDevInfo;
-       
-       
+
+
 
 
        UNREFERENCED_PARAMETER(ui32DeviceID);
 
        psDevInfo = GetAnchorPtr();
 
-       
+
        *phDevice = (IMG_HANDLE)psDevInfo;
 
        return (PVRSRV_OK);
@@ -161,21 +161,21 @@ BCE_ERROR BC_Example_Register(void)
 {
        BC_EXAMPLE_DEVINFO      *psDevInfo;
 
-       
 
 
 
-       
 
 
 
-       
+
+
+
 
        psDevInfo = GetAnchorPtr();
 
        if (psDevInfo == NULL)
        {
-               
+
                psDevInfo = (BC_EXAMPLE_DEVINFO *)BCAllocKernelMem(sizeof(BC_EXAMPLE_DEVINFO));
 
                if(!psDevInfo)
@@ -183,13 +183,13 @@ BCE_ERROR BC_Example_Register(void)
                        return (BCE_ERROR_OUT_OF_MEMORY);
                }
 
-               
+
                SetAnchorPtr((void*)psDevInfo);
 
-               
+
                psDevInfo->ulRefCount = 0;
 
-       
+
                if(BCOpenPVRServices(&psDevInfo->hPVRServices) != BCE_OK)
                {
                        return (BCE_ERROR_INIT_FAILURE);
@@ -199,13 +199,13 @@ BCE_ERROR BC_Example_Register(void)
                        return (BCE_ERROR_INIT_FAILURE);
                }
 
-               
+
                if(!(*pfnGetPVRJTable)(&psDevInfo->sPVRJTable))
                {
                        return (BCE_ERROR_INIT_FAILURE);
                }
 
-               
+
 
                psDevInfo->ulNumBuffers = 0;
 
@@ -216,7 +216,7 @@ BCE_ERROR BC_Example_Register(void)
                        return (BCE_ERROR_OUT_OF_MEMORY);
                }
 
-               
+
                psDevInfo->sBufferInfo.pixelformat        = PVRSRV_PIXEL_FORMAT_UNKNOWN;
                psDevInfo->sBufferInfo.ui32Width          = 0;
                psDevInfo->sBufferInfo.ui32Height         = 0;
@@ -224,10 +224,10 @@ BCE_ERROR BC_Example_Register(void)
                psDevInfo->sBufferInfo.ui32BufferDeviceID = BC_EXAMPLE_DEVICEID;
                psDevInfo->sBufferInfo.ui32Flags          = 0;
                psDevInfo->sBufferInfo.ui32BufferCount    = (IMG_UINT32)psDevInfo->ulNumBuffers;
-               
+
                strncpy(psDevInfo->sBufferInfo.szDeviceName, BUFFERCLASS_DEVICE_NAME, MAX_BUFFER_DEVICE_NAME_SIZE);
 
-               
+
 
                psDevInfo->sBCJTable.ui32TableSize    = sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE);
                psDevInfo->sBCJTable.pfnOpenBCDevice  = OpenBCDevice;
@@ -237,8 +237,8 @@ BCE_ERROR BC_Example_Register(void)
                psDevInfo->sBCJTable.pfnGetBufferAddr = GetBCBufferAddr;
 
 
-               
-               
+
+
                if(psDevInfo->sPVRJTable.pfnPVRSRVRegisterBCDevice (&psDevInfo->sBCJTable,
                                                                                                                        (IMG_UINT32*)&psDevInfo->ulDeviceID ) != PVRSRV_OK)
                {
@@ -246,10 +246,10 @@ BCE_ERROR BC_Example_Register(void)
                }
        }
 
-       
+
        psDevInfo->ulRefCount++;
 
-       
+
        return (BCE_OK);
 }
 
@@ -259,21 +259,21 @@ BCE_ERROR BC_Example_Unregister(void)
 
        psDevInfo = GetAnchorPtr();
 
-       
+
        if (psDevInfo == NULL)
        {
                return (BCE_ERROR_GENERIC);
        }
-       
+
        psDevInfo->ulRefCount--;
 
        if (psDevInfo->ulRefCount == 0)
        {
-               
+
                PVRSRV_BC_BUFFER2SRV_KMJTABLE   *psJTable = &psDevInfo->sPVRJTable;
 
 
-               
+
                if (psJTable->pfnPVRSRVRemoveBCDevice(psDevInfo->ulDeviceID) != PVRSRV_OK)
                {
                        return (BCE_ERROR_GENERIC);
@@ -290,14 +290,14 @@ BCE_ERROR BC_Example_Unregister(void)
                        BCFreeKernelMem(psDevInfo->psSystemBuffer);
                }
 
-               
+
                BCFreeKernelMem(psDevInfo);
 
-               
+
                SetAnchorPtr(NULL);
        }
 
-       
+
        return (BCE_OK);
 }
 
@@ -316,21 +316,21 @@ BCE_ERROR BC_Example_Buffers_Create(void)
 
        IMG_UINT32 ui32MaxWidth = 320 * 4;
 
-       
+
 
        psDevInfo = GetAnchorPtr();
        if (psDevInfo == NULL)
        {
-               
+
                return (BCE_ERROR_DEVICE_REGISTER_FAILED);
        }
        if (psDevInfo->ulNumBuffers)
        {
-               
+
                return (BCE_ERROR_GENERIC);
        }
-               
-       
+
+
        psDevInfo->sBufferInfo.pixelformat        = BC_EXAMPLE_PIXELFORMAT;
        psDevInfo->sBufferInfo.ui32Width          = ui32Width;
        psDevInfo->sBufferInfo.ui32Height         = ui32Height;
@@ -344,15 +344,15 @@ BCE_ERROR BC_Example_Buffers_Create(void)
 
                if(psDevInfo->sBufferInfo.pixelformat == PVRSRV_PIXEL_FORMAT_NV12)
                {
-                       
+
                        ulSize += ((ui32ByteStride >> 1) * (ui32Height >> 1) << 1);
                }
                else if(psDevInfo->sBufferInfo.pixelformat == PVRSRV_PIXEL_FORMAT_I420)
                {
-                       
+
                        ulSize += (ui32ByteStride >> 1) * (ui32Height >> 1);
-                       
-                       
+
+
                        ulSize += (ui32ByteStride >> 1) * (ui32Height >> 1);
                }
 
@@ -365,7 +365,7 @@ BCE_ERROR BC_Example_Buffers_Create(void)
                        break;
                }
 #else
-               
+
                if (BCAllocContigMemory(ulSize,
                                        &psDevInfo->psSystemBuffer[i].hMemHandle,
                                        &psDevInfo->psSystemBuffer[i].sCPUVAddr,
@@ -385,7 +385,7 @@ BCE_ERROR BC_Example_Buffers_Create(void)
 
        psDevInfo->sBufferInfo.ui32BufferCount = (IMG_UINT32)psDevInfo->ulNumBuffers;
 
-       
+
 
        psDevInfo->sBCJTable.ui32TableSize    = sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE);
        psDevInfo->sBCJTable.pfnOpenBCDevice  = OpenBCDevice;
@@ -393,10 +393,10 @@ BCE_ERROR BC_Example_Buffers_Create(void)
        psDevInfo->sBCJTable.pfnGetBCBuffer   = GetBCBuffer;
        psDevInfo->sBCJTable.pfnGetBCInfo     = GetBCInfo;
        psDevInfo->sBCJTable.pfnGetBufferAddr = GetBCBufferAddr;
-       
 
 
-       
+
+
        if (ui32Width < ui32MaxWidth)
        {
                switch(pixelformat)
@@ -439,7 +439,7 @@ BCE_ERROR BC_Example_Buffers_Create(void)
                ui32ByteStride = BC_EXAMPLE_STRIDE;
        }
 
-       
+
        return (BCE_OK);
 }
 
@@ -451,15 +451,15 @@ BCE_ERROR BC_Example_Buffers_Destroy(void)
 
        psDevInfo = GetAnchorPtr();
 
-       
+
        if (psDevInfo == NULL)
        {
-               
+
 
                return (BCE_ERROR_DEVICE_REGISTER_FAILED);
        }
 
-       
+
 
        for(i = 0; i < psDevInfo->ulNumBuffers; i++)
        {
@@ -477,7 +477,7 @@ BCE_ERROR BC_Example_Buffers_Destroy(void)
        }
        psDevInfo->ulNumBuffers = 0;
 
-       
+
        psDevInfo->sBufferInfo.pixelformat        = PVRSRV_PIXEL_FORMAT_UNKNOWN;
        psDevInfo->sBufferInfo.ui32Width          = 0;
        psDevInfo->sBufferInfo.ui32Height         = 0;
@@ -486,7 +486,7 @@ BCE_ERROR BC_Example_Buffers_Destroy(void)
        psDevInfo->sBufferInfo.ui32Flags          = 0;
        psDevInfo->sBufferInfo.ui32BufferCount    = (IMG_UINT32)psDevInfo->ulNumBuffers;
 
-       
+
        return (BCE_OK);
 }
 
old mode 100755 (executable)
new mode 100644 (file)
index 572c3d7..62d0143
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -87,8 +87,8 @@ typedef struct BC_EXAMPLE_BUFFER_TAG
        unsigned long           ulSize;
        BCE_HANDLE              hMemHandle;
 
-       
-       
+
+
 #if defined(BC_DISCONTIG_BUFFERS)
        IMG_SYS_PHYADDR                         *psSysAddr;
 #else
@@ -108,25 +108,25 @@ typedef struct BC_EXAMPLE_DEVINFO_TAG
 
        BC_EXAMPLE_BUFFER       *psSystemBuffer;
 
-       
+
        unsigned long           ulNumBuffers;
 
-       
+
        PVRSRV_BC_BUFFER2SRV_KMJTABLE sPVRJTable;
 
-       
+
        PVRSRV_BC_SRV2BUFFER_KMJTABLE sBCJTable;
 
-       
+
 
 
        BCE_HANDLE              hPVRServices;
 
-       
+
        unsigned long           ulRefCount;
 
-       
-       
+
+
        BUFFER_INFO             sBufferInfo;
 
 }  BC_EXAMPLE_DEVINFO;
@@ -204,5 +204,5 @@ BC_EXAMPLE_DEVINFO * GetAnchorPtr(void);
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 6a855d2..d4e3294
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -94,8 +94,8 @@ static struct file_operations bufferclass_example_fops = {
 #define unref__ __attribute__ ((unused))
 
 #if defined(LMA)
-#define PVR_BUFFERCLASS_MEMOFFSET (220 * 1024 * 1024) 
-#define PVR_BUFFERCLASS_MEMSIZE          (4 * 1024 * 1024)       
+#define PVR_BUFFERCLASS_MEMOFFSET (220 * 1024 * 1024)
+#define PVR_BUFFERCLASS_MEMSIZE          (4 * 1024 * 1024)
 
 unsigned long g_ulMemBase = 0;
 unsigned long g_ulMemCurrent = 0;
@@ -125,7 +125,7 @@ static int __init BC_Example_ModInit(void)
        psPCIDev = pci_get_device(VENDOR_ID_PVR, DEVICE_ID_PVR, NULL);
        if (psPCIDev == NULL)
        {
-               
+
                psPCIDev = pci_get_device(VENDOR_ID_PVR, DEVICE_ID1_PVR, NULL);
        }
 
@@ -157,7 +157,7 @@ static int __init BC_Example_ModInit(void)
 #endif
 
 #if defined(LDM_PLATFORM) || defined(LDM_PCI)
-       
+
        psPvrClass = class_create(THIS_MODULE, "bc_example");
 
        if (IS_ERR(psPvrClass))
@@ -169,17 +169,17 @@ static int __init BC_Example_ModInit(void)
        psDev = device_create(psPvrClass, NULL, MKDEV(AssignedMajorNumber, 0),
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
                                                  NULL,
-#endif 
+#endif
                                                  DEVNAME);
        if (IS_ERR(psDev))
        {
                printk(KERN_ERR DRVNAME ": BC_Example_ModInit: unable to create device (%ld)", PTR_ERR(psDev));
                goto ExitDestroyClass;
        }
-#endif 
+#endif
 
 #if defined(LMA)
-       
+
        g_ulMemBase =  pci_resource_start(psPCIDev, PVR_MEM_PCI_BASENUM) + PVR_BUFFERCLASS_MEMOFFSET;
 #endif
 
@@ -190,7 +190,7 @@ static int __init BC_Example_ModInit(void)
        }
 
 #if defined(LMA)
-       
+
        pci_disable_device(psPCIDev);
 #endif
 
@@ -208,7 +208,7 @@ ExitDisable:
 ExitError:
 #endif
        return -EBUSY;
-} 
+}
 
 static void __exit BC_Example_ModCleanup(void)
 {
@@ -218,13 +218,13 @@ static void __exit BC_Example_ModCleanup(void)
 #endif
 
        unregister_chrdev(AssignedMajorNumber, DEVNAME);
-       
+
        if(BC_Example_Deinit() != BCE_OK)
        {
                printk (KERN_ERR DRVNAME ": BC_Example_ModCleanup: can't deinit device\n");
        }
 
-} 
+}
 
 
 void *BCAllocKernelMem(unsigned long ulSize)
@@ -288,7 +288,7 @@ void BCFreeDiscontigMemory(unsigned long ulSize,
 
        vfree(LinAddr);
 }
-#else  
+#else
 
 BCE_ERROR BCAllocContigMemory(unsigned long ulSize,
                               BCE_HANDLE unref__ *phMemHandle,
@@ -297,8 +297,8 @@ BCE_ERROR BCAllocContigMemory(unsigned long ulSize,
 {
 #if defined(LMA)
        void *pvLinAddr;
-       
-       
+
+
        if(g_ulMemCurrent + ulSize >= PVR_BUFFERCLASS_MEMSIZE)
        {
                return (BCE_ERROR_OUT_OF_MEMORY);
@@ -309,14 +309,14 @@ BCE_ERROR BCAllocContigMemory(unsigned long ulSize,
        if(pvLinAddr)
        {
                pPhysAddr->uiAddr = g_ulMemBase + g_ulMemCurrent;
-               *pLinAddr = pvLinAddr;  
+               *pLinAddr = pvLinAddr;
+
 
-               
                g_ulMemCurrent += ulSize;
                return (BCE_OK);
        }
        return (BCE_ERROR_OUT_OF_MEMORY);
-#else  
+#else
 #if defined(BCE_USE_SET_MEMORY)
        void *pvLinAddr;
        unsigned long ulAlignedSize = PAGE_ALIGN(ulSize);
@@ -337,7 +337,7 @@ BCE_ERROR BCAllocContigMemory(unsigned long ulSize,
        *pLinAddr = pvLinAddr;
 
        return (BCE_OK);
-#else  
+#else
        dma_addr_t dma;
        void *pvLinAddr;
 
@@ -351,8 +351,8 @@ BCE_ERROR BCAllocContigMemory(unsigned long ulSize,
        *pLinAddr = pvLinAddr;
 
        return (BCE_OK);
-#endif 
-#endif 
+#endif
+#endif
 }
 
 void BCFreeContigMemory(unsigned long ulSize,
@@ -363,7 +363,7 @@ void BCFreeContigMemory(unsigned long ulSize,
 #if defined(LMA)
        g_ulMemCurrent -= ulSize;
        iounmap(LinAddr);
-#else  
+#else
 #if defined(BCE_USE_SET_MEMORY)
        unsigned long ulAlignedSize = PAGE_ALIGN(ulSize);
        int iError;
@@ -375,34 +375,34 @@ void BCFreeContigMemory(unsigned long ulSize,
                printk(KERN_ERR DRVNAME ": BCFreeContigMemory:  set_memory_wb failed (%d)\n", iError);
        }
        kfree(LinAddr);
-#else  
+#else
        dma_free_coherent(NULL, ulSize, LinAddr, (dma_addr_t)PhysAddr.uiAddr);
-#endif 
-#endif 
+#endif
+#endif
 }
-#endif 
+#endif
 
 IMG_SYS_PHYADDR CpuPAddrToSysPAddrBC(IMG_CPU_PHYADDR cpu_paddr)
 {
        IMG_SYS_PHYADDR sys_paddr;
-       
-       
+
+
        sys_paddr.uiAddr = cpu_paddr.uiAddr;
        return sys_paddr;
 }
 
 IMG_CPU_PHYADDR SysPAddrToCpuPAddrBC(IMG_SYS_PHYADDR sys_paddr)
 {
-       
+
        IMG_CPU_PHYADDR cpu_paddr;
-       
+
        cpu_paddr.uiAddr = sys_paddr.uiAddr;
        return cpu_paddr;
 }
 
 BCE_ERROR BCOpenPVRServices (BCE_HANDLE *phPVRServices)
 {
-       
+
        *phPVRServices = 0;
        return (BCE_OK);
 }
@@ -410,7 +410,7 @@ BCE_ERROR BCOpenPVRServices (BCE_HANDLE *phPVRServices)
 
 BCE_ERROR BCClosePVRServices (BCE_HANDLE unref__ hPVRServices)
 {
-       
+
        return (BCE_OK);
 }
 
@@ -421,7 +421,7 @@ BCE_ERROR BCGetLibFuncAddr (BCE_HANDLE unref__ hExtDrv, char *szFunctionName, PF
                return (BCE_ERROR_INVALID_PARAMS);
        }
 
-       
+
        *ppfnFuncTable = PVRGetBufferClassJTable;
 
        return (BCE_OK);
old mode 100755 (executable)
new mode 100644 (file)
index b663608..9410321
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -44,5 +44,5 @@ typedef struct BC_Example_ioctl_package_TAG
 #define BC_Example_ioctl_get_buffer_count      BC_EXAMPLE_IOWR(1)
 #define BC_Example_ioctl_reconfigure_buffer BC_EXAMPLE_IOWR(2)
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 3a02eb9..1012882
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -61,7 +61,7 @@ static void FillNV12Image(void *pvDest, int width, int height, int bytestride)
                        u = (j<(height/2))? ((i<(width/2))? 0xFF:0x33) : ((i<(width/2))? 0x33:0xAA);
                        v = (j<(height/2))? ((i<(width/2))? 0xAC:0x0) : ((i<(width/2))? 0x03:0xEE);
 
-                       
+
                        pui16uv[count++] = (v << 8) | u;
 
                }
@@ -158,7 +158,7 @@ static void FillYUV422Image(void *pvDest, int width, int height, int bytestride,
                                case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU:
                                        pui32yuv[count++] = (u << 24) | (y1 << 16) | (v << 8) | y0;
                                        break;
-                               
+
                                default:
                                        break;
 
@@ -178,10 +178,10 @@ static void FillRGB565Image(void *pvDest, int width, int height, int bytestride)
        unsigned long   Colour32;
        unsigned short  Colour16;
        static unsigned char Colour8 = 0;
-       
+
        Colour16 = (Colour8>>3) | ((Colour8>>2)<<5) | ((Colour8>>3)<<11);
        Colour32 = Colour16 | Colour16 << 16;
-                       
+
        Count = (height * bytestride)>>2;
 
        for(i=0; i<Count; i++)
@@ -200,7 +200,7 @@ static void FillRGB565Image(void *pvDest, int width, int height, int bytestride)
                pui16Addr = (unsigned short *)((unsigned char *)pui16Addr + bytestride);
        }
        Count = bytestride >> 2;
-       
+
        pui32Addr = (unsigned long *)((unsigned char *)pvDest + (bytestride * (MIN(height - 1, 0xFF) - Colour8)));
 
        for(i=0; i<Count; i++)
@@ -208,7 +208,7 @@ static void FillRGB565Image(void *pvDest, int width, int height, int bytestride)
                pui32Addr[i] = 0x001F001FUL;
        }
 
-       
+
        Colour8 = (Colour8 + 1) % MIN(height - 1, 0xFFU);
 }
 
@@ -220,7 +220,7 @@ int FillBuffer(unsigned int uiBufferIndex)
        BUFFER_INFO         *psBufferInfo;
        PVRSRV_SYNC_DATA    *psSyncData;
 
-       
+
        if(psDevInfo == NULL)
        {
                return -1;
@@ -229,18 +229,18 @@ int FillBuffer(unsigned int uiBufferIndex)
        psBuffer = &psDevInfo->psSystemBuffer[uiBufferIndex];
        psBufferInfo = &psDevInfo->sBufferInfo;
 
-       
+
        psSyncData = psBuffer->psSyncData;
 
        if(psSyncData)
        {
-               
+
                if(psSyncData->ui32ReadOpsPending != psSyncData->ui32ReadOpsComplete)
                {
                        return -1;
                }
 
-               
+
                psSyncData->ui32WriteOpsPending++;
        }
 
@@ -249,9 +249,9 @@ int FillBuffer(unsigned int uiBufferIndex)
                case PVRSRV_PIXEL_FORMAT_RGB565:
                default:
                {
-                       FillRGB565Image(psBuffer->sCPUVAddr, 
-                                                       psBufferInfo->ui32Width, 
-                                                       psBufferInfo->ui32Height, 
+                       FillRGB565Image(psBuffer->sCPUVAddr,
+                                                       psBufferInfo->ui32Width,
+                                                       psBufferInfo->ui32Height,
                                                        psBufferInfo->ui32ByteStride);
                        break;
                }
@@ -260,32 +260,32 @@ int FillBuffer(unsigned int uiBufferIndex)
                case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV:
                case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU:
                {
-                       FillYUV422Image(psBuffer->sCPUVAddr, 
-                                                       psBufferInfo->ui32Width, 
-                                                       psBufferInfo->ui32Height, 
-                                                       psBufferInfo->ui32ByteStride, 
+                       FillYUV422Image(psBuffer->sCPUVAddr,
+                                                       psBufferInfo->ui32Width,
+                                                       psBufferInfo->ui32Height,
+                                                       psBufferInfo->ui32ByteStride,
                                                        psBufferInfo->pixelformat);
                        break;
                }
                case PVRSRV_PIXEL_FORMAT_NV12:
                {
-                       FillNV12Image(psBuffer->sCPUVAddr, 
-                                                       psBufferInfo->ui32Width, 
-                                                       psBufferInfo->ui32Height, 
+                       FillNV12Image(psBuffer->sCPUVAddr,
+                                                       psBufferInfo->ui32Width,
+                                                       psBufferInfo->ui32Height,
                                                        psBufferInfo->ui32ByteStride);
                        break;
                }
                case PVRSRV_PIXEL_FORMAT_I420:
                {
-                       FillI420Image(psBuffer->sCPUVAddr, 
-                                                       psBufferInfo->ui32Width, 
-                                                       psBufferInfo->ui32Height, 
+                       FillI420Image(psBuffer->sCPUVAddr,
+                                                       psBufferInfo->ui32Width,
+                                                       psBufferInfo->ui32Height,
                                                        psBufferInfo->ui32ByteStride);
                        break;
                }
        }
 
-       
+
        if(psSyncData)
        {
                psSyncData->ui32WriteOpsComplete++;
@@ -304,13 +304,13 @@ int GetBufferCount(unsigned int *puiBufferCount)
 {
        BC_EXAMPLE_DEVINFO *psDevInfo = GetAnchorPtr();
 
-       
+
        if(psDevInfo == IMG_NULL)
        {
                return -1;
        }
 
-       
+
        *puiBufferCount = (unsigned int)psDevInfo->sBufferInfo.ui32BufferCount;
 
        return 0;
@@ -321,8 +321,8 @@ int GetBufferCount(unsigned int *puiBufferCount)
 int ReconfigureBuffer(unsigned int *uiSucceed)
 {
        BCE_ERROR eError;
-       
+
+
        eError = BC_Example_Buffers_Destroy();
 
        if (eError != BCE_OK)
@@ -331,10 +331,10 @@ int ReconfigureBuffer(unsigned int *uiSucceed)
                return -1;
        }
 
-       
 
 
-       
+
+
        eError = BC_Example_Buffers_Create();
 
        if (eError != BCE_OK)
@@ -343,7 +343,7 @@ int ReconfigureBuffer(unsigned int *uiSucceed)
                return -1;
        }
 
-       
+
        *uiSucceed = 1;
        return 0;
 }
old mode 100755 (executable)
new mode 100644 (file)
index 94515bc..e92fe12
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -31,4 +31,4 @@ int FillBuffer(unsigned int uiBufferIndex);
 int GetBufferCount(unsigned int *puiBufferCount);
 int ReconfigureBuffer(unsigned int *uiSucceed);
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 915f044..d0df611
@@ -1,26 +1,26 @@
 #
 # Copyright (C) Imagination Technologies Ltd. All rights reserved.
-# 
+#
 # This program is free software; you can redistribute it and/or modify it
 # under the terms and conditions of the GNU General Public License,
 # version 2, as published by the Free Software Foundation.
-# 
-# This program is distributed in the hope it will be useful but, except 
-# as otherwise stated in writing, without any warranty; without even the 
-# implied warranty of merchantability or fitness for a particular purpose. 
+#
+# This program is distributed in the hope it will be useful but, except
+# as otherwise stated in writing, without any warranty; without even the
+# implied warranty of merchantability or fitness for a particular purpose.
 # See the GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License along with
 # this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-# 
+#
 # The full GNU General Public License is included in this distribution in
 # the file called "COPYING".
 #
 # Contact Information:
 # Imagination Technologies Ltd. <gpl-support@imgtec.com>
-# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
-# 
+# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+#
 #
 
 modules := medfield_drm moorestown_drm poulsbo_drm
old mode 100755 (executable)
new mode 100644 (file)
index 3bbf6ba..e9ef1d6
@@ -1,26 +1,26 @@
 #
 # Copyright (C) Imagination Technologies Ltd. All rights reserved.
-# 
+#
 # This program is free software; you can redistribute it and/or modify it
 # under the terms and conditions of the GNU General Public License,
 # version 2, as published by the Free Software Foundation.
-# 
-# This program is distributed in the hope it will be useful but, except 
-# as otherwise stated in writing, without any warranty; without even the 
-# implied warranty of merchantability or fitness for a particular purpose. 
+#
+# This program is distributed in the hope it will be useful but, except
+# as otherwise stated in writing, without any warranty; without even the
+# implied warranty of merchantability or fitness for a particular purpose.
 # See the GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License along with
 # this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-# 
+#
 # The full GNU General Public License is included in this distribution in
 # the file called "COPYING".
 #
 # Contact Information:
 # Imagination Technologies Ltd. <gpl-support@imgtec.com>
-# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
-# 
+# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+#
 #
 
 MRST_SOURCE_DIR := drivers/staging/mrst
old mode 100755 (executable)
new mode 100644 (file)
index f6615dc..dbb63af
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -65,23 +65,23 @@ typedef int(* MRSTLFB_SCREEN_EVENT_PFN)(struct drm_device* psDrmDevice, int stat
 
 typedef struct MRSTLFB_BUFFER_TAG
 {
-       
+
     IMG_UINT32                         ui32BufferSize;
        union {
-               
+
                IMG_SYS_PHYADDR             *psNonCont;
-               
+
                IMG_SYS_PHYADDR                         sCont;
        } uSysAddr;
-       
+
        IMG_DEV_VIRTADDR                sDevVAddr;
-       
-    IMG_CPU_VIRTADDR                   sCPUVAddr;    
-       
+
+    IMG_CPU_VIRTADDR                   sCPUVAddr;
+
        PVRSRV_SYNC_DATA                *psSyncData;
-       
+
        MRST_BOOL                                               bIsContiguous;
-       
+
        MRST_BOOL                                               bIsAllocated;
 
        IMG_UINT32                                              ui32OwnerTaskID;
@@ -90,16 +90,24 @@ typedef struct MRSTLFB_BUFFER_TAG
 
 typedef struct MRSTLFB_VSYNC_FLIP_ITEM_TAG
 {
+
+
+
        MRST_HANDLE      hCmdComplete;
-       
+
        unsigned long    ulSwapInterval;
-       
+
        MRST_BOOL        bValid;
-       
+
        MRST_BOOL        bFlipped;
-       
+
        MRST_BOOL        bCmdCompleted;
 
+
+
+
+
+
        MRSTLFB_BUFFER* psBuffer;
 
        struct mdfld_plane_contexts sPlaneContexts;
@@ -107,35 +115,35 @@ typedef struct MRSTLFB_VSYNC_FLIP_ITEM_TAG
 
 typedef struct MRSTLFB_SWAPCHAIN_TAG
 {
-       
+
        unsigned long       ulBufferCount;
 
        IMG_UINT32                      ui32SwapChainID;
        IMG_UINT32                      ui32SwapChainPropertyFlag;
        unsigned long                   ulSwapChainGTTOffset;
 
-       
+
        MRSTLFB_BUFFER     **ppsBuffer;
 
-       
+
        unsigned long       ulSwapChainLength;
 
-       
+
        MRSTLFB_VSYNC_FLIP_ITEM *psVSyncFlips;
 
-       
+
        unsigned long       ulInsertIndex;
-       
-       
+
+
        unsigned long       ulRemoveIndex;
 
-       
+
        PVRSRV_DC_DISP2SRV_KMJTABLE     *psPVRJTable;
 
-       
+
        struct drm_driver         *psDrmDriver;
 
-       
+
        struct drm_device         *psDrmDev;
 
        struct MRSTLFB_SWAPCHAIN_TAG *psNext;
@@ -150,17 +158,17 @@ typedef struct MRSTLFB_DEVINFO_TAG
 
        struct drm_device       *psDrmDevice;
 
-       
+
 
        MRSTLFB_BUFFER          sSystemBuffer;
 
-       
+
        PVRSRV_DC_DISP2SRV_KMJTABLE     sPVRJTable;
-       
-       
+
+
        PVRSRV_DC_SRV2DISP_KMJTABLE     sDCJTable;
 
-       
+
        unsigned long           ulRefCount;
 
        MRSTLFB_SWAPCHAIN      *psCurrentSwapChain;
@@ -170,53 +178,53 @@ typedef struct MRSTLFB_DEVINFO_TAG
        IMG_UINT32              ui32SwapChainNum;
 
        MRSTLFB_BUFFER  *psCurrentBuffer;
-       
+
        void *pvRegs;
 
-       
+
        unsigned long ulSetFlushStateRefCount;
 
-       
+
        MRST_BOOL           bFlushCommands;
 
-       
+
        MRST_BOOL           bBlanked;
 
-       
+
        struct fb_info         *psLINFBInfo;
 
-       
+
        struct notifier_block   sLINNotifBlock;
 
-       
+
        spinlock_t             sSwapChainLock;
 
-       
-       
 
-       
+
+
+
        IMG_DEV_VIRTADDR        sDisplayDevVAddr;
 
        DISPLAY_INFO            sDisplayInfo;
 
-       
+
        DISPLAY_FORMAT          sDisplayFormat;
-       
-       
+
+
        DISPLAY_DIMS            sDisplayDim;
 
        IMG_UINT32              ui32MainPipe;
 
-       
+
        MRST_BOOL bSuspended;
 
-       
+
        MRST_BOOL bLeaveVT;
 
-       
+
        unsigned long ulLastFlipAddr;
 
-       
+
        MRST_BOOL bLastFlipAddrValid;
 
        uint32_t uPlaneACntr;
@@ -296,5 +304,5 @@ void MRSTLFBResume(void);
 MRST_ERROR MRSTLFBChangeSwapChainProperty(unsigned long *psSwapChainGTTOffset,
                unsigned long ulSwapChainGTTSize, IMG_INT32 i32Pipe);
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index aadda27..71fb750
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -194,14 +194,14 @@ static void MRSTLFBClearSavedFlip(MRSTLFB_DEVINFO *psDevInfo)
        psDevInfo->bLastFlipAddrValid = MRST_FALSE;
 }
 
-       
+
 static void FlushInternalVSyncQueue(MRSTLFB_SWAPCHAIN *psSwapChain, MRST_BOOL bFlip)
 {
        MRSTLFB_VSYNC_FLIP_ITEM *psFlipItem;
        unsigned long            ulMaxIndex;
        unsigned long            i;
 
-       
+
        psFlipItem = &psSwapChain->psVSyncFlips[psSwapChain->ulRemoveIndex];
        ulMaxIndex = psSwapChain->ulSwapChainLength - 1;
 
@@ -223,7 +223,7 @@ static void FlushInternalVSyncQueue(MRSTLFB_SWAPCHAIN *psSwapChain, MRST_BOOL bF
                                MRSTLFBFlipContexts(psSwapChain->psDevInfo,
                                        &psFlipItem->sPlaneContexts);
                }
-               
+
                if(psFlipItem->bCmdCompleted == MRST_FALSE)
                {
                        DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": FlushInternalVSyncQueue: Calling command complete for swap buffer (index %lu)\n", psSwapChain->ulRemoveIndex));
@@ -231,20 +231,20 @@ static void FlushInternalVSyncQueue(MRSTLFB_SWAPCHAIN *psSwapChain, MRST_BOOL bF
                        psSwapChain->psPVRJTable->pfnPVRSRVCmdComplete((IMG_HANDLE)psFlipItem->hCmdComplete, MRST_TRUE);
                }
 
-               
+
                psSwapChain->ulRemoveIndex++;
-               
+
                if(psSwapChain->ulRemoveIndex > ulMaxIndex)
                {
                        psSwapChain->ulRemoveIndex = 0;
                }
 
-               
+
                psFlipItem->bFlipped = MRST_FALSE;
                psFlipItem->bCmdCompleted = MRST_FALSE;
                psFlipItem->bValid = MRST_FALSE;
-               
-               
+
+
                psFlipItem = &psSwapChain->psVSyncFlips[psSwapChain->ulRemoveIndex];
        }
 
@@ -252,16 +252,14 @@ static void FlushInternalVSyncQueue(MRSTLFB_SWAPCHAIN *psSwapChain, MRST_BOOL bF
        psSwapChain->ulRemoveIndex = 0;
 }
 
-static void DRMLFBFlipBuffer(MRSTLFB_DEVINFO *psDevInfo,
-                       MRSTLFB_SWAPCHAIN *psSwapChain,
-                       MRSTLFB_BUFFER *psBuffer)
+static void DRMLFBFlipBuffer(MRSTLFB_DEVINFO *psDevInfo, MRSTLFB_SWAPCHAIN *psSwapChain, MRSTLFB_BUFFER *psBuffer)
 {
-       if (psSwapChain != NULL)
+       if(psSwapChain != NULL)
        {
                if(psDevInfo->psCurrentSwapChain != NULL)
                {
 
-                       if(psDevInfo->psCurrentSwapChain != psSwapChain) 
+                       if(psDevInfo->psCurrentSwapChain != psSwapChain)
                                FlushInternalVSyncQueue(psDevInfo->psCurrentSwapChain, MRST_FALSE);
                }
                psDevInfo->psCurrentSwapChain = psSwapChain;
@@ -357,7 +355,7 @@ static int FrameBufferEvents(struct notifier_block *psNotif,
        struct fb_event *psFBEvent = (struct fb_event *)data;
        MRST_BOOL bBlanked;
 
-       
+
        if (event != FB_EVENT_BLANK)
        {
                return 0;
@@ -400,7 +398,7 @@ static MRST_ERROR EnableLFBEventNotification(MRSTLFB_DEVINFO *psDevInfo)
        int                res;
        MRST_ERROR         eError;
 
-       
+
        memset(&psDevInfo->sLINNotifBlock, 0, sizeof(psDevInfo->sLINNotifBlock));
 
        psDevInfo->sLINNotifBlock.notifier_call = FrameBufferEvents;
@@ -430,7 +428,7 @@ static MRST_ERROR DisableLFBEventNotification(MRSTLFB_DEVINFO *psDevInfo)
 {
        int res;
 
-       
+
        res = fb_unregister_client(&psDevInfo->sLINNotifBlock);
        if (res != 0)
        {
@@ -453,7 +451,7 @@ static PVRSRV_ERROR OpenDCDevice(IMG_UINT32 ui32DeviceID,
 
        psDevInfo = GetAnchorPtr();
 
-       
+
        psDevInfo->sSystemBuffer.psSyncData = psSystemBufferSyncData;
 
        psDevInfo->ulSetFlushStateRefCount = 0;
@@ -466,9 +464,9 @@ static PVRSRV_ERROR OpenDCDevice(IMG_UINT32 ui32DeviceID,
                return PVRSRV_ERROR_UNABLE_TO_OPEN_DC_DEVICE;
        }
 
-       
+
        *phDevice = (IMG_HANDLE)psDevInfo;
-       
+
        return (PVRSRV_OK);
 }
 
@@ -492,16 +490,16 @@ static PVRSRV_ERROR EnumDCFormats(IMG_HANDLE hDevice,
                                   DISPLAY_FORMAT *psFormat)
 {
        MRSTLFB_DEVINFO *psDevInfo;
-       
+
        if(!hDevice || !pui32NumFormats)
        {
                return (PVRSRV_ERROR_INVALID_PARAMS);
        }
 
        psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
-       
+
        *pui32NumFormats = 1;
-       
+
        if(psFormat)
        {
                psFormat[0] = psDevInfo->sDisplayFormat;
@@ -510,7 +508,7 @@ static PVRSRV_ERROR EnumDCFormats(IMG_HANDLE hDevice,
        return (PVRSRV_OK);
 }
 
-static PVRSRV_ERROR EnumDCDims(IMG_HANDLE hDevice, 
+static PVRSRV_ERROR EnumDCDims(IMG_HANDLE hDevice,
                                DISPLAY_FORMAT *psFormat,
                                IMG_UINT32 *pui32NumDims,
                                DISPLAY_DIMS *psDim)
@@ -526,12 +524,12 @@ static PVRSRV_ERROR EnumDCDims(IMG_HANDLE hDevice,
 
        *pui32NumDims = 1;
 
-       
+
        if(psDim)
        {
                psDim[0] = psDevInfo->sDisplayDim;
        }
-       
+
        return (PVRSRV_OK);
 }
 
@@ -539,7 +537,7 @@ static PVRSRV_ERROR EnumDCDims(IMG_HANDLE hDevice,
 static PVRSRV_ERROR GetDCSystemBuffer(IMG_HANDLE hDevice, IMG_HANDLE *phBuffer)
 {
        MRSTLFB_DEVINFO *psDevInfo;
-       
+
        if(!hDevice || !phBuffer)
        {
                return (PVRSRV_ERROR_INVALID_PARAMS);
@@ -547,8 +545,8 @@ static PVRSRV_ERROR GetDCSystemBuffer(IMG_HANDLE hDevice, IMG_HANDLE *phBuffer)
 
        psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
 
-       
-       
+
+
        *phBuffer = (IMG_HANDLE)&psDevInfo->sSystemBuffer;
 
        return (PVRSRV_OK);
@@ -558,7 +556,7 @@ static PVRSRV_ERROR GetDCSystemBuffer(IMG_HANDLE hDevice, IMG_HANDLE *phBuffer)
 static PVRSRV_ERROR GetDCInfo(IMG_HANDLE hDevice, DISPLAY_INFO *psDCInfo)
 {
        MRSTLFB_DEVINFO *psDevInfo;
-       
+
        if(!hDevice || !psDCInfo)
        {
                return (PVRSRV_ERROR_INVALID_PARAMS);
@@ -572,7 +570,7 @@ static PVRSRV_ERROR GetDCInfo(IMG_HANDLE hDevice, DISPLAY_INFO *psDCInfo)
 }
 
 static PVRSRV_ERROR GetDCBufferAddr(IMG_HANDLE        hDevice,
-                                    IMG_HANDLE        hBuffer, 
+                                    IMG_HANDLE        hBuffer,
                                     IMG_SYS_PHYADDR   **ppsSysAddr,
                                     IMG_SIZE_T        *pui32ByteSize,
                                     IMG_VOID          **ppvCpuVAddr,
@@ -590,7 +588,7 @@ static PVRSRV_ERROR GetDCBufferAddr(IMG_HANDLE        hDevice,
                return (PVRSRV_ERROR_INVALID_PARAMS);
        }
        psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
-       
+
        if(!hBuffer)
        {
                return (PVRSRV_ERROR_INVALID_PARAMS);
@@ -602,7 +600,7 @@ static PVRSRV_ERROR GetDCBufferAddr(IMG_HANDLE        hDevice,
                return (PVRSRV_ERROR_INVALID_PARAMS);
        }
 
-       if( psSystemBuffer->bIsContiguous ) 
+       if( psSystemBuffer->bIsContiguous )
                *ppsSysAddr = &psSystemBuffer->uSysAddr.sCont;
        else
                *ppsSysAddr = psSystemBuffer->uSysAddr.psNonCont;
@@ -656,8 +654,8 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice,
        struct psb_fbdev *fbdev = NULL;
 
        UNREFERENCED_PARAMETER(ui32OEMFlags);
-       
-       
+
+
        if(!hDevice
        || !psDstSurfAttrib
        || !psSrcSurfAttrib
@@ -668,46 +666,46 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice,
        }
 
        psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
-               
-       
+
+
        if(ui32BufferCount > psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers)
        {
                return (PVRSRV_ERROR_TOOMANYBUFFERS);
        }
-       
-       
+
+
        ulSwapChainLength = ui32BufferCount + 1;
 
-       
+
        if(psDstSurfAttrib->pixelformat != psDevInfo->sDisplayFormat.pixelformat
        || psDstSurfAttrib->sDims.ui32ByteStride != psDevInfo->sDisplayDim.ui32ByteStride
        || psDstSurfAttrib->sDims.ui32Width != psDevInfo->sDisplayDim.ui32Width
        || psDstSurfAttrib->sDims.ui32Height != psDevInfo->sDisplayDim.ui32Height)
        {
-               
+
                return (PVRSRV_ERROR_INVALID_PARAMS);
-       }               
+       }
 
        if(psDstSurfAttrib->pixelformat != psSrcSurfAttrib->pixelformat
        || psDstSurfAttrib->sDims.ui32ByteStride != psSrcSurfAttrib->sDims.ui32ByteStride
        || psDstSurfAttrib->sDims.ui32Width != psSrcSurfAttrib->sDims.ui32Width
        || psDstSurfAttrib->sDims.ui32Height != psSrcSurfAttrib->sDims.ui32Height)
        {
-               
+
                return (PVRSRV_ERROR_INVALID_PARAMS);
-       }               
+       }
+
 
-       
        UNREFERENCED_PARAMETER(ui32Flags);
-       
-       
+
+
        psSwapChain = (MRSTLFB_SWAPCHAIN*)MRSTLFBAllocKernelMem(sizeof(MRSTLFB_SWAPCHAIN));
        if(!psSwapChain)
        {
                return (PVRSRV_ERROR_OUT_OF_MEMORY);
        }
 
-       for(iSCId = 0;iSCId < MAX_SWAPCHAINS;++iSCId) 
+       for(iSCId = 0;iSCId < MAX_SWAPCHAINS;++iSCId)
        {
                if( psDevInfo->apsSwapChains[iSCId] == NULL )
                {
@@ -716,7 +714,7 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice,
                }
        }
 
-       if(iSCId == MAX_SWAPCHAINS) 
+       if(iSCId == MAX_SWAPCHAINS)
        {
                eError = PVRSRV_ERROR_OUT_OF_MEMORY;
                goto ErrorFreeSwapChain;
@@ -729,7 +727,7 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice,
                goto ErrorFreeSwapChain;
        }
        for (i = 0; i < ui32BufferCount; i++) ppsBuffer[i] = NULL;
-       
+
 
        psVSyncFlips = (MRSTLFB_VSYNC_FLIP_ITEM *)MRSTLFBAllocKernelMem(sizeof(MRSTLFB_VSYNC_FLIP_ITEM) * ulSwapChainLength);
        if (!psVSyncFlips)
@@ -746,8 +744,8 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice,
        psSwapChain->ulRemoveIndex = 0;
        psSwapChain->psPVRJTable = &psDevInfo->sPVRJTable;
 
-       
-       
+
+
        for (i = 0; i < ui32BufferCount; i++)
        {
                unsigned long bufSize = psDevInfo->sDisplayDim.ui32ByteStride * psDevInfo->sDisplayDim.ui32Height;
@@ -755,10 +753,10 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice,
                        eError = PVRSRV_ERROR_OUT_OF_MEMORY;
                        goto ErrorFreeAllocatedBuffes;
                }
-               ppsBuffer[i]->psSyncData = ppsSyncData[i];              
+               ppsBuffer[i]->psSyncData = ppsSyncData[i];
        }
 
-       
+
        for (i = 0; i < ulSwapChainLength; i++)
        {
                psVSyncFlips[i].bValid = MRST_FALSE;
@@ -778,7 +776,7 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice,
                psbfb = fbdev->pfb;
 
        spin_lock_irqsave(&psDevInfo->sSwapChainLock, ulLockFlags);
-   
+
        psSwapChain->ui32SwapChainID = *pui32SwapChainID = iSCId+1;
        psSwapChain->ui32SwapChainPropertyFlag =
                PVRSRV_SWAPCHAIN_ATTACHED_PLANE_A
@@ -799,7 +797,7 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice,
 
        spin_unlock_irqrestore(&psDevInfo->sSwapChainLock, ulLockFlags);
 
-       
+
        *phSwapChain = (IMG_HANDLE)psSwapChain;
 
        return (PVRSRV_OK);
@@ -807,15 +805,15 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice,
 ErrorFreeAllocatedBuffes:
        for (i = 0; i < ui32BufferCount; i++)
        {
-               if(ppsBuffer[i] != NULL) 
+               if(ppsBuffer[i] != NULL)
                        MRSTLFBFreeBuffer( psDevInfo, &ppsBuffer[i] );
        }
        MRSTLFBFreeKernelMem(psVSyncFlips);
 ErrorFreeBuffers:
        MRSTLFBFreeKernelMem(ppsBuffer);
 ErrorFreeSwapChain:
-       if(iSCId != MAX_SWAPCHAINS && psDevInfo->apsSwapChains[iSCId] == psSwapChain ) 
-               psDevInfo->apsSwapChains[iSCId] = NULL; 
+       if(iSCId != MAX_SWAPCHAINS && psDevInfo->apsSwapChains[iSCId] == psSwapChain )
+               psDevInfo->apsSwapChains[iSCId] = NULL;
        MRSTLFBFreeKernelMem(psSwapChain);
 
        return eError;
@@ -834,7 +832,7 @@ static PVRSRV_ERROR DestroyDCSwapChain(IMG_HANDLE hDevice,
        {
                return (PVRSRV_ERROR_INVALID_PARAMS);
        }
-       
+
        psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
        psSwapChain = (MRSTLFB_SWAPCHAIN*)hSwapChain;
 
@@ -842,19 +840,19 @@ static PVRSRV_ERROR DestroyDCSwapChain(IMG_HANDLE hDevice,
 
        psDevInfo->ui32SwapChainNum--;
 
-       if(psDevInfo->ui32SwapChainNum == 0) 
+       if(psDevInfo->ui32SwapChainNum == 0)
        {
                MRSTLFBDisableVSyncInterrupt(psDevInfo);
        }
 
        psDevInfo->apsSwapChains[ psSwapChain->ui32SwapChainID -1] = NULL;
 
-       
+
        FlushInternalVSyncQueue(psSwapChain, psDevInfo->ui32SwapChainNum == 0);
 
        if (psDevInfo->ui32SwapChainNum == 0)
        {
-               
+
                DRMLFBFlipBuffer(psDevInfo, NULL, &psDevInfo->sSystemBuffer);
                MRSTLFBClearSavedFlip(psDevInfo);
        }
@@ -892,8 +890,8 @@ static PVRSRV_ERROR SetDCDstRect(IMG_HANDLE hDevice,
        UNREFERENCED_PARAMETER(hSwapChain);
        UNREFERENCED_PARAMETER(psRect);
 
-       
-       
+
+
        return (PVRSRV_ERROR_NOT_SUPPORTED);
 }
 
@@ -905,7 +903,7 @@ static PVRSRV_ERROR SetDCSrcRect(IMG_HANDLE hDevice,
        UNREFERENCED_PARAMETER(hSwapChain);
        UNREFERENCED_PARAMETER(psRect);
 
-       
+
 
        return (PVRSRV_ERROR_NOT_SUPPORTED);
 }
@@ -918,7 +916,7 @@ static PVRSRV_ERROR SetDCDstColourKey(IMG_HANDLE hDevice,
        UNREFERENCED_PARAMETER(hSwapChain);
        UNREFERENCED_PARAMETER(ui32CKColour);
 
-       
+
 
        return (PVRSRV_ERROR_NOT_SUPPORTED);
 }
@@ -931,7 +929,7 @@ static PVRSRV_ERROR SetDCSrcColourKey(IMG_HANDLE hDevice,
        UNREFERENCED_PARAMETER(hSwapChain);
        UNREFERENCED_PARAMETER(ui32CKColour);
 
-       
+
 
        return (PVRSRV_ERROR_NOT_SUPPORTED);
 }
@@ -944,28 +942,28 @@ static PVRSRV_ERROR GetDCBuffers(IMG_HANDLE hDevice,
        MRSTLFB_DEVINFO   *psDevInfo;
        MRSTLFB_SWAPCHAIN *psSwapChain;
        unsigned long      i;
-       
-       
-       if(!hDevice 
+
+
+       if(!hDevice
        || !hSwapChain
        || !pui32BufferCount
        || !phBuffer)
        {
                return (PVRSRV_ERROR_INVALID_PARAMS);
        }
-       
+
        psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
        psSwapChain = (MRSTLFB_SWAPCHAIN*)hSwapChain;
-       
-       
+
+
        *pui32BufferCount = (IMG_UINT32)psSwapChain->ulBufferCount;
-       
-       
+
+
        for (i = 0; i < psSwapChain->ulBufferCount; i++)
        {
                phBuffer[i] = (IMG_HANDLE)psSwapChain->ppsBuffer[i];
        }
-       
+
        return (PVRSRV_OK);
 }
 
@@ -1004,8 +1002,8 @@ static PVRSRV_ERROR SwapToDCBuffer(IMG_HANDLE hDevice,
        UNREFERENCED_PARAMETER(ui32SwapInterval);
        UNREFERENCED_PARAMETER(hPrivateTag);
        UNREFERENCED_PARAMETER(psClipRect);
-       
-       if(!hDevice 
+
+       if(!hDevice
        || !hBuffer
        || (ui32ClipRectCount != 0))
        {
@@ -1014,7 +1012,7 @@ static PVRSRV_ERROR SwapToDCBuffer(IMG_HANDLE hDevice,
 
        psDevInfo = (MRSTLFB_DEVINFO*)hDevice;
 
-       
+
        return (PVRSRV_OK);
 }
 
@@ -1026,7 +1024,7 @@ static PVRSRV_ERROR SwapToDCSystem(IMG_HANDLE hDevice,
                return (PVRSRV_ERROR_INVALID_PARAMS);
        }
 
-       
+
        return (PVRSRV_OK);
 }
 
@@ -1039,42 +1037,53 @@ static MRST_BOOL MRSTLFBVSyncIHandler(MRSTLFB_DEVINFO *psDevInfo, int iPipe)
        MRSTLFB_SWAPCHAIN *psSwapChain;
 
        spin_lock_irqsave(&psDevInfo->sSwapChainLock, ulLockFlags);
-       
+
+
        psSwapChain = psDevInfo->psCurrentSwapChain;
        if (psSwapChain == NULL)
                goto ExitUnlock;
-       
-       if (psDevInfo->bFlushCommands || psDevInfo->bSuspended ||
-               psDevInfo->bLeaveVT)
+
+       if (psDevInfo->bFlushCommands || psDevInfo->bSuspended || psDevInfo->bLeaveVT)
                goto ExitUnlock;
 
        psFlipItem = &psSwapChain->psVSyncFlips[psSwapChain->ulRemoveIndex];
        ulMaxIndex = psSwapChain->ulSwapChainLength - 1;
 
-       while (psFlipItem->bValid) {
-               if (psFlipItem->bFlipped) {
-                       if (!psFlipItem->bCmdCompleted) {
+       while(psFlipItem->bValid)
+       {
+               if(psFlipItem->bFlipped)
+               {
+                       if(!psFlipItem->bCmdCompleted)
+                       {
                                MRST_BOOL bScheduleMISR;
+
                                bScheduleMISR = MRST_TRUE;
                                psSwapChain->psPVRJTable->pfnPVRSRVCmdComplete((IMG_HANDLE)psFlipItem->hCmdComplete, bScheduleMISR);
                                psFlipItem->bCmdCompleted = MRST_TRUE;
                        }
-                       
+
                        psFlipItem->ulSwapInterval--;
-                       
-                       if (psFlipItem->ulSwapInterval == 0) {
+
+                       if(psFlipItem->ulSwapInterval == 0)
+                       {
                                psSwapChain->ulRemoveIndex++;
 
                                if(psSwapChain->ulRemoveIndex > ulMaxIndex)
                                        psSwapChain->ulRemoveIndex = 0;
-                               
+
                                psFlipItem->bCmdCompleted = MRST_FALSE;
                                psFlipItem->bFlipped = MRST_FALSE;
-                               
+
                                psFlipItem->bValid = MRST_FALSE;
-                       } else
+                       }
+                       else
+                       {
+
                                break;
-               } else {
+                       }
+               }
+               else
+               {
                        if (psFlipItem->psBuffer)
                                DRMLFBFlipBuffer(psDevInfo, psSwapChain,
                                                psFlipItem->psBuffer);
@@ -1082,9 +1091,12 @@ static MRST_BOOL MRSTLFBVSyncIHandler(MRSTLFB_DEVINFO *psDevInfo, int iPipe)
                                DRMLFBFlipBuffer2(psDevInfo, psSwapChain,
                                                &psFlipItem->sPlaneContexts);
                        psFlipItem->bFlipped = MRST_TRUE;
+
+
                        break;
                }
-               
+
+
                psFlipItem = &psSwapChain->psVSyncFlips[psSwapChain->ulRemoveIndex];
        }
 
@@ -1100,7 +1112,7 @@ ExitUnlock:
 static int
 MRSTLFBVSyncISR(struct drm_device *psDrmDevice, int iPipe)
 {
-       MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();    
+       MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();
 
        return MRSTLFBVSyncIHandler(psDevInfo, iPipe);
 }
@@ -1229,15 +1241,17 @@ static IMG_BOOL ProcessFlip(IMG_HANDLE  hCmdCookie,
        unsigned long irqflags;
        struct drm_device *dev;
        struct drm_psb_private *dev_priv;
-       
+
        if(!hCmdCookie || !pvData)
                return IMG_FALSE;
 
+
        psFlipCmd = (DISPLAYCLASS_FLIP_COMMAND*)pvData;
 
        if (psFlipCmd == IMG_NULL)
                return IMG_FALSE;
 
+
        psDevInfo = (MRSTLFB_DEVINFO*)psFlipCmd->hExtDevice;
        dev = psDevInfo->psDrmDevice;
        dev_priv = (struct drm_psb_private *)
@@ -1251,14 +1265,14 @@ static IMG_BOOL ProcessFlip(IMG_HANDLE  hCmdCookie,
        spin_lock_irqsave(&psDevInfo->sSwapChainLock, ulLockFlags);
 
 #if defined(MRST_USING_INTERRUPTS)
-       
+
     if(!drm_psb_3D_vblank || psFlipCmd->ui32SwapInterval == 0 || psDevInfo->bFlushCommands)
        {
 #endif
                DRMLFBFlipBuffer(psDevInfo, psSwapChain, psBuffer);
 
-               
-       
+
+
                psSwapChain->psPVRJTable->pfnPVRSRVCmdComplete(hCmdCookie, IMG_TRUE);
 
 #if defined(MRST_USING_INTERRUPTS)
@@ -1289,10 +1303,10 @@ static IMG_BOOL ProcessFlip(IMG_HANDLE  hCmdCookie,
        if(psFlipItem->bValid == MRST_FALSE)
        {
                unsigned long ulMaxIndex = psSwapChain->ulSwapChainLength - 1;
-               
+
                if(psSwapChain->ulInsertIndex == psSwapChain->ulRemoveIndex)
                {
-                       
+
                        DRMLFBFlipBuffer(psDevInfo, psSwapChain, psBuffer);
 
                        psFlipItem->bFlipped = MRST_TRUE;
@@ -1315,7 +1329,7 @@ static IMG_BOOL ProcessFlip(IMG_HANDLE  hCmdCookie,
 
                goto ExitTrueUnlock;
        }
-       
+
        spin_unlock_irqrestore(&psDevInfo->sSwapChainLock, ulLockFlags);
        return IMG_FALSE;
 
@@ -1409,42 +1423,42 @@ int MRSTLFBHandleChangeFB(struct drm_device* dev, struct psb_framebuffer *psbfb)
        int i;
        struct drm_psb_private * dev_priv;
        struct psb_gtt * pg;
-       
+
        if( !psDevInfo->sSystemBuffer.bIsContiguous )
                MRSTLFBFreeKernelMem( psDevInfo->sSystemBuffer.uSysAddr.psNonCont );
-       
+
        dev_priv = (struct drm_psb_private *)dev->dev_private;
        pg = dev_priv->pg;
-       
+
        psDevInfo->sDisplayDim.ui32ByteStride = psbfb->base.pitch;
        psDevInfo->sDisplayDim.ui32Width = psbfb->base.width;
        psDevInfo->sDisplayDim.ui32Height = psbfb->base.height;
 
        psDevInfo->sSystemBuffer.ui32BufferSize = psbfb->size;
-       
+
        psDevInfo->sSystemBuffer.sCPUVAddr = pg->vram_addr;
-       
+
        psDevInfo->sSystemBuffer.sDevVAddr.uiAddr = 0;
-       psDevInfo->sSystemBuffer.bIsAllocated = IMG_FALSE;      
+       psDevInfo->sSystemBuffer.bIsAllocated = IMG_FALSE;
 
-       if(psbfb->bo ) 
+       if(psbfb->bo )
        {
-               
+
                psDevInfo->sSystemBuffer.bIsContiguous = IMG_FALSE;
-               psDevInfo->sSystemBuffer.uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * psbfb->bo->ttm->num_pages);    
-               for(i = 0;i < psbfb->bo->ttm->num_pages;++i) 
+               psDevInfo->sSystemBuffer.uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * psbfb->bo->ttm->num_pages);
+               for(i = 0;i < psbfb->bo->ttm->num_pages;++i)
                {
                        struct page *p = ttm_tt_get_page( psbfb->bo->ttm, i);
-                       psDevInfo->sSystemBuffer.uSysAddr.psNonCont[i].uiAddr = page_to_pfn(p) << PAGE_SHIFT;   
-                       
+                       psDevInfo->sSystemBuffer.uSysAddr.psNonCont[i].uiAddr = page_to_pfn(p) << PAGE_SHIFT;
+
                }
-       } 
-       else 
+       }
+       else
        {
-               
-               
-               
-               
+
+
+
+
 
                psDevInfo->sSystemBuffer.bIsContiguous = IMG_TRUE;
                psDevInfo->sSystemBuffer.uSysAddr.sCont.uiAddr = pg->stolen_base;
@@ -1459,11 +1473,11 @@ int MRSTLFBHandleChangeFB(struct drm_device* dev, struct psb_framebuffer *psbfb)
        MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();
        int i;
 
-       
+
        if( !psDevInfo->sSystemBuffer.bIsContiguous )
                MRSTLFBFreeKernelMem( psDevInfo->sSystemBuffer.uSysAddr.psNonCont );
 
-       
+
        psDevInfo->sDisplayDim.ui32ByteStride = psbfb->base.pitch;
        psDevInfo->sDisplayDim.ui32Width = psbfb->base.width;
        psDevInfo->sDisplayDim.ui32Height = psbfb->base.height;
@@ -1471,26 +1485,26 @@ int MRSTLFBHandleChangeFB(struct drm_device* dev, struct psb_framebuffer *psbfb)
        psDevInfo->sSystemBuffer.ui32BufferSize = psbfb->buf.size;
        psDevInfo->sSystemBuffer.sCPUVAddr = psbfb->buf.kMapping;
        psDevInfo->sSystemBuffer.sDevVAddr.uiAddr = psbfb->buf.offsetGTT;
-       psDevInfo->sSystemBuffer.bIsAllocated = MRST_FALSE;     
+       psDevInfo->sSystemBuffer.bIsAllocated = MRST_FALSE;
 
        if ( psbfb->buf.type == PSB_BUFFER_VRAM )
        {
-               
-               struct drm_device * psDrmDevice = psDevInfo->psDrmDevice;       
+
+               struct drm_device * psDrmDevice = psDevInfo->psDrmDevice;
                struct drm_psb_private * dev_priv = (struct drm_psb_private *)psDrmDevice->dev_private;
                struct psb_gtt * pg = dev_priv->pg;
 
                psDevInfo->sSystemBuffer.bIsContiguous = MRST_TRUE;
                psDevInfo->sSystemBuffer.uSysAddr.sCont.uiAddr = pg->stolen_base;
        } else {
-               
+
                psDevInfo->sSystemBuffer.bIsContiguous = MRST_FALSE;
-               psDevInfo->sSystemBuffer.uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * (psbfb->buf.pagesNum));        
-               for (i = 0; i < psbfb->buf.pagesNum; i++) 
+               psDevInfo->sSystemBuffer.uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * (psbfb->buf.pagesNum));
+               for (i = 0; i < psbfb->buf.pagesNum; i++)
                {
-                       psDevInfo->sSystemBuffer.uSysAddr.psNonCont[i].uiAddr = psbfb_get_buffer_pfn( psDevInfo->psDrmDevice, &psbfb->buf, i) << PAGE_SHIFT;   
+                       psDevInfo->sSystemBuffer.uSysAddr.psNonCont[i].uiAddr = psbfb_get_buffer_pfn( psDevInfo->psDrmDevice, &psbfb->buf, i) << PAGE_SHIFT;
                }
-       } 
+       }
 
        return 0;
 }
@@ -1596,28 +1610,28 @@ MRST_ERROR MRSTLFBChangeSwapChainProperty(unsigned long *psSwapChainGTTOffset,
        return eError;
 }
 
-static int MRSTLFBFindMainPipe(struct drm_device *dev)  
+static int MRSTLFBFindMainPipe(struct drm_device *dev)
 {
        struct drm_crtc *crtc;
 
-       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)  
+       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
        {
-               if ( drm_helper_crtc_in_use(crtc) ) 
+               if ( drm_helper_crtc_in_use(crtc) )
                {
                        struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
                        return psb_intel_crtc->pipe;
                }
-       }       
-       
+       }
+
        return 0;
 }
 
 #ifndef DRM_PVR_USE_INTEL_FB
-static int DRMLFBLeaveVTHandler(struct drm_device *dev)  
+static int DRMLFBLeaveVTHandler(struct drm_device *dev)
 {
        MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();
        unsigned long ulLockFlags;
+
        spin_lock_irqsave(&psDevInfo->sSwapChainLock, ulLockFlags);
 
        if (!psDevInfo->bLeaveVT)
@@ -1638,7 +1652,7 @@ static int DRMLFBLeaveVTHandler(struct drm_device *dev)
        return 0;
 }
 
-static int DRMLFBEnterVTHandler(struct drm_device *dev)  
+static int DRMLFBEnterVTHandler(struct drm_device *dev)
 {
        MRSTLFB_DEVINFO *psDevInfo = GetAnchorPtr();
        unsigned long ulLockFlags;
@@ -1701,7 +1715,7 @@ static MRST_ERROR InitDev(MRSTLFB_DEVINFO *psDevInfo)
 #endif
        struct drm_framebuffer * psDrmFB;
        struct psb_framebuffer *psbfb;
-       
+
 
        int hdisplay;
        int vdisplay;
@@ -1711,8 +1725,8 @@ static MRST_ERROR InitDev(MRSTLFB_DEVINFO *psDevInfo)
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
        psDrmFB = psPsbFBDev->psb_fb_helper.fb;
 #else
-       psDrmFB = list_first_entry(&psDrmDevice->mode_config.fb_kernel_list, 
-                                  struct drm_framebuffer, 
+       psDrmFB = list_first_entry(&psDrmDevice->mode_config.fb_kernel_list,
+                                  struct drm_framebuffer,
                                   filp_head);
 #endif
        if(!psDrmFB) {
@@ -1728,20 +1742,20 @@ static MRST_ERROR InitDev(MRSTLFB_DEVINFO *psDevInfo)
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
        psLINFBInfo = (struct fb_info*)psPsbFBDev->psb_fb_helper.fbdev;
 #else
-       psLINFBInfo = (struct fb_info*)psDrmFB->fbdev;  
+       psLINFBInfo = (struct fb_info*)psDrmFB->fbdev;
 #endif
 
 #if defined(PVR_MRST_FB_SET_PAR_ON_INIT)
        MRSTFBSetPar(psLINFBInfo);
 #endif
 
-       
+
        psDevInfo->sSystemBuffer.bIsContiguous = MRST_TRUE;
        psDevInfo->sSystemBuffer.bIsAllocated = MRST_FALSE;
 
        MRSTLFBHandleChangeFB(psDrmDevice, psbfb);
 
-       switch( psDrmFB->depth ) 
+       switch( psDrmFB->depth )
        {
        case 32:
        case 24:
@@ -1753,24 +1767,24 @@ static MRST_ERROR InitDev(MRSTLFB_DEVINFO *psDevInfo)
                {
                        psDevInfo->sDisplayFormat.pixelformat = PVRSRV_PIXEL_FORMAT_RGB565;
                        break;
-               }       
+               }
        default:
-               {                       
+               {
                        printk(KERN_ERR"%s: Unknown bit depth %d\n",__FUNCTION__,psDrmFB->depth);
                }
        }
        psDevInfo->psLINFBInfo = psLINFBInfo;
 
        psDevInfo->ui32MainPipe = MRSTLFBFindMainPipe(psDevInfo->psDrmDevice);
-       
-       for(i = 0;i < MAX_SWAPCHAINS;++i) 
+
+       for(i = 0;i < MAX_SWAPCHAINS;++i)
        {
                psDevInfo->apsSwapChains[i] = NULL;
        }
 
-       
-       
-       
+
+
+
        psDevInfo->pvRegs = psbfb_vdc_reg(psDevInfo->psDrmDevice);
 
        if (psDevInfo->pvRegs == NULL)
@@ -1792,12 +1806,12 @@ MRST_ERROR MRSTLFBInit(struct drm_device * dev)
 #endif
 
        psDevInfo = GetAnchorPtr();
-       
+
        if (psDevInfo == NULL)
        {
                PFN_CMD_PROC                    pfnCmdProcList[MRSTLFB_COMMAND_COUNT];
                IMG_UINT32                              aui32SyncCountList[MRSTLFB_COMMAND_COUNT][2];
-               
+
                psDevInfo = (MRSTLFB_DEVINFO *)MRSTLFBAllocKernelMem(sizeof(MRSTLFB_DEVINFO));
 
                if(!psDevInfo)
@@ -1805,10 +1819,10 @@ MRST_ERROR MRSTLFBInit(struct drm_device * dev)
                        return (MRST_ERROR_OUT_OF_MEMORY);
                }
 
-               
+
                memset(psDevInfo, 0, sizeof(MRSTLFB_DEVINFO));
 
-               
+
                SetAnchorPtr((void*)psDevInfo);
 
                psDevInfo->psDrmDevice = dev;
@@ -1827,13 +1841,13 @@ MRST_ERROR MRSTLFBInit(struct drm_device * dev)
                        return (MRST_ERROR_INIT_FAILURE);
                }
 
-               
+
                if(!(*pfnGetPVRJTable)(&psDevInfo->sPVRJTable))
                {
                        return (MRST_ERROR_INIT_FAILURE);
                }
 
-                               
+
                spin_lock_init(&psDevInfo->sSwapChainLock);
 
                psDevInfo->psCurrentSwapChain = NULL;
@@ -1846,16 +1860,16 @@ MRST_ERROR MRSTLFBInit(struct drm_device * dev)
 
                strncpy(psDevInfo->sDisplayInfo.szDisplayName, DISPLAY_DEVICE_NAME, MAX_DISPLAY_NAME_SIZE);
 
-               
-       
+
+
 
                DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX
                        ": Maximum number of swap chain buffers: %u\n",
                        psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers));
 
-               
 
-               
+
+
 
                psDevInfo->sDCJTable.ui32TableSize = sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE);
                psDevInfo->sDCJTable.pfnOpenDCDevice = OpenDCDevice;
@@ -1877,7 +1891,7 @@ MRST_ERROR MRSTLFBInit(struct drm_device * dev)
                psDevInfo->sDCJTable.pfnSetDCState = SetDCState;
                psDevInfo->sDCJTable.pfnGetDCFrontBuffer = GetDCFrontBuffer;
 
-               
+
                if(psDevInfo->sPVRJTable.pfnPVRSRVRegisterDCDevice (
                        &psDevInfo->sDCJTable,
                        &psDevInfo->uiDeviceID ) != PVRSRV_OK)
@@ -1887,18 +1901,18 @@ MRST_ERROR MRSTLFBInit(struct drm_device * dev)
 
                printk("Device ID: %d\n", (int)psDevInfo->uiDeviceID);
 
-               
 
 
 
-               
+
+
 
 
 
 
 
 #if defined (MRST_USING_INTERRUPTS)
-       
+
        if(MRSTLFBInstallVSyncISR(psDevInfo,MRSTLFBVSyncISR) != MRST_OK)
        {
                DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX   "ISR Installation failed\n"));
@@ -1906,14 +1920,14 @@ MRST_ERROR MRSTLFBInit(struct drm_device * dev)
        }
 #endif
 
-       
+
        pfnCmdProcList[DC_FLIP_COMMAND] = ProcessFlip;
-       
-       
-       aui32SyncCountList[DC_FLIP_COMMAND][0] = 0; 
-       aui32SyncCountList[DC_FLIP_COMMAND][1] = 2; 
-       
-       
+
+
+       aui32SyncCountList[DC_FLIP_COMMAND][0] = 0;
+       aui32SyncCountList[DC_FLIP_COMMAND][1] = 2;
+
+
 
 
 
@@ -1929,19 +1943,19 @@ MRST_ERROR MRSTLFBInit(struct drm_device * dev)
 
        }
 
-       
+
 #ifndef DRM_PVR_USE_INTEL_FB
-       psDrmPriv->psb_change_fb_handler = MRSTLFBHandleChangeFB;       
+       psDrmPriv->psb_change_fb_handler = MRSTLFBHandleChangeFB;
 
        psDrmPriv->psb_leave_vt_handler = DRMLFBLeaveVTHandler;
        psDrmPriv->psb_enter_vt_handler = DRMLFBEnterVTHandler;
 #endif
     MRSTLFBInstallScreenEvents(psDevInfo, MRSTLFBScreenEventHandler);
-       
+
        psDevInfo->ulRefCount++;
 
-       
-       return (MRST_OK);       
+
+       return (MRST_OK);
 }
 
 MRST_ERROR MRSTLFBDeinit(void)
@@ -1951,18 +1965,18 @@ MRST_ERROR MRSTLFBDeinit(void)
        psDevFirst = GetAnchorPtr();
        psDevInfo = psDevFirst;
 
-       
+
        if (psDevInfo == NULL)
        {
                return (MRST_ERROR_GENERIC);
        }
 
-       
+
        psDevInfo->ulRefCount--;
 
        if (psDevInfo->ulRefCount == 0)
        {
-               
+
                PVRSRV_DC_DISP2SRV_KMJTABLE     *psJTable = &psDevInfo->sPVRJTable;
 
                if (psDevInfo->sPVRJTable.pfnPVRSRVRemoveCmdProcList (psDevInfo->uiDeviceID, MRSTLFB_COMMAND_COUNT) != PVRSRV_OK)
@@ -1971,27 +1985,27 @@ MRST_ERROR MRSTLFBDeinit(void)
                }
 
 #if defined (MRST_USING_INTERRUPTS)
-               
+
                if(MRSTLFBUninstallVSyncISR(psDevInfo) != MRST_OK)
                {
                        return (MRST_ERROR_GENERIC);
                }
 #endif
 
-               
+
                if (psJTable->pfnPVRSRVRemoveDCDevice(psDevInfo->uiDeviceID) != PVRSRV_OK)
                {
                        return (MRST_ERROR_GENERIC);
                }
-               
-               
+
+
                MRSTLFBFreeKernelMem(psDevInfo);
        }
-       
-       
+
+
        SetAnchorPtr(NULL);
 
-       
+
        return (MRST_OK);
 }
 
@@ -2005,37 +2019,37 @@ MRST_ERROR MRSTLFBAllocBuffer(struct MRSTLFB_DEVINFO_TAG *psDevInfo, IMG_UINT32
        int i;
 
        pvBuf = __vmalloc( ui32Size, GFP_KERNEL | __GFP_HIGHMEM, __pgprot((pgprot_val(PAGE_KERNEL ) & ~_PAGE_CACHE_MASK) | _PAGE_CACHE_WC) );
-       if( pvBuf == NULL ) 
+       if( pvBuf == NULL )
        {
                return MRST_ERROR_OUT_OF_MEMORY;
        }
 
        ulPagesNumber = (ui32Size + PAGE_SIZE -1) / PAGE_SIZE;
 
-       *ppBuffer = MRSTLFBAllocKernelMem( sizeof( MRSTLFB_BUFFER ) );  
+       *ppBuffer = MRSTLFBAllocKernelMem( sizeof( MRSTLFB_BUFFER ) );
        (*ppBuffer)->sCPUVAddr = pvBuf;
        (*ppBuffer)->ui32BufferSize = ui32Size;
-       (*ppBuffer)->uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * ulPagesNumber);    
+       (*ppBuffer)->uSysAddr.psNonCont = MRSTLFBAllocKernelMem( sizeof( IMG_SYS_PHYADDR ) * ulPagesNumber);
        (*ppBuffer)->bIsAllocated = MRST_TRUE;
        (*ppBuffer)->bIsContiguous = MRST_FALSE;
        (*ppBuffer)->ui32OwnerTaskID = task_tgid_nr(current);
 
        i = 0;
-       for (ulCounter = 0; ulCounter < ui32Size; ulCounter += PAGE_SIZE) 
+       for (ulCounter = 0; ulCounter < ui32Size; ulCounter += PAGE_SIZE)
        {
                (*ppBuffer)->uSysAddr.psNonCont[i++].uiAddr = vmalloc_to_pfn( pvBuf + ulCounter ) << PAGE_SHIFT;
        }
-       
-       psb_gtt_map_pvr_memory( psDevInfo->psDrmDevice, 
-                                                       (unsigned int)*ppBuffer, 
+
+       psb_gtt_map_pvr_memory( psDevInfo->psDrmDevice,
+                                                       (unsigned int)*ppBuffer,
                                                        (*ppBuffer)->ui32OwnerTaskID,
-                                                       (IMG_CPU_PHYADDR*) (*ppBuffer)->uSysAddr.psNonCont, 
+                                                       (IMG_CPU_PHYADDR*) (*ppBuffer)->uSysAddr.psNonCont,
                                                        ulPagesNumber,
                                                        &(*ppBuffer)->sDevVAddr.uiAddr );
 
        (*ppBuffer)->sDevVAddr.uiAddr <<= PAGE_SHIFT;
 
-       return MRST_OK; 
+       return MRST_OK;
 }
 
 MRST_ERROR MRSTLFBFreeBuffer(struct MRSTLFB_DEVINFO_TAG *psDevInfo, MRSTLFB_BUFFER **ppBuffer)
@@ -2043,10 +2057,10 @@ MRST_ERROR MRSTLFBFreeBuffer(struct MRSTLFB_DEVINFO_TAG *psDevInfo, MRSTLFB_BUFF
        if( !(*ppBuffer)->bIsAllocated )
                return MRST_ERROR_INVALID_PARAMS;
 
-#ifndef DRM_PVR_USE_INTEL_FB   
-       psb_gtt_unmap_memory( psDevInfo->psDrmDevice, 
+#ifndef DRM_PVR_USE_INTEL_FB
+       psb_gtt_unmap_memory( psDevInfo->psDrmDevice,
 #else
-       psb_gtt_unmap_pvr_memory( psDevInfo->psDrmDevice, 
+       psb_gtt_unmap_pvr_memory( psDevInfo->psDrmDevice,
 #endif
                                                          (unsigned int)*ppBuffer,
                                                          (*ppBuffer)->ui32OwnerTaskID);
@@ -2054,12 +2068,12 @@ MRST_ERROR MRSTLFBFreeBuffer(struct MRSTLFB_DEVINFO_TAG *psDevInfo, MRSTLFB_BUFF
        vfree( (*ppBuffer)->sCPUVAddr );
 
        MRSTLFBFreeKernelMem( (*ppBuffer)->uSysAddr.psNonCont );
-       
+
        MRSTLFBFreeKernelMem( *ppBuffer);
 
        *ppBuffer = NULL;
 
-       return MRST_OK; 
+       return MRST_OK;
 }
 
 
old mode 100755 (executable)
new mode 100644 (file)
index 609c12a..aacee79
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 /*
@@ -83,7 +83,7 @@ MRST_ERROR MRSTLFBGetLibFuncAddr (char *szFunctionName, PFN_DC_GET_PVRJTABLE *pp
                return (MRST_ERROR_INVALID_PARAMS);
        }
 
-       
+
        *ppfnFuncTable = PVRGetDisplayClassJTable;
 
        return (MRST_OK);
@@ -99,7 +99,7 @@ static void MRSTLFBVSyncWriteReg(MRSTLFB_DEVINFO *psDevInfo, unsigned long ulOff
 
 void MRSTLFBEnableVSyncInterrupt(MRSTLFB_DEVINFO * psDevinfo)
 {
-#if defined(MRST_USING_INTERRUPTS)     
+#if defined(MRST_USING_INTERRUPTS)
        if( drm_vblank_get( psDevinfo->psDrmDevice , psDevinfo->ui32MainPipe ) )
        {
                DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX   "Couldn't get vsync enabled"));
@@ -109,8 +109,8 @@ void MRSTLFBEnableVSyncInterrupt(MRSTLFB_DEVINFO * psDevinfo)
 
 void MRSTLFBDisableVSyncInterrupt(MRSTLFB_DEVINFO * psDevinfo)
 {
-#if defined(MRST_USING_INTERRUPTS)     
-       drm_vblank_put( psDevinfo->psDrmDevice,  psDevinfo->ui32MainPipe );    
+#if defined(MRST_USING_INTERRUPTS)
+       drm_vblank_put( psDevinfo->psDrmDevice,  psDevinfo->ui32MainPipe );
 #endif
 }
 
@@ -131,7 +131,7 @@ MRST_ERROR MRSTLFBUninstallVSyncISR(MRSTLFB_DEVINFO *psDevInfo)
        dev_priv->psb_vsync_handler = NULL;
        return (MRST_OK);
 }
-#endif 
+#endif
 
 
 void MRSTLFBFlipToSurface(MRSTLFB_DEVINFO *psDevInfo,  unsigned long uiAddr)
@@ -144,7 +144,7 @@ void MRSTLFBFlipToSurface(MRSTLFB_DEVINFO *psDevInfo,  unsigned long uiAddr)
     MRSTLFB_SWAPCHAIN *psCurrentSwapChain = psDevInfo->psCurrentSwapChain;
 
     if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false))
-    {   
+    {
         if (IS_MRST(dev)) {
             MRSTLFBVSyncWriteReg(psDevInfo, dspsurf, uiAddr);
         } else if (IS_MDFLD(dev)) {
@@ -183,9 +183,9 @@ void MRSTLFBFlipToSurface(MRSTLFB_DEVINFO *psDevInfo,  unsigned long uiAddr)
                }
         } else {
             MRSTLFBVSyncWriteReg(psDevInfo, dspbase, uiAddr);
-        }   
+        }
         ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
-    }   
+    }
 }
 
 void MRSTLFBSavePlaneConfig(MRSTLFB_DEVINFO *psDevInfo)
@@ -274,7 +274,7 @@ int PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Init)(struct drm_device unref__ *dev)
 }
 
 void PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Cleanup)(struct drm_device unref__ *dev)
-{    
+{
        if(MRSTLFBDeinit() != MRST_OK)
        {
                printk(KERN_WARNING DRIVER_PREFIX ": %s: can't deinit device\n", __FUNCTION__);
old mode 100755 (executable)
new mode 100644 (file)
index 11e8e12..0538d2f
@@ -1,26 +1,26 @@
 #
 # Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
-# 
+#
 # This program is free software; you can redistribute it and/or modify it
 # under the terms and conditions of the GNU General Public License,
 # version 2, as published by the Free Software Foundation.
-# 
-# This program is distributed in the hope it will be useful but, except 
-# as otherwise stated in writing, without any warranty; without even the 
-# implied warranty of merchantability or fitness for a particular purpose. 
+#
+# This program is distributed in the hope it will be useful but, except
+# as otherwise stated in writing, without any warranty; without even the
+# implied warranty of merchantability or fitness for a particular purpose.
 # See the GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License along with
 # this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-# 
+#
 # The full GNU General Public License is included in this distribution in
 # the file called "COPYING".
 #
 # Contact Information:
 # Imagination Technologies Ltd. <gpl-support@imgtec.com>
-# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
-# 
+# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+#
 #
 #
 
@@ -230,7 +230,7 @@ EXT_SOURCE_LIST += \
        imgv/psb_ttm_glue.medfield.c \
        imgv/psb_ttm_fence.medfield.c \
        imgv/psb_ttm_fence_user.medfield.c \
-       imgv/psb_ttm_placement_user.medfield.c 
+       imgv/psb_ttm_placement_user.medfield.c
 
 EXT_SOURCE_LIST += \
        ttm/ttm_agp_backend.c \
old mode 100755 (executable)
new mode 100644 (file)
index a7e9060..0253e39
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #if defined(SUPPORT_DRI_DRM)
 
 #if defined(SUPPORT_DRI_DRM_EXT)
-#define PVR_DRM_SRVKM_CMD      DRM_PVR_RESERVED1       
-#define        PVR_DRM_DISP_CMD        DRM_PVR_RESERVED2       
-#define        PVR_DRM_BC_CMD          DRM_PVR_RESERVED3       
-#define PVR_DRM_IS_MASTER_CMD  DRM_PVR_RESERVED4       
-#define PVR_DRM_UNPRIV_CMD     DRM_PVR_RESERVED5       
-#define PVR_DRM_DBGDRV_CMD     DRM_PVR_RESERVED6       
-#else  
-#define PVR_DRM_SRVKM_CMD      0       
-#define        PVR_DRM_DISP_CMD        1       
-#define        PVR_DRM_BC_CMD          2       
-#define PVR_DRM_IS_MASTER_CMD  3       
-#define PVR_DRM_UNPRIV_CMD     4       
-#define PVR_DRM_DBGDRV_CMD     5       
-#endif 
-
-#define        PVR_DRM_UNPRIV_INIT_SUCCESFUL   0 
+#define PVR_DRM_SRVKM_CMD      DRM_PVR_RESERVED1
+#define        PVR_DRM_DISP_CMD        DRM_PVR_RESERVED2
+#define        PVR_DRM_BC_CMD          DRM_PVR_RESERVED3
+#define PVR_DRM_IS_MASTER_CMD  DRM_PVR_RESERVED4
+#define PVR_DRM_UNPRIV_CMD     DRM_PVR_RESERVED5
+#define PVR_DRM_DBGDRV_CMD     DRM_PVR_RESERVED6
+#else
+#define PVR_DRM_SRVKM_CMD      0
+#define        PVR_DRM_DISP_CMD        1
+#define        PVR_DRM_BC_CMD          2
+#define PVR_DRM_IS_MASTER_CMD  3
+#define PVR_DRM_UNPRIV_CMD     4
+#define PVR_DRM_DBGDRV_CMD     5
+#endif
+
+#define        PVR_DRM_UNPRIV_INIT_SUCCESFUL   0
 
 #endif
 
-#endif 
+#endif
 
 
old mode 100755 (executable)
new mode 100644 (file)
index 4cd36d2..78fb3c6
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -50,7 +50,7 @@ typedef struct PVRSRV_BC_SRV2BUFFER_KMJTABLE_TAG
 
 typedef PVRSRV_ERROR (*PFN_BC_REGISTER_BUFFER_DEV)(PVRSRV_BC_SRV2BUFFER_KMJTABLE*, IMG_UINT32*);
 typedef IMG_VOID (*PFN_BC_SCHEDULE_DEVICES)(IMG_VOID);
-typedef PVRSRV_ERROR (*PFN_BC_REMOVE_BUFFER_DEV)(IMG_UINT32);  
+typedef PVRSRV_ERROR (*PFN_BC_REMOVE_BUFFER_DEV)(IMG_UINT32);
 
 typedef struct PVRSRV_BC_BUFFER2SRV_KMJTABLE_TAG
 {
@@ -61,7 +61,7 @@ typedef struct PVRSRV_BC_BUFFER2SRV_KMJTABLE_TAG
 
 } PVRSRV_BC_BUFFER2SRV_KMJTABLE, *PPVRSRV_BC_BUFFER2SRV_KMJTABLE;
 
-typedef IMG_BOOL (*PFN_BC_GET_PVRJTABLE) (PPVRSRV_BC_BUFFER2SRV_KMJTABLE); 
+typedef IMG_BOOL (*PFN_BC_GET_PVRJTABLE) (PPVRSRV_BC_BUFFER2SRV_KMJTABLE);
 
 IMG_IMPORT IMG_BOOL PVRGetBufferClassJTable(PVRSRV_BC_BUFFER2SRV_KMJTABLE *psJTable);
 
old mode 100755 (executable)
new mode 100644 (file)
index a5cc900..67fad0f
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -41,15 +41,15 @@ typedef PVRSRV_ERROR (*PFN_ENUM_DC_DIMS)(IMG_HANDLE,
 typedef PVRSRV_ERROR (*PFN_GET_DC_SYSTEMBUFFER)(IMG_HANDLE, IMG_HANDLE*);
 typedef PVRSRV_ERROR (*PFN_GET_DC_INFO)(IMG_HANDLE, DISPLAY_INFO*);
 typedef PVRSRV_ERROR (*PFN_CREATE_DC_SWAPCHAIN)(IMG_HANDLE,
-                                                                                               IMG_UINT32, 
-                                                                                               DISPLAY_SURF_ATTRIBUTES*, 
+                                                                                               IMG_UINT32,
+                                                                                               DISPLAY_SURF_ATTRIBUTES*,
                                                                                                DISPLAY_SURF_ATTRIBUTES*,
-                                                                                               IMG_UINT32, 
+                                                                                               IMG_UINT32,
                                                                                                PVRSRV_SYNC_DATA**,
                                                                                                IMG_UINT32,
-                                                                                               IMG_HANDLE*, 
+                                                                                               IMG_HANDLE*,
                                                                                                IMG_UINT32*);
-typedef PVRSRV_ERROR (*PFN_DESTROY_DC_SWAPCHAIN)(IMG_HANDLE, 
+typedef PVRSRV_ERROR (*PFN_DESTROY_DC_SWAPCHAIN)(IMG_HANDLE,
                                                                                                 IMG_HANDLE);
 typedef PVRSRV_ERROR (*PFN_SET_DC_DSTRECT)(IMG_HANDLE, IMG_HANDLE, IMG_RECT*);
 typedef PVRSRV_ERROR (*PFN_SET_DC_SRCRECT)(IMG_HANDLE, IMG_HANDLE, IMG_RECT*);
@@ -139,25 +139,25 @@ typedef struct PVRSRV_DC_DISP2SRV_KMJTABLE_TAG
 
 typedef struct DISPLAYCLASS_FLIP_COMMAND_TAG
 {
-       
+
        IMG_HANDLE hExtDevice;
 
-       
+
        IMG_HANDLE hExtSwapChain;
 
-       
+
        IMG_HANDLE hExtBuffer;
 
-       
+
        IMG_HANDLE hPrivateTag;
 
-       
+
        IMG_UINT32 ui32ClipRectCount;
 
-       
+
        IMG_RECT *psClipRect;
 
-       
+
        IMG_UINT32      ui32SwapInterval;
 
 } DISPLAYCLASS_FLIP_COMMAND;
old mode 100755 (executable)
new mode 100644 (file)
index c41a6d4..8f7e5ea
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -33,5 +33,5 @@
 #define PDUMP_FLAGS_CONTINUOUS         0x40000000U
 #define PDUMP_FLAGS_PERSISTENT         0x80000000U
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 149e384..461f63a
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -36,14 +36,14 @@ extern "C" {
 #ifdef __linux__
 
                #include <linux/ioctl.h>
-    
+
     #define PVRSRV_IOC_GID      'g'
     #define PVRSRV_IO(INDEX)    _IO(PVRSRV_IOC_GID, INDEX, PVRSRV_BRIDGE_PACKAGE)
     #define PVRSRV_IOW(INDEX)   _IOW(PVRSRV_IOC_GID, INDEX, PVRSRV_BRIDGE_PACKAGE)
     #define PVRSRV_IOR(INDEX)   _IOR(PVRSRV_IOC_GID, INDEX, PVRSRV_BRIDGE_PACKAGE)
     #define PVRSRV_IOWR(INDEX)  _IOWR(PVRSRV_IOC_GID, INDEX, PVRSRV_BRIDGE_PACKAGE)
 
-#else 
+#else
 
                        #error Unknown platform: Cannot define ioctls
 
@@ -53,26 +53,26 @@ extern "C" {
        #define PVRSRV_IOWR(INDEX)  (PVRSRV_IOC_GID + (INDEX))
 
        #define PVRSRV_BRIDGE_BASE                  PVRSRV_IOC_GID
-#endif 
+#endif
 
 
 #define PVRSRV_BRIDGE_CORE_CMD_FIRST                   0UL
-#define PVRSRV_BRIDGE_ENUM_DEVICES                             PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+0)     
-#define PVRSRV_BRIDGE_ACQUIRE_DEVICEINFO               PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+1)     
-#define PVRSRV_BRIDGE_RELEASE_DEVICEINFO               PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+2)     
-#define PVRSRV_BRIDGE_CREATE_DEVMEMCONTEXT             PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+3)     
-#define PVRSRV_BRIDGE_DESTROY_DEVMEMCONTEXT            PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+4)     
-#define PVRSRV_BRIDGE_GET_DEVMEM_HEAPINFO              PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+5)     
-#define PVRSRV_BRIDGE_ALLOC_DEVICEMEM                  PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+6)     
-#define PVRSRV_BRIDGE_FREE_DEVICEMEM                   PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+7)     
-#define PVRSRV_BRIDGE_GETFREE_DEVICEMEM                        PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+8)     
-#define PVRSRV_BRIDGE_CREATE_COMMANDQUEUE              PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+9)     
-#define PVRSRV_BRIDGE_DESTROY_COMMANDQUEUE             PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+10)    
-#define        PVRSRV_BRIDGE_MHANDLE_TO_MMAP_DATA              PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+11)   
-#define PVRSRV_BRIDGE_CONNECT_SERVICES                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+12)    
-#define PVRSRV_BRIDGE_DISCONNECT_SERVICES              PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+13)    
-#define PVRSRV_BRIDGE_WRAP_DEVICE_MEM                  PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+14)    
-#define PVRSRV_BRIDGE_GET_DEVICEMEMINFO                        PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+15)    
+#define PVRSRV_BRIDGE_ENUM_DEVICES                             PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_ACQUIRE_DEVICEINFO               PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_RELEASE_DEVICEINFO               PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+2)
+#define PVRSRV_BRIDGE_CREATE_DEVMEMCONTEXT             PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+3)
+#define PVRSRV_BRIDGE_DESTROY_DEVMEMCONTEXT            PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+4)
+#define PVRSRV_BRIDGE_GET_DEVMEM_HEAPINFO              PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+5)
+#define PVRSRV_BRIDGE_ALLOC_DEVICEMEM                  PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+6)
+#define PVRSRV_BRIDGE_FREE_DEVICEMEM                   PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+7)
+#define PVRSRV_BRIDGE_GETFREE_DEVICEMEM                        PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+8)
+#define PVRSRV_BRIDGE_CREATE_COMMANDQUEUE              PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+9)
+#define PVRSRV_BRIDGE_DESTROY_COMMANDQUEUE             PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+10)
+#define        PVRSRV_BRIDGE_MHANDLE_TO_MMAP_DATA              PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+11)
+#define PVRSRV_BRIDGE_CONNECT_SERVICES                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+12)
+#define PVRSRV_BRIDGE_DISCONNECT_SERVICES              PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+13)
+#define PVRSRV_BRIDGE_WRAP_DEVICE_MEM                  PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+14)
+#define PVRSRV_BRIDGE_GET_DEVICEMEMINFO                        PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+15)
 #define PVRSRV_BRIDGE_RESERVE_DEV_VIRTMEM              PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+16)
 #define PVRSRV_BRIDGE_FREE_DEV_VIRTMEM                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+17)
 #define PVRSRV_BRIDGE_MAP_EXT_MEMORY                   PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+18)
@@ -91,30 +91,30 @@ extern "C" {
 #define PVRSRV_BRIDGE_CORE_CMD_LAST                            (PVRSRV_BRIDGE_CORE_CMD_FIRST+30)
 
 #define PVRSRV_BRIDGE_SIM_CMD_FIRST                            (PVRSRV_BRIDGE_CORE_CMD_LAST+1)
-#define PVRSRV_BRIDGE_PROCESS_SIMISR_EVENT             PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+0)      
-#define PVRSRV_BRIDGE_REGISTER_SIM_PROCESS             PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+1)      
-#define PVRSRV_BRIDGE_UNREGISTER_SIM_PROCESS   PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+2)      
+#define PVRSRV_BRIDGE_PROCESS_SIMISR_EVENT             PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_REGISTER_SIM_PROCESS             PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_UNREGISTER_SIM_PROCESS   PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+2)
 #define PVRSRV_BRIDGE_SIM_CMD_LAST                             (PVRSRV_BRIDGE_SIM_CMD_FIRST+2)
 
 #define PVRSRV_BRIDGE_MAPPING_CMD_FIRST                        (PVRSRV_BRIDGE_SIM_CMD_LAST+1)
-#define PVRSRV_BRIDGE_MAPPHYSTOUSERSPACE               PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+0)  
-#define PVRSRV_BRIDGE_UNMAPPHYSTOUSERSPACE             PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+1)  
-#define PVRSRV_BRIDGE_GETPHYSTOUSERSPACEMAP            PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+2)  
+#define PVRSRV_BRIDGE_MAPPHYSTOUSERSPACE               PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_UNMAPPHYSTOUSERSPACE             PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_GETPHYSTOUSERSPACEMAP            PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+2)
 #define PVRSRV_BRIDGE_MAPPING_CMD_LAST                 (PVRSRV_BRIDGE_MAPPING_CMD_FIRST+2)
 
 #define PVRSRV_BRIDGE_STATS_CMD_FIRST                  (PVRSRV_BRIDGE_MAPPING_CMD_LAST+1)
-#define        PVRSRV_BRIDGE_GET_FB_STATS                              PVRSRV_IOWR(PVRSRV_BRIDGE_STATS_CMD_FIRST+0)    
+#define        PVRSRV_BRIDGE_GET_FB_STATS                              PVRSRV_IOWR(PVRSRV_BRIDGE_STATS_CMD_FIRST+0)
 #define PVRSRV_BRIDGE_STATS_CMD_LAST                   (PVRSRV_BRIDGE_STATS_CMD_FIRST+0)
 
 #define PVRSRV_BRIDGE_MISC_CMD_FIRST                   (PVRSRV_BRIDGE_STATS_CMD_LAST+1)
-#define PVRSRV_BRIDGE_GET_MISC_INFO                            PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+0)     
-#define PVRSRV_BRIDGE_RELEASE_MISC_INFO                        PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+1)     
+#define PVRSRV_BRIDGE_GET_MISC_INFO                            PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_RELEASE_MISC_INFO                        PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+1)
 #define PVRSRV_BRIDGE_MISC_CMD_LAST                            (PVRSRV_BRIDGE_MISC_CMD_FIRST+1)
 
 #if defined (SUPPORT_OVERLAY_ROTATE_BLIT)
 #define PVRSRV_BRIDGE_OVERLAY_CMD_FIRST                        (PVRSRV_BRIDGE_MISC_CMD_LAST+1)
-#define PVRSRV_BRIDGE_INIT_3D_OVL_BLT_RES              PVRSRV_IOWR(PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+0)  
-#define PVRSRV_BRIDGE_DEINIT_3D_OVL_BLT_RES            PVRSRV_IOWR(PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+1)  
+#define PVRSRV_BRIDGE_INIT_3D_OVL_BLT_RES              PVRSRV_IOWR(PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_DEINIT_3D_OVL_BLT_RES            PVRSRV_IOWR(PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+1)
 #define PVRSRV_BRIDGE_OVERLAY_CMD_LAST                 (PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+1)
 #else
 #define PVRSRV_BRIDGE_OVERLAY_CMD_LAST                 PVRSRV_BRIDGE_MISC_CMD_LAST
@@ -122,21 +122,21 @@ extern "C" {
 
 #if defined(PDUMP)
 #define PVRSRV_BRIDGE_PDUMP_CMD_FIRST                  (PVRSRV_BRIDGE_OVERLAY_CMD_LAST+1)
-#define PVRSRV_BRIDGE_PDUMP_INIT                       PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+0)    
-#define PVRSRV_BRIDGE_PDUMP_MEMPOL                     PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+1)    
-#define PVRSRV_BRIDGE_PDUMP_DUMPMEM                    PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2)    
-#define PVRSRV_BRIDGE_PDUMP_REG                                PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+3)    
-#define PVRSRV_BRIDGE_PDUMP_REGPOL                     PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+4)    
-#define PVRSRV_BRIDGE_PDUMP_COMMENT                    PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+5)    
-#define PVRSRV_BRIDGE_PDUMP_SETFRAME                   PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+6)    
-#define PVRSRV_BRIDGE_PDUMP_ISCAPTURING                        PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+7)    
-#define PVRSRV_BRIDGE_PDUMP_DUMPBITMAP                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+8)    
-#define PVRSRV_BRIDGE_PDUMP_DUMPREADREG                        PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+9)    
-#define PVRSRV_BRIDGE_PDUMP_SYNCPOL                    PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+10)   
-#define PVRSRV_BRIDGE_PDUMP_DUMPSYNC                   PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+11)   
-#define PVRSRV_BRIDGE_PDUMP_MEMPAGES                   PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+12)   
-#define PVRSRV_BRIDGE_PDUMP_DRIVERINFO                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+13)   
-#define PVRSRV_BRIDGE_PDUMP_DUMPPDDEVPADDR             PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+15)   
+#define PVRSRV_BRIDGE_PDUMP_INIT                       PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+0)
+#define PVRSRV_BRIDGE_PDUMP_MEMPOL                     PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+1)
+#define PVRSRV_BRIDGE_PDUMP_DUMPMEM                    PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2)
+#define PVRSRV_BRIDGE_PDUMP_REG                                PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+3)
+#define PVRSRV_BRIDGE_PDUMP_REGPOL                     PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+4)
+#define PVRSRV_BRIDGE_PDUMP_COMMENT                    PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+5)
+#define PVRSRV_BRIDGE_PDUMP_SETFRAME                   PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+6)
+#define PVRSRV_BRIDGE_PDUMP_ISCAPTURING                        PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+7)
+#define PVRSRV_BRIDGE_PDUMP_DUMPBITMAP                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+8)
+#define PVRSRV_BRIDGE_PDUMP_DUMPREADREG                        PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+9)
+#define PVRSRV_BRIDGE_PDUMP_SYNCPOL                    PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+10)
+#define PVRSRV_BRIDGE_PDUMP_DUMPSYNC                   PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+11)
+#define PVRSRV_BRIDGE_PDUMP_MEMPAGES                   PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+12)
+#define PVRSRV_BRIDGE_PDUMP_DRIVERINFO                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+13)
+#define PVRSRV_BRIDGE_PDUMP_DUMPPDDEVPADDR             PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+15)
 #define PVRSRV_BRIDGE_PDUMP_CYCLE_COUNT_REG_READ       PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+16)
 #define PVRSRV_BRIDGE_PDUMP_STARTINITPHASE                     PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+17)
 #define PVRSRV_BRIDGE_PDUMP_STOPINITPHASE                      PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+18)
@@ -146,7 +146,7 @@ extern "C" {
 #endif
 
 #define PVRSRV_BRIDGE_OEM_CMD_FIRST                            (PVRSRV_BRIDGE_PDUMP_CMD_LAST+1)
-#define PVRSRV_BRIDGE_GET_OEMJTABLE                            PVRSRV_IOWR(PVRSRV_BRIDGE_OEM_CMD_FIRST+0)      
+#define PVRSRV_BRIDGE_GET_OEMJTABLE                            PVRSRV_IOWR(PVRSRV_BRIDGE_OEM_CMD_FIRST+0)
 #define PVRSRV_BRIDGE_OEM_CMD_LAST                             (PVRSRV_BRIDGE_OEM_CMD_FIRST+0)
 
 #define PVRSRV_BRIDGE_DEVCLASS_CMD_FIRST               (PVRSRV_BRIDGE_OEM_CMD_LAST+1)
@@ -231,30 +231,30 @@ typedef struct PVRSRV_BRIDGE_RETURN_TAG
 
 typedef struct PVRSRV_BRIDGE_PACKAGE_TAG
 {
-       IMG_UINT32                              ui32BridgeID;                   
-       IMG_UINT32                              ui32Size;                               
-       IMG_VOID                                *pvParamIn;                             
-       IMG_UINT32                              ui32InBufferSize;               
-       IMG_VOID                                *pvParamOut;                    
-       IMG_UINT32                              ui32OutBufferSize;              
+       IMG_UINT32                              ui32BridgeID;
+       IMG_UINT32                              ui32Size;
+       IMG_VOID                                *pvParamIn;
+       IMG_UINT32                              ui32InBufferSize;
+       IMG_VOID                                *pvParamOut;
+       IMG_UINT32                              ui32OutBufferSize;
 
 #if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID                                 hKernelServices;                
+       IMG_SID                                 hKernelServices;
 #else
-       IMG_HANDLE                              hKernelServices;                
+       IMG_HANDLE                              hKernelServices;
 #endif
 }PVRSRV_BRIDGE_PACKAGE;
 
 
 typedef struct PVRSRV_BRIDGE_IN_CONNECT_SERVICES_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
        IMG_UINT32              ui32Flags;
 } PVRSRV_BRIDGE_IN_CONNECT_SERVICES;
 
 typedef struct PVRSRV_BRIDGE_IN_ACQUIRE_DEVICEINFO_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        IMG_UINT32                      uiDevIndex;
        PVRSRV_DEVICE_TYPE      eDeviceType;
 
@@ -263,14 +263,14 @@ typedef struct PVRSRV_BRIDGE_IN_ACQUIRE_DEVICEINFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_ENUMCLASS_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        PVRSRV_DEVICE_CLASS sDeviceClass;
 } PVRSRV_BRIDGE_IN_ENUMCLASS;
 
 
 typedef struct PVRSRV_BRIDGE_IN_CLOSE_DISPCLASS_DEVICE_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDeviceKM;
 #else
@@ -281,7 +281,7 @@ typedef struct PVRSRV_BRIDGE_IN_CLOSE_DISPCLASS_DEVICE_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_ENUM_DISPCLASS_FORMATS_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDeviceKM;
 #else
@@ -292,7 +292,7 @@ typedef struct PVRSRV_BRIDGE_IN_ENUM_DISPCLASS_FORMATS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_SYSBUFFER_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDeviceKM;
 #else
@@ -303,7 +303,7 @@ typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_SYSBUFFER_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_INFO_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDeviceKM;
 #else
@@ -314,7 +314,7 @@ typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_INFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_CLOSE_BUFFERCLASS_DEVICE_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDeviceKM;
 #else
@@ -325,7 +325,7 @@ typedef struct PVRSRV_BRIDGE_IN_CLOSE_BUFFERCLASS_DEVICE_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_GET_BUFFERCLASS_INFO_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDeviceKM;
 #else
@@ -336,7 +336,7 @@ typedef struct PVRSRV_BRIDGE_IN_GET_BUFFERCLASS_INFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_RELEASE_DEVICEINFO_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
 #else
@@ -348,7 +348,7 @@ typedef struct PVRSRV_BRIDGE_IN_RELEASE_DEVICEINFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_FREE_CLASSDEVICEINFO_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        PVRSRV_DEVICE_CLASS DeviceClass;
        IMG_VOID*                       pvDevInfo;
 
@@ -357,7 +357,7 @@ typedef struct PVRSRV_BRIDGE_IN_FREE_CLASSDEVICEINFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_GET_DEVMEM_HEAPINFO_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
        IMG_SID                         hDevMemContext;
@@ -371,7 +371,7 @@ typedef struct PVRSRV_BRIDGE_IN_GET_DEVMEM_HEAPINFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_CREATE_DEVMEMCONTEXT_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
 #else
@@ -383,7 +383,7 @@ typedef struct PVRSRV_BRIDGE_IN_CREATE_DEVMEMCONTEXT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_DESTROY_DEVMEMCONTEXT_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
        IMG_SID                         hDevMemContext;
@@ -397,7 +397,7 @@ typedef struct PVRSRV_BRIDGE_IN_DESTROY_DEVMEMCONTEXT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
        IMG_SID                         hDevMemHeap;
@@ -415,7 +415,7 @@ typedef struct PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_MAPMEMINFOTOUSER_TAG
 {
-       IMG_UINT32  ui32BridgeFlags; 
+       IMG_UINT32  ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID     hKernelMemInfo;
 #else
@@ -426,7 +426,7 @@ typedef struct PVRSRV_BRIDGE_IN_MAPMEMINFOTOUSER_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_UNMAPMEMINFOFROMUSER_TAG
 {
-       IMG_UINT32      ui32BridgeFlags; 
+       IMG_UINT32      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID         hKernelMemInfo;
 #else
@@ -443,7 +443,7 @@ typedef struct PVRSRV_BRIDGE_IN_UNMAPMEMINFOFROMUSER_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_FREEDEVICEMEM_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hDevCookie;
        IMG_SID                 hKernelMemInfo;
@@ -457,7 +457,7 @@ typedef struct PVRSRV_BRIDGE_IN_FREEDEVICEMEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_EXPORTDEVICEMEM_TAG
 {
-       IMG_UINT32      ui32BridgeFlags; 
+       IMG_UINT32      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID         hDevCookie;
        IMG_SID         hKernelMemInfo;
@@ -470,14 +470,14 @@ typedef struct PVRSRV_BRIDGE_IN_EXPORTDEVICEMEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_GETFREEDEVICEMEM_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        IMG_UINT32                      ui32Flags;
 
 } PVRSRV_BRIDGE_IN_GETFREEDEVICEMEM;
 
 typedef struct PVRSRV_BRIDGE_IN_CREATECOMMANDQUEUE_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
 #else
@@ -490,7 +490,7 @@ typedef struct PVRSRV_BRIDGE_IN_CREATECOMMANDQUEUE_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_DESTROYCOMMANDQUEUE_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
 #else
@@ -503,29 +503,29 @@ typedef struct PVRSRV_BRIDGE_IN_DESTROYCOMMANDQUEUE_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_MHANDLE_TO_MMAP_DATA_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID                         hMHandle;        
+       IMG_SID                         hMHandle;
 #else
-       IMG_HANDLE                      hMHandle;        
+       IMG_HANDLE                      hMHandle;
 #endif
 } PVRSRV_BRIDGE_IN_MHANDLE_TO_MMAP_DATA;
 
 
 typedef struct PVRSRV_BRIDGE_IN_RELEASE_MMAP_DATA_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID                         hMHandle;        
+       IMG_SID                         hMHandle;
 #else
-       IMG_HANDLE                      hMHandle;        
+       IMG_HANDLE                      hMHandle;
 #endif
 } PVRSRV_BRIDGE_IN_RELEASE_MMAP_DATA;
 
 
 typedef struct PVRSRV_BRIDGE_IN_RESERVE_DEV_VIRTMEM_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevMemHeap;
 #else
@@ -565,7 +565,7 @@ typedef struct PVRSRV_BRIDGE_OUT_RESERVE_DEV_VIRTMEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_FREE_DEV_VIRTMEM_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hKernelMemInfo;
 #else
@@ -579,7 +579,7 @@ typedef struct PVRSRV_BRIDGE_IN_FREE_DEV_VIRTMEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_MAP_DEV_MEMORY_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hKernelMemInfo;
        IMG_SID                                 hDstDevMemHeap;
@@ -607,7 +607,7 @@ typedef struct PVRSRV_BRIDGE_OUT_MAP_DEV_MEMORY_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_UNMAP_DEV_MEMORY_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hKernelMemInfo;
 #else
@@ -621,7 +621,7 @@ typedef struct PVRSRV_BRIDGE_IN_UNMAP_DEV_MEMORY_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_MAP_EXT_MEMORY_TAG
 {
-       IMG_UINT32       ui32BridgeFlags; 
+       IMG_UINT32       ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID          hKernelMemInfo;
 #else
@@ -634,7 +634,7 @@ typedef struct PVRSRV_BRIDGE_IN_MAP_EXT_MEMORY_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_UNMAP_EXT_MEMORY_TAG
 {
-       IMG_UINT32                                      ui32BridgeFlags; 
+       IMG_UINT32                                      ui32BridgeFlags;
        PVRSRV_CLIENT_MEM_INFO          sClientMemInfo;
        PVRSRV_CLIENT_SYNC_INFO         sClientSyncInfo;
        IMG_UINT32                                      ui32Flags;
@@ -643,7 +643,7 @@ typedef struct PVRSRV_BRIDGE_IN_UNMAP_EXT_MEMORY_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_MAP_DEVICECLASS_MEMORY_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hDeviceClassBuffer;
        IMG_SID                 hDevMemContext;
@@ -673,7 +673,7 @@ typedef struct PVRSRV_BRIDGE_OUT_MAP_DEVICECLASS_MEMORY_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_UNMAP_DEVICECLASS_MEMORY_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hKernelMemInfo;
 #else
@@ -687,7 +687,7 @@ typedef struct PVRSRV_BRIDGE_IN_UNMAP_DEVICECLASS_MEMORY_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_MEMPOL_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelMemInfo;
 #else
@@ -703,7 +703,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_MEMPOL_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_SYNCPOL_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfo;
 #else
@@ -719,7 +719,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_SYNCPOL_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPMEM_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_PVOID  pvLinAddr;
        IMG_PVOID  pvAltLinAddr;
 #if defined (SUPPORT_SID_INTERFACE)
@@ -736,7 +736,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPMEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPSYNC_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_PVOID  pvAltLinAddr;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfo;
@@ -751,7 +751,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPSYNC_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPREG_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hDevCookie;
 #else
@@ -765,7 +765,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPREG_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_REGPOL_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -779,7 +779,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_REGPOL_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPPDREG_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        PVRSRV_HWREG sHWReg;
        IMG_UINT32 ui32Flags;
 
@@ -787,7 +787,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPPDREG_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_MEMPAGES_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
        IMG_SID                         hKernelMemInfo;
@@ -806,7 +806,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_MEMPAGES_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_COMMENT_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_CHAR szComment[PVRSRV_PDUMP_MAX_COMMENT_SIZE];
        IMG_UINT32 ui32Flags;
 
@@ -815,7 +815,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_COMMENT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_SETFRAME_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_UINT32 ui32Frame;
 
 }PVRSRV_BRIDGE_IN_PDUMP_SETFRAME;
@@ -823,7 +823,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_SETFRAME_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_BITMAP_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -850,7 +850,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_BITMAP_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_READREG_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -867,7 +867,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_READREG_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_DRIVERINFO_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_CHAR szString[PVRSRV_PDUMP_MAX_COMMENT_SIZE];
        IMG_BOOL bContinuous;
 
@@ -875,7 +875,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_DRIVERINFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPPDDEVPADDR_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelMemInfo;
 #else
@@ -887,7 +887,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_DUMPPDDEVPADDR_TAG
 
 typedef struct PVRSRV_BRIDGE_PDUM_IN_CYCLE_COUNT_REG_READ_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -930,7 +930,7 @@ typedef struct PVRSRV_BRIDGE_OUT_ENUMCLASS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_OPEN_DISPCLASS_DEVICE_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
        IMG_UINT32              ui32DeviceID;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hDevCookie;
@@ -954,7 +954,7 @@ typedef struct PVRSRV_BRIDGE_OUT_OPEN_DISPCLASS_DEVICE_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_WRAP_EXT_MEMORY_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hDevCookie;
        IMG_SID                                 hDevMemContext;
@@ -982,7 +982,7 @@ typedef struct PVRSRV_BRIDGE_OUT_WRAP_EXT_MEMORY_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_UNWRAP_EXT_MEMORY_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelMemInfo;
 #else
@@ -1010,7 +1010,7 @@ typedef struct PVRSRV_BRIDGE_OUT_ENUM_DISPCLASS_FORMATS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_ENUM_DISPCLASS_DIMS_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hDeviceKM;
 #else
@@ -1052,7 +1052,7 @@ typedef struct PVRSRV_BRIDGE_OUT_GET_DISPCLASS_SYSBUFFER_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_CREATE_DISPCLASS_SWAPCHAIN_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDeviceKM;
 #else
@@ -1083,7 +1083,7 @@ typedef struct PVRSRV_BRIDGE_OUT_CREATE_DISPCLASS_SWAPCHAIN_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_DESTROY_DISPCLASS_SWAPCHAIN_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDeviceKM;
        IMG_SID                         hSwapChain;
@@ -1097,7 +1097,7 @@ typedef struct PVRSRV_BRIDGE_IN_DESTROY_DISPCLASS_SWAPCHAIN_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SET_DISPCLASS_RECT_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDeviceKM;
        IMG_SID                         hSwapChain;
@@ -1112,7 +1112,7 @@ typedef struct PVRSRV_BRIDGE_IN_SET_DISPCLASS_RECT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SET_DISPCLASS_COLOURKEY_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDeviceKM;
        IMG_SID                         hSwapChain;
@@ -1127,7 +1127,7 @@ typedef struct PVRSRV_BRIDGE_IN_SET_DISPCLASS_COLOURKEY_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_BUFFERS_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDeviceKM;
        IMG_SID                         hSwapChain;
@@ -1154,7 +1154,7 @@ typedef struct PVRSRV_BRIDGE_OUT_GET_DISPCLASS_BUFFERS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SWAP_DISPCLASS_TO_BUFFER_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDeviceKM;
        IMG_SID                         hBuffer;
@@ -1196,7 +1196,7 @@ typedef struct PVRSRV_BRIDGE_IN_SWAP_DISPCLASS_TO_BUFFER2_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SWAP_DISPCLASS_TO_SYSTEM_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDeviceKM;
        IMG_SID                         hSwapChain;
@@ -1211,7 +1211,7 @@ typedef struct PVRSRV_BRIDGE_IN_SWAP_DISPCLASS_TO_SYSTEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_FRONT_BUFFER_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        IMG_HANDLE                      hDeviceKM;
 
 } PVRSRV_BRIDGE_IN_GET_DISPCLASS_FRONT_BUFFER;
@@ -1230,7 +1230,7 @@ typedef struct PVRSRV_BRIDGE_OUT_GET_DISPCLASS_FRONT_BUFFER_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_OPEN_BUFFERCLASS_DEVICE_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        IMG_UINT32                      ui32DeviceID;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
@@ -1263,7 +1263,7 @@ typedef struct PVRSRV_BRIDGE_OUT_GET_BUFFERCLASS_INFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_GET_BUFFERCLASS_BUFFER_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDeviceKM;
 #else
@@ -1378,16 +1378,16 @@ typedef struct PVRSRV_BRIDGE_OUT_MHANDLE_TO_MMAP_DATA_TAG
 {
     PVRSRV_ERROR               eError;
 
-    
+
      IMG_UINT32                        ui32MMapOffset;
 
-    
+
     IMG_UINT32                 ui32ByteOffset;
 
-    
+
     IMG_UINT32                         ui32RealByteSize;
 
-    
+
     IMG_UINT32                 ui32UserVAddr;
 
 } PVRSRV_BRIDGE_OUT_MHANDLE_TO_MMAP_DATA;
@@ -1396,18 +1396,18 @@ typedef struct PVRSRV_BRIDGE_OUT_RELEASE_MMAP_DATA_TAG
 {
     PVRSRV_ERROR               eError;
 
-    
+
     IMG_BOOL                   bMUnmap;
 
-    
+
     IMG_UINT32                 ui32UserVAddr;
 
-    
+
     IMG_UINT32                 ui32RealByteSize;
 } PVRSRV_BRIDGE_OUT_RELEASE_MMAP_DATA;
 typedef struct PVRSRV_BRIDGE_IN_GET_MISC_INFO_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        PVRSRV_MISC_INFO        sMiscInfo;
 
 }PVRSRV_BRIDGE_IN_GET_MISC_INFO;
@@ -1423,7 +1423,7 @@ typedef struct PVRSRV_BRIDGE_OUT_GET_MISC_INFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_RELEASE_MISC_INFO_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        PVRSRV_MISC_INFO        sMiscInfo;
 
 }PVRSRV_BRIDGE_IN_RELEASE_MISC_INFO;
@@ -1446,7 +1446,7 @@ typedef struct PVRSRV_BRIDGE_OUT_PDUMP_ISCAPTURING_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_GET_FB_STATS_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_SIZE_T ui32Total;
        IMG_SIZE_T ui32Available;
 
@@ -1455,7 +1455,7 @@ typedef struct PVRSRV_BRIDGE_IN_GET_FB_STATS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_MAPPHYSTOUSERSPACE_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
 #else
@@ -1478,7 +1478,7 @@ typedef struct PVRSRV_BRIDGE_OUT_MAPPHYSTOUSERSPACE_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_UNMAPPHYSTOUSERSPACE_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
 #else
@@ -1501,7 +1501,7 @@ typedef struct PVRSRV_BRIDGE_OUT_GETPHYSTOUSERSPACEMAP_TAG
 #if !defined (SUPPORT_SID_INTERFACE)
 typedef struct PVRSRV_BRIDGE_IN_REGISTER_SIM_PROCESS_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        IMG_HANDLE                      hDevCookie;
        IMG_PVOID                       pvProcess;
 
@@ -1510,8 +1510,8 @@ typedef struct PVRSRV_BRIDGE_IN_REGISTER_SIM_PROCESS_TAG
 
 typedef struct PVRSRV_BRIDGE_OUT_REGISTER_SIM_PROCESS_TAG
 {
-       IMG_SYS_PHYADDR         sRegsPhysBase;                  
-       IMG_VOID                        *pvRegsBase;                    
+       IMG_SYS_PHYADDR         sRegsPhysBase;
+       IMG_VOID                        *pvRegsBase;
        IMG_PVOID                       pvProcess;
        IMG_UINT32                      ulNoOfEntries;
        IMG_PVOID                       pvTblLinAddr;
@@ -1521,33 +1521,33 @@ typedef struct PVRSRV_BRIDGE_OUT_REGISTER_SIM_PROCESS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_UNREGISTER_SIM_PROCESS_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        IMG_HANDLE                      hDevCookie;
        IMG_PVOID                       pvProcess;
-       IMG_VOID                        *pvRegsBase;                    
+       IMG_VOID                        *pvRegsBase;
 
 } PVRSRV_BRIDGE_IN_UNREGISTER_SIM_PROCESS;
 
 typedef struct PVRSRV_BRIDGE_IN_PROCESS_SIMISR_EVENT_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        IMG_HANDLE                      hDevCookie;
        IMG_UINT32                      ui32StatusAndMask;
        PVRSRV_ERROR            eError;
 
 } PVRSRV_BRIDGE_IN_PROCESS_SIMISR_EVENT;
-#endif 
+#endif
 
 typedef struct PVRSRV_BRIDGE_IN_INITSRV_DISCONNECT_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
        IMG_BOOL                        bInitSuccesful;
 } PVRSRV_BRIDGE_IN_INITSRV_DISCONNECT;
 
 
 typedef struct PVRSRV_BRIDGE_IN_ALLOC_SHARED_SYS_MEM_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
     IMG_UINT32 ui32Flags;
     IMG_SIZE_T ui32Size;
 }PVRSRV_BRIDGE_IN_ALLOC_SHARED_SYS_MEM;
@@ -1568,7 +1568,7 @@ typedef struct PVRSRV_BRIDGE_IN_FREE_SHARED_SYS_MEM_TAG
        IMG_SID                 hKernelMemInfo;
        IMG_SID                 hMappingInfo;
 #else
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
        PVRSRV_KERNEL_MEM_INFO  *psKernelMemInfo;
 #endif
        PVRSRV_CLIENT_MEM_INFO  sClientMemInfo;
@@ -1581,7 +1581,7 @@ typedef struct PVRSRV_BRIDGE_OUT_FREE_SHARED_SYS_MEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_MAP_MEMINFO_MEM_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelMemInfo;
 #else
@@ -1603,7 +1603,7 @@ typedef struct PVRSRV_BRIDGE_OUT_MAP_MEMINFO_MEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_UNMAP_MEMINFO_MEM_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
 }PVRSRV_BRIDGE_IN_UNMAP_MEMINFO_MEM;
 
@@ -1614,7 +1614,7 @@ typedef struct PVRSRV_BRIDGE_OUT_UNMAP_MEMINFO_MEM_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_EVENT_OBJECT_WAI_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID         hOSEventKM;
 #else
@@ -1661,7 +1661,7 @@ typedef struct PVRSRV_BRIDGE_OUT_CREATE_SYNC_INFO_MOD_OBJ_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_DESTROY_SYNC_INFO_MOD_OBJ
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfoModObj;
 #else
@@ -1671,7 +1671,7 @@ typedef struct PVRSRV_BRIDGE_IN_DESTROY_SYNC_INFO_MOD_OBJ
 
 typedef struct PVRSRV_BRIDGE_IN_MODIFY_PENDING_SYNC_OPS_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfoModObj;
        IMG_SID    hKernelSyncInfo;
@@ -1685,7 +1685,7 @@ typedef struct PVRSRV_BRIDGE_IN_MODIFY_PENDING_SYNC_OPS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_MODIFY_COMPLETE_SYNC_OPS_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfoModObj;
 #else
@@ -1697,7 +1697,7 @@ typedef struct PVRSRV_BRIDGE_OUT_MODIFY_PENDING_SYNC_OPS_TAG
 {
        PVRSRV_ERROR eError;
 
-       
+
        IMG_UINT32 ui32ReadOpsPending;
        IMG_UINT32 ui32WriteOpsPending;
        IMG_UINT32 ui32ReadOps2Pending;
@@ -1706,7 +1706,7 @@ typedef struct PVRSRV_BRIDGE_OUT_MODIFY_PENDING_SYNC_OPS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_TAKE_TOKEN_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfo;
 #else
@@ -1727,7 +1727,7 @@ typedef struct PVRSRV_BRIDGE_OUT_SYNC_OPS_TAKE_TOKEN_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_FLUSH_TO_TOKEN_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfo;
 #else
@@ -1740,7 +1740,7 @@ typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_FLUSH_TO_TOKEN_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_FLUSH_TO_MOD_OBJ_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfoModObj;
 #else
@@ -1750,7 +1750,7 @@ typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_FLUSH_TO_MOD_OBJ_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_FLUSH_TO_DELTA_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfo;
 #else
@@ -1761,7 +1761,7 @@ typedef struct PVRSRV_BRIDGE_IN_SYNC_OPS_FLUSH_TO_DELTA_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_ALLOC_SYNC_INFO_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
@@ -1783,7 +1783,7 @@ typedef struct PVRSRV_BRIDGE_OUT_ALLOC_SYNC_INFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_FREE_SYNC_INFO_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hKernelSyncInfo;
@@ -1803,5 +1803,5 @@ typedef struct PVRSRV_BRIDGE_IN_CHG_DEV_MEM_ATTRIBS_TAG
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index da36fba..2b16ea6
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -47,7 +47,7 @@ IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVAcquireDeviceDataKM(IMG_UINT32                 uiDevIndex,
                                                                                                        PVRSRV_DEVICE_TYPE      eDeviceType,
                                                                                                        IMG_HANDLE                      *phDevCookie);
-                                                       
+
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_SIZE_T ui32QueueSize,
                                                                                                         PVRSRV_QUEUE_INFO **ppsQueueInfo);
@@ -150,7 +150,7 @@ IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemoryKM(IMG_HANDLE                             hDevCookie,
                                                                                                PVRSRV_PER_PROCESS_DATA *psPerProc,
                                                                                                IMG_HANDLE                              hDevMemContext,
-                                                                                               IMG_SIZE_T                              ui32ByteSize, 
+                                                                                               IMG_SIZE_T                              ui32ByteSize,
                                                                                                IMG_SIZE_T                              ui32PageOffset,
                                                                                                IMG_BOOL                                bPhysContig,
                                                                                                IMG_SYS_PHYADDR                 *psSysAddr,
@@ -318,5 +318,5 @@ PVRSRVDissociateMemFromResmanKM(PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo);
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 242d953..8024d17
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -40,5 +40,5 @@ IMG_BOOL PVRUnMapKMem(IMG_HANDLE hModule, IMG_SID hMappingInfo, IMG_SID hMHandle
 IMG_BOOL PVRUnMapKMem(IMG_HANDLE hModule, IMG_HANDLE hMappingInfo, IMG_HANDLE hMHandle);
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 5474984..addab68
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -262,5 +262,5 @@ extern "C" {
 #if defined (__cplusplus)
 }
 #endif
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 79013bc..c0db526
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -58,47 +58,47 @@ typedef enum _PVRSRV_MEMTYPE_
 
 typedef struct _PVRSRV_KERNEL_MEM_INFO_
 {
-       
+
        IMG_PVOID                               pvLinAddrKM;
 
-       
+
        IMG_DEV_VIRTADDR                sDevVAddr;
 
-       
+
        IMG_UINT32                              ui32Flags;
 
-       
+
        IMG_SIZE_T                              uAllocSize;
 
-       
+
        PVRSRV_MEMBLK                   sMemBlk;
 
-       
+
        IMG_PVOID                               pvSysBackupBuffer;
 
-       
+
        IMG_UINT32                              ui32RefCount;
 
-       
+
        IMG_BOOL                                bPendingFree;
 
 
 #if defined(SUPPORT_MEMINFO_IDS)
        #if !defined(USE_CODE)
-       
+
        IMG_UINT64                              ui64Stamp;
-       #else 
+       #else
        IMG_UINT32                              dummy1;
        IMG_UINT32                              dummy2;
-       #endif 
-#endif 
+       #endif
+#endif
+
 
-       
        struct _PVRSRV_KERNEL_SYNC_INFO_        *psKernelSyncInfo;
 
        PVRSRV_MEMTYPE                          memType;
 
-    
+
 
 
 
@@ -106,17 +106,17 @@ typedef struct _PVRSRV_KERNEL_MEM_INFO_
 
 
        struct {
-        
+
 
                IMG_BOOL bInUse;
 
-        
+
                IMG_HANDLE hDevCookieInt;
 
-        
+
                IMG_UINT32 ui32ShareIndex;
 
-        
+
 
                IMG_UINT32 ui32OrigReqAttribs;
                IMG_UINT32 ui32OrigReqSize;
@@ -127,35 +127,35 @@ typedef struct _PVRSRV_KERNEL_MEM_INFO_
 
 typedef struct _PVRSRV_KERNEL_SYNC_INFO_
 {
-       
+
        PVRSRV_SYNC_DATA                *psSyncData;
 
-       
+
        IMG_DEV_VIRTADDR                sWriteOpsCompleteDevVAddr;
 
-       
+
        IMG_DEV_VIRTADDR                sReadOpsCompleteDevVAddr;
 
 
        IMG_DEV_VIRTADDR                sReadOps2CompleteDevVAddr;
 
-       
+
        PVRSRV_KERNEL_MEM_INFO  *psSyncDataMemInfoKM;
 
-       
-       
+
+
        IMG_UINT32              ui32RefCount;
 
-       
+
        IMG_HANDLE hResItem;
 
-       
+
        IMG_UINT32              ui32UID;
 } PVRSRV_KERNEL_SYNC_INFO;
 
 typedef struct _PVRSRV_DEVICE_SYNC_OBJECT_
 {
-       
+
        IMG_UINT32                      ui32ReadOpsPendingVal;
        IMG_DEV_VIRTADDR        sReadOpsCompleteDevVAddr;
        IMG_UINT32                      ui32WriteOpsPendingVal;
@@ -175,16 +175,16 @@ typedef struct _PVRSRV_SYNC_OBJECT
 
 typedef struct _PVRSRV_COMMAND
 {
-       IMG_SIZE_T                      uCmdSize;               
-       IMG_UINT32                      ui32DevIndex;           
-       IMG_UINT32                      CommandType;            
-       IMG_UINT32                      ui32DstSyncCount;       
-       IMG_UINT32                      ui32SrcSyncCount;       
-       PVRSRV_SYNC_OBJECT      *psDstSync;                     
-       PVRSRV_SYNC_OBJECT      *psSrcSync;                     
-       IMG_SIZE_T                      uDataSize;              
-       IMG_UINT32                      ui32ProcessID;          
-       IMG_VOID                        *pvData;                        
+       IMG_SIZE_T                      uCmdSize;
+       IMG_UINT32                      ui32DevIndex;
+       IMG_UINT32                      CommandType;
+       IMG_UINT32                      ui32DstSyncCount;
+       IMG_UINT32                      ui32SrcSyncCount;
+       PVRSRV_SYNC_OBJECT      *psDstSync;
+       PVRSRV_SYNC_OBJECT      *psSrcSync;
+       IMG_SIZE_T                      uDataSize;
+       IMG_UINT32                      ui32ProcessID;
+       IMG_VOID                        *pvData;
        PFN_QUEUE_COMMAND_COMPLETE  pfnCommandComplete;
        IMG_HANDLE                                      hCallbackData;
 }PVRSRV_COMMAND, *PPVRSRV_COMMAND;
@@ -192,19 +192,19 @@ typedef struct _PVRSRV_COMMAND
 
 typedef struct _PVRSRV_QUEUE_INFO_
 {
-       IMG_VOID                        *pvLinQueueKM;                  
-       IMG_VOID                        *pvLinQueueUM;                  
-       volatile IMG_SIZE_T     ui32ReadOffset;                 
-       volatile IMG_SIZE_T     ui32WriteOffset;                
-       IMG_UINT32                      *pui32KickerAddrKM;             
-       IMG_UINT32                      *pui32KickerAddrUM;             
-       IMG_SIZE_T                      ui32QueueSize;                  
+       IMG_VOID                        *pvLinQueueKM;
+       IMG_VOID                        *pvLinQueueUM;
+       volatile IMG_SIZE_T     ui32ReadOffset;
+       volatile IMG_SIZE_T     ui32WriteOffset;
+       IMG_UINT32                      *pui32KickerAddrKM;
+       IMG_UINT32                      *pui32KickerAddrUM;
+       IMG_SIZE_T                      ui32QueueSize;
 
-       IMG_UINT32                      ui32ProcessID;                  
+       IMG_UINT32                      ui32ProcessID;
 
        IMG_HANDLE                      hMemBlock[2];
 
-       struct _PVRSRV_QUEUE_INFO_ *psNextKM;           
+       struct _PVRSRV_QUEUE_INFO_ *psNextKM;
 }PVRSRV_QUEUE_INFO;
 
 
@@ -222,9 +222,9 @@ typedef struct _PVRSRV_HEAP_INFO_KM_
 
 typedef struct _PVRSRV_EVENTOBJECT_KM_
 {
-       
+
        IMG_CHAR        szName[EVENTOBJNAME_MAXLENGTH];
-       
+
        IMG_HANDLE      hOSEventKM;
 
 } PVRSRV_EVENTOBJECT_KM;
@@ -232,46 +232,46 @@ typedef struct _PVRSRV_EVENTOBJECT_KM_
 
 typedef struct _PVRSRV_MISC_INFO_KM_
 {
-       IMG_UINT32      ui32StateRequest;               
-       IMG_UINT32      ui32StatePresent;               
+       IMG_UINT32      ui32StateRequest;
+       IMG_UINT32      ui32StatePresent;
+
 
-       
        IMG_VOID        *pvSOCTimerRegisterKM;
        IMG_VOID        *pvSOCTimerRegisterUM;
        IMG_HANDLE      hSOCTimerRegisterOSMemHandle;
        IMG_HANDLE      hSOCTimerRegisterMappingInfo;
 
-       
+
        IMG_VOID        *pvSOCClockGateRegs;
        IMG_UINT32      ui32SOCClockGateRegsSize;
 
-       
+
        IMG_CHAR        *pszMemoryStr;
        IMG_UINT32      ui32MemoryStrLen;
 
-       
+
        PVRSRV_EVENTOBJECT_KM   sGlobalEventObject;
        IMG_HANDLE                              hOSGlobalEvent;
 
-       
+
        IMG_UINT32      aui32DDKVersion[4];
 
 
        struct
        {
-               
+
                IMG_BOOL bDeferOp;
 
-               
+
                PVRSRV_MISC_INFO_CPUCACHEOP_TYPE eCacheOpType;
 
 
                PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
 
-               
+
                IMG_VOID *pvBaseVAddr;
 
-               
+
                IMG_UINT32      ui32Length;
        } sCacheOpCtl;
 
@@ -368,5 +368,5 @@ PVRSRVMapMemInfoMem(const PVRSRV_CONNECTION *psConnection,
 #if defined (__cplusplus)
 }
 #endif
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index ec630a5..e59da89
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -90,15 +90,15 @@ extern "C" {
 
 #define PVRSRV_BRIDGE_LAST_SGX_CMD (PVRSRV_BRIDGE_SGX_CMD_BASE+37)
 
+
 typedef struct PVRSRV_BRIDGE_IN_GETPHYSPAGEADDR
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_HANDLE hDevMemHeap;
        IMG_DEV_VIRTADDR sDevVAddr;
 }PVRSRV_BRIDGE_IN_GETPHYSPAGEADDR;
 
+
 typedef struct PVRSRV_BRIDGE_OUT_GETPHYSPAGEADDR
 {
        PVRSRV_ERROR            eError;
@@ -106,10 +106,10 @@ typedef struct PVRSRV_BRIDGE_OUT_GETPHYSPAGEADDR
        IMG_CPU_PHYADDR         CpuPAddr;
 }PVRSRV_BRIDGE_OUT_GETPHYSPAGEADDR;
 
+
 typedef struct PVRSRV_BRIDGE_IN_SGX_SET_TRANSFER_CONTEXT_PRIORITY_TAG
  {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
  #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
        IMG_SID                                 hHWTransferContext;
@@ -121,10 +121,10 @@ typedef struct PVRSRV_BRIDGE_IN_SGX_SET_TRANSFER_CONTEXT_PRIORITY_TAG
     IMG_UINT32              ui32OffsetOfPriorityField;
 }PVRSRV_BRIDGE_IN_SGX_SET_TRANSFER_CONTEXT_PRIORITY;
 
+
 typedef struct PVRSRV_BRIDGE_IN_SGX_SET_RENDER_CONTEXT_PRIORITY_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
        IMG_SID                                 hHWRenderContext;
@@ -136,10 +136,10 @@ typedef struct PVRSRV_BRIDGE_IN_SGX_SET_RENDER_CONTEXT_PRIORITY_TAG
     IMG_UINT32              ui32OffsetOfPriorityField;
 }PVRSRV_BRIDGE_IN_SGX_SET_RENDER_CONTEXT_PRIORITY;
 
+
 typedef struct PVRSRV_BRIDGE_IN_GETCLIENTINFO_TAG
 {
-       IMG_UINT32                                      ui32BridgeFlags; 
+       IMG_UINT32                                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                         hDevCookie;
 #else
@@ -147,17 +147,17 @@ typedef struct PVRSRV_BRIDGE_IN_GETCLIENTINFO_TAG
 #endif
 }PVRSRV_BRIDGE_IN_GETCLIENTINFO;
 
+
 typedef struct PVRSRV_BRIDGE_OUT_GETINTERNALDEVINFO_TAG
 {
        SGX_INTERNAL_DEVINFO    sSGXInternalDevInfo;
        PVRSRV_ERROR                            eError;
 }PVRSRV_BRIDGE_OUT_GETINTERNALDEVINFO;
 
+
 typedef struct PVRSRV_BRIDGE_IN_GETINTERNALDEVINFO_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
 #else
@@ -165,17 +165,17 @@ typedef struct PVRSRV_BRIDGE_IN_GETINTERNALDEVINFO_TAG
 #endif
 }PVRSRV_BRIDGE_IN_GETINTERNALDEVINFO;
 
+
 typedef struct PVRSRV_BRIDGE_OUT_GETCLIENTINFO_TAG
 {
        SGX_CLIENT_INFO         sClientInfo;
        PVRSRV_ERROR                    eError;
 }PVRSRV_BRIDGE_OUT_GETCLIENTINFO;
 
+
 typedef struct PVRSRV_BRIDGE_IN_RELEASECLIENTINFO_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
 #else
@@ -184,10 +184,10 @@ typedef struct PVRSRV_BRIDGE_IN_RELEASECLIENTINFO_TAG
        SGX_CLIENT_INFO         sClientInfo;
 }PVRSRV_BRIDGE_IN_RELEASECLIENTINFO;
 
+
 typedef struct PVRSRV_BRIDGE_IN_ISPBREAKPOLL_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
 #else
@@ -195,10 +195,10 @@ typedef struct PVRSRV_BRIDGE_IN_ISPBREAKPOLL_TAG
 #endif
 }PVRSRV_BRIDGE_IN_ISPBREAKPOLL;
 
+
 typedef struct PVRSRV_BRIDGE_IN_DOKICK_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
 #else
@@ -207,10 +207,10 @@ typedef struct PVRSRV_BRIDGE_IN_DOKICK_TAG
        SGX_CCB_KICK                    sCCBKick;
 }PVRSRV_BRIDGE_IN_DOKICK;
 
+
 typedef struct PVRSRV_BRIDGE_IN_SGX_SCHEDULE_PROCESS_QUEUES_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
 #else
@@ -220,10 +220,10 @@ typedef struct PVRSRV_BRIDGE_IN_SGX_SCHEDULE_PROCESS_QUEUES_TAG
 
 
 #if defined(TRANSFER_QUEUE)
+
 typedef struct PVRSRV_BRIDGE_IN_SUBMITTRANSFER_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
 #else
@@ -233,10 +233,10 @@ typedef struct PVRSRV_BRIDGE_IN_SUBMITTRANSFER_TAG
 }PVRSRV_BRIDGE_IN_SUBMITTRANSFER;
 
 #if defined(SGX_FEATURE_2D_HARDWARE)
+
 typedef struct PVRSRV_BRIDGE_IN_SUBMIT2D_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
 #else
@@ -247,10 +247,10 @@ typedef struct PVRSRV_BRIDGE_IN_SUBMIT2D_TAG
 #endif
 #endif
 
+
 typedef struct PVRSRV_BRIDGE_IN_READREGDWORD_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
 #else
@@ -260,7 +260,7 @@ typedef struct PVRSRV_BRIDGE_IN_READREGDWORD_TAG
     IMG_PCHAR                          pszValue;
 }PVRSRV_BRIDGE_IN_READREGDWORD;
 
+
 typedef struct PVRSRV_BRIDGE_OUT_READREGDWORD_TAG
 {
        PVRSRV_ERROR    eError;
@@ -270,7 +270,7 @@ typedef struct PVRSRV_BRIDGE_OUT_READREGDWORD_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGXGETMISCINFO_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hDevCookie;
 #else
@@ -281,7 +281,7 @@ typedef struct PVRSRV_BRIDGE_IN_SGXGETMISCINFO_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGXINFO_FOR_SRVINIT_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hDevCookie;
 #else
@@ -297,7 +297,7 @@ typedef struct PVRSRV_BRIDGE_OUT_SGXINFO_FOR_SRVINIT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGXDEVINITPART2_TAG
 {
-       IMG_UINT32              ui32BridgeFlags; 
+       IMG_UINT32              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 hDevCookie;
 #else
@@ -313,10 +313,10 @@ typedef struct PVRSRV_BRIDGE_OUT_SGXDEVINITPART2_TAG
 
 }PVRSRV_BRIDGE_OUT_SGXDEVINITPART2;
 
+
 typedef struct PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE_TAG
 {
-       IMG_UINT32                              ui32BridgeFlags; 
+       IMG_UINT32                              ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                 hDevCookie;
        IMG_SID                                 hKernSyncInfo;
@@ -332,7 +332,7 @@ typedef struct PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGXFINDSHAREDPBDESC_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -367,7 +367,7 @@ typedef struct PVRSRV_BRIDGE_OUT_SGXFINDSHAREDPBDESC_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGXUNREFSHAREDPBDESC_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hSharedPBDesc;
 #else
@@ -383,7 +383,7 @@ typedef struct PVRSRV_BRIDGE_OUT_SGXUNREFSHAREDPBDESC_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGXADDSHAREDPBDESC_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_UINT32 ui32TotalPBSize;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
@@ -418,7 +418,7 @@ typedef struct PVRSRV_BRIDGE_OUT_SGXADDSHAREDPBDESC_TAG
 #ifdef PDUMP
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_BUFFER_ARRAY_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        SGX_KICKTA_DUMP_BUFFER *psBufferArray;
        IMG_UINT32 ui32BufferArrayLength;
        IMG_BOOL bDumpPolls;
@@ -426,7 +426,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_BUFFER_ARRAY_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_3D_SIGNATURE_REGISTERS_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
        IMG_SID    hDevMemContext;
@@ -442,7 +442,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_3D_SIGNATURE_REGISTERS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMPCOUNTER_REGISTERS_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -456,7 +456,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMPCOUNTER_REGISTERS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_TA_SIGNATURE_REGISTERS_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -471,7 +471,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_TA_SIGNATURE_REGISTERS_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_HWPERFCB_TAG
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
        IMG_SID                         hDevMemContext;
@@ -487,7 +487,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_HWPERFCB_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_PDUMP_SAVEMEM
 {
-       IMG_UINT32                      ui32BridgeFlags; 
+       IMG_UINT32                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         hDevCookie;
        IMG_SID                         hDevMemContext;
@@ -509,7 +509,7 @@ typedef struct PVRSRV_BRIDGE_IN_PDUMP_SAVEMEM
 
 typedef struct PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_RENDER_CONTEXT_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -534,7 +534,7 @@ typedef struct PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_RENDER_CONTEXT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_RENDER_CONTEXT_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_BOOL   bForceCleanup;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
@@ -547,7 +547,7 @@ typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_RENDER_CONTEXT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_TRANSFER_CONTEXT_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -572,7 +572,7 @@ typedef struct PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_TRANSFER_CONTEXT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_TRANSFER_CONTEXT_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_BOOL   bForceCleanup;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
@@ -585,7 +585,7 @@ typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_TRANSFER_CONTEXT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGX_FLUSH_HW_RENDER_TARGET_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -594,11 +594,11 @@ typedef struct PVRSRV_BRIDGE_IN_SGX_FLUSH_HW_RENDER_TARGET_TAG
        IMG_DEV_VIRTADDR sHWRTDataSetDevVAddr;
 }PVRSRV_BRIDGE_IN_SGX_FLUSH_HW_RENDER_TARGET;
 
+
 #if defined(SGX_FEATURE_2D_HARDWARE)
 typedef struct PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_2D_CONTEXT_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
 #else
@@ -623,7 +623,7 @@ typedef struct PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_2D_CONTEXT_TAG
 
 typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT_TAG
 {
-       IMG_UINT32 ui32BridgeFlags; 
+       IMG_UINT32 ui32BridgeFlags;
        IMG_BOOL   bForceCleanup;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID    hDevCookie;
@@ -634,13 +634,13 @@ typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT_TAG
 #endif
 }PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT;
 
-#define        SGX2D_MAX_BLT_CMD_SIZ           256     
-#endif 
+#define        SGX2D_MAX_BLT_CMD_SIZ           256
+#endif
 
 
 typedef struct PVRSRV_BRIDGE_IN_SGX_READ_HWPERF_CB_TAG
 {
-       IMG_UINT32                                      ui32BridgeFlags; 
+       IMG_UINT32                                      ui32BridgeFlags;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                                         hDevCookie;
 #else
@@ -662,5 +662,5 @@ typedef struct PVRSRV_BRIDGE_OUT_SGX_READ_HWPERF_CB_TAG
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 535c2de..d3bf203
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
        #define SGX_MP_MASTER_SELECT(x)         (x + (SGX_REG_BANK_MASTER_INDEX * SGX_REG_BANK_SIZE))
 #else
        #define SGX_MP_CORE_SELECT(x,i)         (x)
-#endif 
+#endif
 #endif
 
 
 typedef struct _SGXMKIF_COMMAND_
 {
-       IMG_UINT32                              ui32ServiceAddress;             
-       IMG_UINT32                              ui32CacheControl;               
-       IMG_UINT32                              ui32Data[6];                    
+       IMG_UINT32                              ui32ServiceAddress;
+       IMG_UINT32                              ui32CacheControl;
+       IMG_UINT32                              ui32Data[6];
 } SGXMKIF_COMMAND;
 
 
 typedef struct _PVRSRV_SGX_KERNEL_CCB_
 {
-       SGXMKIF_COMMAND         asCommands[256];                
+       SGXMKIF_COMMAND         asCommands[256];
 } PVRSRV_SGX_KERNEL_CCB;
 
 
 typedef struct _PVRSRV_SGX_CCB_CTL_
 {
-       IMG_UINT32                              ui32WriteOffset;                
-       IMG_UINT32                              ui32ReadOffset;                 
+       IMG_UINT32                              ui32WriteOffset;
+       IMG_UINT32                              ui32ReadOffset;
 } PVRSRV_SGX_CCB_CTL;
 
 
@@ -74,58 +74,58 @@ typedef struct _SGXMKIF_HOST_CTL_
        IMG_UINT32                              ui32Continue;
 #endif
 
-       volatile IMG_UINT32             ui32InitStatus;                         
-       volatile IMG_UINT32             ui32PowerStatus;                        
-       volatile IMG_UINT32             ui32CleanupStatus;                      
+       volatile IMG_UINT32             ui32InitStatus;
+       volatile IMG_UINT32             ui32PowerStatus;
+       volatile IMG_UINT32             ui32CleanupStatus;
 #if defined(FIX_HW_BRN_28889)
-       volatile IMG_UINT32             ui32InvalStatus;                        
+       volatile IMG_UINT32             ui32InvalStatus;
 #endif
 #if defined(SUPPORT_HW_RECOVERY)
-       IMG_UINT32                              ui32uKernelDetectedLockups;     
-       IMG_UINT32                              ui32HostDetectedLockups;        
-       IMG_UINT32                              ui32HWRecoverySampleRate;       
-#endif 
-       IMG_UINT32                              ui32uKernelTimerClock;          
-       IMG_UINT32                              ui32ActivePowManSampleRate;     
-       IMG_UINT32                              ui32InterruptFlags;             
-       IMG_UINT32                              ui32InterruptClearFlags;        
-       IMG_UINT32                              ui32BPSetClearSignal;           
-
-       IMG_UINT32                              ui32NumActivePowerEvents;       
-
-       IMG_UINT32                              ui32TimeWraps;                          
-       IMG_UINT32                              ui32HostClock;                          
-       IMG_UINT32                              ui32AssertFail;                         
+       IMG_UINT32                              ui32uKernelDetectedLockups;
+       IMG_UINT32                              ui32HostDetectedLockups;
+       IMG_UINT32                              ui32HWRecoverySampleRate;
+#endif
+       IMG_UINT32                              ui32uKernelTimerClock;
+       IMG_UINT32                              ui32ActivePowManSampleRate;
+       IMG_UINT32                              ui32InterruptFlags;
+       IMG_UINT32                              ui32InterruptClearFlags;
+       IMG_UINT32                              ui32BPSetClearSignal;
+
+       IMG_UINT32                              ui32NumActivePowerEvents;
+
+       IMG_UINT32                              ui32TimeWraps;
+       IMG_UINT32                              ui32HostClock;
+       IMG_UINT32                              ui32AssertFail;
 
 #if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS)
-       IMG_UINT32                              aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS]; 
-       IMG_UINT32                              aui32PerfBit[PVRSRV_SGX_HWPERF_NUM_COUNTERS];   
+       IMG_UINT32                              aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
+       IMG_UINT32                              aui32PerfBit[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
 #else
-       IMG_UINT32                              ui32PerfGroup;                                                                  
-#endif 
+       IMG_UINT32                              ui32PerfGroup;
+#endif
 
 #if defined(FIX_HW_BRN_31939)
        IMG_UINT32                              ui32BRN31939Mem;
 #endif
 
-       IMG_UINT32                              ui32OpenCLDelayCount;                   
+       IMG_UINT32                              ui32OpenCLDelayCount;
 } SGXMKIF_HOST_CTL;
 
 #define        SGXMKIF_CMDTA_CTRLFLAGS_READY                   0x00000001
 typedef struct _SGXMKIF_CMDTA_SHARED_
 {
        IMG_UINT32                      ui32CtrlFlags;
-       
+
        IMG_UINT32                      ui32NumTAStatusVals;
        IMG_UINT32                      ui32Num3DStatusVals;
 
-       
+
        IMG_UINT32                      ui32TATQSyncWriteOpsPendingVal;
        IMG_DEV_VIRTADDR        sTATQSyncWriteOpsCompleteDevVAddr;
        IMG_UINT32                      ui32TATQSyncReadOpsPendingVal;
        IMG_DEV_VIRTADDR        sTATQSyncReadOpsCompleteDevVAddr;
 
-       
+
        IMG_UINT32                      ui323DTQSyncWriteOpsPendingVal;
        IMG_DEV_VIRTADDR        s3DTQSyncWriteOpsCompleteDevVAddr;
        IMG_UINT32                      ui323DTQSyncReadOpsPendingVal;
@@ -133,7 +133,7 @@ typedef struct _SGXMKIF_CMDTA_SHARED_
 
 
 #if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-       
+
        IMG_UINT32                                      ui32NumTASrcSyncs;
        PVRSRV_DEVICE_SYNC_OBJECT       asTASrcSyncs[SGX_MAX_TA_SRC_SYNCS];
        IMG_UINT32                                      ui32NumTADstSyncs;
@@ -141,12 +141,12 @@ typedef struct _SGXMKIF_CMDTA_SHARED_
        IMG_UINT32                                      ui32Num3DSrcSyncs;
        PVRSRV_DEVICE_SYNC_OBJECT       as3DSrcSyncs[SGX_MAX_3D_SRC_SYNCS];
 #else
-       
+
        IMG_UINT32                      ui32NumSrcSyncs;
        PVRSRV_DEVICE_SYNC_OBJECT       asSrcSyncs[SGX_MAX_SRC_SYNCS];
 #endif
 
-       
+
        PVRSRV_DEVICE_SYNC_OBJECT       sTA3DDependency;
 
        CTL_STATUS                      sCtlTAStatusInfo[SGX_MAX_TA_STATUS_VALS];
@@ -167,21 +167,21 @@ typedef struct _SGXMKIF_CMDTA_SHARED_
 
 typedef struct _SGXMKIF_TRANSFERCMD_SHARED_
 {
-       
+
 
        IMG_UINT32                      ui32NumSrcSyncs;
        PVRSRV_DEVICE_SYNC_OBJECT       asSrcSyncs[SGX_MAX_SRC_SYNCS];
-       
+
 
        IMG_UINT32                      ui32NumDstSyncs;
-       PVRSRV_DEVICE_SYNC_OBJECT       asDstSyncs[SGX_MAX_DST_SYNCS];  
-       
+       PVRSRV_DEVICE_SYNC_OBJECT       asDstSyncs[SGX_MAX_DST_SYNCS];
+
        IMG_UINT32              ui32TASyncWriteOpsPendingVal;
        IMG_DEV_VIRTADDR        sTASyncWriteOpsCompleteDevVAddr;
        IMG_UINT32              ui32TASyncReadOpsPendingVal;
        IMG_DEV_VIRTADDR        sTASyncReadOpsCompleteDevVAddr;
 
-       
+
        IMG_UINT32              ui323DSyncWriteOpsPendingVal;
        IMG_DEV_VIRTADDR        s3DSyncWriteOpsCompleteDevVAddr;
        IMG_UINT32              ui323DSyncReadOpsPendingVal;
@@ -194,55 +194,55 @@ typedef struct _SGXMKIF_TRANSFERCMD_SHARED_
 
 #if defined(SGX_FEATURE_2D_HARDWARE)
 typedef struct _SGXMKIF_2DCMD_SHARED_ {
-       
+
        IMG_UINT32                      ui32NumSrcSync;
        PVRSRV_DEVICE_SYNC_OBJECT       sSrcSyncData[SGX_MAX_2D_SRC_SYNC_OPS];
 
-       
+
        PVRSRV_DEVICE_SYNC_OBJECT       sDstSyncData;
 
-       
+
        PVRSRV_DEVICE_SYNC_OBJECT       sTASyncData;
 
-       
+
        PVRSRV_DEVICE_SYNC_OBJECT       s3DSyncData;
 } SGXMKIF_2DCMD_SHARED, *PSGXMKIF_2DCMD_SHARED;
-#endif 
+#endif
 
 
 typedef struct _SGXMKIF_HWDEVICE_SYNC_LIST_
 {
        IMG_DEV_VIRTADDR        sAccessDevAddr;
        IMG_UINT32                      ui32NumSyncObjects;
-       
+
        PVRSRV_DEVICE_SYNC_OBJECT       asSyncData[1];
 } SGXMKIF_HWDEVICE_SYNC_LIST, *PSGXMKIF_HWDEVICE_SYNC_LIST;
 
 
-#define PVRSRV_USSE_EDM_INIT_COMPLETE                  (1UL << 0)      
+#define PVRSRV_USSE_EDM_INIT_COMPLETE                  (1UL << 0)
 
-#define PVRSRV_USSE_EDM_POWMAN_IDLE_COMPLETE                           (1UL << 2)      
-#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_COMPLETE                       (1UL << 3)      
-#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_RESTART_IMMEDIATE      (1UL << 4)      
-#define PVRSRV_USSE_EDM_POWMAN_NO_WORK                                         (1UL << 5)      
+#define PVRSRV_USSE_EDM_POWMAN_IDLE_COMPLETE                           (1UL << 2)
+#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_COMPLETE                       (1UL << 3)
+#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_RESTART_IMMEDIATE      (1UL << 4)
+#define PVRSRV_USSE_EDM_POWMAN_NO_WORK                                         (1UL << 5)
 
-#define PVRSRV_USSE_EDM_INTERRUPT_HWR                  (1UL << 0)      
-#define PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER (1UL << 1)      
+#define PVRSRV_USSE_EDM_INTERRUPT_HWR                  (1UL << 0)
+#define PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER (1UL << 1)
 #define PVRSRV_USSE_EDM_INTERRUPT_IDLE                 (1UL << 2)
 
-#define PVRSRV_USSE_EDM_CLEANUPCMD_COMPLETE    (1UL << 0)      
+#define PVRSRV_USSE_EDM_CLEANUPCMD_COMPLETE    (1UL << 0)
 
 #if defined(FIX_HW_BRN_28889)
-#define PVRSRV_USSE_EDM_BIF_INVAL_COMPLETE             (1UL << 0)      
+#define PVRSRV_USSE_EDM_BIF_INVAL_COMPLETE             (1UL << 0)
 #endif
 
 #define PVRSRV_USSE_MISCINFO_READY             0x1UL
-#define PVRSRV_USSE_MISCINFO_GET_STRUCT_SIZES  0x2UL   
+#define PVRSRV_USSE_MISCINFO_GET_STRUCT_SIZES  0x2UL
 #if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
-#define PVRSRV_USSE_MISCINFO_MEMREAD                   0x4UL   
-#define PVRSRV_USSE_MISCINFO_MEMWRITE                  0x8UL   
+#define PVRSRV_USSE_MISCINFO_MEMREAD                   0x4UL
+#define PVRSRV_USSE_MISCINFO_MEMWRITE                  0x8UL
 #if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-#define PVRSRV_USSE_MISCINFO_MEMREAD_FAIL              0x1UL << 31     
+#define PVRSRV_USSE_MISCINFO_MEMREAD_FAIL              0x1UL << 31
 #endif
 #endif
 
@@ -298,27 +298,27 @@ typedef struct _SGX_MISCINFO_STRUCT_SIZES_
 #if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
 typedef struct _PVRSRV_SGX_MISCINFO_MEMACCESS
 {
-       IMG_DEV_VIRTADDR        sDevVAddr;              
-       IMG_DEV_PHYADDR         sPDDevPAddr;    
+       IMG_DEV_VIRTADDR        sDevVAddr;
+       IMG_DEV_PHYADDR         sPDDevPAddr;
 } PVRSRV_SGX_MISCINFO_MEMACCESS;
 #endif
 
 typedef struct _PVRSRV_SGX_MISCINFO_INFO
 {
        IMG_UINT32                                              ui32MiscInfoFlags;
-       PVRSRV_SGX_MISCINFO_FEATURES    sSGXFeatures;           
-       SGX_MISCINFO_STRUCT_SIZES               sSGXStructSizes;        
+       PVRSRV_SGX_MISCINFO_FEATURES    sSGXFeatures;
+       SGX_MISCINFO_STRUCT_SIZES               sSGXStructSizes;
 #if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
-       PVRSRV_SGX_MISCINFO_MEMACCESS   sSGXMemAccessSrc;       
-       PVRSRV_SGX_MISCINFO_MEMACCESS   sSGXMemAccessDest;      
+       PVRSRV_SGX_MISCINFO_MEMACCESS   sSGXMemAccessSrc;
+       PVRSRV_SGX_MISCINFO_MEMACCESS   sSGXMemAccessDest;
 #endif
 } PVRSRV_SGX_MISCINFO_INFO;
 
 #ifdef PVRSRV_USSE_EDM_STATUS_DEBUG
 #define SGXMK_TRACE_BUFFER_SIZE 512
-#endif 
+#endif
 
-#define SGXMKIF_HWPERF_CB_SIZE                                 0x100   
+#define SGXMKIF_HWPERF_CB_SIZE                                 0x100
 
 typedef struct _SGXMKIF_HWPERF_CB_ENTRY_
 {
@@ -330,7 +330,7 @@ typedef struct _SGXMKIF_HWPERF_CB_ENTRY_
        IMG_UINT32      ui32Info;
        IMG_UINT32      ui32TimeWraps;
        IMG_UINT32      ui32Time;
-       
+
        IMG_UINT32      ui32Counters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_COUNTERS];
        IMG_UINT32      ui32MiscCounters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS];
 } SGXMKIF_HWPERF_CB_ENTRY;
@@ -344,5 +344,5 @@ typedef struct _SGXMKIF_HWPERF_CB_
 } SGXMKIF_HWPERF_CB;
 
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index c32dc31..32dddb0
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -192,7 +192,7 @@ typedef struct _SGX_BRIDGE_INIT_INFO_
        IMG_UINT32 ui32MasterClkGateStatusMask;
        IMG_UINT32 ui32MasterClkGateStatus2Reg;
        IMG_UINT32 ui32MasterClkGateStatus2Mask;
-#endif 
+#endif
 
        IMG_UINT32 ui32CacheControl;
 
@@ -222,7 +222,7 @@ typedef struct _SGX_DEVICE_SYNC_LIST_
 
        struct _SGX_DEVICE_SYNC_LIST_   *psNext;
 
-       
+
        IMG_UINT32                      ui32NumSyncObjects;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                         ahSyncHandles[1];
@@ -259,7 +259,7 @@ typedef struct _SGX_CCB_KICK_
        IMG_HANDLE      hKernelHWSyncListMemInfo;
 #endif
 
-       
+
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID         *pahDstSyncHandles;
 #else
@@ -288,11 +288,11 @@ typedef struct _SGX_CCB_KICK_
 #endif
        IMG_BOOL        bLastInScene;
 
-       
+
        IMG_UINT32      ui32CCBOffset;
 
 #if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-       
+
        IMG_UINT32      ui32NumTASrcSyncs;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID         ahTASrcKernelSyncInfo[SGX_MAX_TA_SRC_SYNCS];
@@ -312,7 +312,7 @@ typedef struct _SGX_CCB_KICK_
        IMG_HANDLE      ah3DSrcKernelSyncInfo[SGX_MAX_3D_SRC_SYNCS];
 #endif
 #else
-       
+
        IMG_UINT32      ui32NumSrcSyncs;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID         ahSrcKernelSyncInfo[SGX_MAX_SRC_SYNCS];
@@ -321,7 +321,7 @@ typedef struct _SGX_CCB_KICK_
 #endif
 #endif
 
-       
+
        IMG_BOOL        bTADependency;
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID         hTA3DSyncInfo;
@@ -349,9 +349,9 @@ typedef struct _SGX_CCB_KICK_
 
 typedef struct _SGX_CLIENT_INFO_
 {
-       IMG_UINT32                                      ui32ProcessID;                  
-       IMG_VOID                                        *pvProcess;                             
-       PVRSRV_MISC_INFO                        sMiscInfo;                              
+       IMG_UINT32                                      ui32ProcessID;
+       IMG_VOID                                        *pvProcess;
+       PVRSRV_MISC_INFO                        sMiscInfo;
 
        IMG_UINT32                                      asDevData[SGX_MAX_DEV_DATA];
 
@@ -436,24 +436,24 @@ typedef struct _PVRSRV_2D_SGX_KICK_
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID                 ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
 
-       
+
        IMG_SID                 hDstSyncInfo;
 
-       
+
        IMG_SID                 hTASyncInfo;
 
-       
+
        IMG_SID                 h3DSyncInfo;
 #else
        IMG_HANDLE              ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
 
-       
+
        IMG_HANDLE              hDstSyncInfo;
 
-       
+
        IMG_HANDLE              hTASyncInfo;
 
-       
+
        IMG_HANDLE              h3DSyncInfo;
 #endif
 
@@ -463,8 +463,8 @@ typedef struct _PVRSRV_2D_SGX_KICK_
 #endif
        IMG_HANDLE              hDevMemContext;
 } PVRSRV_2D_SGX_KICK, *PPVRSRV_2D_SGX_KICK;
-#endif 
-#endif 
+#endif
+#endif
 
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 5c13976..7d4cb8e
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -148,7 +148,7 @@ PVRSRVAcquireDeviceDataBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
                psAcquireDevInfoOUT->eError =
                PVRSRVAllocHandle(psPerProc->psHandleBase,
                                                  &psAcquireDevInfoOUT->hDevCookie,
@@ -176,7 +176,7 @@ PVRSRVCreateDeviceMemContextBW(IMG_UINT32 ui32BridgeID,
 
        PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CREATE_DEVMEMCONTEXT);
 
-       
+
        NEW_HANDLE_BATCH_OR_ERROR(psCreateDevMemContextOUT->eError, psPerProc, PVRSRV_MAX_CLIENT_HEAPS + 1)
 
        psCreateDevMemContextOUT->eError =
@@ -207,7 +207,7 @@ PVRSRVCreateDeviceMemContextBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        if(bCreated)
        {
                PVRSRVAllocHandleNR(psPerProc->psHandleBase,
@@ -241,7 +241,7 @@ PVRSRVCreateDeviceMemContextBW(IMG_UINT32 ui32BridgeID,
                if(abSharedDeviceMemHeap[i])
 #endif
                {
-                       
+
 #if defined (SUPPORT_SID_INTERFACE)
                        PVRSRVAllocHandleNR(psPerProc->psHandleBase,
                                                                &hDevMemHeapExt,
@@ -258,7 +258,7 @@ PVRSRVCreateDeviceMemContextBW(IMG_UINT32 ui32BridgeID,
 #if defined(PVR_SECURE_HANDLES) || defined (SUPPORT_SID_INTERFACE)
                else
                {
-                       
+
                        if(bCreated)
                        {
 #if defined (SUPPORT_SID_INTERFACE)
@@ -426,7 +426,7 @@ PVRSRVGetDeviceMemHeapInfoBW(IMG_UINT32 ui32BridgeID,
                if(abSharedDeviceMemHeap[i])
 #endif
                {
-                       
+
 #if defined (SUPPORT_SID_INTERFACE)
                        PVRSRVAllocHandleNR(psPerProc->psHandleBase,
                                                                &hDevMemHeapExt,
@@ -443,7 +443,7 @@ PVRSRVGetDeviceMemHeapInfoBW(IMG_UINT32 ui32BridgeID,
 #if defined(PVR_SECURE_HANDLES) || defined (SUPPORT_SID_INTERFACE)
                else
                {
-                       
+
                        psGetDevMemHeapInfoOUT->eError =
                                PVRSRVFindHandle(psPerProc->psHandleBase,
                                                                 &hDevMemHeapExt,
@@ -518,15 +518,15 @@ PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
 
        bUseShareMemWorkaround = ((psAllocDeviceMemIN->ui32Attribs & PVRSRV_MEM_XPROC) != 0) ? IMG_TRUE : IMG_FALSE;
-       ui32ShareIndex = 7654321; 
+       ui32ShareIndex = 7654321;
 
        if (bUseShareMemWorkaround)
        {
-               
-               
+
+
 
                psAllocDeviceMemOUT->eError =
                        BM_XProcWorkaroundFindNewBufferAndSetShareIndex(&ui32ShareIndex);
@@ -536,7 +536,7 @@ PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
                }
        }
 
-       
+
        if(psAllocDeviceMemIN->pvPrivData)
        {
                if(!OSAccessOK(PVR_VERIFY_READ,
@@ -598,7 +598,7 @@ PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
        psAllocDeviceMemOUT->sClientMemInfo.ui32Flags = psMemInfo->ui32Flags;
        psAllocDeviceMemOUT->sClientMemInfo.uAllocSize = psMemInfo->uAllocSize;
 #if defined (SUPPORT_SID_INTERFACE)
-       
+
 #else
        psAllocDeviceMemOUT->sClientMemInfo.hMappingInfo = psMemInfo->sMemBlk.hOSMemHandle;
 #endif
@@ -629,7 +629,7 @@ PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
 
        if(psAllocDeviceMemIN->ui32Attribs & PVRSRV_MEM_NO_SYNCOBJ)
        {
-               
+
                OSMemSet(&psAllocDeviceMemOUT->sClientSyncInfo,
                                 0,
                                 sizeof (PVRSRV_CLIENT_SYNC_INFO));
@@ -637,7 +637,7 @@ PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
        }
        else
        {
-               
+
 
 #if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
                psAllocDeviceMemOUT->sClientSyncInfo.psSyncData =
@@ -685,7 +685,7 @@ PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
        return 0;
 }
 
-#endif 
+#endif
 
 static IMG_INT
 PVRSRVFreeDeviceMemBW(IMG_UINT32 ui32BridgeID,
@@ -760,7 +760,7 @@ PVRSRVExportDeviceMemBW(IMG_UINT32 ui32BridgeID,
                           ui32BridgeID == PVRSRV_GET_BRIDGE_ID(PVRSRV_BRIDGE_EXPORT_DEVICEMEM_2));
        PVR_UNREFERENCED_PARAMETER(ui32BridgeID);
 
-       
+
        psExportDeviceMemOUT->eError =
         PVRSRVLookupHandle(psPerProc->psHandleBase,
                            &hDevCookieInt,
@@ -773,7 +773,7 @@ PVRSRVExportDeviceMemBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        psExportDeviceMemOUT->eError =
                PVRSRVLookupHandle(psPerProc->psHandleBase,
                                                   (IMG_PVOID *)&psKernelMemInfo,
@@ -790,7 +790,7 @@ PVRSRVExportDeviceMemBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        psExportDeviceMemOUT->eError =
                PVRSRVFindHandle(KERNEL_HANDLE_BASE,
                                                         &psExportDeviceMemOUT->hMemInfo,
@@ -798,12 +798,12 @@ PVRSRVExportDeviceMemBW(IMG_UINT32 ui32BridgeID,
                                                         PVRSRV_HANDLE_TYPE_MEM_INFO);
        if(psExportDeviceMemOUT->eError == PVRSRV_OK)
        {
-               
+
                PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVExportDeviceMemBW: allocation is already exported"));
                return 0;
        }
 
-       
+
        psExportDeviceMemOUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE,
                                                                                                        &psExportDeviceMemOUT->hMemInfo,
                                                                                                        psKernelMemInfo,
@@ -815,7 +815,7 @@ PVRSRVExportDeviceMemBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        psKernelMemInfo->ui32Flags |= PVRSRV_MEM_EXPORTED;
 
        return 0;
@@ -838,7 +838,7 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
 
        NEW_HANDLE_BATCH_OR_ERROR(psMapDevMemOUT->eError, psPerProc, 2)
 
-       
+
        psMapDevMemOUT->eError = PVRSRVLookupHandle(KERNEL_HANDLE_BASE,
                                                                                                (IMG_VOID**)&psSrcKernelMemInfo,
                                                                                                psMapDevMemIN->hKernelMemInfo,
@@ -848,7 +848,7 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        psMapDevMemOUT->eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
                                                                                                &hDstDevMemHeap,
                                                                                                psMapDevMemIN->hDstDevMemHeap,
@@ -858,14 +858,14 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        if (psSrcKernelMemInfo->sShareMemWorkaround.bInUse)
        {
                PVR_DPF((PVR_DBG_MESSAGE, "using the mem wrap workaround."));
 
                psSrcKernelMemInfo->sShareMemWorkaround.ui32OrigReqAttribs |=
                        psMapDevMemIN->ui32BridgeFlags;
-               
+
                psMapDevMemOUT->eError = BM_XProcWorkaroundSetShareIndex(psSrcKernelMemInfo->sShareMemWorkaround.ui32ShareIndex);
                if(psMapDevMemOUT->eError != PVRSRV_OK)
                {
@@ -884,7 +884,7 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
                                                                   0,
                                                                   &psDstKernelMemInfo,
                                                                   "" );
-               
+
 
                BM_XProcWorkaroundUnsetShareIndex(psSrcKernelMemInfo->sShareMemWorkaround.ui32ShareIndex);
                if(psMapDevMemOUT->eError != PVRSRV_OK)
@@ -902,7 +902,7 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
        }
        else
        {
-               
+
                psMapDevMemOUT->eError = PVRSRVMapDeviceMemoryKM(psPerProc,
                                                                                                                 psSrcKernelMemInfo,
                                                                                                                 hDstDevMemHeap,
@@ -913,7 +913,7 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
                }
        }
 
-       
+
        psDstKernelMemInfo->sShareMemWorkaround = psSrcKernelMemInfo->sShareMemWorkaround;
 
        OSMemSet(&psMapDevMemOUT->sDstClientMemInfo,
@@ -931,12 +931,12 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
        psMapDevMemOUT->sDstClientMemInfo.ui32Flags = psDstKernelMemInfo->ui32Flags;
     psMapDevMemOUT->sDstClientMemInfo.uAllocSize = psDstKernelMemInfo->uAllocSize;
 #if defined (SUPPORT_SID_INTERFACE)
-       
+
 #else
        psMapDevMemOUT->sDstClientMemInfo.hMappingInfo = psDstKernelMemInfo->sMemBlk.hOSMemHandle;
 #endif
 
-       
+
        PVRSRVAllocHandleNR(psPerProc->psHandleBase,
                                          &psMapDevMemOUT->sDstClientMemInfo.hKernelMemInfo,
                                          psDstKernelMemInfo,
@@ -945,7 +945,7 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
        psMapDevMemOUT->sDstClientSyncInfo.hKernelSyncInfo = IMG_NULL;
 
 #if defined (SUPPORT_SID_INTERFACE)
-       
+
        if (psDstKernelMemInfo->sMemBlk.hOSMemHandle != IMG_NULL)
        {
                PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
@@ -961,7 +961,7 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
        }
 #endif
 
-       
+
        if(psDstKernelMemInfo->psKernelSyncInfo)
        {
 #if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
@@ -975,7 +975,7 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
                        psDstKernelMemInfo->psKernelSyncInfo->sReadOps2CompleteDevVAddr;
 
 #if defined (SUPPORT_SID_INTERFACE)
-               
+
                if (psDstKernelMemInfo->psKernelSyncInfo->psSyncDataMemInfoKM->sMemBlk.hOSMemHandle != IMG_NULL)
                {
                        PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
@@ -996,7 +996,7 @@ PVRSRVMapDeviceMemoryBW(IMG_UINT32 ui32BridgeID,
 #endif
 
                psMapDevMemOUT->sDstClientMemInfo.psClientSyncInfo = &psMapDevMemOUT->sDstClientSyncInfo;
-               
+
                PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
                                          &psMapDevMemOUT->sDstClientSyncInfo.hKernelSyncInfo,
                                          psDstKernelMemInfo->psKernelSyncInfo,
@@ -1081,7 +1081,7 @@ PVRSRVMapDeviceClassMemoryBW(IMG_UINT32 ui32BridgeID,
 
        NEW_HANDLE_BATCH_OR_ERROR(psMapDevClassMemOUT->eError, psPerProc, 2)
 
-       
+
        psMapDevClassMemOUT->eError =
         PVRSRVLookupHandleAnyType(psPerProc->psHandleBase,
                                                                  &hDeviceClassBufferInt,
@@ -1093,7 +1093,7 @@ PVRSRVMapDeviceClassMemoryBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        psMapDevClassMemOUT->eError =
                PVRSRVLookupHandle(psPerProc->psHandleBase,
                                   &hDevMemContextInt,
@@ -1105,7 +1105,7 @@ PVRSRVMapDeviceClassMemoryBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        switch(eHandleType)
        {
 #if defined(PVR_SECURE_HANDLES) || defined (SUPPORT_SID_INTERFACE)
@@ -1172,7 +1172,7 @@ PVRSRVMapDeviceClassMemoryBW(IMG_UINT32 ui32BridgeID,
 
        psMapDevClassMemOUT->sClientSyncInfo.hKernelSyncInfo = IMG_NULL;
 
-       
+
        if(psMemInfo->psKernelSyncInfo)
        {
 #if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
@@ -1206,7 +1206,7 @@ PVRSRVMapDeviceClassMemoryBW(IMG_UINT32 ui32BridgeID,
 #endif
 
                psMapDevClassMemOUT->sClientMemInfo.psClientSyncInfo = &psMapDevClassMemOUT->sClientSyncInfo;
-               
+
                PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
                                                  &psMapDevClassMemOUT->sClientSyncInfo.hKernelSyncInfo,
                                                  psMemInfo->psKernelSyncInfo,
@@ -1269,7 +1269,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
                                          PVRSRV_BRIDGE_IN_WRAP_EXT_MEMORY *psWrapExtMemIN,
                                          PVRSRV_BRIDGE_OUT_WRAP_EXT_MEMORY *psWrapExtMemOUT,
                                          PVRSRV_PER_PROCESS_DATA *psPerProc);
-#else 
+#else
 static IMG_INT
 PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
                                          PVRSRV_BRIDGE_IN_WRAP_EXT_MEMORY *psWrapExtMemIN,
@@ -1286,7 +1286,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
 
        NEW_HANDLE_BATCH_OR_ERROR(psWrapExtMemOUT->eError, psPerProc, 2)
 
-       
+
        psWrapExtMemOUT->eError =
                PVRSRVLookupHandle(psPerProc->psHandleBase, &hDevCookieInt,
                                                   psWrapExtMemIN->hDevCookie,
@@ -1296,7 +1296,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        psWrapExtMemOUT->eError =
        PVRSRVLookupHandle(psPerProc->psHandleBase, &hDevMemContextInt,
                                   psWrapExtMemIN->hDevMemContext,
@@ -1325,7 +1325,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
                                                           ui32PageTableSize) != PVRSRV_OK)
                {
                        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,      ui32PageTableSize, (IMG_VOID *)psSysPAddr, 0);
-                       
+
                        return -EFAULT;
                }
        }
@@ -1347,7 +1347,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
                          ui32PageTableSize,
                          (IMG_VOID *)psSysPAddr, 0);
-               
+
        }
 
        if(psWrapExtMemOUT->eError != PVRSRV_OK)
@@ -1358,7 +1358,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
        psWrapExtMemOUT->sClientMemInfo.pvLinAddrKM =
                        psMemInfo->pvLinAddrKM;
 
-       
+
        psWrapExtMemOUT->sClientMemInfo.pvLinAddr = 0;
        psWrapExtMemOUT->sClientMemInfo.sDevVAddr = psMemInfo->sDevVAddr;
        psWrapExtMemOUT->sClientMemInfo.ui32Flags = psMemInfo->ui32Flags;
@@ -1375,7 +1375,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
                                          PVRSRV_HANDLE_ALLOC_FLAG_NONE);
 
 #if defined (SUPPORT_SID_INTERFACE)
-       
+
        if (psMemInfo->sMemBlk.hOSMemHandle != IMG_NULL)
        {
                PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
@@ -1391,7 +1391,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
        }
 #endif
 
-       
+
 #if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
        psWrapExtMemOUT->sClientSyncInfo.psSyncData =
                psMemInfo->psKernelSyncInfo->psSyncData;
@@ -1403,7 +1403,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
                psMemInfo->psKernelSyncInfo->sReadOps2CompleteDevVAddr;
 
 #if defined (SUPPORT_SID_INTERFACE)
-       
+
        if (psMemInfo->psKernelSyncInfo->psSyncDataMemInfoKM->sMemBlk.hOSMemHandle != IMG_NULL)
        {
                PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
@@ -1436,7 +1436,7 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
 
        return 0;
 }
-#endif 
+#endif
 
 static IMG_INT
 PVRSRVUnwrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
@@ -1956,7 +1956,7 @@ PDumpSyncPolBW(IMG_UINT32 ui32BridgeID,
                ui32Offset = offsetof(PVRSRV_SYNC_DATA, ui32WriteOpsComplete);
        }
 
-       
+
        if (psPDumpSyncPolIN->bUseLastOpDumpVal)
        {
                if(psPDumpSyncPolIN->bIsRead)
@@ -2075,7 +2075,7 @@ PDumpStopInitPhaseBW(IMG_UINT32 ui32BridgeID,
        return 0;
 }
 
-#endif 
+#endif
 
 
 static IMG_INT
@@ -2113,7 +2113,7 @@ PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
            ((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_DDKVERSION_PRESENT) != 0) &&
            ((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_FREEMEM_PRESENT) != 0))
        {
-               
+
                psGetMiscInfoOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
                return 0;
        }
@@ -2122,7 +2122,7 @@ PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
            ((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_DDKVERSION_PRESENT) != 0) ||
            ((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_FREEMEM_PRESENT) != 0))
        {
-               
+
 #if defined (SUPPORT_SID_INTERFACE)
                ASSIGN_AND_EXIT_ON_ERROR(psGetMiscInfoOUT->eError,
                                        OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
@@ -2131,7 +2131,7 @@ PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
                                                        "Output string buffer"));
                psGetMiscInfoOUT->eError = PVRSRVGetMiscInfoKM(&sMiscInfo);
 
-               
+
                eError = CopyToUserWrapper(psPerProc, ui32BridgeID,
                                                                        psGetMiscInfoIN->sMiscInfo.pszMemoryStr,
                                                                        sMiscInfo.pszMemoryStr,
@@ -2145,14 +2145,14 @@ PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
 
                psGetMiscInfoOUT->eError = PVRSRVGetMiscInfoKM(&psGetMiscInfoOUT->sMiscInfo);
 
-               
+
                eError = CopyToUserWrapper(psPerProc, ui32BridgeID,
                                           psGetMiscInfoIN->sMiscInfo.pszMemoryStr,
                                           psGetMiscInfoOUT->sMiscInfo.pszMemoryStr,
                                           psGetMiscInfoOUT->sMiscInfo.ui32MemoryStrLen);
 #endif
 
-               
+
 #if defined (SUPPORT_SID_INTERFACE)
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
                                        sMiscInfo.ui32MemoryStrLen,
@@ -2163,12 +2163,12 @@ PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
                         (IMG_VOID *)psGetMiscInfoOUT->sMiscInfo.pszMemoryStr, 0);
 #endif
 
-               
+
                psGetMiscInfoOUT->sMiscInfo.pszMemoryStr = psGetMiscInfoIN->sMiscInfo.pszMemoryStr;
 
                if(eError != PVRSRV_OK)
                {
-                       
+
                        PVR_DPF((PVR_DBG_ERROR, "PVRSRVGetMiscInfoBW Error copy to user"));
                        return -EFAULT;
                }
@@ -2182,13 +2182,13 @@ PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
 #endif
        }
 
-       
+
        if (psGetMiscInfoOUT->eError != PVRSRV_OK)
        {
                return 0;
        }
 
-       
+
 #if defined (SUPPORT_SID_INTERFACE)
        if (sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_GLOBALEVENTOBJECT_PRESENT)
 #else
@@ -2223,7 +2223,7 @@ PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
        if (psGetMiscInfoOUT->sMiscInfo.hSOCTimerRegisterOSMemHandle)
 #endif
        {
-               
+
                psGetMiscInfoOUT->eError = PVRSRVAllocHandle(psPerProc->psHandleBase,
                                                  &psGetMiscInfoOUT->sMiscInfo.hSOCTimerRegisterOSMemHandle,
 #if defined (SUPPORT_SID_INTERFACE)
@@ -2245,7 +2245,7 @@ PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
                psGetMiscInfoOUT->sMiscInfo.hSOCTimerRegisterOSMemHandle = 0;
        }
 
-       
+
        psGetMiscInfoOUT->sMiscInfo.ui32StateRequest = sMiscInfo.ui32StateRequest;
        psGetMiscInfoOUT->sMiscInfo.ui32StatePresent = sMiscInfo.ui32StatePresent;
 
@@ -2278,19 +2278,19 @@ PVRSRVConnectBW(IMG_UINT32 ui32BridgeID,
        PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CONNECT_SERVICES);
 
 #if defined(PDUMP)
-       
+
        if ((psConnectServicesIN->ui32Flags & SRV_FLAGS_PERSIST) != 0)
        {
        psPerProc->bPDumpPersistent = IMG_TRUE;
        }
 
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-       
+
        if ((psConnectServicesIN->ui32Flags & SRV_FLAGS_PDUMP_ACTIVE) != 0)
        {
        psPerProc->bPDumpActive = IMG_TRUE;
        }
-#endif 
+#endif
 #else
        PVR_UNREFERENCED_PARAMETER(psConnectServicesIN);
 #endif
@@ -2311,7 +2311,7 @@ PVRSRVDisconnectBW(IMG_UINT32 ui32BridgeID,
 
        PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DISCONNECT_SERVICES);
 
-       
+
        psRetOUT->eError = PVRSRV_OK;
 
        return 0;
@@ -2474,7 +2474,7 @@ PVRSRVEnumDCDimsBW(IMG_UINT32 ui32BridgeID,
 #if defined(SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER)
 static IMG_INT
 PVRSRVGetDCSystemBufferBW(IMG_UINT32 ui32BridgeID,
-                                                 PVRSRV_BRIDGE_IN_GET_DISPCLASS_SYSBUFFER *psGetDispClassSysBufferIN,  
+                                                 PVRSRV_BRIDGE_IN_GET_DISPCLASS_SYSBUFFER *psGetDispClassSysBufferIN,
                                                  PVRSRV_BRIDGE_OUT_GET_DISPCLASS_SYSBUFFER *psGetDispClassSysBufferOUT,
                                                  PVRSRV_PER_PROCESS_DATA *psPerProc)
 {
@@ -2504,7 +2504,7 @@ PVRSRVGetDCSystemBufferBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-        
+
        PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
                                                 &psGetDispClassSysBufferOUT->hBuffer,
                                                 hBufferInt,
@@ -2570,7 +2570,7 @@ PVRSRVCreateDCSwapChainBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        ui32SwapChainID = psCreateDispClassSwapChainIN->ui32SwapChainID;
 
        psCreateDispClassSwapChainOUT->eError =
@@ -2588,7 +2588,7 @@ PVRSRVCreateDCSwapChainBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        psCreateDispClassSwapChainOUT->ui32SwapChainID = ui32SwapChainID;
 
        PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
@@ -2869,7 +2869,7 @@ PVRSRVGetDCBuffersBW(IMG_UINT32 ui32BridgeID,
                IMG_HANDLE hBufferExt;
 #endif
 
-        
+
 #if defined (SUPPORT_SID_INTERFACE)
        PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
                                                        &hBufferExt,
@@ -3305,7 +3305,7 @@ PVRSRVGetBCBufferBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-        
+
        PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
                                                 &psGetBufferClassBufferOUT->hBuffer,
                                                 hBufferInt,
@@ -3475,7 +3475,7 @@ PVRSRVMapMemInfoMemBW(IMG_UINT32 ui32BridgeID,
                        return 0;
        }
 
-       
+
        psMapMemInfoMemOUT->eError =
                PVRSRVGetParentHandle(psPerProc->psHandleBase,
                                        &hParent,
@@ -3535,14 +3535,14 @@ PVRSRVMapMemInfoMemBW(IMG_UINT32 ui32BridgeID,
 
        if(psKernelMemInfo->ui32Flags & PVRSRV_MEM_NO_SYNCOBJ)
        {
-               
+
                OSMemSet(&psMapMemInfoMemOUT->sClientSyncInfo,
                                 0,
                                 sizeof (PVRSRV_CLIENT_SYNC_INFO));
        }
        else
        {
-               
+
 #if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
                psMapMemInfoMemOUT->sClientSyncInfo.psSyncData =
                        psKernelMemInfo->psKernelSyncInfo->psSyncData;
@@ -3624,7 +3624,7 @@ _SetDispatchTableEntry(IMG_UINT32 ui32Index,
                                           BridgeWrapperFunction pfFunction,
                                           const IMG_CHAR *pszFunctionName)
 {
-       static IMG_UINT32 ui32PrevIndex = ~0UL;         
+       static IMG_UINT32 ui32PrevIndex = ~0UL;
 #if !defined(DEBUG)
        PVR_UNREFERENCED_PARAMETER(pszIOCName);
 #endif
@@ -3633,11 +3633,11 @@ _SetDispatchTableEntry(IMG_UINT32 ui32Index,
 #endif
 
 #if defined(DEBUG_BRIDGE_KM_DISPATCH_TABLE)
-       
+
        PVR_DPF((PVR_DBG_WARNING, "%s: %d %s %s", __FUNCTION__, ui32Index, pszIOCName, pszFunctionName));
 #endif
 
-       
+
        if (ui32Index >= BRIDGE_DISPATCH_TABLE_ENTRY_COUNT) {
                PVR_DPF((PVR_DBG_ERROR, "Invalid parameters."));
                return;
@@ -3656,7 +3656,7 @@ _SetDispatchTableEntry(IMG_UINT32 ui32Index,
                PVR_DPF((PVR_DBG_ERROR, "NOTE: Enabling DEBUG_BRIDGE_KM_DISPATCH_TABLE may help debug this issue."));
        }
 
-       
+
        if((ui32PrevIndex != ~0UL) &&
           ((ui32Index >= ui32PrevIndex + DISPATCH_TABLE_GAP_THRESHOLD) ||
                (ui32Index <= ui32PrevIndex)))
@@ -3696,7 +3696,7 @@ PVRSRVInitSrvConnectBW(IMG_UINT32 ui32BridgeID,
        PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_INITSRV_CONNECT);
        PVR_UNREFERENCED_PARAMETER(psBridgeIn);
 
-        
+
        if((OSProcHasPrivSrvInit() == IMG_FALSE) || PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_RUNNING) || PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_RAN))
        {
                psRetOUT->eError = PVRSRV_ERROR_SRV_CONNECT_FAILED;
@@ -3879,7 +3879,7 @@ PVRSRVEventObjectCloseBW(IMG_UINT32 ui32BridgeID,
                                                        &psEventObjectCloseIN->sEventObject.szName,
                                                        EVENTOBJNAME_MAXLENGTH) != PVRSRV_OK)
        {
-               
+
                return -EFAULT;
        }
 
@@ -3912,13 +3912,13 @@ static PVRSRV_ERROR DoQuerySyncOpsSatisfied(PVRSRV_KERNEL_SYNC_INFO *psKernelSyn
        IMG_UINT32 ui32ReadOpsPending;
        IMG_UINT32 ui32ReadOps2Pending;
 
-       
+
        if (!psKernelSyncInfo)
        {
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
 
 
 
@@ -3940,7 +3940,7 @@ static PVRSRV_ERROR DoQuerySyncOpsSatisfied(PVRSRV_KERNEL_SYNC_INFO *psKernelSyn
                ui32ReadOps2Pending - psKernelSyncInfo->psSyncData->ui32ReadOps2Complete))
        {
 #if defined(PDUMP) && !defined(SUPPORT_VGX)
-               
+
                PDumpComment("Poll for read ops complete to reach value (pdump: %u, actual snapshot: %u)",
                                         psKernelSyncInfo->psSyncData->ui32LastReadOpDumpVal,
                                         ui32ReadOpsPendingSnapShot);
@@ -3948,11 +3948,11 @@ static PVRSRV_ERROR DoQuerySyncOpsSatisfied(PVRSRV_KERNEL_SYNC_INFO *psKernelSyn
                                          offsetof(PVRSRV_SYNC_DATA, ui32ReadOpsComplete),
                                          psKernelSyncInfo->psSyncData->ui32LastReadOpDumpVal,
                                          0xFFFFFFFF,
-                                         PDUMP_POLL_OPERATOR_EQUAL, 
+                                         PDUMP_POLL_OPERATOR_EQUAL,
                                          0,
                                          MAKEUNIQUETAG(psKernelSyncInfo->psSyncDataMemInfoKM));
 
-               
+
                PDumpComment("Poll for write ops complete to reach value (pdump: %u, actual snapshot: %u)",
                                         psKernelSyncInfo->psSyncData->ui32LastOpDumpVal,
                                         ui32WriteOpsPendingSnapShot);
@@ -3960,10 +3960,10 @@ static PVRSRV_ERROR DoQuerySyncOpsSatisfied(PVRSRV_KERNEL_SYNC_INFO *psKernelSyn
                                          offsetof(PVRSRV_SYNC_DATA, ui32WriteOpsComplete),
                                          psKernelSyncInfo->psSyncData->ui32LastOpDumpVal,
                                          0xFFFFFFFF,
-                                         PDUMP_POLL_OPERATOR_EQUAL, 
+                                         PDUMP_POLL_OPERATOR_EQUAL,
                                          0,
                                          MAKEUNIQUETAG(psKernelSyncInfo->psSyncDataMemInfoKM));
-               
+
 
 #endif
                return PVRSRV_OK;
@@ -3986,20 +3986,20 @@ static PVRSRV_ERROR DoModifyCompleteSyncOps(MODIFY_SYNC_OP_INFO *psModSyncOpInfo
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        if((psModSyncOpInfo->ui32WriteOpsPendingSnapShot != psKernelSyncInfo->psSyncData->ui32WriteOpsComplete)
           || (psModSyncOpInfo->ui32ReadOpsPendingSnapShot != psKernelSyncInfo->psSyncData->ui32ReadOpsComplete))
        {
                return PVRSRV_ERROR_BAD_SYNC_STATE;
        }
 
-       
+
        if(psModSyncOpInfo->ui32ModifyFlags & PVRSRV_MODIFYSYNCOPS_FLAGS_WO_INC)
        {
                psKernelSyncInfo->psSyncData->ui32WriteOpsComplete++;
        }
 
-       
+
        if(psModSyncOpInfo->ui32ModifyFlags & PVRSRV_MODIFYSYNCOPS_FLAGS_RO_INC)
        {
                psKernelSyncInfo->psSyncData->ui32ReadOpsComplete++;
@@ -4028,7 +4028,7 @@ static PVRSRV_ERROR ModifyCompleteSyncOpsCallBack(IMG_PVOID               pvParam,
 
        if (psModSyncOpInfo->psKernelSyncInfo)
        {
-               
+
                LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
                {
                        if (DoQuerySyncOpsSatisfied(psModSyncOpInfo->psKernelSyncInfo,
@@ -4059,9 +4059,9 @@ OpFlushedComplete:
        }
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,      sizeof(MODIFY_SYNC_OP_INFO), (IMG_VOID *)psModSyncOpInfo, 0);
-       
 
-       
+
+
        PVRSRVScheduleDeviceCallbacks();
 
        return PVRSRV_OK;
@@ -4088,7 +4088,7 @@ PVRSRVCreateSyncInfoModObjBW(IMG_UINT32
                          (IMG_VOID **)&psModSyncOpInfo, 0,
                          "ModSyncOpInfo (MODIFY_SYNC_OP_INFO)"));
 
-       psModSyncOpInfo->psKernelSyncInfo = IMG_NULL; 
+       psModSyncOpInfo->psKernelSyncInfo = IMG_NULL;
 
        psCreateSyncInfoModObjOUT->eError = PVRSRVAllocHandle(psPerProc->psHandleBase,
                                                                                                                                  &psCreateSyncInfoModObjOUT->hKernelSyncInfoModObj,
@@ -4135,7 +4135,7 @@ PVRSRVDestroySyncInfoModObjBW(IMG_UINT32
 
        if(psModSyncOpInfo->psKernelSyncInfo != IMG_NULL)
        {
-               
+
                psDestroySyncInfoModObjOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
                return 0;
        }
@@ -4194,20 +4194,20 @@ PVRSRVModifyPendingSyncOpsBW(IMG_UINT32                                                                 ui32BridgeID,
 
        if(psModSyncOpInfo->psKernelSyncInfo)
        {
-               
+
                psModifySyncOpsOUT->eError = PVRSRV_ERROR_RETRY;
                PVR_DPF((PVR_DBG_VERBOSE, "PVRSRVModifyPendingSyncOpsBW: SyncInfo Modification object is not empty"));
                return 0;
        }
 
-       
+
        psModSyncOpInfo->psKernelSyncInfo = psKernelSyncInfo;
        psModSyncOpInfo->ui32ModifyFlags = psModifySyncOpsIN->ui32ModifyFlags;
        psModSyncOpInfo->ui32ReadOpsPendingSnapShot = psKernelSyncInfo->psSyncData->ui32ReadOpsPending;
        psModSyncOpInfo->ui32WriteOpsPendingSnapShot = psKernelSyncInfo->psSyncData->ui32WriteOpsPending;
        psModSyncOpInfo->ui32ReadOps2PendingSnapShot = psKernelSyncInfo->psSyncData->ui32ReadOps2Pending;
 
-       
+
 
        psModifySyncOpsOUT->ui32ReadOpsPending = psKernelSyncInfo->psSyncData->ui32ReadOpsPending;
        psModifySyncOpsOUT->ui32WriteOpsPending = psKernelSyncInfo->psSyncData->ui32WriteOpsPending;
@@ -4223,7 +4223,7 @@ PVRSRVModifyPendingSyncOpsBW(IMG_UINT32                                                                   ui32BridgeID,
                psKernelSyncInfo->psSyncData->ui32ReadOpsPending++;
        }
 
-       
+
        psModifySyncOpsOUT->eError = ResManDissociateRes(psModSyncOpInfo->hResItem,
                                                                                                         psPerProc->hResManContext);
 
@@ -4259,7 +4259,7 @@ PVRSRVModifyCompleteSyncOpsBW(IMG_UINT32                                                  ui32BridgeID,
 
        if(psModSyncOpInfo->psKernelSyncInfo == IMG_NULL)
        {
-               
+
                psModifySyncOpsOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
                return 0;
        }
@@ -4274,7 +4274,7 @@ PVRSRVModifyCompleteSyncOpsBW(IMG_UINT32                                                  ui32BridgeID,
 
        psModSyncOpInfo->psKernelSyncInfo = IMG_NULL;
 
-       
+
        PVRSRVScheduleDeviceCallbacks();
 
        return 0;
@@ -4301,7 +4301,7 @@ PVRSRVSyncOpsTakeTokenBW(IMG_UINT32                                                                       ui32BridgeID,
                return 0;
        }
 
-       
+
 
        psSyncOpsTakeTokenOUT->ui32ReadOpsPending = psKernelSyncInfo->psSyncData->ui32ReadOpsPending;
        psSyncOpsTakeTokenOUT->ui32WriteOpsPending = psKernelSyncInfo->psSyncData->ui32WriteOpsPending;
@@ -4375,7 +4375,7 @@ PVRSRVSyncOpsFlushToModObjBW(IMG_UINT32
 
        if(psModSyncOpInfo->psKernelSyncInfo == IMG_NULL)
        {
-               
+
                psSyncOpsFlushToModObjOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
                return 0;
        }
@@ -4417,14 +4417,14 @@ PVRSRVSyncOpsFlushToDeltaBW(IMG_UINT32                                         u
                return 0;
        }
 
-       
+
        ui32DeltaRead = psSyncInfo->psSyncData->ui32ReadOpsPending - psSyncInfo->psSyncData->ui32ReadOpsComplete;
        ui32DeltaWrite = psSyncInfo->psSyncData->ui32WriteOpsPending - psSyncInfo->psSyncData->ui32WriteOpsComplete;
 
        if (ui32DeltaRead <= psSyncOpsFlushToDeltaIN->ui32Delta && ui32DeltaWrite <= psSyncOpsFlushToDeltaIN->ui32Delta)
        {
 #if defined(PDUMP) && !defined(SUPPORT_VGX)
-               
+
                PDumpComment("Poll for read ops complete to delta (%u)",
                                         psSyncOpsFlushToDeltaIN->ui32Delta);
                psSyncOpsFlushToDeltaOUT->eError =
@@ -4436,7 +4436,7 @@ PVRSRVSyncOpsFlushToDeltaBW(IMG_UINT32                                         u
                                                  0,
                                                  MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
 
-               
+
                PDumpComment("Poll for write ops complete to delta (%u)",
                                         psSyncOpsFlushToDeltaIN->ui32Delta);
                psSyncOpsFlushToDeltaOUT->eError =
@@ -4535,16 +4535,16 @@ PVRSRVAllocSyncInfoBW(IMG_UINT32                                         ui32Bri
                                                                                           0,
                                                                                           FreeSyncInfoCallback);
 
-       
+
        goto allocsyncinfo_commit;
 
-       
+
  allocsyncinfo_errorexit_freesyncinfo:
        PVRSRVFreeSyncInfoKM(psSyncInfo);
 
  allocsyncinfo_errorexit:
 
-       
+
  allocsyncinfo_commit:
        psAllocSyncInfoOUT->eError = eError;
        COMMIT_HANDLE_BATCH_OR_ERROR(eError, psPerProc);
@@ -4635,30 +4635,30 @@ CommonBridgeInit(IMG_VOID)
     SetDispatchTableEntry(PVRSRV_BRIDGE_MAP_DEV_MEMORY_2, PVRSRVMapDeviceMemoryBW);
     SetDispatchTableEntry(PVRSRV_BRIDGE_EXPORT_DEVICEMEM_2, PVRSRVExportDeviceMemBW);
 
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_PROCESS_SIMISR_EVENT, DummyBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_REGISTER_SIM_PROCESS, DummyBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_UNREGISTER_SIM_PROCESS, DummyBW);
 
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_MAPPHYSTOUSERSPACE, DummyBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_UNMAPPHYSTOUSERSPACE, DummyBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_GETPHYSTOUSERSPACEMAP, DummyBW);
 
        SetDispatchTableEntry(PVRSRV_BRIDGE_GET_FB_STATS, DummyBW);
 
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_GET_MISC_INFO, PVRSRVGetMiscInfoBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_RELEASE_MISC_INFO, DummyBW);
 
-       
+
 #if defined (SUPPORT_OVERLAY_ROTATE_BLIT)
        SetDispatchTableEntry(PVRSRV_BRIDGE_INIT_3D_OVL_BLT_RES, DummyBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_DEINIT_3D_OVL_BLT_RES, DummyBW);
 #endif
 
 
-       
+
 #if defined(PDUMP)
        SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_INIT, DummyBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_MEMPOL, PDumpMemPolBW);
@@ -4678,15 +4678,15 @@ CommonBridgeInit(IMG_VOID)
        SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_CYCLE_COUNT_REG_READ, PDumpCycleCountRegReadBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_STARTINITPHASE, PDumpStartInitPhaseBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_STOPINITPHASE, PDumpStopInitPhaseBW);
-#endif 
+#endif
+
 
-       
        SetDispatchTableEntry(PVRSRV_BRIDGE_GET_OEMJTABLE, DummyBW);
 
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_ENUM_CLASS, PVRSRVEnumerateDCBW);
 
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_OPEN_DISPCLASS_DEVICE, PVRSRVOpenDCDeviceBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_CLOSE_DISPCLASS_DEVICE, PVRSRVCloseDCDeviceBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_ENUM_DISPCLASS_FORMATS, PVRSRVEnumDCFormatsBW);
@@ -4708,26 +4708,26 @@ CommonBridgeInit(IMG_VOID)
        SetDispatchTableEntry(PVRSRV_BRIDGE_SWAP_DISPCLASS_TO_BUFFER2, PVRSRVSwapToDCBuffer2BW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_SWAP_DISPCLASS_TO_SYSTEM, PVRSRVSwapToDCSystemBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_GET_DISPCLASS_FRONT_BUFFER, PVRSRVGetDCFrontBufferBW);
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_OPEN_BUFFERCLASS_DEVICE, PVRSRVOpenBCDeviceBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_CLOSE_BUFFERCLASS_DEVICE, PVRSRVCloseBCDeviceBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_GET_BUFFERCLASS_INFO, PVRSRVGetBCInfoBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_GET_BUFFERCLASS_BUFFER, PVRSRVGetBCBufferBW);
 
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_WRAP_EXT_MEMORY, PVRSRVWrapExtMemoryBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_UNWRAP_EXT_MEMORY, PVRSRVUnwrapExtMemoryBW);
 
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_ALLOC_SHARED_SYS_MEM, PVRSRVAllocSharedSysMemoryBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_FREE_SHARED_SYS_MEM, PVRSRVFreeSharedSysMemoryBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_MAP_MEMINFO_MEM, PVRSRVMapMemInfoMemBW);
 
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_INITSRV_CONNECT,    &PVRSRVInitSrvConnectBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_INITSRV_DISCONNECT, &PVRSRVInitSrvDisconnectBW);
 
-       
+
        SetDispatchTableEntry(PVRSRV_BRIDGE_EVENT_OBJECT_WAIT,  &PVRSRVEventObjectWaitBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_EVENT_OBJECT_OPEN,  &PVRSRVEventObjectOpenBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_EVENT_OBJECT_CLOSE, &PVRSRVEventObjectCloseBW);
@@ -4753,8 +4753,8 @@ CommonBridgeInit(IMG_VOID)
        SetMSVDXDispatchTableEntry();
 #endif
 
-       
-       
+
+
        for(i=0;i<BRIDGE_DISPATCH_TABLE_ENTRY_COUNT;i++)
        {
                if(!g_BridgeDispatchTable[i].pfFunction)
@@ -4814,7 +4814,7 @@ IMG_INT BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
                        }
                        else
                        {
-                               
+
                                switch(ui32BridgeID)
                                {
                                        case PVRSRV_GET_BRIDGE_ID(PVRSRV_BRIDGE_CONNECT_SERVICES):
@@ -4833,17 +4833,17 @@ IMG_INT BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
 
 #if defined(__linux__)
        {
-               
+
                SYS_DATA *psSysData;
 
                SysAcquireData(&psSysData);
 
-               
+
                psBridgeIn = ((ENV_DATA *)psSysData->pvEnvSpecificData)->pvBridgeData;
                psBridgeOut = (IMG_PVOID)((IMG_PBYTE)psBridgeIn + PVRSRV_MAX_BRIDGE_IN_SIZE);
 
-               
-               if((psBridgePackageKM->ui32InBufferSize > PVRSRV_MAX_BRIDGE_IN_SIZE) || 
+
+               if((psBridgePackageKM->ui32InBufferSize > PVRSRV_MAX_BRIDGE_IN_SIZE) ||
                        (psBridgePackageKM->ui32OutBufferSize > PVRSRV_MAX_BRIDGE_OUT_SIZE))
                {
                        goto return_fault;
@@ -4892,7 +4892,7 @@ IMG_INT BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
        }
 
 #if defined(__linux__)
-       
+
        if(CopyToUserWrapper(psPerProc,
                                                 ui32BridgeID,
                                                 psBridgePackageKM->pvParamOut,
old mode 100755 (executable)
new mode 100644 (file)
index 6b0dd88..2ac8adf
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -57,7 +57,7 @@ CopyFromUserWrapper(PVRSRV_PER_PROCESS_DATA *pProcData,
                                        IMG_VOID *pvSrc,
                                        IMG_UINT32 ui32Size);
 PVRSRV_ERROR
-CopyToUserWrapper(PVRSRV_PER_PROCESS_DATA *pProcData, 
+CopyToUserWrapper(PVRSRV_PER_PROCESS_DATA *pProcData,
                                  IMG_UINT32 ui32BridgeID,
                                  IMG_VOID *pvDest,
                                  IMG_VOID *pvSrc,
@@ -138,11 +138,11 @@ ReleaseHandleBatch(PVRSRV_PER_PROCESS_DATA *psPerProc)
                PVRSRVReleaseHandleBatch(psPerProc->psHandleBase);
        }
 }
-#else  
+#else
 #define NEW_HANDLE_BATCH_OR_ERROR(error, psPerProc, ui32BatchSize)
 #define COMMIT_HANDLE_BATCH_OR_ERROR(error, psPerProc)
 #define ReleaseHandleBatch(psPerProc)
-#endif 
+#endif
 
 IMG_INT
 DummyBW(IMG_UINT32 ui32BridgeID,
@@ -157,13 +157,13 @@ typedef IMG_INT (*BridgeWrapperFunction)(IMG_UINT32 ui32BridgeID,
 
 typedef struct _PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY
 {
-       BridgeWrapperFunction pfFunction; 
+       BridgeWrapperFunction pfFunction;
 #if defined(DEBUG_BRIDGE_KM)
-       const IMG_CHAR *pszIOCName; 
-       const IMG_CHAR *pszFunctionName; 
-       IMG_UINT32 ui32CallCount; 
-       IMG_UINT32 ui32CopyFromUserTotalBytes; 
-       IMG_UINT32 ui32CopyToUserTotalBytes; 
+       const IMG_CHAR *pszIOCName;
+       const IMG_CHAR *pszFunctionName;
+       IMG_UINT32 ui32CallCount;
+       IMG_UINT32 ui32CopyFromUserTotalBytes;
+       IMG_UINT32 ui32CopyToUserTotalBytes;
 #endif
 }PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY;
 
@@ -194,7 +194,7 @@ _SetDispatchTableEntry(IMG_UINT32 ui32Index,
                                           const IMG_CHAR *pszFunctionName);
 
 
+
 #define SetDispatchTableEntry(ui32Index, pfFunction) \
        _SetDispatchTableEntry(PVRSRV_GET_BRIDGE_ID(ui32Index), #ui32Index, (BridgeWrapperFunction)pfFunction, #pfFunction)
 
@@ -228,5 +228,5 @@ IMG_INT BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index dad0800..2ce279e
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -40,7 +40,7 @@ PVRSRVLookupOSMemHandle(PVRSRV_HANDLE_BASE *psHandleBase, IMG_HANDLE *phOSMemHan
        PVRSRV_HANDLE_TYPE eHandleType;
        PVRSRV_ERROR eError;
 
-       
+
        eError = PVRSRVLookupHandleAnyType(psHandleBase, &hMHandleInt,
                                                          &eHandleType,
                                                          hMHandle);
@@ -66,7 +66,7 @@ PVRSRVLookupOSMemHandle(PVRSRV_HANDLE_BASE *psHandleBase, IMG_HANDLE *phOSMemHan
                {
                        PVRSRV_KERNEL_SYNC_INFO *psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)hMHandleInt;
                        PVRSRV_KERNEL_MEM_INFO *psMemInfo = psSyncInfo->psSyncDataMemInfoKM;
-                       
+
                        *phOSMemHandle = psMemInfo->sMemBlk.hOSMemHandle;
 
                        break;
old mode 100755 (executable)
new mode 100644 (file)
index d027290..0f21a6f
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -43,5 +43,5 @@ PVRSRV_ERROR PVRSRVLookupOSMemHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phO
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 846b493..8638838
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -103,12 +103,12 @@ SGXReleaseClientInfoBW(IMG_UINT32 ui32BridgeID,
 
        PVR_ASSERT(psDevInfo->ui32ClientRefCount > 0);
 
-       
+
        if (psDevInfo->ui32ClientRefCount > 0)
        {
                psDevInfo->ui32ClientRefCount--;
        }
-       
+
        psRetOUT->eError = PVRSRV_OK;
 
        return 0;
@@ -146,7 +146,7 @@ SGXGetInternalDevInfoBW(IMG_UINT32 ui32BridgeID,
                                                                &psSGXGetInternalDevInfoOUT->sSGXInternalDevInfo);
 #endif
 
-       
+
        psSGXGetInternalDevInfoOUT->eError =
                PVRSRVAllocHandle(psPerProc->psHandleBase,
                                                  &psSGXGetInternalDevInfoOUT->sSGXInternalDevInfo.hHostCtlKernelMemInfoHandle,
@@ -212,7 +212,7 @@ SGXDoKickBW(IMG_UINT32 ui32BridgeID,
        {
                return 0;
        }
-                       
+
        if(psDoKickIN->sCCBKick.hTA3DSyncInfo != 0)
 #else
        if(psDoKickIN->sCCBKick.hTA3DSyncInfo != IMG_NULL)
@@ -257,7 +257,7 @@ SGXDoKickBW(IMG_UINT32 ui32BridgeID,
        }
 
 #if defined(FIX_HW_BRN_31620)
-       
+
        psRetOUT->eError =
                PVRSRVLookupHandle(psPerProc->psHandleBase,
                                                   &psDoKickIN->sCCBKick.hDevMemContext,
@@ -294,7 +294,7 @@ SGXDoKickBW(IMG_UINT32 ui32BridgeID,
 
 
 #if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-       
+
        if (psDoKickIN->sCCBKick.ui32NumTASrcSyncs > SGX_MAX_TA_SRC_SYNCS)
        {
                psRetOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
@@ -376,7 +376,7 @@ SGXDoKickBW(IMG_UINT32 ui32BridgeID,
                }
        }
 #else
-       
+
        if (psDoKickIN->sCCBKick.ui32NumSrcSyncs > SGX_MAX_SRC_SYNCS)
        {
                psRetOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
@@ -460,7 +460,7 @@ SGXDoKickBW(IMG_UINT32 ui32BridgeID,
 #endif
                                                           psDoKickIN->sCCBKick.as3DStatusUpdate[i].hKernelMemInfo,
                                                           PVRSRV_HANDLE_TYPE_MEM_INFO);
-                                                          
+
 #if defined (SUPPORT_SID_INTERFACE)
                sCCBKickKM.as3DStatusUpdate[i].sCtlStatus = psDoKickIN->sCCBKick.as3DStatusUpdate[i].sCtlStatus;
 #endif
@@ -517,7 +517,7 @@ SGXDoKickBW(IMG_UINT32 ui32BridgeID,
                        goto PVRSRV_BRIDGE_SGX_DOKICK_RETURN_RESULT;
                }
 
-               
+
                psDoKickIN->sCCBKick.pahDstSyncHandles = phKernelSyncInfoHandles;
 #endif
 
@@ -576,7 +576,7 @@ SGXDoKickBW(IMG_UINT32 ui32BridgeID,
 #if defined(NO_HARDWARE)
        sCCBKickKM.ui32WriteOpsPendingVal = psDoKickIN->sCCBKick.ui32WriteOpsPendingVal;
 #endif
-#endif 
+#endif
        psRetOUT->eError =
                SGXDoKickKM(hDevCookieInt,
 #if defined (SUPPORT_SID_INTERFACE)
@@ -593,7 +593,7 @@ PVRSRV_BRIDGE_SGX_DOKICK_RETURN_RESULT:
                                  ui32NumDstSyncs * sizeof(IMG_HANDLE),
                                  (IMG_VOID *)phKernelSyncInfoHandles,
                                  0);
-               
+
        }
        return ret;
 }
@@ -646,7 +646,7 @@ SGXSubmitTransferBW(IMG_UINT32 ui32BridgeID,
        psKick = &psSubmitTransferIN->sKick;
 
 #if defined(FIX_HW_BRN_31620)
-       
+
        psRetOUT->eError =
                PVRSRVLookupHandle(psPerProc->psHandleBase,
                                                   &psKick->hDevMemContext,
@@ -814,7 +814,7 @@ SGXSetTransferContextPriorityBW(IMG_UINT32 ui32BridgeID,
        }
 
     psRetOUT->eError = SGXSetTransferContextPriorityKM(
-            hDevCookieInt, 
+            hDevCookieInt,
             hTransferContextInt,
             psSGXSetTransferContextPriorityIN->ui32Priority,
             psSGXSetTransferContextPriorityIN->ui32OffsetOfPriorityField);
@@ -856,7 +856,7 @@ SGXSetRenderContextPriorityBW(IMG_UINT32 ui32BridgeID,
        }
 
     psRetOUT->eError = SGXSetRenderContextPriorityKM(
-            hDevCookieInt, 
+            hDevCookieInt,
             hRenderContextInt,
             psSGXSetRenderContextPriorityIN->ui32Priority,
             psSGXSetRenderContextPriorityIN->ui32OffsetOfPriorityField);
@@ -885,7 +885,7 @@ SGXSubmit2DBW(IMG_UINT32 ui32BridgeID,
        psKick = &psSubmit2DIN->sKick;
 
 #if defined(FIX_HW_BRN_31620)
-       
+
        psRetOUT->eError =
                PVRSRVLookupHandle(psPerProc->psHandleBase,
                                                   &psKick->hDevMemContext,
@@ -1037,7 +1037,7 @@ SGXSubmit2DBW(IMG_UINT32 ui32BridgeID,
                sKickKM.hDstSyncInfo = IMG_NULL;
        }
 
-       
+
        sKickKM.ui32SharedCmdCCBOffset = psKick->ui32SharedCmdCCBOffset;
        sKickKM.ui32NumSrcSync         = psKick->ui32NumSrcSync;
        sKickKM.ui32PDumpFlags         = psKick->ui32PDumpFlags;
@@ -1056,8 +1056,8 @@ SGXSubmit2DBW(IMG_UINT32 ui32BridgeID,
 
        return 0;
 }
-#endif 
-#endif 
+#endif
+#endif
 
 
 static IMG_INT
@@ -1086,7 +1086,7 @@ SGXGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
        }
 
 #if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
-       
+
        if (psSGXGetMiscInfoIN->psMiscInfo->eRequest == SGX_MISC_INFO_REQUEST_MEMREAD)
        {
                psRetOUT->eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
@@ -1100,7 +1100,7 @@ SGXGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
                }
        }
 #endif
-       
+
        psDeviceNode = hDevCookieInt;
        PVR_ASSERT(psDeviceNode != IMG_NULL);
        if (psDeviceNode == IMG_NULL)
@@ -1110,7 +1110,7 @@ SGXGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
 
        psDevInfo = psDeviceNode->pvDevice;
 
-       
+
        psRetOUT->eError = CopyFromUserWrapper(psPerProc,
                                                       ui32BridgeID,
                                                       &sMiscInfo,
@@ -1130,7 +1130,7 @@ SGXGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
                }
        }
 
-       
+
        psRetOUT->eError = CopyToUserWrapper(psPerProc,
                                             ui32BridgeID,
                                             psSGXGetMiscInfoIN->psMiscInfo,
@@ -1195,7 +1195,7 @@ SGXReadHWPerfCBBW(IMG_UINT32                                                      ui32BridgeID,
                          ui32AllocatedSize,
                          psAllocated,
                          hAllocatedHandle);
-       
+
 
        return 0;
 }
@@ -1224,7 +1224,7 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
 
        PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SGX_DEVINITPART2);
 
-       
+
        psSGXDevInitPart2OUT->ui32KMBuildOptions = SGX_BUILD_OPTIONS;
 
        if(!psPerProc->bInitProcess)
@@ -1243,7 +1243,7 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
                                                   &hDummy,
                                                   psSGXDevInitPart2IN->sInitInfo.hKernelCCBMemInfo,
@@ -1421,7 +1421,7 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
        {
                bLookupFailed = IMG_TRUE;
        }
-       
+
        eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
                                                   &hDummy,
                                                   psSGXDevInitPart2IN->sInitInfo.hKernelClearClipWATPCMemInfo,
@@ -1516,7 +1516,7 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        eError = PVRSRVLookupAndReleaseHandle(psPerProc->psHandleBase,
 #if defined (SUPPORT_SID_INTERFACE)
                                                   &asInitInfoKM.hKernelCCBMemInfo,
@@ -1876,12 +1876,12 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
        {
                PVR_DPF((PVR_DBG_ERROR, "DevInitSGXPart2BW: A handle release failed"));
                psSGXDevInitPart2OUT->eError = PVRSRV_ERROR_INIT2_PHASE_FAILED;
-               
+
                PVR_DBG_BREAK;
                return 0;
        }
 
-       
+
 #if defined (SUPPORT_SID_INTERFACE)
        eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, asInitInfoKM.hKernelCCBMemInfo);
 #else
@@ -1944,7 +1944,7 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
        }
 #endif
 
-       
+
 #if defined (SUPPORT_SID_INTERFACE)
        eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, asInitInfoKM.hKernelSGXMiscMemInfo);
 #else
@@ -2113,7 +2113,7 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
 #if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && defined(FIX_HW_BRN_31425)
        eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, psSGXDevInitPart2IN->sInitInfo.hKernelVDMSnapShotBufferMemInfo);
        bDissociateFailed |= (IMG_BOOL)(eError != PVRSRV_OK);
-       
+
        eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, psSGXDevInitPart2IN->sInitInfo.hKernelVDMCtrlStreamBufferMemInfo);
        bDissociateFailed |= (IMG_BOOL)(eError != PVRSRV_OK);
 #endif
@@ -2154,7 +2154,7 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
                }
        }
 
-       
+
        if(bDissociateFailed)
        {
 #if defined (SUPPORT_SID_INTERFACE)
@@ -2198,7 +2198,7 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
 
                psSGXDevInitPart2OUT->eError = PVRSRV_ERROR_INIT2_PHASE_FAILED;
 
-               
+
                PVR_DBG_BREAK;
                return 0;
        }
@@ -2496,7 +2496,7 @@ SGXUnregisterHW2DContextBW(IMG_UINT32 ui32BridgeID,
 
        return 0;
 }
-#endif 
+#endif
 
 static IMG_INT
 SGXFlushHWRenderTargetBW(IMG_UINT32 ui32BridgeID,
@@ -2619,7 +2619,7 @@ SGXFindSharedPBDescBW(IMG_UINT32 ui32BridgeID,
        if(hSharedPBDesc == IMG_NULL)
        {
                psSGXFindSharedPBDescOUT->hSharedPBDescKernelMemInfoHandle = 0;
-               
+
                goto PVRSRV_BRIDGE_SGX_FINDSHAREDPBDESC_EXIT;
        }
 
@@ -2629,7 +2629,7 @@ SGXFindSharedPBDescBW(IMG_UINT32 ui32BridgeID,
                                          PVRSRV_HANDLE_TYPE_SHARED_PB_DESC,
                                          PVRSRV_HANDLE_ALLOC_FLAG_NONE);
 
-       
+
        PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
                                          &psSGXFindSharedPBDescOUT->hSharedPBDescKernelMemInfoHandle,
                                          psSharedPBDescKernelMemInfo,
@@ -2866,26 +2866,26 @@ SGXAddSharedPBDescBW(IMG_UINT32 ui32BridgeID,
                }
        }
 
-       
-        
+
+
        eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
                                                                psSGXAddSharedPBDescIN->hSharedPBDescKernelMemInfo,
                                                                PVRSRV_HANDLE_TYPE_SHARED_SYS_MEM_INFO);
        PVR_ASSERT(eError == PVRSRV_OK);
 
-        
+
        eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
                                                                psSGXAddSharedPBDescIN->hHWPBDescKernelMemInfo,
                                                                PVRSRV_HANDLE_TYPE_MEM_INFO);
        PVR_ASSERT(eError == PVRSRV_OK);
 
-        
+
        eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
                                                                psSGXAddSharedPBDescIN->hBlockKernelMemInfo,
                                                                PVRSRV_HANDLE_TYPE_SHARED_SYS_MEM_INFO);
        PVR_ASSERT(eError == PVRSRV_OK);
 
-        
+
        eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
                                                                psSGXAddSharedPBDescIN->hHWBlockKernelMemInfo,
                                                                PVRSRV_HANDLE_TYPE_MEM_INFO);
@@ -2893,7 +2893,7 @@ SGXAddSharedPBDescBW(IMG_UINT32 ui32BridgeID,
 
        for(i=0; i<ui32KernelMemInfoHandlesCount; i++)
        {
-                
+
                eError = PVRSRVReleaseHandle(psPerProc->psHandleBase,
                                                                        phKernelMemInfoHandles[i],
                                                                        PVRSRV_HANDLE_TYPE_MEM_INFO);
@@ -3005,7 +3005,7 @@ SGXGetInfoForSrvinitBW(IMG_UINT32 ui32BridgeID,
                if ((asHeapInfo[i].ui32HeapID != (IMG_UINT32)SGX_UNDEFINED_HEAP_ID) &&
                        (asHeapInfo[i].hDevMemHeap != IMG_NULL))
                {
-                       
+
                        PVRSRVAllocHandleNR(psPerProc->psHandleBase,
                                                          &psHeapInfo->hDevMemHeap,
                                                          asHeapInfo[i].hDevMemHeap,
@@ -3029,7 +3029,7 @@ SGXGetInfoForSrvinitBW(IMG_UINT32 ui32BridgeID,
 
                        if (psHeapInfo->hDevMemHeap != IMG_NULL)
                        {
-                               
+
                                PVRSRVAllocHandleNR(psPerProc->psHandleBase,
                                                                  &hDevMemHeapExt,
                                                                  psHeapInfo->hDevMemHeap,
@@ -3114,7 +3114,7 @@ DumpBufferArray(PVRSRV_PER_PROCESS_DATA   *psPerProc,
                }
                else
                {
-                       
+
 
                        if (bDumpPolls)
                        {
@@ -3201,7 +3201,7 @@ SGXPDumpBufferArrayBW(IMG_UINT32 ui32BridgeID,
                                  ui32BufferArraySize,
                                  (IMG_PVOID *)&psKickTADumpBuffer, 0,
                                  "Array of Kick Tile Accelerator Dump Buffer") != PVRSRV_OK)
-#endif                           
+#endif
        {
                return -ENOMEM;
        }
@@ -3214,7 +3214,7 @@ SGXPDumpBufferArrayBW(IMG_UINT32 ui32BridgeID,
                                                   ui32BufferArraySize) != PVRSRV_OK)
        {
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, ui32BufferArraySize, psKickTADumpBuffer, 0);
-               
+
                return -EFAULT;
        }
 #endif
@@ -3303,7 +3303,7 @@ SGXPDumpBufferArrayBW(IMG_UINT32 ui32BridgeID,
 #else
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, ui32BufferArraySize, psKickTADumpBuffer, 0);
 #endif
-       
+
 
        return 0;
 }
@@ -3348,7 +3348,7 @@ SGXPDump3DSignatureRegistersBW(IMG_UINT32 ui32BridgeID,
        psDevInfo = (PVRSRV_SGXDEV_INFO*)psDeviceNode->pvDevice;
 
 #if defined(SGX_FEATURE_MP)    && defined(FIX_HW_BRN_27270)
-       
+
        ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE);
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE, (SGX_FEATURE_MP_CORE_COUNT - 1) << EUR_CR_MASTER_CORE_ENABLE_SHIFT);
 #if defined(PDUMP)
@@ -3392,7 +3392,7 @@ SGXPDump3DSignatureRegistersBW(IMG_UINT32 ui32BridgeID,
                return 0;
        }
 
-       
+
        PVR_ASSERT(psDeviceNode->pfnMMUGetContextID != IMG_NULL)
        ui32MMUContextID = psDeviceNode->pfnMMUGetContextID((IMG_HANDLE)psDeviceNode->sDevMemoryInfo.pBMKernelContext);
 
@@ -3537,7 +3537,7 @@ SGXPDumpTASignatureRegistersBW(IMG_UINT32 ui32BridgeID,
 
        psDevInfo = (PVRSRV_SGXDEV_INFO*)psDeviceNode->pvDevice;
 
-       
+
        ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE);
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE, (SGX_FEATURE_MP_CORE_COUNT - 1) << EUR_CR_MASTER_CORE_ENABLE_SHIFT);
 #if defined(PDUMP)
@@ -3631,7 +3631,7 @@ SGXPDumpHWPerfCBBW(IMG_UINT32                                             ui32BridgeID,
                return 0;
        }
 
-       
+
        PVR_ASSERT(psDeviceNode->pfnMMUGetContextID != IMG_NULL)
        ui32MMUContextID = psDeviceNode->pfnMMUGetContextID(hDevMemContextInt);
 
@@ -3650,14 +3650,14 @@ SGXPDumpHWPerfCBBW(IMG_UINT32                                           ui32BridgeID,
        PVR_UNREFERENCED_PARAMETER(psRetOUT);
        PVR_UNREFERENCED_PARAMETER(psPerProc);
        return 0;
-#endif 
+#endif
 #else
        PVR_UNREFERENCED_PARAMETER(ui32BridgeID);
        PVR_UNREFERENCED_PARAMETER(psPDumpHWPerfCBIN);
        PVR_UNREFERENCED_PARAMETER(psRetOUT);
        PVR_UNREFERENCED_PARAMETER(psPerProc);
        return -EFAULT;
-#endif 
+#endif
 }
 
 
@@ -3693,7 +3693,7 @@ SGXPDumpSaveMemBW(IMG_UINT32                                              ui32BridgeID,
                return 0;
        }
 
-       
+
        PVR_ASSERT(psDeviceNode->pfnMMUGetContextID != IMG_NULL)
        ui32MMUContextID = psDeviceNode->pfnMMUGetContextID(hDevMemContextInt);
 
@@ -3707,10 +3707,10 @@ SGXPDumpSaveMemBW(IMG_UINT32                                            ui32BridgeID,
        return 0;
 }
 
-#endif 
+#endif
+
 
 
 IMG_VOID SetSGXDispatchTableEntry(IMG_VOID)
 {
 
@@ -3759,6 +3759,6 @@ IMG_VOID SetSGXDispatchTableEntry(IMG_VOID)
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_PDUMP_SAVEMEM, SGXPDumpSaveMemBW);
 #endif
 }
 
-#endif 
+
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 204450c..584ca2c
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -38,5 +38,5 @@ IMG_VOID SetSGXDispatchTableEntry(IMG_VOID);
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 49e4a02..042dfbf
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -71,26 +71,26 @@ AllocMemory (BM_CONTEXT                     *pBMContext,
                          "AllocMemory (uSize=0x%x, uFlags=0x%x, align=0x%x)",
                          uSize, uFlags, uDevVAddrAlignment));
 
-       
+
 
 
        if(uFlags & PVRSRV_MEM_RAM_BACKED_ALLOCATION)
        {
                if(uFlags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR)
                {
-                       
+
                        PVR_DPF ((PVR_DBG_ERROR, "AllocMemory: combination of DevVAddr management and RAM backing mode unsupported"));
                        return IMG_FALSE;
                }
 
-               
 
-               
+
+
                if(psBMHeap->ui32Attribs
                   &    (PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG
                   |PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG))
                {
-                       
+
                        pArena = psBMHeap->pImportArena;
                        PVR_ASSERT(psBMHeap->sDevArena.psDeviceMemoryHeapInfo->ui32Attribs & PVRSRV_MEM_RAM_BACKED_ALLOCATION);
                }
@@ -100,7 +100,7 @@ AllocMemory (BM_CONTEXT                     *pBMContext,
                        return IMG_FALSE;
                }
 
-               
+
                if(uFlags & PVRSRV_MEM_NO_GPU_ADDR)
                {
                        IMG_SIZE_T uImportSize = uSize;
@@ -169,7 +169,7 @@ AllocMemory (BM_CONTEXT                     *pBMContext,
                        }
                }
 
-               
+
                pBuf->CpuPAddr.uiAddr = pMapping->CpuPAddr.uiAddr + uOffset;
 
                if(uFlags & PVRSRV_MEM_ZERO)
@@ -184,7 +184,7 @@ AllocMemory (BM_CONTEXT                     *pBMContext,
        {
                if(uFlags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR)
                {
-                       
+
                        PVR_ASSERT(psDevVAddr != IMG_NULL);
 
                        if (psDevVAddr == IMG_NULL)
@@ -193,7 +193,7 @@ AllocMemory (BM_CONTEXT                     *pBMContext,
                                return IMG_FALSE;
                        }
 
-                       
+
                        pBMContext->psDeviceNode->pfnMMUAlloc (psBMHeap->pMMUHeap,
                                                                                                        uSize,
                                                                                                        IMG_NULL,
@@ -201,15 +201,15 @@ AllocMemory (BM_CONTEXT                   *pBMContext,
                                                                                                        uDevVAddrAlignment,
                                                                                                        psDevVAddr);
 
-                       
+
                        pBuf->DevVAddr = *psDevVAddr;
                }
                else
                {
                        IMG_BOOL bResult;
-                       
 
-                       
+
+
                        bResult = pBMContext->psDeviceNode->pfnMMUAlloc (psBMHeap->pMMUHeap,
                                                                                                        uSize,
                                                                                                        IMG_NULL,
@@ -224,7 +224,7 @@ AllocMemory (BM_CONTEXT                     *pBMContext,
                        }
                }
 
-               
+
                if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                                        sizeof (struct _BM_MAPPING_),
                                                        (IMG_PVOID *)&pMapping, IMG_NULL,
@@ -234,12 +234,12 @@ AllocMemory (BM_CONTEXT                   *pBMContext,
                        return IMG_FALSE;
                }
 
-               
+
                pBuf->CpuVAddr = IMG_NULL;
                pBuf->hOSMemHandle = 0;
                pBuf->CpuPAddr.uiAddr = 0;
 
-               
+
                pMapping->CpuVAddr = IMG_NULL;
                pMapping->CpuPAddr.uiAddr = 0;
                pMapping->DevVAddr = pBuf->DevVAddr;
@@ -248,14 +248,14 @@ AllocMemory (BM_CONTEXT                   *pBMContext,
                pMapping->hOSMemHandle = 0;
        }
 
-       
+
        pMapping->pArena = pArena;
 
-       
+
        pMapping->pBMHeap = psBMHeap;
        pBuf->pMapping = pMapping;
 
-       
+
        PVR_DPF ((PVR_DBG_MESSAGE,
                                "AllocMemory: pMapping=%08x: DevV=%08X CpuV=%08x CpuP=%08X uSize=0x%x",
                                (IMG_UINTPTR_T)pMapping,
@@ -272,7 +272,7 @@ AllocMemory (BM_CONTEXT                     *pBMContext,
                                pBuf->CpuPAddr.uiAddr,
                                uSize));
 
-       
+
        PVR_ASSERT(((pBuf->DevVAddr.uiAddr) & (uDevVAddrAlignment - 1)) == 0);
 
        return IMG_TRUE;
@@ -299,13 +299,13 @@ WrapMemory (BM_HEAP *psBMHeap,
                          (IMG_UINTPTR_T)psBMHeap, uSize, ui32BaseOffset, bPhysContig, (IMG_UINTPTR_T)pvCPUVAddr, uFlags));
 
        PVR_ASSERT((psAddr->uiAddr & (ui32PageSize - 1)) == 0);
-       
+
        PVR_ASSERT(((IMG_UINTPTR_T)pvCPUVAddr & (ui32PageSize - 1)) == 0);
 
        uSize += ui32BaseOffset;
        uSize = HOST_PAGEALIGN (uSize);
 
-       
+
        if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                                sizeof(*pMapping),
                                                (IMG_PVOID *)&pMapping, IMG_NULL,
@@ -393,7 +393,7 @@ WrapMemory (BM_HEAP *psBMHeap,
                }
        }
 
-       
+
        bResult = DevMemoryAlloc(psBMHeap->pBMContext,
                                                         pMapping,
                                                         IMG_NULL,
@@ -408,7 +408,7 @@ WrapMemory (BM_HEAP *psBMHeap,
                goto fail_cleanup;
        }
 
-       
+
        pBuf->CpuPAddr.uiAddr = pMapping->CpuPAddr.uiAddr + ui32BaseOffset;
        if(!ui32BaseOffset)
        {
@@ -480,7 +480,7 @@ fail_cleanup:
        }
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), pMapping, IMG_NULL);
-       
+
 
        return IMG_FALSE;
 }
@@ -521,14 +521,14 @@ ZeroBuf(BM_BUF *pBuf, BM_MAPPING *pMapping, IMG_SIZE_T ui32Bytes, IMG_UINT32 ui3
                IMG_SIZE_T ui32CurrentOffset = 0;
                IMG_CPU_PHYADDR CpuPAddr;
 
-               
+
                PVR_ASSERT(pBuf->hOSMemHandle);
 
                while(ui32BytesRemaining > 0)
                {
                        IMG_SIZE_T ui32BlockBytes = MIN(ui32BytesRemaining, HOST_PAGESIZE());
                        CpuPAddr = OSMemHandleToCpuPAddr(pBuf->hOSMemHandle, ui32CurrentOffset);
-                       
+
                        if(CpuPAddr.uiAddr & (HOST_PAGESIZE() -1))
                        {
                                ui32BlockBytes =
@@ -571,7 +571,7 @@ FreeBuf (BM_BUF *pBuf, IMG_UINT32 ui32Flags, IMG_BOOL bFromAllocator)
                        (IMG_UINTPTR_T)pBuf, pBuf->DevVAddr.uiAddr,
                        (IMG_UINTPTR_T)pBuf->CpuVAddr, pBuf->CpuPAddr.uiAddr));
 
-       
+
        pMapping = pBuf->pMapping;
 
        psDeviceNode = pMapping->pBMHeap->pBMContext->psDeviceNode;
@@ -582,42 +582,42 @@ FreeBuf (BM_BUF *pBuf, IMG_UINT32 ui32Flags, IMG_BOOL bFromAllocator)
 
        if(ui32Flags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR)
        {
-               
+
                if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
                {
-                       
+
                        if(ui32Flags & PVRSRV_MEM_RAM_BACKED_ALLOCATION)
                        {
-                               
+
                                PVR_DPF ((PVR_DBG_ERROR, "FreeBuf: combination of DevVAddr management and RAM backing mode unsupported"));
                        }
                        else
                        {
-                               
+
                                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), pMapping, IMG_NULL);
-                               pBuf->pMapping = IMG_NULL; 
+                               pBuf->pMapping = IMG_NULL;
                        }
                }
        }
        else
        {
-               
+
                if(pBuf->hOSMemHandle != pMapping->hOSMemHandle)
                {
-            
+
                        if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
                        {
-                               
+
                                OSReleaseSubMemHandle(pBuf->hOSMemHandle, ui32Flags);
                        }
                }
                if(ui32Flags & PVRSRV_MEM_RAM_BACKED_ALLOCATION)
                {
-                       
-            
+
+
                        if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
                        {
-                               
+
 
 
                                PVR_ASSERT(pBuf->ui32ExportCount == 0)
@@ -660,9 +660,9 @@ FreeBuf (BM_BUF *pBuf, IMG_UINT32 ui32Flags, IMG_BOOL bFromAllocator)
 
                        if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
                        {
-                               
+
                                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), pMapping, IMG_NULL);
-                               pBuf->pMapping = IMG_NULL; 
+                               pBuf->pMapping = IMG_NULL;
                        }
                }
        }
@@ -671,7 +671,7 @@ FreeBuf (BM_BUF *pBuf, IMG_UINT32 ui32Flags, IMG_BOOL bFromAllocator)
        if ((pBuf->ui32ExportCount == 0) && (pBuf->ui32RefCount == 0))
        {
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_BUF), pBuf, IMG_NULL);
-               
+
        }
 }
 
@@ -709,7 +709,7 @@ BM_DestroyContext(IMG_HANDLE        hBMContext,
                *pbDestroyed = IMG_FALSE;
        }
 
-       
+
 
        if (pBMContext == IMG_NULL)
        {
@@ -721,11 +721,11 @@ BM_DestroyContext(IMG_HANDLE      hBMContext,
 
        if (pBMContext->ui32RefCount > 0)
        {
-               
+
                return PVRSRV_OK;
        }
 
-       
+
 
 
        eError = List_BM_HEAP_PVRSRV_ERROR_Any(pBMContext->psBMHeap, &BM_DestroyContext_AnyCb);
@@ -733,22 +733,22 @@ BM_DestroyContext(IMG_HANDLE      hBMContext,
        {
                PVR_DPF ((PVR_DBG_ERROR, "BM_DestroyContext: List_BM_HEAP_PVRSRV_ERROR_Any failed"));
 #if 0
-               
-               
-               
-               
+
+
+
+
                PVR_DPF ((PVR_DBG_ERROR, "BM_DestroyContext: Cleaning up with ResManFreeSpecial"));
                if(ResManFreeSpecial() != PVRSRV_OK)
                {
                        PVR_DPF ((PVR_DBG_ERROR, "BM_DestroyContext: ResManFreeSpecial failed %d",eError));
                }
-               
+
 #endif
                return eError;
        }
        else
        {
-               
+
                eError = ResManFreeResByPtr(pBMContext->hResItem, CLEANUP_WITH_POLL);
                if(eError != PVRSRV_OK)
                {
@@ -756,7 +756,7 @@ BM_DestroyContext(IMG_HANDLE        hBMContext,
                        return eError;
                }
 
-               
+
                if (pbDestroyed != IMG_NULL)
                {
                        *pbDestroyed = IMG_TRUE;
@@ -772,7 +772,7 @@ static PVRSRV_ERROR BM_DestroyContextCallBack_AnyVaCb(BM_HEAP *psBMHeap, va_list
        PVRSRV_DEVICE_NODE *psDeviceNode;
        psDeviceNode = va_arg(va, PVRSRV_DEVICE_NODE*);
 
-       
+
        if(psBMHeap->ui32Attribs
        &       (PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG
                |PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG))
@@ -788,12 +788,12 @@ static PVRSRV_ERROR BM_DestroyContextCallBack_AnyVaCb(BM_HEAP *psBMHeap, va_list
                return PVRSRV_ERROR_UNSUPPORTED_BACKING_STORE;
        }
 
-       
+
        psDeviceNode->pfnMMUDelete(psBMHeap->pMMUHeap);
 
-       
+
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_HEAP), psBMHeap, IMG_NULL);
-       
+
 
        return PVRSRV_OK;
 }
@@ -809,11 +809,11 @@ static PVRSRV_ERROR BM_DestroyContextCallBack(IMG_PVOID   pvParam,
        PVR_UNREFERENCED_PARAMETER(ui32Param);
        PVR_UNREFERENCED_PARAMETER(bDummy);
 
-       
+
 
        psDeviceNode = pBMContext->psDeviceNode;
 
-       
+
 
        eError = List_BM_HEAP_PVRSRV_ERROR_Any_va(pBMContext->psBMHeap,
                                                                                &BM_DestroyContextCallBack_AnyVaCb,
@@ -822,14 +822,14 @@ static PVRSRV_ERROR BM_DestroyContextCallBack(IMG_PVOID   pvParam,
        {
                return eError;
        }
-       
+
 
        if (pBMContext->psMMUContext)
        {
                psDeviceNode->pfnMMUFinalise(pBMContext->psMMUContext);
        }
 
-       
+
 
        if (pBMContext->pBufferHash)
        {
@@ -838,20 +838,20 @@ static PVRSRV_ERROR BM_DestroyContextCallBack(IMG_PVOID   pvParam,
 
        if (pBMContext == psDeviceNode->sDevMemoryInfo.pBMKernelContext)
        {
-               
+
                psDeviceNode->sDevMemoryInfo.pBMKernelContext = IMG_NULL;
        }
        else
        {
            if (pBMContext->ppsThis != IMG_NULL)
            {
-                   
+
                    List_BM_CONTEXT_Remove(pBMContext);
                }
        }
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_CONTEXT), pBMContext, IMG_NULL);
-       
+
 
        return PVRSRV_OK;
 }
@@ -863,7 +863,7 @@ static IMG_HANDLE BM_CreateContext_IncRefCount_AnyVaCb(BM_CONTEXT *pBMContext, v
        hResManContext = va_arg(va, PRESMAN_CONTEXT);
        if(ResManFindResourceByPtr(hResManContext, pBMContext->hResItem) == PVRSRV_OK)
        {
-               
+
                pBMContext->ui32RefCount++;
                return pBMContext;
        }
@@ -881,7 +881,7 @@ static IMG_VOID BM_CreateContext_InsertHeap_ForEachVaCb(BM_HEAP *psBMHeap, va_li
                case DEVICE_MEMORY_HEAP_SHARED:
                case DEVICE_MEMORY_HEAP_SHARED_EXPORTED:
                {
-                       
+
                        psDeviceNode->pfnMMUInsertHeap(pBMContext->psMMUContext, psBMHeap->pMMUHeap);
                        break;
                }
@@ -917,7 +917,7 @@ BM_CreateContext(PVRSRV_DEVICE_NODE                 *psDeviceNode,
                *pbCreated = IMG_FALSE;
        }
 
-       
+
        psDevMemoryInfo = &psDeviceNode->sDevMemoryInfo;
 
        if (bKernelContext == IMG_FALSE)
@@ -931,7 +931,7 @@ BM_CreateContext(PVRSRV_DEVICE_NODE                 *psDeviceNode,
                }
        }
 
-       
+
        if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                         sizeof (struct _BM_CONTEXT_),
                                         (IMG_PVOID *)&pBMContext, IMG_NULL,
@@ -942,11 +942,11 @@ BM_CreateContext(PVRSRV_DEVICE_NODE                       *psDeviceNode,
        }
        OSMemSet(pBMContext, 0, sizeof (BM_CONTEXT));
 
-       
+
        pBMContext->psDeviceNode = psDeviceNode;
 
-       
-       
+
+
        pBMContext->pBufferHash = HASH_Create(32);
        if (pBMContext->pBufferHash==IMG_NULL)
        {
@@ -964,13 +964,13 @@ BM_CreateContext(PVRSRV_DEVICE_NODE                       *psDeviceNode,
 
        if(bKernelContext)
        {
-               
+
                PVR_ASSERT(psDevMemoryInfo->pBMKernelContext == IMG_NULL);
                psDevMemoryInfo->pBMKernelContext = pBMContext;
        }
        else
        {
-               
+
 
 
 
@@ -985,13 +985,13 @@ BM_CreateContext(PVRSRV_DEVICE_NODE                       *psDeviceNode,
 
                PVR_ASSERT(psDevMemoryInfo->pBMKernelContext->psBMHeap);
 
-               
+
 
 
 
                pBMContext->psBMSharedHeap = psDevMemoryInfo->pBMKernelContext->psBMHeap;
 
-               
+
 
 
                List_BM_HEAP_ForEach_va(pBMContext->psBMSharedHeap,
@@ -999,14 +999,14 @@ BM_CreateContext(PVRSRV_DEVICE_NODE                       *psDeviceNode,
                                                                psDeviceNode,
                                                                pBMContext);
 
-               
+
                List_BM_CONTEXT_Insert(&psDevMemoryInfo->pBMContext, pBMContext);
        }
 
-       
+
        pBMContext->ui32RefCount++;
 
-       
+
        pBMContext->hResItem = ResManRegisterRes(hResManContext,
                                                                                        RESMAN_TYPE_DEVICEMEM_CONTEXT,
                                                                                        pBMContext,
@@ -1037,7 +1037,7 @@ static IMG_VOID *BM_CreateHeap_AnyVaCb(BM_HEAP *psBMHeap, va_list va)
        psDevMemHeapInfo = va_arg(va, DEVICE_MEMORY_HEAP_INFO*);
        if (psBMHeap->sDevArena.ui32HeapID ==  psDevMemHeapInfo->ui32HeapID)
        {
-               
+
                return psBMHeap;
        }
        else
@@ -1064,12 +1064,12 @@ BM_CreateHeap (IMG_HANDLE hBMContext,
 
        psDeviceNode = pBMContext->psDeviceNode;
 
-       
+
+
        PVR_ASSERT((psDevMemHeapInfo->ui32HeapSize & (psDevMemHeapInfo->ui32DataPageSize - 1)) == 0);
        PVR_ASSERT(psDevMemHeapInfo->ui32HeapSize > 0);
 
-       
+
 
 
 
@@ -1110,7 +1110,7 @@ BM_CreateHeap (IMG_HANDLE hBMContext,
        psBMHeap->ui32XTileStride = psDevMemHeapInfo->ui32XTileStride;
 #endif
 
-       
+
        psBMHeap->pBMContext = pBMContext;
 
        psBMHeap->pMMUHeap = psDeviceNode->pfnMMUCreate (pBMContext->psMMUContext,
@@ -1123,7 +1123,7 @@ BM_CreateHeap (IMG_HANDLE hBMContext,
                goto ErrorExit;
        }
 
-       
+
        psBMHeap->pImportArena = RA_Create (psDevMemHeapInfo->pszBSName,
                                                                                0, 0, IMG_NULL,
                                                                                MAX(HOST_PAGESIZE(), psBMHeap->sDevArena.ui32DataPageSize),
@@ -1139,7 +1139,7 @@ BM_CreateHeap (IMG_HANDLE hBMContext,
 
        if(psBMHeap->ui32Attribs & PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG)
        {
-               
+
 
 
 
@@ -1151,24 +1151,24 @@ BM_CreateHeap (IMG_HANDLE hBMContext,
                }
        }
 
-       
+
        List_BM_HEAP_Insert(&pBMContext->psBMHeap, psBMHeap);
 
        return (IMG_HANDLE)psBMHeap;
 
-       
+
 ErrorExit:
 
-       
+
        if (psBMHeap->pMMUHeap != IMG_NULL)
        {
                psDeviceNode->pfnMMUDelete (psBMHeap->pMMUHeap);
-               
+
        }
 
-       
+
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_HEAP), psBMHeap, IMG_NULL);
-       
+
 
        return IMG_NULL;
 }
@@ -1183,7 +1183,7 @@ BM_DestroyHeap (IMG_HANDLE hDevMemHeap)
 
        if(psBMHeap)
        {
-               
+
                if(psBMHeap->ui32Attribs
                &       (PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG
                        |PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG))
@@ -1199,14 +1199,14 @@ BM_DestroyHeap (IMG_HANDLE hDevMemHeap)
                        return;
                }
 
-               
+
                psDeviceNode->pfnMMUDelete (psBMHeap->pMMUHeap);
 
-               
+
                List_BM_HEAP_Remove(psBMHeap);
-               
+
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_HEAP), psBMHeap, IMG_NULL);
-               
+
        }
        else
        {
@@ -1265,7 +1265,7 @@ BM_Alloc (  IMG_HANDLE                    hDevMemHeap,
                uDevVAddrAlignment = 1;
        }
 
-       
+
        if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                   sizeof (BM_BUF),
                                   (IMG_PVOID *)&pBuf, IMG_NULL,
@@ -1276,7 +1276,7 @@ BM_Alloc (  IMG_HANDLE                    hDevMemHeap,
        }
        OSMemSet(pBuf, 0, sizeof (BM_BUF));
 
-       
+
        if (AllocMemory(pBMContext,
                                        psBMHeap,
                                        psDevVAddr,
@@ -1288,7 +1288,7 @@ BM_Alloc (  IMG_HANDLE                    hDevMemHeap,
                                        pBuf) != IMG_TRUE)
        {
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof (BM_BUF), pBuf, IMG_NULL);
-               
+
                PVR_DPF((PVR_DBG_ERROR, "BM_Alloc: AllocMemory FAILED"));
                return IMG_FALSE;
        }
@@ -1297,12 +1297,12 @@ BM_Alloc (  IMG_HANDLE                  hDevMemHeap,
                  "BM_Alloc (uSize=0x%x, uFlags=0x%x)",
                  uSize, uFlags));
 
-       
+
        pBuf->ui32RefCount = 1;
        *phBuf = (BM_HANDLE)pBuf;
        *pui32Flags = uFlags | psBMHeap->ui32Attribs;
 
-       
+
        if(uFlags & PVRSRV_HAP_CACHETYPE_MASK)
        {
                *pui32Flags &= ~PVRSRV_HAP_CACHETYPE_MASK;
@@ -1422,24 +1422,24 @@ BM_Wrap (       IMG_HANDLE hDevMemHeap,
                }
        }
 #endif
-       
+
        if (psSysAddr == IMG_NULL) {
                PVR_DPF((PVR_DBG_ERROR, "Invalid parameter."));
                return IMG_FALSE;
        }
        sHashAddress = psSysAddr[0];
 
-       
+
        sHashAddress.uiAddr += ui32Offset;
 
-       
+
        pBuf = (BM_BUF *)HASH_Retrieve(psBMContext->pBufferHash, sHashAddress.uiAddr);
 
        if(pBuf)
        {
                IMG_SIZE_T ui32MappingSize = HOST_PAGEALIGN (ui32Size + ui32Offset);
 
-               
+
                if(pBuf->pMapping->uSize == ui32MappingSize && (pBuf->pMapping->eCpuMemoryOrigin == hm_wrapped ||
                                                                                                                pBuf->pMapping->eCpuMemoryOrigin == hm_wrapped_virtaddr))
                {
@@ -1456,12 +1456,12 @@ BM_Wrap (       IMG_HANDLE hDevMemHeap,
                }
                else
                {
-                 
+
                        HASH_Remove(psBMContext->pBufferHash, (IMG_UINTPTR_T)sHashAddress.uiAddr);
-               }       
+               }
        }
 
-       
+
        if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                                sizeof (BM_BUF),
                                                (IMG_PVOID *)&pBuf, IMG_NULL,
@@ -1472,19 +1472,19 @@ BM_Wrap (       IMG_HANDLE hDevMemHeap,
        }
        OSMemSet(pBuf, 0, sizeof (BM_BUF));
 
-       
+
        if (WrapMemory (psBMHeap, ui32Size, ui32Offset, bPhysContig, psSysAddr, pvCPUVAddr, uFlags, pBuf) != IMG_TRUE)
        {
                PVR_DPF((PVR_DBG_ERROR, "BM_Wrap: WrapMemory FAILED"));
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof (BM_BUF), pBuf, IMG_NULL);
-               
+
                return IMG_FALSE;
        }
 
-       
+
        if(pBuf->pMapping->eCpuMemoryOrigin == hm_wrapped || pBuf->pMapping->eCpuMemoryOrigin == hm_wrapped_virtaddr)
        {
-               
+
                PVR_ASSERT(SysSysPAddrToCpuPAddr(sHashAddress).uiAddr == pBuf->CpuPAddr.uiAddr);
 
                if (!HASH_Insert (psBMContext->pBufferHash, sHashAddress.uiAddr, (IMG_UINTPTR_T)pBuf))
@@ -1499,12 +1499,12 @@ BM_Wrap (       IMG_HANDLE hDevMemHeap,
                        "BM_Wrap (uSize=0x%x, uFlags=0x%x, devVAddr=%08X)",
                        ui32Size, uFlags, pBuf->DevVAddr.uiAddr));
 
-       
+
        pBuf->ui32RefCount = 1;
        *phBuf = (BM_HANDLE)pBuf;
        if(pui32Flags)
        {
-               
+
                *pui32Flags = (uFlags & ~PVRSRV_HAP_MAPTYPE_MASK) | PVRSRV_HAP_MULTI_PROCESS;
        }
 
@@ -1654,19 +1654,19 @@ DevMemoryAlloc (BM_CONTEXT *pBMContext,
 
        if(uFlags & PVRSRV_MEM_INTERLEAVED)
        {
-               
+
                pMapping->uSize *= 2;
        }
 
 #ifdef PDUMP
        if(uFlags & PVRSRV_MEM_DUMMY)
        {
-               
+
                ui32PDumpSize = pMapping->pBMHeap->sDevArena.ui32DataPageSize;
        }
 #endif
 
-       
+
        if (!psDeviceNode->pfnMMUAlloc (pMapping->pBMHeap->pMMUHeap,
                                                                        pMapping->uSize,
                                                                        pActualSize,
@@ -1683,7 +1683,7 @@ DevMemoryAlloc (BM_CONTEXT *pBMContext,
 #endif
 
 #if defined(PDUMP)
-       
+
        PDUMPMALLOCPAGES(&psDeviceNode->sDevId,
                                         pMapping->DevVAddr.uiAddr,
                                         pMapping->CpuVAddr,
@@ -1693,8 +1693,8 @@ DevMemoryAlloc (BM_CONTEXT *pBMContext,
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
                                         psDeviceNode->pfnMMUIsHeapShared(pMapping->pBMHeap->pMMUHeap),
 #else
-                                        IMG_FALSE, 
-#endif 
+                                        IMG_FALSE,
+#endif
                                         (IMG_HANDLE)pMapping);
 #endif
 
@@ -1768,17 +1768,17 @@ DevMemoryFree (BM_MAPPING *pMapping)
        if (sDevPAddr.uiAddr != 0)
        {
 #ifdef PDUMP
-               
+
                if(pMapping->ui32Flags & PVRSRV_MEM_DUMMY)
                {
-                       
+
                        ui32PSize = pMapping->pBMHeap->sDevArena.ui32DataPageSize;
                }
                else
                {
                        ui32PSize = (IMG_UINT32)pMapping->uSize;
                }
-       
+
                PDUMPFREEPAGES(pMapping->pBMHeap,
                            pMapping->DevVAddr,
                            ui32PSize,
@@ -1803,7 +1803,7 @@ DevMemoryFree (BM_MAPPING *pMapping)
 static IMG_UINT32 gXProcWorkaroundShareIndex = XPROC_WORKAROUND_BAD_SHAREINDEX;
 static IMG_UINT32 gXProcWorkaroundState = XPROC_WORKAROUND_UNKNOWN;
 
+
 static struct {
        IMG_UINT32 ui32RefCount;
        IMG_UINT32 ui32AllocFlags;
@@ -1817,7 +1817,7 @@ static struct {
 
 PVRSRV_ERROR BM_XProcWorkaroundSetShareIndex(IMG_UINT32 ui32Index)
 {
-       
+
 
 
        if (gXProcWorkaroundShareIndex != XPROC_WORKAROUND_BAD_SHAREINDEX)
@@ -1834,7 +1834,7 @@ PVRSRV_ERROR BM_XProcWorkaroundSetShareIndex(IMG_UINT32 ui32Index)
 
 PVRSRV_ERROR BM_XProcWorkaroundUnsetShareIndex(IMG_UINT32 ui32Index)
 {
-       
+
 
 
        if (gXProcWorkaroundShareIndex == XPROC_WORKAROUND_BAD_SHAREINDEX)
@@ -1856,7 +1856,7 @@ PVRSRV_ERROR BM_XProcWorkaroundUnsetShareIndex(IMG_UINT32 ui32Index)
 
 PVRSRV_ERROR BM_XProcWorkaroundFindNewBufferAndSetShareIndex(IMG_UINT32 *pui32Index)
 {
-       
+
 
 
        if (gXProcWorkaroundShareIndex != XPROC_WORKAROUND_BAD_SHAREINDEX)
@@ -1985,7 +1985,7 @@ XProcWorkaroundAllocShareable(RA_ARENA *psArena,
             ui32AllocFlags &= ~PVRSRV_HAP_MAPTYPE_MASK;
             ui32AllocFlags |= PVRSRV_HAP_SINGLE_PROCESS;
 
-            
+
             if (OSAllocPages(ui32AllocFlags,
                              ui32Size,
                              ui32PageSize,
@@ -2017,7 +2017,7 @@ XProcWorkaroundAllocShareable(RA_ARENA *psArena,
 
 static PVRSRV_ERROR XProcWorkaroundHandleToSI(IMG_HANDLE hOSMemHandle, IMG_UINT32 *pui32SI)
 {
-       
+
        IMG_UINT32 ui32SI;
        IMG_BOOL bFound;
        IMG_BOOL bErrorDups;
@@ -2112,7 +2112,7 @@ BM_ImportMemory (IMG_VOID *pH,
        IMG_BOOL bResult;
        IMG_SIZE_T uSize;
        IMG_SIZE_T uPSize;
-       IMG_SIZE_T uDevVAddrAlignment = 0; 
+       IMG_SIZE_T uDevVAddrAlignment = 0;
 
        PVR_DPF ((PVR_DBG_MESSAGE,
                          "BM_ImportMemory (pBMContext=0x%x, uRequestSize=0x%x, uFlags=0x%x, uAlign=0x%x)",
@@ -2147,13 +2147,13 @@ BM_ImportMemory (IMG_VOID *pH,
        pMapping->pBMHeap = pBMHeap;
        pMapping->ui32Flags = uFlags;
 
-       
+
        if (pActualSize)
        {
                *pActualSize = uSize;
        }
 
-       
+
        if(pMapping->ui32Flags & PVRSRV_MEM_DUMMY)
        {
                uPSize = pBMHeap->sDevArena.ui32DataPageSize;
@@ -2174,7 +2174,7 @@ BM_ImportMemory (IMG_VOID *pH,
             ui32Attribs |= PVRSRV_MEM_ION;
         }
 
-        bBadBackingStoreType = IMG_TRUE; 
+        bBadBackingStoreType = IMG_TRUE;
 
                if ((ui32Attribs & PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG) != 0)
         {
@@ -2189,16 +2189,16 @@ BM_ImportMemory (IMG_VOID *pH,
                        PVR_DPF((PVR_DBG_ERROR, "Cannot use use this memory sharing workaround with allocations that might be suballocated"));
                        goto fail_mapping_alloc;
                }
-               uDevVAddrAlignment = 0; 
+               uDevVAddrAlignment = 0;
+
 
-               
                if (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
                {
                        ui32Attribs &= ~PVRSRV_HAP_CACHETYPE_MASK;
                        ui32Attribs |= (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK);
                }
 
-               
+
                if (XProcWorkaroundAllocShareable(IMG_NULL,
                                           ui32Attribs,
                                                                                  (IMG_UINT32)uPSize,
@@ -2214,8 +2214,8 @@ BM_ImportMemory (IMG_VOID *pH,
                        goto fail_mapping_alloc;
                }
 
-               
-               
+
+
 
                pMapping->eCpuMemoryOrigin = hm_env;
         bBadBackingStoreType = IMG_FALSE;
@@ -2230,16 +2230,16 @@ BM_ImportMemory (IMG_VOID *pH,
                 PVR_DPF((PVR_DBG_ERROR, "Cannot use use this memory sharing workaround with allocations that might be suballocated"));
                 goto fail_mapping_alloc;
             }
-            uDevVAddrAlignment = 0; 
+            uDevVAddrAlignment = 0;
+
 
-            
             if (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
             {
                 ui32Attribs &= ~PVRSRV_HAP_CACHETYPE_MASK;
                 ui32Attribs |= (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK);
             }
 
-            
+
             if (XProcWorkaroundAllocShareable(pBMHeap->pLocalDevMemArena,
                                               ui32Attribs,
                                               (IMG_UINT32)uPSize,
@@ -2255,8 +2255,8 @@ BM_ImportMemory (IMG_VOID *pH,
                 goto fail_mapping_alloc;
             }
 
-            
-            
+
+
 
             pMapping->eCpuMemoryOrigin = hm_env;
             bBadBackingStoreType = IMG_FALSE;
@@ -2270,13 +2270,13 @@ BM_ImportMemory (IMG_VOID *pH,
        }
        else
 
-       
+
 
        if(pBMHeap->ui32Attribs & PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG)
        {
                IMG_UINT32 ui32Attribs = pBMHeap->ui32Attribs;
 
-               
+
                if (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
                {
                        ui32Attribs &= ~PVRSRV_HAP_CACHETYPE_MASK;
@@ -2304,7 +2304,7 @@ BM_ImportMemory (IMG_VOID *pH,
                        goto fail_mapping_alloc;
                }
 
-               
+
                pMapping->eCpuMemoryOrigin = hm_env;
        }
        else if(pBMHeap->ui32Attribs & PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG)
@@ -2312,10 +2312,10 @@ BM_ImportMemory (IMG_VOID *pH,
                IMG_SYS_PHYADDR sSysPAddr;
                IMG_UINT32 ui32Attribs = pBMHeap->ui32Attribs;
 
-               
+
                PVR_ASSERT(pBMHeap->pLocalDevMemArena != IMG_NULL);
 
-               
+
                if (pMapping->ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
                {
                        ui32Attribs &= ~PVRSRV_HAP_CACHETYPE_MASK;
@@ -2337,7 +2337,7 @@ BM_ImportMemory (IMG_VOID *pH,
                        goto fail_mapping_alloc;
                }
 
-               
+
                pMapping->CpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
                if(OSReservePhys(pMapping->CpuPAddr,
                                                 uPSize,
@@ -2349,7 +2349,7 @@ BM_ImportMemory (IMG_VOID *pH,
                        goto fail_dev_mem_alloc;
                }
 
-               
+
                pMapping->eCpuMemoryOrigin = hm_contiguous;
        }
        else
@@ -2358,7 +2358,7 @@ BM_ImportMemory (IMG_VOID *pH,
                goto fail_mapping_alloc;
        }
 
-       
+
        if(!(uFlags & PVRSRV_MEM_NO_GPU_ADDR))
        {
                bResult = DevMemoryAlloc (pBMContext,
@@ -2376,8 +2376,8 @@ BM_ImportMemory (IMG_VOID *pH,
                }
        }
 
-       
-       
+
+
        PVR_ASSERT (uDevVAddrAlignment>1?(pMapping->DevVAddr.uiAddr%uDevVAddrAlignment)==0:1);
 
        *pBase = pMapping->DevVAddr.uiAddr;
@@ -2389,7 +2389,7 @@ BM_ImportMemory (IMG_VOID *pH,
 fail_dev_mem_alloc:
        if (pMapping && (pMapping->CpuVAddr || pMapping->hOSMemHandle))
        {
-               
+
                if(pMapping->ui32Flags & PVRSRV_MEM_INTERLEAVED)
                {
                        pMapping->uSize /= 2;
@@ -2433,7 +2433,7 @@ fail_dev_mem_alloc:
        }
 fail_mapping_alloc:
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), pMapping, IMG_NULL);
-       
+
 fail_exit:
        return IMG_FALSE;
 }
@@ -2464,7 +2464,7 @@ BM_FreeMemory (IMG_VOID *h, IMG_UINTPTR_T _base, BM_MAPPING *psMapping)
                DevMemoryFree (psMapping);
        }
 
-       
+
        if((psMapping->ui32Flags & PVRSRV_MEM_INTERLEAVED) != 0)
        {
                psMapping->uSize /= 2;
@@ -2507,7 +2507,7 @@ BM_FreeMemory (IMG_VOID *h, IMG_UINTPTR_T _base, BM_MAPPING *psMapping)
        }
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BM_MAPPING), psMapping, IMG_NULL);
-       
+
 
        PVR_DPF((PVR_DBG_MESSAGE,
                        "..BM_FreeMemory (h=0x%x, base=0x%x)",
@@ -2524,10 +2524,10 @@ IMG_VOID BM_GetPhysPageAddr(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
 
        PVR_ASSERT (psMemInfo && psDevPAddr)
 
-       
+
        PVR_ASSERT((sDevVPageAddr.uiAddr & 0xFFF) == 0);
 
-        
+
        psDeviceNode = ((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->pBMContext->psDeviceNode;
 
        *psDevPAddr = psDeviceNode->pfnMMUGetPhysPageAddr(((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->pMMUHeap,
old mode 100755 (executable)
new mode 100644 (file)
index 47b2b1d..e23ab56
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -49,7 +49,7 @@ typedef struct PVRSRV_DC_SRV2DISP_KMJTABLE_TAG *PPVRSRV_DC_SRV2DISP_KMJTABLE;
 
 typedef struct PVRSRV_DC_BUFFER_TAG
 {
-       
+
        PVRSRV_DEVICECLASS_BUFFER sDeviceClassBuffer;
 
        struct PVRSRV_DISPLAYCLASS_INFO_TAG *psDCInfo;
@@ -80,7 +80,7 @@ typedef struct PVRSRV_DC_SWAPCHAIN_TAG
 typedef struct PVRSRV_DC_SWAPCHAIN_REF_TAG
 {
        struct PVRSRV_DC_SWAPCHAIN_TAG          *psSwapChain;
-       IMG_HANDLE                                                      hResItem;       
+       IMG_HANDLE                                                      hResItem;
 } PVRSRV_DC_SWAPCHAIN_REF;
 
 
@@ -108,7 +108,7 @@ typedef struct PVRSRV_BC_SRV2BUFFER_KMJTABLE_TAG *PPVRSRV_BC_SRV2BUFFER_KMJTABLE
 
 typedef struct PVRSRV_BC_BUFFER_TAG
 {
-       
+
        PVRSRV_DEVICECLASS_BUFFER sDeviceClassBuffer;
 
        struct PVRSRV_BUFFERCLASS_INFO_TAG *psBCInfo;
@@ -122,7 +122,7 @@ typedef struct PVRSRV_BUFFERCLASS_INFO_TAG
        IMG_HANDLE                                                      hExtDevice;
        PPVRSRV_BC_SRV2BUFFER_KMJTABLE          psFuncTable;
        IMG_HANDLE                                                      hDevMemContext;
-       
+
        IMG_UINT32                                                      ui32BufferCount;
        PVRSRV_BC_BUFFER                                        *psBuffer;
 
@@ -182,13 +182,13 @@ PVRSRV_ERROR PVRSRVEnumerateDCKM (PVRSRV_DEVICE_CLASS DeviceClass,
                                                                  IMG_UINT32 *pui32DevCount,
                                                                  IMG_UINT32 *pui32DevID )
 {
-       
+
        IMG_UINT                        ui32DevCount = 0;
        SYS_DATA                        *psSysData;
 
        SysAcquireData(&psSysData);
 
-       
+
        List_PVRSRV_DEVICE_NODE_ForEach_va(psSysData->psDeviceNodeList,
                                                                                &PVRSRVEnumerateDCKM_ForEachVaCb,
                                                                                &ui32DevCount,
@@ -217,7 +217,7 @@ PVRSRV_ERROR PVRSRVRegisterDCDeviceKM (PVRSRV_DC_SRV2DISP_KMJTABLE *psFuncTable,
        PVRSRV_DEVICE_NODE                      *psDeviceNode;
        SYS_DATA                                        *psSysData;
 
-       
+
 
 
 
@@ -234,10 +234,10 @@ PVRSRV_ERROR PVRSRVRegisterDCDeviceKM (PVRSRV_DC_SRV2DISP_KMJTABLE *psFuncTable,
 
        SysAcquireData(&psSysData);
 
-       
 
 
-       
+
+
        if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
                                         sizeof(*psDCInfo),
                                         (IMG_VOID **)&psDCInfo, IMG_NULL,
@@ -248,7 +248,7 @@ PVRSRV_ERROR PVRSRVRegisterDCDeviceKM (PVRSRV_DC_SRV2DISP_KMJTABLE *psFuncTable,
        }
        OSMemSet (psDCInfo, 0, sizeof(*psDCInfo));
 
-       
+
        if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
                                         sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE),
                                         (IMG_VOID **)&psDCInfo->psFuncTable, IMG_NULL,
@@ -259,10 +259,10 @@ PVRSRV_ERROR PVRSRVRegisterDCDeviceKM (PVRSRV_DC_SRV2DISP_KMJTABLE *psFuncTable,
        }
        OSMemSet (psDCInfo->psFuncTable, 0, sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE));
 
-       
+
        *psDCInfo->psFuncTable = *psFuncTable;
 
-       
+
        if(OSAllocMem( PVRSRV_OS_NON_PAGEABLE_HEAP,
                                         sizeof(PVRSRV_DEVICE_NODE),
                                         (IMG_VOID **)&psDeviceNode, IMG_NULL,
@@ -280,7 +280,7 @@ PVRSRV_ERROR PVRSRVRegisterDCDeviceKM (PVRSRV_DC_SRV2DISP_KMJTABLE *psFuncTable,
        psDeviceNode->sDevId.eDeviceClass = PVRSRV_DEVICE_CLASS_DISPLAY;
        psDeviceNode->psSysData = psSysData;
 
-       
+
        if (AllocateDeviceID(psSysData, &psDeviceNode->sDevId.ui32DeviceIndex) != PVRSRV_OK)
        {
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterBCDeviceKM: Failed to allocate Device ID"));
@@ -292,10 +292,10 @@ PVRSRV_ERROR PVRSRVRegisterDCDeviceKM (PVRSRV_DC_SRV2DISP_KMJTABLE *psFuncTable,
                *pui32DeviceID = psDeviceNode->sDevId.ui32DeviceIndex;
        }
 
-       
+
        SysRegisterExternalDevice(psDeviceNode);
 
-       
+
        List_PVRSRV_DEVICE_NODE_Insert(&psSysData->psDeviceNodeList, psDeviceNode);
 
        return PVRSRV_OK;
@@ -309,7 +309,7 @@ ErrorExit:
        }
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DISPLAYCLASS_INFO), psDCInfo, IMG_NULL);
-       
+
 
        return PVRSRV_ERROR_OUT_OF_MEMORY;
 }
@@ -322,7 +322,7 @@ static PVRSRV_ERROR PVRSRVRemoveDCDeviceKM(IMG_UINT32 ui32DevIndex)
 
        SysAcquireData(&psSysData);
 
-       
+
        psDeviceNode = (PVRSRV_DEVICE_NODE*)
                List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
                                                                           &MatchDeviceKM_AnyVaCb,
@@ -331,27 +331,27 @@ static PVRSRV_ERROR PVRSRVRemoveDCDeviceKM(IMG_UINT32 ui32DevIndex)
                                                                           PVRSRV_DEVICE_CLASS_DISPLAY);
        if (!psDeviceNode)
        {
-               
+
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVRemoveDCDeviceKM: requested device %d not present", ui32DevIndex));
                return PVRSRV_ERROR_NO_DEVICENODE_FOUND;
        }
 
-       
+
        psDCInfo = (PVRSRV_DISPLAYCLASS_INFO*)psDeviceNode->pvDevice;
 
-       
+
 
 
        if(psDCInfo->ui32RefCount == 0)
        {
-               
+
 
                List_PVRSRV_DEVICE_NODE_Remove(psDeviceNode);
 
-               
+
                SysRemoveExternalDevice(psDeviceNode);
 
-               
+
 
 
                PVR_ASSERT(psDCInfo->ui32RefCount == 0);
@@ -359,9 +359,9 @@ static PVRSRV_ERROR PVRSRVRemoveDCDeviceKM(IMG_UINT32 ui32DevIndex)
                (IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE), psDCInfo->psFuncTable, IMG_NULL);
                psDCInfo->psFuncTable = IMG_NULL;
                (IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DISPLAYCLASS_INFO), psDCInfo, IMG_NULL);
-               
+
                (IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DEVICE_NODE), psDeviceNode, IMG_NULL);
-               
+
        }
        else
        {
@@ -380,7 +380,7 @@ PVRSRV_ERROR PVRSRVRegisterBCDeviceKM (PVRSRV_BC_SRV2BUFFER_KMJTABLE *psFuncTabl
        PVRSRV_BUFFERCLASS_INFO *psBCInfo = IMG_NULL;
        PVRSRV_DEVICE_NODE              *psDeviceNode;
        SYS_DATA                                *psSysData;
-       
+
 
 
 
@@ -396,10 +396,10 @@ PVRSRV_ERROR PVRSRVRegisterBCDeviceKM (PVRSRV_BC_SRV2BUFFER_KMJTABLE *psFuncTabl
 
        SysAcquireData(&psSysData);
 
-       
 
 
-       
+
+
        if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
                                         sizeof(*psBCInfo),
                                         (IMG_VOID **)&psBCInfo, IMG_NULL,
@@ -410,7 +410,7 @@ PVRSRV_ERROR PVRSRVRegisterBCDeviceKM (PVRSRV_BC_SRV2BUFFER_KMJTABLE *psFuncTabl
        }
        OSMemSet (psBCInfo, 0, sizeof(*psBCInfo));
 
-       
+
        if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
                                         sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE),
                                         (IMG_VOID **)&psBCInfo->psFuncTable, IMG_NULL,
@@ -421,10 +421,10 @@ PVRSRV_ERROR PVRSRVRegisterBCDeviceKM (PVRSRV_BC_SRV2BUFFER_KMJTABLE *psFuncTabl
        }
        OSMemSet (psBCInfo->psFuncTable, 0, sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE));
 
-       
+
        *psBCInfo->psFuncTable = *psFuncTable;
 
-       
+
        if(OSAllocMem( PVRSRV_OS_NON_PAGEABLE_HEAP,
                                         sizeof(PVRSRV_DEVICE_NODE),
                                         (IMG_VOID **)&psDeviceNode, IMG_NULL,
@@ -442,7 +442,7 @@ PVRSRV_ERROR PVRSRVRegisterBCDeviceKM (PVRSRV_BC_SRV2BUFFER_KMJTABLE *psFuncTabl
        psDeviceNode->sDevId.eDeviceClass = PVRSRV_DEVICE_CLASS_BUFFER;
        psDeviceNode->psSysData = psSysData;
 
-       
+
        if (AllocateDeviceID(psSysData, &psDeviceNode->sDevId.ui32DeviceIndex) != PVRSRV_OK)
        {
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterBCDeviceKM: Failed to allocate Device ID"));
@@ -454,7 +454,7 @@ PVRSRV_ERROR PVRSRVRegisterBCDeviceKM (PVRSRV_BC_SRV2BUFFER_KMJTABLE *psFuncTabl
                *pui32DeviceID = psDeviceNode->sDevId.ui32DeviceIndex;
        }
 
-       
+
        List_PVRSRV_DEVICE_NODE_Insert(&psSysData->psDeviceNodeList, psDeviceNode);
 
        return PVRSRV_OK;
@@ -468,7 +468,7 @@ ErrorExit:
        }
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BUFFERCLASS_INFO), psBCInfo, IMG_NULL);
-       
+
 
        return PVRSRV_ERROR_OUT_OF_MEMORY;
 }
@@ -482,7 +482,7 @@ static PVRSRV_ERROR PVRSRVRemoveBCDeviceKM(IMG_UINT32 ui32DevIndex)
 
        SysAcquireData(&psSysData);
 
-       
+
        psDevNode = (PVRSRV_DEVICE_NODE*)
                List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
                                                                           &MatchDeviceKM_AnyVaCb,
@@ -496,31 +496,31 @@ static PVRSRV_ERROR PVRSRVRemoveBCDeviceKM(IMG_UINT32 ui32DevIndex)
                return PVRSRV_ERROR_NO_DEVICENODE_FOUND;
        }
 
-       
-       
+
+
        psBCInfo = (PVRSRV_BUFFERCLASS_INFO*)psDevNode->pvDevice;
 
-       
+
 
 
        if(psBCInfo->ui32RefCount == 0)
        {
-               
+
 
                List_PVRSRV_DEVICE_NODE_Remove(psDevNode);
 
-               
+
 
 
                (IMG_VOID)FreeDeviceID(psSysData, ui32DevIndex);
-               
-               
+
+
                (IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE), psBCInfo->psFuncTable, IMG_NULL);
                psBCInfo->psFuncTable = IMG_NULL;
                (IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BUFFERCLASS_INFO), psBCInfo, IMG_NULL);
-               
+
                (IMG_VOID)OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DEVICE_NODE), psDevNode, IMG_NULL);
-               
+
        }
        else
        {
@@ -544,7 +544,7 @@ PVRSRV_ERROR PVRSRVCloseDCDeviceKM (IMG_HANDLE      hDeviceKM,
 
        psDCPerContextInfo = (PVRSRV_DISPLAYCLASS_PERCONTEXT_INFO *)hDeviceKM;
 
-       
+
        eError = ResManFreeResByPtr(psDCPerContextInfo->hResItem, CLEANUP_WITH_POLL);
 
        return eError;
@@ -570,7 +570,7 @@ static PVRSRV_ERROR CloseDCDeviceCallBack(IMG_PVOID  pvParam,
                                &psDCInfo->sSystemBuffer.sDeviceClassBuffer,
                                psDCInfo->sSystemBuffer.sDeviceClassBuffer.ui32MemMapRefCount));
 #if 0
-               
+
                return PVRSRV_ERROR_STILL_MAPPED;
 #endif
        }
@@ -578,7 +578,7 @@ static PVRSRV_ERROR CloseDCDeviceCallBack(IMG_PVOID  pvParam,
        psDCInfo->ui32RefCount--;
        if(psDCInfo->ui32RefCount == 0)
        {
-               
+
                psDCInfo->psFuncTable->pfnCloseDCDevice(psDCInfo->hExtDevice);
 
                PVRSRVKernelSyncInfoDecRef(psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo, IMG_NULL);
@@ -592,7 +592,7 @@ static PVRSRV_ERROR CloseDCDeviceCallBack(IMG_PVOID  pvParam,
        }
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DISPLAYCLASS_PERCONTEXT_INFO), psDCPerContextInfo, IMG_NULL);
-       
+
 
        return PVRSRV_OK;
 }
@@ -618,7 +618,7 @@ PVRSRV_ERROR PVRSRVOpenDCDeviceKM (PVRSRV_PER_PROCESS_DATA  *psPerProc,
 
        SysAcquireData(&psSysData);
 
-       
+
        psDeviceNode = (PVRSRV_DEVICE_NODE*)
                        List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
                                                                                   &MatchDeviceKM_AnyVaCb,
@@ -632,7 +632,7 @@ PVRSRV_ERROR PVRSRVOpenDCDeviceKM (PVRSRV_PER_PROCESS_DATA  *psPerProc,
        }
        psDCInfo = (PVRSRV_DISPLAYCLASS_INFO*)psDeviceNode->pvDevice;
 
-       
+
 
 
        if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
@@ -650,10 +650,10 @@ PVRSRV_ERROR PVRSRVOpenDCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
 
                psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
 
-               
+
                psDCInfo->hDevMemContext = (IMG_HANDLE)psDeviceNode->sDevMemoryInfo.pBMKernelContext;
 
-               
+
                eError = PVRSRVAllocSyncInfoKM(IMG_NULL,
                                                                        (IMG_HANDLE)psDeviceNode->sDevMemoryInfo.pBMKernelContext,
                                                                        &psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo);
@@ -664,7 +664,7 @@ PVRSRV_ERROR PVRSRVOpenDCDeviceKM (PVRSRV_PER_PROCESS_DATA  *psPerProc,
                        return eError;
                }
 
-               
+
                eError = psDCInfo->psFuncTable->pfnOpenDCDevice(ui32DeviceID,
                                                                &psDCInfo->hExtDevice,
                                                                (PVRSRV_SYNC_DATA*)psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo->psSyncDataMemInfoKM->pvLinAddrKM);
@@ -700,7 +700,7 @@ PVRSRV_ERROR PVRSRVOpenDCDeviceKM (PVRSRV_PER_PROCESS_DATA  *psPerProc,
                                                                                                         0,
                                                                                                         &CloseDCDeviceCallBack);
 
-       
+
        *phDeviceKM = (IMG_HANDLE)psDCPerContextInfo;
 
        return PVRSRV_OK;
@@ -722,7 +722,7 @@ PVRSRV_ERROR PVRSRVEnumDCFormatsKM (IMG_HANDLE hDeviceKM,
 
        psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
 
-       
+
        return psDCInfo->psFuncTable->pfnEnumDCFormats(psDCInfo->hExtDevice, pui32Count, psFormat);
 }
 
@@ -736,7 +736,7 @@ PVRSRV_ERROR PVRSRVEnumDCDimsKM (IMG_HANDLE hDeviceKM,
 {
        PVRSRV_DISPLAYCLASS_INFO *psDCInfo;
 
-       if(!hDeviceKM || !pui32Count || !psFormat)      
+       if(!hDeviceKM || !pui32Count || !psFormat)
        {
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVEnumDCDimsKM: Invalid parameters"));
                return PVRSRV_ERROR_INVALID_PARAMS;
@@ -744,7 +744,7 @@ PVRSRV_ERROR PVRSRVEnumDCDimsKM (IMG_HANDLE hDeviceKM,
 
        psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
 
-       
+
        return psDCInfo->psFuncTable->pfnEnumDCDims(psDCInfo->hExtDevice, psFormat, pui32Count, psDim);
 }
 
@@ -765,7 +765,7 @@ PVRSRV_ERROR PVRSRVGetDCSystemBufferKM (IMG_HANDLE hDeviceKM,
 
        psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
 
-       
+
        eError = psDCInfo->psFuncTable->pfnGetDCSystemBuffer(psDCInfo->hExtDevice, &hExtBuffer);
        if(eError != PVRSRV_OK)
        {
@@ -773,7 +773,7 @@ PVRSRV_ERROR PVRSRVGetDCSystemBufferKM (IMG_HANDLE hDeviceKM,
                return eError;
        }
 
-       
+
        psDCInfo->sSystemBuffer.sDeviceClassBuffer.pfnGetBufferAddr = psDCInfo->psFuncTable->pfnGetBufferAddr;
        psDCInfo->sSystemBuffer.sDeviceClassBuffer.hDevMemContext = psDCInfo->hDevMemContext;
        psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtDevice = psDCInfo->hExtDevice;
@@ -781,7 +781,7 @@ PVRSRV_ERROR PVRSRVGetDCSystemBufferKM (IMG_HANDLE hDeviceKM,
 
        psDCInfo->sSystemBuffer.psDCInfo = psDCInfo;
 
-       
+
        if (phBuffer)
        {
                *phBuffer = (IMG_HANDLE)&(psDCInfo->sSystemBuffer);
@@ -806,7 +806,7 @@ PVRSRV_ERROR PVRSRVGetDCInfoKM (IMG_HANDLE hDeviceKM,
 
        psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
 
-       
+
        eError = psDCInfo->psFuncTable->pfnGetDCInfo(psDCInfo->hExtDevice, psDisplayInfo);
        if (eError != PVRSRV_OK)
        {
@@ -848,34 +848,34 @@ static PVRSRV_ERROR DestroyDCSwapChain(PVRSRV_DC_SWAPCHAIN *psSwapChain)
        PVRSRV_DISPLAYCLASS_INFO        *psDCInfo = psSwapChain->psDCInfo;
        IMG_UINT32 i;
 
-       
+
        if( psDCInfo->psDCSwapChainShared )
        {
                if( psDCInfo->psDCSwapChainShared == psSwapChain )
                {
                        psDCInfo->psDCSwapChainShared = psSwapChain->psNext;
                }
-               else 
+               else
                {
                        PVRSRV_DC_SWAPCHAIN *psCurrentSwapChain;
-                       psCurrentSwapChain = psDCInfo->psDCSwapChainShared;             
+                       psCurrentSwapChain = psDCInfo->psDCSwapChainShared;
                        while( psCurrentSwapChain->psNext )
                        {
-                               if( psCurrentSwapChain->psNext != psSwapChain ) 
+                               if( psCurrentSwapChain->psNext != psSwapChain )
                                {
                                        psCurrentSwapChain = psCurrentSwapChain->psNext;
                                        continue;
                                }
                                psCurrentSwapChain->psNext = psSwapChain->psNext;
-                               break;                          
+                               break;
                        }
                }
        }
 
-       
+
        PVRSRVDestroyCommandQueueKM(psSwapChain->psQueue);
 
-       
+
        eError = psDCInfo->psFuncTable->pfnDestroyDCSwapChain(psDCInfo->hExtDevice,
                                                                                                                        psSwapChain->hExtSwapChain);
 
@@ -885,7 +885,7 @@ static PVRSRV_ERROR DestroyDCSwapChain(PVRSRV_DC_SWAPCHAIN *psSwapChain)
                return eError;
        }
 
-       
+
        for(i=0; i<psSwapChain->ui32BufferCount; i++)
        {
                if(psSwapChain->asBuffer[i].sDeviceClassBuffer.psKernelSyncInfo)
@@ -907,7 +907,7 @@ static PVRSRV_ERROR DestroyDCSwapChain(PVRSRV_DC_SWAPCHAIN *psSwapChain)
 #endif
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DC_SWAPCHAIN), psSwapChain, IMG_NULL);
-       
+
 
        return eError;
 }
@@ -932,13 +932,13 @@ static PVRSRV_ERROR DestroyDCSwapChainRefCallBack(IMG_PVOID pvParam,
                                        &psSwapChainRef->psSwapChain->asBuffer[i].sDeviceClassBuffer,
                                        psSwapChainRef->psSwapChain->asBuffer[i].sDeviceClassBuffer.ui32MemMapRefCount));
 #if 0
-                       
+
                        return PVRSRV_ERROR_STILL_MAPPED;
 #endif
                }
        }
 
-       if(--psSwapChainRef->psSwapChain->ui32RefCount == 0) 
+       if(--psSwapChainRef->psSwapChain->ui32RefCount == 0)
        {
                eError = DestroyDCSwapChain(psSwapChainRef->psSwapChain);
        }
@@ -952,9 +952,9 @@ static PVRSRV_DC_SWAPCHAIN* PVRSRVFindSharedDCSwapChainKM(PVRSRV_DISPLAYCLASS_IN
 {
        PVRSRV_DC_SWAPCHAIN *psCurrentSwapChain;
 
-       for(psCurrentSwapChain = psDCInfo->psDCSwapChainShared; 
-               psCurrentSwapChain; 
-               psCurrentSwapChain = psCurrentSwapChain->psNext) 
+       for(psCurrentSwapChain = psDCInfo->psDCSwapChainShared;
+               psCurrentSwapChain;
+               psCurrentSwapChain = psCurrentSwapChain->psNext)
        {
                if(psCurrentSwapChain->ui32SwapChainID == ui32SwapChainID)
                        return psCurrentSwapChain;
@@ -963,12 +963,12 @@ static PVRSRV_DC_SWAPCHAIN* PVRSRVFindSharedDCSwapChainKM(PVRSRV_DISPLAYCLASS_IN
 }
 
 static PVRSRV_ERROR PVRSRVCreateDCSwapChainRefKM(PVRSRV_PER_PROCESS_DATA       *psPerProc,
-                                                                                                PVRSRV_DC_SWAPCHAIN            *psSwapChain, 
+                                                                                                PVRSRV_DC_SWAPCHAIN            *psSwapChain,
                                                                                                 PVRSRV_DC_SWAPCHAIN_REF        **ppsSwapChainRef)
 {
        PVRSRV_DC_SWAPCHAIN_REF *psSwapChainRef = IMG_NULL;
 
-       
+
        if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
                                         sizeof(PVRSRV_DC_SWAPCHAIN_REF),
                                         (IMG_VOID **)&psSwapChainRef, IMG_NULL,
@@ -979,10 +979,10 @@ static PVRSRV_ERROR PVRSRVCreateDCSwapChainRefKM(PVRSRV_PER_PROCESS_DATA  *psPerP
        }
        OSMemSet (psSwapChainRef, 0, sizeof(PVRSRV_DC_SWAPCHAIN_REF));
 
-       
+
        psSwapChain->ui32RefCount++;
 
-       
+
        psSwapChainRef->psSwapChain = psSwapChain;
        psSwapChainRef->hResItem = ResManRegisterRes(psPerProc->hResManContext,
                                                                                                  RESMAN_TYPE_DISPLAYCLASS_SWAPCHAIN_REF,
@@ -1042,15 +1042,15 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA *psPerProc,
 
        if( ui32Flags & PVRSRV_CREATE_SWAPCHAIN_QUERY )
        {
-               
+
                psSwapChain = PVRSRVFindSharedDCSwapChainKM(psDCInfo, *pui32SwapChainID );
-               if( psSwapChain  ) 
-               {       
-                                          
-                       eError = PVRSRVCreateDCSwapChainRefKM(psPerProc, 
-                                                                                                 psSwapChain, 
+               if( psSwapChain  )
+               {
+
+                       eError = PVRSRVCreateDCSwapChainRefKM(psPerProc,
+                                                                                                 psSwapChain,
                                                                                                  &psSwapChainRef);
-                       if( eError != PVRSRV_OK ) 
+                       if( eError != PVRSRV_OK )
                        {
                                PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: Couldn't create swap chain reference"));
                                return eError;
@@ -1060,10 +1060,10 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA *psPerProc,
                        return PVRSRV_OK;
                }
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: No shared SwapChain found for query"));
-               return PVRSRV_ERROR_FLIP_CHAIN_EXISTS;          
+               return PVRSRV_ERROR_FLIP_CHAIN_EXISTS;
        }
 
-       
+
        if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
                                         sizeof(PVRSRV_DC_SWAPCHAIN),
                                         (IMG_VOID **)&psSwapChain, IMG_NULL,
@@ -1075,7 +1075,7 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA   *psPerProc,
        }
        OSMemSet (psSwapChain, 0, sizeof(PVRSRV_DC_SWAPCHAIN));
 
-       
+
        eError = PVRSRVCreateCommandQueueKM(1024, &psQueue);
        if(eError != PVRSRV_OK)
        {
@@ -1083,10 +1083,10 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA *psPerProc,
                goto ErrorExit;
        }
 
-       
+
        psSwapChain->psQueue = psQueue;
 
-       
+
        for(i=0; i<ui32BufferCount; i++)
        {
                eError = PVRSRVAllocSyncInfoKM(IMG_NULL,
@@ -1100,16 +1100,16 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA *psPerProc,
 
                PVRSRVKernelSyncInfoIncRef(psSwapChain->asBuffer[i].sDeviceClassBuffer.psKernelSyncInfo, IMG_NULL);
 
-               
+
                psSwapChain->asBuffer[i].sDeviceClassBuffer.pfnGetBufferAddr = psDCInfo->psFuncTable->pfnGetBufferAddr;
                psSwapChain->asBuffer[i].sDeviceClassBuffer.hDevMemContext = psDCInfo->hDevMemContext;
                psSwapChain->asBuffer[i].sDeviceClassBuffer.hExtDevice = psDCInfo->hExtDevice;
 
-               
+
                psSwapChain->asBuffer[i].psDCInfo = psDCInfo;
                psSwapChain->asBuffer[i].psSwapChain = psSwapChain;
 
-               
+
                apsSyncData[i] = (PVRSRV_SYNC_DATA*)psSwapChain->asBuffer[i].sDeviceClassBuffer.psKernelSyncInfo->psSyncDataMemInfoKM->pvLinAddrKM;
        }
 
@@ -1134,11 +1134,11 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA *psPerProc,
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: Failed to get DC info"));
                return eError;
        }
-       
+
        psSwapChain->ui32MinSwapInterval = sDisplayInfo.ui32MinSwapInterval;
        psSwapChain->ui32MaxSwapInterval = sDisplayInfo.ui32MaxSwapInterval;
 
-       
+
        eError =  psDCInfo->psFuncTable->pfnCreateDCSwapChain(psDCInfo->hExtDevice,
                                                                                                                ui32Flags,
                                                                                                                psDstSurfAttrib,
@@ -1155,11 +1155,11 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA *psPerProc,
                goto ErrorExit;
        }
 
-                          
-       eError = PVRSRVCreateDCSwapChainRefKM(psPerProc, 
-                                                                                 psSwapChain, 
+
+       eError = PVRSRVCreateDCSwapChainRefKM(psPerProc,
+                                                                                 psSwapChain,
                                                                                  &psSwapChainRef);
-       if( eError != PVRSRV_OK ) 
+       if( eError != PVRSRV_OK )
        {
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: Couldn't create swap chain reference"));
                PDUMPCOMMENT("Swapchain allocation failed.");
@@ -1169,25 +1169,25 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA *psPerProc,
        psSwapChain->ui32RefCount = 1;
        psSwapChain->ui32Flags = ui32Flags;
 
-       
+
        if( ui32Flags & PVRSRV_CREATE_SWAPCHAIN_SHARED )
        {
-               if(! psDCInfo->psDCSwapChainShared ) 
+               if(! psDCInfo->psDCSwapChainShared )
                {
                        psDCInfo->psDCSwapChainShared = psSwapChain;
-               } 
-               else 
-               {       
+               }
+               else
+               {
                        PVRSRV_DC_SWAPCHAIN *psOldHead = psDCInfo->psDCSwapChainShared;
                        psDCInfo->psDCSwapChainShared = psSwapChain;
                        psSwapChain->psNext = psOldHead;
                }
        }
 
-       
+
        *pui32SwapChainID = psSwapChain->ui32SwapChainID;
 
-       
+
        *phSwapChainRef= (IMG_HANDLE)psSwapChainRef;
 
        return eError;
@@ -1214,7 +1214,7 @@ ErrorExit:
        if(psSwapChain)
        {
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_DC_SWAPCHAIN), psSwapChain, IMG_NULL);
-               
+
        }
 
        return eError;
@@ -1337,7 +1337,7 @@ PVRSRV_ERROR PVRSRVGetDCBuffersKM(IMG_HANDLE      hDeviceKM,
        psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
        psSwapChain = ((PVRSRV_DC_SWAPCHAIN_REF*)hSwapChainRef)->psSwapChain;
 
-       
+
        eError = psDCInfo->psFuncTable->pfnGetDCBuffers(psDCInfo->hExtDevice,
                                                                                                        psSwapChain->hExtSwapChain,
                                                                                                        pui32BufferCount,
@@ -1345,7 +1345,7 @@ PVRSRV_ERROR PVRSRVGetDCBuffersKM(IMG_HANDLE      hDeviceKM,
 
        PVR_ASSERT(*pui32BufferCount <= PVRSRV_MAX_DC_SWAPCHAIN_BUFFERS);
 
-       
+
 
 
        for(i=0; i<*pui32BufferCount; i++)
@@ -1414,7 +1414,7 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(IMG_HANDLE    hDeviceKM,
        psBuffer = (PVRSRV_DC_BUFFER*)hBuffer;
        psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
 
-       
+
        if(ui32SwapInterval < psBuffer->psSwapChain->ui32MinSwapInterval ||
                ui32SwapInterval > psBuffer->psSwapChain->ui32MaxSwapInterval)
        {
@@ -1429,34 +1429,34 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(IMG_HANDLE  hDeviceKM,
        {
                psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice,
                                                                                                         psBuffer->psSwapChain->hExtSwapChain,
-                                                                                                        psBuffer->sDeviceClassBuffer.hExtBuffer, 
-                                                                                                        hPrivateTag, 
+                                                                                                        psBuffer->sDeviceClassBuffer.hExtBuffer,
+                                                                                                        hPrivateTag,
                                                                                                         &ui16SwapCommandID,
                                                                                                         &bAddReferenceToLast);
-               
+
        }
 
 #endif
 
-       
+
        psQueue = psBuffer->psSwapChain->psQueue;
 
-       
+
        apsSrcSync[0] = psBuffer->sDeviceClassBuffer.psKernelSyncInfo;
-       
+
 
 
        if(bAddReferenceToLast && psBuffer->psSwapChain->psLastFlipBuffer &&
                psBuffer != psBuffer->psSwapChain->psLastFlipBuffer)
        {
                apsSrcSync[1] = psBuffer->psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.psKernelSyncInfo;
-               
+
 
 
                ui32NumSrcSyncs++;
        }
 
-       
+
        eError = PVRSRVInsertCommandKM (psQueue,
                                                                        &psCommand,
                                                                        psDCInfo->ui32DeviceID,
@@ -1474,32 +1474,32 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(IMG_HANDLE  hDeviceKM,
                goto Exit;
        }
 
-       
+
        psFlipCmd = (DISPLAYCLASS_FLIP_COMMAND*)psCommand->pvData;
 
-       
+
        psFlipCmd->hExtDevice = psDCInfo->hExtDevice;
 
-       
+
        psFlipCmd->hExtSwapChain = psBuffer->psSwapChain->hExtSwapChain;
 
-       
+
        psFlipCmd->hExtBuffer = psBuffer->sDeviceClassBuffer.hExtBuffer;
 
-       
+
        psFlipCmd->hPrivateTag = hPrivateTag;
 
-       
+
        psFlipCmd->ui32ClipRectCount = ui32ClipRectCount;
-       
-       psFlipCmd->psClipRect = (IMG_RECT*)((IMG_UINT8*)psFlipCmd + sizeof(DISPLAYCLASS_FLIP_COMMAND)); 
-       
+
+       psFlipCmd->psClipRect = (IMG_RECT*)((IMG_UINT8*)psFlipCmd + sizeof(DISPLAYCLASS_FLIP_COMMAND));
+
        for(i=0; i<ui32ClipRectCount; i++)
        {
                psFlipCmd->psClipRect[i] = psClipRect[i];
        }
 
-       
+
        psFlipCmd->ui32SwapInterval = ui32SwapInterval;
 
        SysAcquireData(&psSysData);
@@ -1526,9 +1526,9 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(IMG_HANDLE    hDeviceKM,
                goto Exit;
        }
 
-       
 
-       eError = OSScheduleMISR(psSysData);
+
+    eError = OSScheduleMISR(psSysData);
 
        if (eError != PVRSRV_OK)
        {
@@ -1536,7 +1536,7 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(IMG_HANDLE    hDeviceKM,
                goto Exit;
        }
 
-       
+
        psBuffer->psSwapChain->psLastFlipBuffer = psBuffer;
        psDCInfo->psDCSwapChainCur = psBuffer->psSwapChain;
 
@@ -1632,7 +1632,6 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE   hDeviceKM,
        psCallbackData->pvPrivData = pvPrivData;
        psCallbackData->ui32PrivDataLength = ui32PrivDataLength;
 
-
        if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                  sizeof(IMG_VOID *) * ui32NumMemSyncInfos,
                                  (IMG_VOID **)&ppvMemInfos, IMG_NULL,
@@ -1674,7 +1673,6 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE   hDeviceKM,
 
                ui32NumCompiledSyncInfos = ui32NumMemSyncInfos + ui32NumUniqueSyncInfos;
 
-
                if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                          sizeof(PVRSRV_KERNEL_SYNC_INFO *) * ui32NumCompiledSyncInfos,
                                          (IMG_VOID **)&ppsCompiledSyncInfos, IMG_NULL,
@@ -1749,6 +1747,9 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE   hDeviceKM,
        psFlipCmd->ppsMemInfos = (PDC_MEM_INFO *)ppvMemInfos;
        psFlipCmd->ui32NumMemInfos = ui32NumMemSyncInfos;
 
+
+       psFlipCmd->hUnused = IMG_NULL;
+
        SysAcquireData(&psSysData);
 
 
@@ -1861,7 +1862,7 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(IMG_HANDLE    hDeviceKM,
        psSwapChainRef = (PVRSRV_DC_SWAPCHAIN_REF*)hSwapChainRef;
        psSwapChain = psSwapChainRef->psSwapChain;
 
-       
+
        psQueue = psSwapChain->psQueue;
 
 #if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
@@ -1870,34 +1871,34 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(IMG_HANDLE  hDeviceKM,
        {
                psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice,
                                                                                                         psSwapChain->hExtSwapChain,
-                                                                                                        psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtBuffer, 
-                                                                                                        0, 
+                                                                                                        psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtBuffer,
+                                                                                                        0,
                                                                                                         &ui16SwapCommandID,
                                                                                                         &bAddReferenceToLast);
-               
+
        }
 
 #endif
 
-       
+
        apsSrcSync[0] = psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo;
-       
+
 
 
        if(bAddReferenceToLast && psSwapChain->psLastFlipBuffer)
        {
-               
+
                if (apsSrcSync[0] != psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.psKernelSyncInfo)
                {
                        apsSrcSync[1] = psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.psKernelSyncInfo;
-                       
+
 
 
                        ui32NumSrcSyncs++;
                }
        }
 
-       
+
        eError = PVRSRVInsertCommandKM (psQueue,
                                                                        &psCommand,
                                                                        psDCInfo->ui32DeviceID,
@@ -1915,27 +1916,27 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(IMG_HANDLE  hDeviceKM,
                goto Exit;
        }
 
-       
+
        psFlipCmd = (DISPLAYCLASS_FLIP_COMMAND*)psCommand->pvData;
 
-       
+
        psFlipCmd->hExtDevice = psDCInfo->hExtDevice;
 
-       
+
        psFlipCmd->hExtSwapChain = psSwapChain->hExtSwapChain;
 
-       
+
        psFlipCmd->hExtBuffer = psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtBuffer;
 
-       
+
        psFlipCmd->hPrivateTag = IMG_NULL;
 
-       
+
        psFlipCmd->ui32ClipRectCount = 0;
 
        psFlipCmd->ui32SwapInterval = 1;
 
-       
+
        eError = PVRSRVSubmitCommandKM (psQueue, psCommand);
        if (eError != PVRSRV_OK)
        {
@@ -1943,7 +1944,7 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(IMG_HANDLE    hDeviceKM,
                goto Exit;
        }
 
-       
+
        SysAcquireData(&psSysData);
     eError = OSScheduleMISR(psSysData);
 
@@ -1953,7 +1954,7 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(IMG_HANDLE    hDeviceKM,
                goto Exit;
        }
 
-       
+
        psSwapChain->psLastFlipBuffer = &psDCInfo->sSystemBuffer;
        psDCInfo->psDCSwapChainCur = psSwapChain;
 
@@ -1993,7 +1994,7 @@ PVRSRV_ERROR PVRSRVGetDCFrontBufferKM(IMG_HANDLE  hDeviceKM,
        {
                return eError;
        }
-#endif 
+#endif
 
        psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
        psSwapChain = psDCInfo->psDCSwapChainCur;
@@ -2069,7 +2070,7 @@ PVRSRV_ERROR PVRSRVRegisterSystemISRHandler (PFN_ISR_HANDLER      pfnISRHandler,
 
        SysAcquireData(&psSysData);
 
-       
+
        psDevNode = (PVRSRV_DEVICE_NODE*)
                                List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
                                                                                                &MatchDeviceKM_AnyVaCb,
@@ -2083,10 +2084,10 @@ PVRSRV_ERROR PVRSRVRegisterSystemISRHandler (PFN_ISR_HANDLER    pfnISRHandler,
                return PVRSRV_ERROR_NO_DEVICENODE_FOUND;
        }
 
-       
+
        psDevNode->pvISRData = (IMG_VOID*) pvISRHandlerData;
 
-       
+
        psDevNode->pfnDeviceISR = pfnISRHandler;
 
        return PVRSRV_OK;
@@ -2190,7 +2191,7 @@ PVRSRV_ERROR PVRSRVCloseBCDeviceKM (IMG_HANDLE    hDeviceKM,
 
        psBCPerContextInfo = (PVRSRV_BUFFERCLASS_PERCONTEXT_INFO *)hDeviceKM;
 
-       
+
        eError = ResManFreeResByPtr(psBCPerContextInfo->hResItem, CLEANUP_WITH_POLL);
 
        return eError;
@@ -2227,15 +2228,15 @@ static PVRSRV_ERROR CloseBCDeviceCallBack(IMG_PVOID  pvParam,
        if(psBCInfo->ui32RefCount > 0)
        {
                // reference count may be not increased if buffer count is zero
-               psBCInfo->ui32RefCount--;
+       psBCInfo->ui32RefCount--;
        }
 
        if(psBCInfo->ui32RefCount == 0)
        {
-               
+
                psBCInfo->psFuncTable->pfnCloseBCDevice(psBCInfo->ui32DeviceID, psBCInfo->hExtDevice);
 
-               
+
                for(i=0; i<psBCInfo->ui32BufferCount; i++)
                {
                        if(psBCInfo->psBuffer[i].sDeviceClassBuffer.psKernelSyncInfo)
@@ -2248,7 +2249,7 @@ static PVRSRV_ERROR CloseBCDeviceCallBack(IMG_PVOID  pvParam,
                        }
                }
 
-               
+
                if(psBCInfo->psBuffer)
                {
                        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BC_BUFFER) * psBCInfo->ui32BufferCount, psBCInfo->psBuffer, IMG_NULL);
@@ -2257,7 +2258,7 @@ static PVRSRV_ERROR CloseBCDeviceCallBack(IMG_PVOID  pvParam,
        }
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BUFFERCLASS_PERCONTEXT_INFO), psBCPerContextInfo, IMG_NULL);
-       
+
 
        return PVRSRV_OK;
 }
@@ -2284,7 +2285,7 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
 
        SysAcquireData(&psSysData);
 
-       
+
        psDeviceNode = (PVRSRV_DEVICE_NODE*)
                        List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
                                                                                   &MatchDeviceKM_AnyVaCb,
@@ -2298,7 +2299,7 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
        }
        psBCInfo = (PVRSRV_BUFFERCLASS_INFO*)psDeviceNode->pvDevice;
 
-       
+
 
 
        if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
@@ -2317,10 +2318,10 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA      *psPerProc,
 
                psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
 
-               
+
                psBCInfo->hDevMemContext = (IMG_HANDLE)psDeviceNode->sDevMemoryInfo.pBMKernelContext;
 
-               
+
                eError = psBCInfo->psFuncTable->pfnOpenBCDevice(ui32DeviceID, &psBCInfo->hExtDevice);
                if(eError != PVRSRV_OK)
                {
@@ -2328,7 +2329,7 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
                        return eError;
                }
 
-               
+
                eError = psBCInfo->psFuncTable->pfnGetBCInfo(psBCInfo->hExtDevice, &sBufferInfo);
                if(eError != PVRSRV_OK)
                {
@@ -2336,7 +2337,7 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
                        return eError;
                }
 
-               
+
                psBCInfo->ui32BufferCount = sBufferInfo.ui32BufferCount;
 
                if(sBufferInfo.ui32BufferCount == 0)
@@ -2344,7 +2345,7 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
                        // reference count is not increased if buffer count is zero
                        psBCInfo->ui32RefCount = 0;
                }
-               
+
                eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                                          sizeof(PVRSRV_BC_BUFFER) * sBufferInfo.ui32BufferCount,
                                                          (IMG_VOID **)&psBCInfo->psBuffer,
@@ -2361,7 +2362,7 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
 
                for(i=0; i<psBCInfo->ui32BufferCount; i++)
                {
-                       
+
                        eError = PVRSRVAllocSyncInfoKM(IMG_NULL,
                                                                                psBCInfo->hDevMemContext,
                                                                                &psBCInfo->psBuffer[i].sDeviceClassBuffer.psKernelSyncInfo);
@@ -2372,8 +2373,8 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
                        }
 
                        PVRSRVKernelSyncInfoIncRef(psBCInfo->psBuffer[i].sDeviceClassBuffer.psKernelSyncInfo, IMG_NULL);
-                       
-                       
+
+
 
 
                        eError = psBCInfo->psFuncTable->pfnGetBCBuffer(psBCInfo->hExtDevice,
@@ -2386,7 +2387,7 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
                                goto ErrorExit;
                        }
 
-                       
+
                        psBCInfo->psBuffer[i].sDeviceClassBuffer.pfnGetBufferAddr = psBCInfo->psFuncTable->pfnGetBufferAddr;
                        psBCInfo->psBuffer[i].sDeviceClassBuffer.hDevMemContext = psBCInfo->hDevMemContext;
                        psBCInfo->psBuffer[i].sDeviceClassBuffer.hExtDevice = psBCInfo->hExtDevice;
@@ -2401,7 +2402,7 @@ PVRSRV_ERROR PVRSRVOpenBCDeviceKM (PVRSRV_PER_PROCESS_DATA        *psPerProc,
                                                                                                         0,
                                                                                                         &CloseBCDeviceCallBack);
 
-       
+
        *phDeviceKM = (IMG_HANDLE)psBCPerContextInfo;
 
        return PVRSRV_OK;
@@ -2423,7 +2424,7 @@ ErrorExit:
                }
        }
 
-       
+
        if(psBCInfo->psBuffer)
        {
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_BC_BUFFER), psBCInfo->psBuffer, IMG_NULL);
old mode 100755 (executable)
new mode 100644 (file)
index 9a7bdb3..2de8413
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -33,4 +33,4 @@
 PVRSRV_ERROR AllocateDeviceID(SYS_DATA *psSysData, IMG_UINT32 *pui32DevID);
 PVRSRV_ERROR FreeDeviceID(SYS_DATA *psSysData, IMG_UINT32 ui32DevID);
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 3d4f49d..866c67a
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -43,9 +43,9 @@ static PVRSRV_ERROR AllocDeviceMem(IMG_HANDLE         hDevCookie,
 
 typedef struct _RESMAN_MAP_DEVICE_MEM_DATA_
 {
-       
+
        PVRSRV_KERNEL_MEM_INFO  *psMemInfo;
-       
+
        PVRSRV_KERNEL_MEM_INFO  *psSrcMemInfo;
 } RESMAN_MAP_DEVICE_MEM_DATA;
 
@@ -82,17 +82,17 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapsKM(IMG_HANDLE hDevCookie,
 
        psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
 
-       
+
        ui32HeapCount = psDeviceNode->sDevMemoryInfo.ui32HeapCount;
        psDeviceMemoryHeap = psDeviceNode->sDevMemoryInfo.psDeviceMemoryHeap;
 
-       
+
        PVR_ASSERT(ui32HeapCount <= PVRSRV_MAX_CLIENT_HEAPS);
 
-       
+
        for(i=0; i<ui32HeapCount; i++)
        {
-               
+
                psHeapInfo[i].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
                psHeapInfo[i].hDevMemHeap = psDeviceMemoryHeap[i].hDevMemHeap;
                psHeapInfo[i].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
@@ -144,16 +144,16 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDeviceMemContextKM(IMG_HANDLE                                       hDevCook
 
        psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
 
-       
+
 
        ui32HeapCount = psDeviceNode->sDevMemoryInfo.ui32HeapCount;
        psDeviceMemoryHeap = psDeviceNode->sDevMemoryInfo.psDeviceMemoryHeap;
 
-       
+
 
        PVR_ASSERT(ui32HeapCount <= PVRSRV_MAX_CLIENT_HEAPS);
 
-       
+
 
        hDevMemContext = BM_CreateContext(psDeviceNode,
                                                                          &sPDDevPAddr,
@@ -165,14 +165,14 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDeviceMemContextKM(IMG_HANDLE                                       hDevCook
                return PVRSRV_ERROR_OUT_OF_MEMORY;
        }
 
-       
+
        for(i=0; i<ui32HeapCount; i++)
        {
                switch(psDeviceMemoryHeap[i].DevMemHeapType)
                {
                        case DEVICE_MEMORY_HEAP_SHARED_EXPORTED:
                        {
-                               
+
                                psHeapInfo[ui32ClientHeapCount].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
                                psHeapInfo[ui32ClientHeapCount].hDevMemHeap = psDeviceMemoryHeap[i].hDevMemHeap;
                                psHeapInfo[ui32ClientHeapCount].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
@@ -207,7 +207,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDeviceMemContextKM(IMG_HANDLE                                 hDevCook
                                        hDevMemHeap = IMG_NULL;
                                }
 
-                               
+
                                psHeapInfo[ui32ClientHeapCount].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
                                psHeapInfo[ui32ClientHeapCount].hDevMemHeap = hDevMemHeap;
                                psHeapInfo[ui32ClientHeapCount].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
@@ -228,7 +228,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDeviceMemContextKM(IMG_HANDLE                                 hDevCook
                }
        }
 
-       
+
        *pui32ClientHeapCount = ui32ClientHeapCount;
        *phDevMemContext = hDevMemContext;
 
@@ -278,23 +278,23 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfoKM(IMG_HANDLE                                 hDevCookie
 
        psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
 
-       
+
 
        ui32HeapCount = psDeviceNode->sDevMemoryInfo.ui32HeapCount;
        psDeviceMemoryHeap = psDeviceNode->sDevMemoryInfo.psDeviceMemoryHeap;
 
-       
+
 
        PVR_ASSERT(ui32HeapCount <= PVRSRV_MAX_CLIENT_HEAPS);
 
-       
+
        for(i=0; i<ui32HeapCount; i++)
        {
                switch(psDeviceMemoryHeap[i].DevMemHeapType)
                {
                        case DEVICE_MEMORY_HEAP_SHARED_EXPORTED:
                        {
-                               
+
                                psHeapInfo[ui32ClientHeapCount].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
                                psHeapInfo[ui32ClientHeapCount].hDevMemHeap = psDeviceMemoryHeap[i].hDevMemHeap;
                                psHeapInfo[ui32ClientHeapCount].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
@@ -313,7 +313,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfoKM(IMG_HANDLE                                   hDevCookie
                                {
                                        hDevMemHeap = BM_CreateHeap(hDevMemContext,
                                                                                                &psDeviceMemoryHeap[i]);
-                               
+
                                        if (hDevMemHeap == IMG_NULL)
                                        {
                                                return PVRSRV_ERROR_OUT_OF_MEMORY;
@@ -324,7 +324,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfoKM(IMG_HANDLE                                   hDevCookie
                                        hDevMemHeap = IMG_NULL;
                                }
 
-                               
+
                                psHeapInfo[ui32ClientHeapCount].ui32HeapID = psDeviceMemoryHeap[i].ui32HeapID;
                                psHeapInfo[ui32ClientHeapCount].hDevMemHeap = hDevMemHeap;
                                psHeapInfo[ui32ClientHeapCount].sDevVAddrBase = psDeviceMemoryHeap[i].sDevVAddrBase;
@@ -341,7 +341,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfoKM(IMG_HANDLE                                   hDevCookie
                }
        }
 
-       
+
        *pui32ClientHeapCount = ui32ClientHeapCount;
 
        return PVRSRV_OK;
@@ -359,7 +359,7 @@ static PVRSRV_ERROR AllocDeviceMem(IMG_HANDLE               hDevCookie,
 {
        PVRSRV_KERNEL_MEM_INFO  *psMemInfo;
        BM_HANDLE               hBuffer;
-       
+
        PVRSRV_MEMBLK   *psMemBlock;
        IMG_BOOL                bBMError;
 
@@ -380,7 +380,7 @@ static PVRSRV_ERROR AllocDeviceMem(IMG_HANDLE               hDevCookie,
 
        psMemBlock = &(psMemInfo->sMemBlk);
 
-       
+
        psMemInfo->ui32Flags = ui32Flags | PVRSRV_MEM_RAM_BACKED_ALLOCATION;
 
        bBMError = BM_Alloc (hDevMemHeap,
@@ -396,18 +396,18 @@ static PVRSRV_ERROR AllocDeviceMem(IMG_HANDLE             hDevCookie,
        {
                PVR_DPF((PVR_DBG_ERROR,"AllocDeviceMem: BM_Alloc Failed"));
                OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-               
+
                return PVRSRV_ERROR_OUT_OF_MEMORY;
        }
 
-       
+
        psMemBlock->sDevVirtAddr = BM_HandleToDevVaddr(hBuffer);
        psMemBlock->hOSMemHandle = BM_HandleToOSMemHandle(hBuffer);
 
-       
+
        psMemBlock->hBuffer = (IMG_HANDLE)hBuffer;
 
-       
+
 
        psMemInfo->pvLinAddrKM = BM_HandleToCpuVaddr(hBuffer);
 
@@ -415,13 +415,13 @@ static PVRSRV_ERROR AllocDeviceMem(IMG_HANDLE             hDevCookie,
 
        psMemInfo->uAllocSize = ui32Size;
 
-       
+
        psMemInfo->pvSysBackupBuffer = IMG_NULL;
 
-       
+
        *ppsMemInfo = psMemInfo;
 
-       
+
        return (PVRSRV_OK);
 }
 
@@ -436,7 +436,7 @@ static PVRSRV_ERROR FreeDeviceMem2(PVRSRV_KERNEL_MEM_INFO *psMemInfo, PVRSRV_FRE
 
        hBuffer = psMemInfo->sMemBlk.hBuffer;
 
-       
+
        switch(eCallbackOrigin)
        {
                case PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR:
@@ -449,18 +449,18 @@ static PVRSRV_ERROR FreeDeviceMem2(PVRSRV_KERNEL_MEM_INFO *psMemInfo, PVRSRV_FRE
                        break;
        }
 
-       
+
        if (psMemInfo->pvSysBackupBuffer &&
                eCallbackOrigin == PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR)
        {
-               
+
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, psMemInfo->uAllocSize, psMemInfo->pvSysBackupBuffer, IMG_NULL);
                psMemInfo->pvSysBackupBuffer = IMG_NULL;
        }
 
        if (psMemInfo->ui32RefCount == 0)
                OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-       
+
 
        return(PVRSRV_OK);
 }
@@ -476,18 +476,18 @@ static PVRSRV_ERROR FreeDeviceMem(PVRSRV_KERNEL_MEM_INFO *psMemInfo)
 
        hBuffer = psMemInfo->sMemBlk.hBuffer;
 
-       
+
        BM_Free(hBuffer, psMemInfo->ui32Flags);
 
        if(psMemInfo->pvSysBackupBuffer)
        {
-               
+
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, psMemInfo->uAllocSize, psMemInfo->pvSysBackupBuffer, IMG_NULL);
                psMemInfo->pvSysBackupBuffer = IMG_NULL;
        }
 
        OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-       
+
 
        return(PVRSRV_OK);
 }
@@ -517,14 +517,14 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocSyncInfoKM(IMG_HANDLE                                        hDevCookie,
 
        psKernelSyncInfo->ui32RefCount = 0;
 
-       
+
        pBMContext = (BM_CONTEXT*)hDevMemContext;
        psDevMemoryInfo = &pBMContext->psDeviceNode->sDevMemoryInfo;
 
-       
+
        hSyncDevMemHeap = psDevMemoryInfo->psDeviceMemoryHeap[psDevMemoryInfo->ui32SyncHeapID].hDevMemHeap;
 
-       
+
 
 
        eError = AllocDeviceMem(hDevCookie,
@@ -541,11 +541,11 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocSyncInfoKM(IMG_HANDLE                                        hDevCookie,
 
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVAllocSyncInfoKM: Failed to alloc memory"));
                OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_SYNC_INFO), psKernelSyncInfo, IMG_NULL);
-               
+
                return PVRSRV_ERROR_OUT_OF_MEMORY;
        }
 
-       
+
        psKernelSyncInfo->psSyncData = psKernelSyncInfo->psSyncDataMemInfoKM->pvLinAddrKM;
        psSyncData = psKernelSyncInfo->psSyncData;
 
@@ -573,10 +573,10 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocSyncInfoKM(IMG_HANDLE                                        hDevCookie,
        psKernelSyncInfo->sReadOps2CompleteDevVAddr.uiAddr = psKernelSyncInfo->psSyncDataMemInfoKM->sDevVAddr.uiAddr + offsetof(PVRSRV_SYNC_DATA, ui32ReadOps2Complete);
        psKernelSyncInfo->ui32UID = g_ui32SyncUID++;
 
-       
+
        psKernelSyncInfo->psSyncDataMemInfoKM->psKernelSyncInfo = IMG_NULL;
 
-       
+
        *ppsKernelSyncInfo = psKernelSyncInfo;
 
        return PVRSRV_OK;
@@ -591,8 +591,8 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeSyncInfoKM(PVRSRV_KERNEL_SYNC_INFO      *psKernel
        if (psKernelSyncInfo->ui32RefCount != 0)
        {
                PVR_DPF((PVR_DBG_ERROR, "oops: sync info ref count not zero at destruction"));
-               
-               return PVRSRV_ERROR_OUT_OF_MEMORY; 
+
+               return PVRSRV_ERROR_OUT_OF_MEMORY;
        }
 
        eError = FreeDeviceMem(psKernelSyncInfo->psSyncDataMemInfoKM);
@@ -600,7 +600,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeSyncInfoKM(PVRSRV_KERNEL_SYNC_INFO      *psKernel
        psKernelSyncInfo->psSyncDataMemInfoKM = IMG_NULL;
        psKernelSyncInfo->psSyncData = IMG_NULL;
        (IMG_VOID)OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_SYNC_INFO), psKernelSyncInfo, IMG_NULL);
-       
+
 
        return eError;
 }
@@ -609,7 +609,7 @@ static IMG_VOID freeWrapped(PVRSRV_KERNEL_MEM_INFO *psMemInfo)
 {
        IMG_HANDLE hOSWrapMem = psMemInfo->sMemBlk.hOSWrapMem;
 
-       
+
        if(psMemInfo->sMemBlk.psIntSysPAddr)
        {
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(IMG_SYS_PHYADDR), psMemInfo->sMemBlk.psIntSysPAddr, IMG_NULL);
@@ -652,7 +652,7 @@ PVRSRV_ERROR _PollUntilAtLeast(volatile IMG_UINT32* pui32WatchedValue,
 
                ui32Tries--;
 
-               
+
                if (psSysData->psGlobalEventObject)
                {
                        IMG_HANDLE hOSEventKM;
@@ -695,7 +695,7 @@ static PVRSRV_ERROR FlushKernelOps(PVRSRV_SYNC_DATA *psSyncData)
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
 
 
 
@@ -711,7 +711,7 @@ static PVRSRV_ERROR FlushKernelOps(PVRSRV_SYNC_DATA *psSyncData)
        if (eError != PVRSRV_OK)
        {
                PVR_DPF((PVR_DBG_ERROR, "FlushClientOps: Read ops pending timeout"));
-               PVR_DBG_BREAK; 
+               PVR_DBG_BREAK;
                return eError;
        }
 
@@ -722,12 +722,12 @@ static PVRSRV_ERROR FlushKernelOps(PVRSRV_SYNC_DATA *psSyncData)
        if (eError != PVRSRV_OK)
        {
                PVR_DPF((PVR_DBG_ERROR, "FlushClientOps: Write ops pending timeout"));
-               PVR_DBG_BREAK; 
+               PVR_DBG_BREAK;
        }
 
        return eError;
 }
-#endif 
+#endif
 
 IMG_EXPORT
 PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
@@ -738,10 +738,10 @@ PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
 
        PVR_UNREFERENCED_PARAMETER(ui32Param);
 
-       
+
        PVRSRVKernelMemInfoDecRef(psMemInfo);
 
-       
+
        if (psMemInfo->ui32RefCount == 0)
        {
                if((psMemInfo->ui32Flags & PVRSRV_MEM_EXPORTED) != 0)
@@ -785,7 +785,7 @@ PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
 #endif
                switch(psMemInfo->memType)
                {
-                       
+
                        case PVRSRV_MEMTYPE_WRAPPED:
                                freeWrapped(psMemInfo);
                        case PVRSRV_MEMTYPE_DEVICE:
@@ -806,7 +806,7 @@ PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
                }
        }
 
-       
+
        if (eError == PVRSRV_OK)
        {
                eError = FreeDeviceMem2(psMemInfo, eCallbackOrigin);
@@ -820,7 +820,7 @@ static PVRSRV_ERROR FreeDeviceMemCallBack(IMG_PVOID  pvParam,
                                                                                  IMG_BOOL   bDummy)
 {
        PVRSRV_KERNEL_MEM_INFO  *psMemInfo = (PVRSRV_KERNEL_MEM_INFO *)pvParam;
-       
+
        PVR_UNREFERENCED_PARAMETER(bDummy);
 
        return FreeMemCallBackCommon(psMemInfo, ui32Param,
@@ -847,7 +847,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeDeviceMemKM(IMG_HANDLE                          hDevCookie,
        }
        else
        {
-               
+
                eError = FreeDeviceMemCallBack(psMemInfo, 0, CLEANUP_WITH_POLL);
        }
 
@@ -877,10 +877,10 @@ PVRSRV_ERROR IMG_CALLCONV _PVRSRVAllocDeviceMemKM(IMG_HANDLE                              hDevCookie,
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        if (ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)
        {
-                
+
                if (((ui32Size % HOST_PAGESIZE()) != 0) ||
                        ((ui32Alignment % HOST_PAGESIZE()) != 0))
                {
@@ -908,7 +908,7 @@ PVRSRV_ERROR IMG_CALLCONV _PVRSRVAllocDeviceMemKM(IMG_HANDLE                                hDevCookie,
        }
        else
        {
-               
+
 
 
                psBMHeap = (BM_HEAP*)hDevMemHeap;
@@ -924,7 +924,7 @@ PVRSRV_ERROR IMG_CALLCONV _PVRSRVAllocDeviceMemKM(IMG_HANDLE                                hDevCookie,
                PVRSRVKernelSyncInfoIncRef(psMemInfo->psKernelSyncInfo, psMemInfo);
        }
 
-       
+
        *ppsMemInfo = psMemInfo;
 
        if (ui32Flags & PVRSRV_MEM_NO_RESMAN)
@@ -933,7 +933,7 @@ PVRSRV_ERROR IMG_CALLCONV _PVRSRVAllocDeviceMemKM(IMG_HANDLE                                hDevCookie,
        }
        else
        {
-               
+
                psMemInfo->sMemBlk.hResItem = ResManRegisterRes(psPerProc->hResManContext,
                                                                                                                RESMAN_TYPE_DEVICEMEM_ALLOCATION,
                                                                                                                psMemInfo,
@@ -941,18 +941,18 @@ PVRSRV_ERROR IMG_CALLCONV _PVRSRVAllocDeviceMemKM(IMG_HANDLE                              hDevCookie,
                                                                                                                &FreeDeviceMemCallBack);
                if (psMemInfo->sMemBlk.hResItem == IMG_NULL)
                {
-                       
+
                        eError = PVRSRV_ERROR_OUT_OF_MEMORY;
                        goto free_mainalloc;
                }
        }
 
-       
+
        PVRSRVKernelMemInfoIncRef(psMemInfo);
 
        psMemInfo->memType = PVRSRV_MEMTYPE_DEVICE;
 
-       
+
        return (PVRSRV_OK);
 
 free_mainalloc:
@@ -990,7 +990,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetFreeDeviceMemKM(IMG_UINT32 ui32Flags,
                                                                                                   IMG_SIZE_T *pui32Free,
                                                                                                   IMG_SIZE_T *pui32LargestBlock)
 {
-       
+
 
        PVR_UNREFERENCED_PARAMETER(ui32Flags);
        PVR_UNREFERENCED_PARAMETER(pui32Total);
@@ -1020,7 +1020,7 @@ static PVRSRV_ERROR UnwrapExtMemoryCallBack(IMG_PVOID  pvParam,
                                                                                        IMG_BOOL   bDummy)
 {
        PVRSRV_KERNEL_MEM_INFO  *psMemInfo = (PVRSRV_KERNEL_MEM_INFO *)pvParam;
-       
+
        PVR_UNREFERENCED_PARAMETER(bDummy);
 
        return FreeMemCallBackCommon(psMemInfo, ui32Param,
@@ -1069,14 +1069,14 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemoryKM(IMG_HANDLE                              hDevCookie,
 
        if(pvLinAddr)
        {
-               
+
                uPageOffset = (IMG_UINTPTR_T)pvLinAddr & (ui32HostPageSize - 1);
 
-               
+
                uPageCount = HOST_PAGEALIGN(uByteSize + uPageOffset) / ui32HostPageSize;
                pvPageAlignedCPUVAddr = (IMG_VOID *)((IMG_UINTPTR_T)pvLinAddr - uPageOffset);
 
-               
+
                if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                                uPageCount * sizeof(IMG_SYS_PHYADDR),
                                                (IMG_VOID **)&psIntSysPAddr, IMG_NULL,
@@ -1097,19 +1097,19 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemoryKM(IMG_HANDLE                              hDevCookie,
                        goto ErrorExitPhase1;
                }
 
-               
+
                psExtSysPAddr = psIntSysPAddr;
 
-               
+
 
                bPhysContig = IMG_FALSE;
        }
        else
        {
-               
+
        }
 
-       
+
        psDevMemoryInfo = &((BM_CONTEXT*)hDevMemContext)->psDeviceNode->sDevMemoryInfo;
        psDeviceMemoryHeap = psDevMemoryInfo->psDeviceMemoryHeap;
        for(i=0; i<PVRSRV_MAX_CLIENT_HEAPS; i++)
@@ -1118,7 +1118,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemoryKM(IMG_HANDLE                                hDevCookie,
                {
                        if(psDeviceMemoryHeap[i].DevMemHeapType == DEVICE_MEMORY_HEAP_PERCONTEXT)
                        {
-                               
+
                                if (psDeviceMemoryHeap[i].ui32HeapSize > 0)
                                {
                                        hDevMemHeap = BM_CreateHeap(hDevMemContext, &psDeviceMemoryHeap[i]);
@@ -1173,25 +1173,25 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemoryKM(IMG_HANDLE                              hDevCookie,
                goto ErrorExitPhase3;
        }
 
-       
+
        psMemBlock->sDevVirtAddr = BM_HandleToDevVaddr(hBuffer);
        psMemBlock->hOSMemHandle = BM_HandleToOSMemHandle(hBuffer);
        psMemBlock->hOSWrapMem = hOSWrapMem;
        psMemBlock->psIntSysPAddr = psIntSysPAddr;
 
-       
+
        psMemBlock->hBuffer = (IMG_HANDLE)hBuffer;
 
-       
+
        psMemInfo->pvLinAddrKM = BM_HandleToCpuVaddr(hBuffer);
        psMemInfo->sDevVAddr = psMemBlock->sDevVirtAddr;
        psMemInfo->uAllocSize = uByteSize;
 
-       
+
 
        psMemInfo->pvSysBackupBuffer = IMG_NULL;
 
-       
+
 
 
        psBMHeap = (BM_HEAP*)hDevMemHeap;
@@ -1211,25 +1211,25 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemoryKM(IMG_HANDLE                              hDevCookie,
 
        psMemInfo->memType = PVRSRV_MEMTYPE_WRAPPED;
 
-       
+
        psMemInfo->sMemBlk.hResItem = ResManRegisterRes(psPerProc->hResManContext,
                                                                                                        RESMAN_TYPE_DEVICEMEM_WRAP,
                                                                                                        psMemInfo,
                                                                                                        0,
                                                                                                        &UnwrapExtMemoryCallBack);
 
-       
+
        *ppsMemInfo = psMemInfo;
 
        return PVRSRV_OK;
 
-       
+
 
 ErrorExitPhase4:
        if(psMemInfo)
        {
                FreeDeviceMem(psMemInfo);
-               
+
 
 
                psMemInfo = IMG_NULL;
@@ -1239,7 +1239,7 @@ ErrorExitPhase3:
        if(psMemInfo)
        {
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-               
+
        }
 
 ErrorExitPhase2:
@@ -1252,7 +1252,7 @@ ErrorExitPhase1:
        if(psIntSysPAddr)
        {
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, uPageCount * sizeof(IMG_SYS_PHYADDR), psIntSysPAddr, IMG_NULL);
-               
+
        }
 
        return eError;
@@ -1308,12 +1308,12 @@ static PVRSRV_ERROR UnmapDeviceMemoryCallBack(IMG_PVOID  pvParam,
                return eError;
        }
 
-       
+
        eError = FreeMemCallBackCommon(psMapData->psSrcMemInfo, 0,
                                                                   PVRSRV_FREE_CALLBACK_ORIGIN_IMPORTER);
 
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RESMAN_MAP_DEVICE_MEM_DATA), psMapData, IMG_NULL);
-       
+
 
        return eError;
 }
@@ -1341,21 +1341,21 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemoryKM(PVRSRV_PER_PROCESS_DATA       *psPer
        IMG_VOID                                        *pvPageAlignedCPUVAddr;
        RESMAN_MAP_DEVICE_MEM_DATA      *psMapData = IMG_NULL;
 
-       
+
        if(!psSrcMemInfo || !hDstDevMemHeap || !ppsDstMemInfo)
        {
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVMapDeviceMemoryKM: invalid parameters"));
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        *ppsDstMemInfo = IMG_NULL;
 
        uPageOffset = psSrcMemInfo->sDevVAddr.uiAddr & (ui32HostPageSize - 1);
        uPageCount = HOST_PAGEALIGN(psSrcMemInfo->uAllocSize + uPageOffset) / ui32HostPageSize;
        pvPageAlignedCPUVAddr = (IMG_VOID *)((IMG_UINTPTR_T)psSrcMemInfo->pvLinAddrKM - uPageOffset);
 
-       
+
 
 
 
@@ -1370,23 +1370,23 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemoryKM(PVRSRV_PER_PROCESS_DATA       *psPer
 
        psBuf = psSrcMemInfo->sMemBlk.hBuffer;
 
-       
+
        psDeviceNode = psBuf->pMapping->pBMHeap->pBMContext->psDeviceNode;
 
-       
+
        sDevVAddr.uiAddr = psSrcMemInfo->sDevVAddr.uiAddr - IMG_CAST_TO_DEVVADDR_UINT(uPageOffset);
        for(i=0; i<uPageCount; i++)
        {
                BM_GetPhysPageAddr(psSrcMemInfo, sDevVAddr, &sDevPAddr);
 
-               
+
                psSysPAddr[i] = SysDevPAddrToSysPAddr (psDeviceNode->sDevId.eDeviceType, sDevPAddr);
 
-               
+
                sDevVAddr.uiAddr += IMG_CAST_TO_DEVVADDR_UINT(ui32HostPageSize);
        }
 
-       
+
        if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                        sizeof(RESMAN_MAP_DEVICE_MEM_DATA),
                                        (IMG_VOID **)&psMapData, IMG_NULL,
@@ -1428,31 +1428,31 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemoryKM(PVRSRV_PER_PROCESS_DATA       *psPer
                goto ErrorExit;
        }
 
-       
+
        psMemBlock->sDevVirtAddr = BM_HandleToDevVaddr(hBuffer);
        psMemBlock->hOSMemHandle = BM_HandleToOSMemHandle(hBuffer);
 
-       
+
        psMemBlock->hBuffer = (IMG_HANDLE)hBuffer;
 
-       
+
        psMemBlock->psIntSysPAddr = psSysPAddr;
 
-       
+
        psMemInfo->pvLinAddrKM = psSrcMemInfo->pvLinAddrKM;
 
-       
+
        psMemInfo->sDevVAddr = psMemBlock->sDevVirtAddr;
        psMemInfo->uAllocSize = psSrcMemInfo->uAllocSize;
        psMemInfo->psKernelSyncInfo = psSrcMemInfo->psKernelSyncInfo;
 
-       
+
        if(psMemInfo->psKernelSyncInfo)
        {
                PVRSRVKernelSyncInfoIncRef(psMemInfo->psKernelSyncInfo, psMemInfo);
        }
 
-       
+
 
        psMemInfo->pvSysBackupBuffer = IMG_NULL;
 
@@ -1462,16 +1462,16 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemoryKM(PVRSRV_PER_PROCESS_DATA       *psPer
 
        PVRSRVKernelMemInfoIncRef(psSrcMemInfo);
 
-       
+
        BM_Export(psSrcMemInfo->sMemBlk.hBuffer);
 
        psMemInfo->memType = PVRSRV_MEMTYPE_MAPPED;
 
-       
+
        psMapData->psMemInfo = psMemInfo;
        psMapData->psSrcMemInfo = psSrcMemInfo;
 
-       
+
        psMemInfo->sMemBlk.hResItem = ResManRegisterRes(psPerProc->hResManContext,
                                                                                                        RESMAN_TYPE_DEVICEMEM_MAPPING,
                                                                                                        psMapData,
@@ -1482,29 +1482,29 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemoryKM(PVRSRV_PER_PROCESS_DATA       *psPer
 
        return PVRSRV_OK;
 
-       
+
 
 ErrorExit:
 
        if(psSysPAddr)
        {
-               
+
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(IMG_SYS_PHYADDR), psSysPAddr, IMG_NULL);
-               
+
        }
 
        if(psMemInfo)
        {
-               
+
                OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(PVRSRV_KERNEL_MEM_INFO), psMemInfo, IMG_NULL);
-               
+
        }
 
        if(psMapData)
        {
-               
+
                OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(RESMAN_MAP_DEVICE_MEM_DATA), psMapData, IMG_NULL);
-               
+
        }
 
        return eError;
@@ -1590,7 +1590,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA    *
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                        sizeof(PVRSRV_DC_MAPINFO),
                                        (IMG_VOID **)&psDCMapInfo, IMG_NULL,
@@ -1603,7 +1603,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA    *
 
        psDeviceClassBuffer = (PVRSRV_DEVICECLASS_BUFFER*)hDeviceClassBuffer;
 
-       
+
 
 
 
@@ -1636,7 +1636,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA    *
                goto ErrorExitPhase1;
        }
 
-       
+
        psBMContext = (BM_CONTEXT*)psDeviceClassBuffer->hDevMemContext;
        psDeviceNode = psBMContext->psDeviceNode;
        psDevMemoryInfo = &psDeviceNode->sDevMemoryInfo;
@@ -1647,7 +1647,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA    *
                {
                        if(psDeviceMemoryHeap[i].DevMemHeapType == DEVICE_MEMORY_HEAP_PERCONTEXT)
                        {
-                               
+
                                if (psDeviceMemoryHeap[i].ui32HeapSize > 0)
                                {
                                        hDevMemHeap = BM_CreateHeap(hDevMemContext, &psDeviceMemoryHeap[i]);
@@ -1672,7 +1672,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA    *
                goto ErrorExitPhase1;
        }
 
-       
+
        ui32Offset = ((IMG_UINTPTR_T)pvCPUVAddr) & (ui32PageSize - 1);
        pvPageAlignedCPUVAddr = (IMG_VOID *)((IMG_UINTPTR_T)pvCPUVAddr - ui32Offset);
 
@@ -1702,32 +1702,32 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA  *
        if (!bBMError)
        {
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVMapDeviceClassMemoryKM: BM_Wrap Failed"));
-               
+
                eError = PVRSRV_ERROR_BAD_MAPPING;
                goto ErrorExitPhase2;
        }
 
-       
+
        psMemBlock->sDevVirtAddr = BM_HandleToDevVaddr(hBuffer);
        psMemBlock->hOSMemHandle = BM_HandleToOSMemHandle(hBuffer);
 
-       
+
        psMemBlock->hBuffer = (IMG_HANDLE)hBuffer;
 
-       
+
 
        psMemInfo->pvLinAddrKM = BM_HandleToCpuVaddr(hBuffer);
 
-       
+
        psMemInfo->sDevVAddr = psMemBlock->sDevVirtAddr;
        psMemInfo->uAllocSize = uByteSize;
        psMemInfo->psKernelSyncInfo = psDeviceClassBuffer->psKernelSyncInfo;
 
-       
+
 
        psMemInfo->pvSysBackupBuffer = IMG_NULL;
 
-       
+
        psDCMapInfo->psMemInfo = psMemInfo;
        psDCMapInfo->psDeviceClassBuffer = psDeviceClassBuffer;
 
@@ -1736,7 +1736,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA    *
 
        if(psDCMapInfo->ui32TilingStride > 0)
        {
-               
+
                eError = psDeviceNode->pfnAllocMemTilingRange(psDeviceNode,
                                                                                                                psMemInfo,
                                                                                                                psDCMapInfo->ui32TilingStride,
@@ -1749,7 +1749,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA    *
        }
 #endif
 
-       
+
        psMemInfo->sMemBlk.hResItem = ResManRegisterRes(psPerProc->hResManContext,
                                                                                                        RESMAN_TYPE_DEVICECLASSMEM_MAPPING,
                                                                                                        psDCMapInfo,
@@ -1761,7 +1761,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA    *
 
        psMemInfo->memType = PVRSRV_MEMTYPE_DEVICECLASS;
 
-       
+
        *ppsMemInfo = psMemInfo;
 
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
@@ -1779,7 +1779,7 @@ ErrorExitPhase3:
        if(psMemInfo)
        {
                FreeDeviceMem(psMemInfo);
-               
+
 
 
                psMemInfo = IMG_NULL;
old mode 100755 (executable)
new mode 100644 (file)
index 5201078..0819d92
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -130,85 +130,85 @@ enum ePVRSRVInternalHandleFlag
 
 struct sHandle
 {
-       
+
        PVRSRV_HANDLE_TYPE eType;
 
-       
+
        IMG_VOID *pvData;
 
-       
+
        IMG_UINT32 ui32NextIndexPlusOne;
 
-       
+
        enum ePVRSRVInternalHandleFlag eInternalFlag;
 
-       
+
        PVRSRV_HANDLE_ALLOC_FLAG eFlag;
 
-       
+
        IMG_UINT32 ui32Index;
 
-       
+
        struct sHandleList sChildren;
 
-       
+
        struct sHandleList sSiblings;
 };
 
 struct sHandleIndex
 {
-       
+
        struct sHandle *psHandle;
 
-       
+
        IMG_HANDLE hBlockAlloc;
 
-       
+
        IMG_UINT32 ui32FreeHandBlockCount;
 };
 
 struct _PVRSRV_HANDLE_BASE_
 {
-       
+
        IMG_HANDLE hBaseBlockAlloc;
 
-       
+
        IMG_HANDLE hArrayBlockAlloc;
 
-       
+
        struct sHandleIndex *psHandleArray;
 
-       
+
        HASH_TABLE *psHashTab;
 
-       
+
        IMG_UINT32 ui32FreeHandCount;
 
-       
+
        IMG_UINT32 ui32FirstFreeIndex;
 
-       
+
        IMG_UINT32 ui32MaxIndexPlusOne;
 
-       
+
        IMG_UINT32 ui32TotalHandCount;
 
-       
+
        IMG_UINT32 ui32LastFreeIndexPlusOne;
 
-       
+
        IMG_UINT32 ui32HandBatchSize;
 
-       
+
        IMG_UINT32 ui32TotalHandCountPreBatch;
 
-       
+
        IMG_UINT32 ui32FirstBatchIndexPlusOne;
 
-       
+
        IMG_UINT32 ui32BatchHandAllocFailures;
 
-       
+
        IMG_BOOL bPurgingEnabled;
 };
 
@@ -216,7 +216,7 @@ enum eHandKey {
        HAND_KEY_DATA = 0,
        HAND_KEY_TYPE,
        HAND_KEY_PARENT,
-       HAND_KEY_LEN                    
+       HAND_KEY_LEN
 };
 
 PVRSRV_HANDLE_BASE *gpsKernelHandleBase = IMG_NULL;
@@ -310,7 +310,7 @@ IMG_BOOL NoParent(struct sHandle *psHandle)
        }
        return IMG_FALSE;
 }
-#endif 
+#endif
 #ifdef INLINE_IS_PRAGMA
 #pragma inline(ParentHandle)
 #endif
@@ -333,7 +333,7 @@ IMG_HANDLE ParentHandle(struct sHandle *psHandle)
 static INLINE
 IMG_VOID HandleListInsertBefore(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32InsIndex, struct sHandleList *psIns, IMG_SIZE_T uiParentOffset, IMG_UINT32 ui32EntryIndex, struct sHandleList *psEntry, IMG_SIZE_T uiEntryOffset, IMG_UINT32 ui32ParentIndex)
 {
-        
+
        struct sHandleList *psPrevIns = LIST_PTR_FROM_INDEX_AND_OFFSET(psBase, psIns->ui32Prev, ui32ParentIndex, uiParentOffset, uiEntryOffset);
 
        PVR_ASSERT(psEntry->hParent == IMG_NULL)
@@ -370,11 +370,11 @@ IMG_VOID HandleListRemove(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32EntryIndex,
 {
        if (!HandleListIsEmpty(ui32EntryIndex, psEntry))
        {
-                
+
                struct sHandleList *psPrev = LIST_PTR_FROM_INDEX_AND_OFFSET(psBase, psEntry->ui32Prev, HANDLE_TO_INDEX(psEntry->hParent), uiParentOffset, uiEntryOffset);
                struct sHandleList *psNext = LIST_PTR_FROM_INDEX_AND_OFFSET(psBase, psEntry->ui32Next, HANDLE_TO_INDEX(psEntry->hParent), uiParentOffset, uiEntryOffset);
 
-               
+
                PVR_ASSERT(psEntry->hParent != IMG_NULL)
 
                psPrev->ui32Next = psEntry->ui32Next;
@@ -404,16 +404,16 @@ PVRSRV_ERROR HandleListIterate(PVRSRV_HANDLE_BASE *psBase, struct sHandleList *p
 
        PVR_ASSERT(psHead->hParent != IMG_NULL)
 
-       
+
        for(ui32Index = psHead->ui32Next; ui32Index != ui32Parent; )
        {
                struct sHandle *psHandle = INDEX_TO_HANDLE_STRUCT_PTR(psBase, ui32Index);
-                
+
                struct sHandleList *psEntry = LIST_PTR_FROM_INDEX_AND_OFFSET(psBase, ui32Index, ui32Parent, uiParentOffset, uiEntryOffset);
                PVRSRV_ERROR eError;
 
                PVR_ASSERT(psEntry->hParent == psHead->hParent)
-               
+
                ui32Index = psEntry->ui32Next;
 
                eError = (*pfnIterFunc)(psBase, psHandle);
@@ -448,7 +448,7 @@ PVRSRV_ERROR GetHandleStructure(PVRSRV_HANDLE_BASE *psBase, struct sHandle **pps
        IMG_UINT32 ui32Index = HANDLE_TO_INDEX(hHandle);
        struct sHandle *psHandle;
 
-       
+
        if (!INDEX_IS_VALID(psBase, ui32Index))
        {
                PVR_DPF((PVR_DBG_ERROR, "GetHandleStructure: Handle index out of range (%u >= %u)", ui32Index, psBase->ui32TotalHandCount));
@@ -468,7 +468,7 @@ PVRSRV_ERROR GetHandleStructure(PVRSRV_HANDLE_BASE *psBase, struct sHandle **pps
                return PVRSRV_ERROR_HANDLE_NOT_ALLOCATED;
        }
 
-       
+
        if (eType != PVRSRV_HANDLE_TYPE_NONE && eType != psHandle->eType)
        {
                PVR_DPF((PVR_DBG_ERROR, "GetHandleStructure: Handle type mismatch (%d != %d)", eType, psHandle->eType));
@@ -478,7 +478,7 @@ PVRSRV_ERROR GetHandleStructure(PVRSRV_HANDLE_BASE *psBase, struct sHandle **pps
                return PVRSRV_ERROR_HANDLE_TYPE_MISMATCH;
        }
 
-       
+
        *ppsHandle = psHandle;
 
        return PVRSRV_OK;
@@ -549,7 +549,7 @@ PVRSRV_ERROR ReallocHandleArray(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32NewCo
 
        if (ui32NewCount != 0)
        {
-               
+
                eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                        HANDLE_ARRAY_SIZE(ui32NewCount) * sizeof(struct sHandleIndex),
                        (IMG_VOID **)&psNewArray,
@@ -568,7 +568,7 @@ PVRSRV_ERROR ReallocHandleArray(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32NewCo
                }
        }
 
-       
+
        for(ui32Index = ui32NewCount; ui32Index < ui32OldCount; ui32Index += HANDLE_BLOCK_SIZE)
        {
                struct sHandleIndex *psIndex = INDEX_TO_INDEX_STRUCT_PTR(psOldArray, ui32Index);
@@ -583,10 +583,10 @@ PVRSRV_ERROR ReallocHandleArray(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32NewCo
                }
        }
 
-       
+
        for(ui32Index = ui32OldCount; ui32Index < ui32NewCount; ui32Index += HANDLE_BLOCK_SIZE)
        {
-                
+
                struct sHandleIndex *psIndex = INDEX_TO_INDEX_STRUCT_PTR(psNewArray, ui32Index);
 
                eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
@@ -624,7 +624,7 @@ PVRSRV_ERROR ReallocHandleArray(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32NewCo
        }
 
 #ifdef DEBUG_MAX_HANDLE_COUNT
-       
+
        if (ui32NewCount > DEBUG_MAX_HANDLE_COUNT)
        {
                PVR_DPF((PVR_DBG_ERROR, "ReallocHandleArray: Max handle count (%u) reached", DEBUG_MAX_HANDLE_COUNT));
@@ -635,7 +635,7 @@ PVRSRV_ERROR ReallocHandleArray(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32NewCo
 
        if (psOldArray != IMG_NULL)
        {
-               
+
                eError = OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
                        HANDLE_ARRAY_SIZE(ui32OldCount) * sizeof(struct sHandleIndex),
                        psOldArray,
@@ -652,13 +652,13 @@ PVRSRV_ERROR ReallocHandleArray(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32NewCo
 
        if (ui32NewCount > ui32OldCount)
        {
-               
+
                PVR_ASSERT(psBase->ui32FreeHandCount + (ui32NewCount - ui32OldCount) > psBase->ui32FreeHandCount)
 
-                
+
                psBase->ui32FreeHandCount += (ui32NewCount - ui32OldCount);
 
-               
+
                if (psBase->ui32FirstFreeIndex == 0)
                {
                        PVR_ASSERT(psBase->ui32LastFreeIndexPlusOne == 0)
@@ -687,7 +687,7 @@ PVRSRV_ERROR ReallocHandleArray(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32NewCo
                PVR_ASSERT(ui32NewCount == 0 || psBase->ui32FirstFreeIndex <= ui32NewCount)
                PVR_ASSERT(psBase->ui32FreeHandCount - (ui32OldCount - ui32NewCount) < psBase->ui32FreeHandCount)
 
-                
+
                psBase->ui32FreeHandCount -= (ui32OldCount - ui32NewCount);
 
                if (ui32NewCount == 0)
@@ -706,7 +706,7 @@ error:
 
        if (psNewArray != IMG_NULL)
        {
-               
+
                for(ui32Index = ui32OldCount; ui32Index < ui32NewCount; ui32Index += HANDLE_BLOCK_SIZE)
                {
                        struct sHandleIndex *psIndex = INDEX_TO_INDEX_STRUCT_PTR(psNewArray, ui32Index);
@@ -723,7 +723,7 @@ error:
                        }
                }
 
-               
+
                eError = OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
                        HANDLE_ARRAY_SIZE(ui32NewCount) * sizeof(struct sHandleIndex),
                        psNewArray,
@@ -748,7 +748,7 @@ static PVRSRV_ERROR FreeHandle(PVRSRV_HANDLE_BASE *psBase, struct sHandle *psHan
        IMG_UINT32 ui32Index = HANDLE_PTR_TO_INDEX(psHandle);
        PVRSRV_ERROR eError;
 
-       
+
        InitKey(aKey, psBase, psHandle->pvData, psHandle->eType, ParentIfPrivate(psHandle));
 
        if (!TEST_ALLOC_FLAG(psHandle, PVRSRV_HANDLE_ALLOC_FLAG_MULTI) && !BATCHED_HANDLE_PARTIALLY_FREE(psHandle))
@@ -767,10 +767,10 @@ static PVRSRV_ERROR FreeHandle(PVRSRV_HANDLE_BASE *psBase, struct sHandle *psHan
                PVR_UNREFERENCED_PARAMETER(hHandle);
        }
 
-       
+
        UnlinkFromParent(psBase, psHandle);
 
-       
+
        eError = IterateOverChildren(psBase, psHandle, FreeHandle);
        if (eError != PVRSRV_OK)
        {
@@ -778,18 +778,18 @@ static PVRSRV_ERROR FreeHandle(PVRSRV_HANDLE_BASE *psBase, struct sHandle *psHan
                return eError;
        }
 
-       
+
        psHandle->eType = PVRSRV_HANDLE_TYPE_NONE;
 
        if (BATCHED_HANDLE(psHandle) && !BATCHED_HANDLE_PARTIALLY_FREE(psHandle))
        {
-                
+
         SET_BATCHED_HANDLE_PARTIALLY_FREE(psHandle);
-               
+
                return PVRSRV_OK;
        }
 
-       
+
        if (!psBase->bPurgingEnabled)
        {
                if (psBase->ui32FreeHandCount == 0)
@@ -801,7 +801,7 @@ static PVRSRV_ERROR FreeHandle(PVRSRV_HANDLE_BASE *psBase, struct sHandle *psHan
                }
                else
                {
-                       
+
                        PVR_ASSERT(psBase->ui32LastFreeIndexPlusOne != 0)
                        PVR_ASSERT(INDEX_TO_HANDLE_STRUCT_PTR(psBase, psBase->ui32LastFreeIndexPlusOne - 1)->ui32NextIndexPlusOne == 0)
                        INDEX_TO_HANDLE_STRUCT_PTR(psBase, psBase->ui32LastFreeIndexPlusOne - 1)->ui32NextIndexPlusOne =  ui32Index + 1;
@@ -809,7 +809,7 @@ static PVRSRV_ERROR FreeHandle(PVRSRV_HANDLE_BASE *psBase, struct sHandle *psHan
 
                PVR_ASSERT(psHandle->ui32NextIndexPlusOne == 0)
 
-               
+
                psBase->ui32LastFreeIndexPlusOne = ui32Index + 1;
        }
 
@@ -860,7 +860,7 @@ static PVRSRV_ERROR FreeAllHandles(PVRSRV_HANDLE_BASE *psBase)
                                break;
                        }
 
-                       
+
                        if (psBase->ui32FreeHandCount == psBase->ui32TotalHandCount)
                        {
                                break;
@@ -881,7 +881,7 @@ static PVRSRV_ERROR FreeHandleBase(PVRSRV_HANDLE_BASE *psBase)
                PVRSRVReleaseHandleBatch(psBase);
        }
 
-       
+
        eError = FreeAllHandles(psBase);
        if (eError != PVRSRV_OK)
        {
@@ -889,7 +889,7 @@ static PVRSRV_ERROR FreeHandleBase(PVRSRV_HANDLE_BASE *psBase)
                return eError;
        }
 
-       
+
        eError = FreeHandleArray(psBase);
        if (eError != PVRSRV_OK)
        {
@@ -899,7 +899,7 @@ static PVRSRV_ERROR FreeHandleBase(PVRSRV_HANDLE_BASE *psBase)
 
        if (psBase->psHashTab != IMG_NULL)
        {
-               
+
                HASH_Delete(psBase->psHashTab);
        }
 
@@ -948,7 +948,7 @@ static PVRSRV_ERROR IncreaseHandleArraySize(PVRSRV_HANDLE_BASE *psBase, IMG_UINT
 
        PVR_ASSERT(ui32Delta != 0)
 
-       
+
        if (ui32NewTotalHandCount > psBase->ui32MaxIndexPlusOne || ui32NewTotalHandCount <= psBase->ui32TotalHandCount)
        {
                ui32NewTotalHandCount = psBase->ui32MaxIndexPlusOne;
@@ -964,7 +964,7 @@ static PVRSRV_ERROR IncreaseHandleArraySize(PVRSRV_HANDLE_BASE *psBase, IMG_UINT
 
        PVR_ASSERT(ui32DeltaAdjusted >= ui32Delta)
 
-       
+
        eError = ReallocHandleArray(psBase, ui32NewTotalHandCount);
        if (eError != PVRSRV_OK)
        {
@@ -1010,23 +1010,23 @@ static PVRSRV_ERROR AllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle
        HAND_KEY aKey;
        PVRSRV_ERROR eError;
 
-       
+
        PVR_ASSERT(eType != PVRSRV_HANDLE_TYPE_NONE)
        PVR_ASSERT(psBase != IMG_NULL)
        PVR_ASSERT(psBase->psHashTab != IMG_NULL)
 
        if (!TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_MULTI))
        {
-               
+
                PVR_ASSERT(FindHandle(psBase, pvData, eType, hParent) == IMG_NULL)
        }
 
        if (psBase->ui32FreeHandCount == 0 && HANDLES_BATCHED(psBase))
        {
-                PVR_DPF((PVR_DBG_WARNING, "AllocHandle: Handle batch size (%u) was too small, allocating additional space", psBase->ui32HandBatchSize)); 
+                PVR_DPF((PVR_DBG_WARNING, "AllocHandle: Handle batch size (%u) was too small, allocating additional space", psBase->ui32HandBatchSize));
        }
 
-       
+
        eError = EnsureFreeHandles(psBase, 1);
        if (eError != PVRSRV_OK)
        {
@@ -1037,18 +1037,18 @@ static PVRSRV_ERROR AllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle
 
        if (!psBase->bPurgingEnabled)
        {
-               
+
                ui32NewIndex = psBase->ui32FirstFreeIndex;
 
-               
+
                psNewHandle = INDEX_TO_HANDLE_STRUCT_PTR(psBase, ui32NewIndex);
        }
        else
        {
                IMG_UINT32 ui32BlockedIndex;
 
-               
-               
+
+
                PVR_ASSERT((psBase->ui32FirstFreeIndex % HANDLE_BLOCK_SIZE) == 0)
 
                for (ui32BlockedIndex = ROUND_DOWN_TO_MULTIPLE_OF_BLOCK_SIZE(psBase->ui32FirstFreeIndex); ui32BlockedIndex < psBase->ui32TotalHandCount; ui32BlockedIndex += HANDLE_BLOCK_SIZE)
@@ -1077,16 +1077,16 @@ static PVRSRV_ERROR AllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        hHandle = INDEX_TO_HANDLE(ui32NewIndex);
 
-       
+
        if (!TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_MULTI))
        {
-               
+
                InitKey(aKey, psBase, pvData, eType, hParent);
 
-               
+
                if (!HASH_Insert_Extended(psBase->psHashTab, aKey, (IMG_UINTPTR_T)hHandle))
                {
                        PVR_DPF((PVR_DBG_ERROR, "AllocHandle: Couldn't add handle to hash table"));
@@ -1102,10 +1102,10 @@ static PVRSRV_ERROR AllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle
 
        INDEX_TO_FREE_HAND_BLOCK_COUNT(psBase, ui32NewIndex)--;
 
-       
+
        if (!psBase->bPurgingEnabled)
        {
-               
+
                if (psBase->ui32FreeHandCount == 0)
                {
                        PVR_ASSERT(psBase->ui32FirstFreeIndex == ui32NewIndex)
@@ -1116,17 +1116,17 @@ static PVRSRV_ERROR AllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle
                }
                else
                {
-                       
+
                        psBase->ui32FirstFreeIndex = (psNewHandle->ui32NextIndexPlusOne == 0) ?
                                ui32NewIndex + 1 :
                                psNewHandle->ui32NextIndexPlusOne - 1;
                }
        }
 
-       
+
        PVR_ASSERT(psNewHandle->ui32Index == ui32NewIndex)
 
-        
+
        psNewHandle->eType = eType;
        psNewHandle->pvData = pvData;
        psNewHandle->eInternalFlag = INTERNAL_HANDLE_FLAG_NONE;
@@ -1144,12 +1144,12 @@ static PVRSRV_ERROR AllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle
 
        if (HANDLES_BATCHED(psBase))
        {
-               
+
                psNewHandle->ui32NextIndexPlusOne = psBase->ui32FirstBatchIndexPlusOne;
 
                psBase->ui32FirstBatchIndexPlusOne = ui32NewIndex + 1;
 
-                
+
                SET_BATCHED_HANDLE(psNewHandle);
        }
        else
@@ -1157,7 +1157,7 @@ static PVRSRV_ERROR AllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle
                psNewHandle->ui32NextIndexPlusOne = 0;
        }
 
-       
+
        *phHandle = hHandle;
 
        return PVRSRV_OK;
@@ -1184,16 +1184,16 @@ PVRSRV_ERROR PVRSRVAllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle,
 
        if (HANDLES_BATCHED(psBase))
        {
-               
+
                psBase->ui32BatchHandAllocFailures++;
        }
 
-       
+
        PVR_ASSERT(eType != PVRSRV_HANDLE_TYPE_NONE)
 
        if (!TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_MULTI))
        {
-               
+
                hHandle = FindHandle(psBase, pvData, eType, IMG_NULL);
 #if defined (SUPPORT_SID_INTERFACE)
                if (hHandle != 0)
@@ -1210,14 +1210,14 @@ PVRSRV_ERROR PVRSRVAllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle,
                                return eError;
                        }
 
-                       
+
                        if (TEST_FLAG(psHandle->eFlag & eFlag, PVRSRV_HANDLE_ALLOC_FLAG_SHARED))
                        {
                                *phHandle = hHandle;
                                eError = PVRSRV_OK;
                                goto exit_ok;
                        }
-                       
+
 #if defined (SUPPORT_SID_INTERFACE)
                        PVR_DBG_BREAK
 #endif
@@ -1226,7 +1226,7 @@ PVRSRV_ERROR PVRSRVAllocHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle,
        }
 
        eError = AllocHandle(psBase, phHandle, pvData, eType, eFlag, IMG_NULL);
-       
+
 exit_ok:
        if (HANDLES_BATCHED(psBase) && (eError == PVRSRV_OK))
        {
@@ -1259,17 +1259,17 @@ PVRSRV_ERROR PVRSRVAllocSubHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHand
 
        if (HANDLES_BATCHED(psBase))
        {
-               
+
                psBase->ui32BatchHandAllocFailures++;
        }
 
-       
+
        PVR_ASSERT(eType != PVRSRV_HANDLE_TYPE_NONE)
 
        hParentKey = TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_PRIVATE) ?
                        hParent : IMG_NULL;
 
-       
+
        eError = GetHandleStructure(psBase, &psPHand, hParent, PVRSRV_HANDLE_TYPE_NONE);
        if (eError != PVRSRV_OK)
        {
@@ -1278,7 +1278,7 @@ PVRSRV_ERROR PVRSRVAllocSubHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHand
 
        if (!TEST_FLAG(eFlag, PVRSRV_HANDLE_ALLOC_FLAG_MULTI))
        {
-               
+
                hHandle = FindHandle(psBase, pvData, eType, hParentKey);
 #if defined (SUPPORT_SID_INTERFACE)
                if (hHandle != 0)
@@ -1298,7 +1298,7 @@ PVRSRV_ERROR PVRSRVAllocSubHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHand
 
                        PVR_ASSERT(hParentKey != IMG_NULL && ParentHandle(HANDLE_TO_HANDLE_STRUCT_PTR(psBase, hHandle)) == hParent)
 
-                       
+
                        if (TEST_FLAG(psCHandle->eFlag & eFlag, PVRSRV_HANDLE_ALLOC_FLAG_SHARED) && ParentHandle(HANDLE_TO_HANDLE_STRUCT_PTR(psBase, hHandle)) == hParent)
                        {
                                *phHandle = hHandle;
@@ -1317,7 +1317,7 @@ PVRSRV_ERROR PVRSRVAllocSubHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHand
                return eError;
        }
 
-       
+
        psPHand = HANDLE_TO_HANDLE_STRUCT_PTR(psBase, hParent);
 
        psCHand = HANDLE_TO_HANDLE_STRUCT_PTR(psBase, hHandle);
@@ -1349,7 +1349,7 @@ PVRSRV_ERROR PVRSRVFindHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE *phHandle,
 
        PVR_ASSERT(eType != PVRSRV_HANDLE_TYPE_NONE)
 
-       
+
 #if defined (SUPPORT_SID_INTERFACE)
        hHandle = (IMG_SID) FindHandle(psBase, pvData, eType, IMG_NULL);
 #else
@@ -1441,7 +1441,7 @@ PVRSRV_ERROR PVRSRVLookupSubHandle(PVRSRV_HANDLE_BASE *psBase, IMG_PVOID *ppvDat
                return eError;
        }
 
-       
+
        for (psPHand = psCHand; ParentHandle(psPHand) != hAncestor; )
        {
                eError = GetHandleStructure(psBase, &psPHand, ParentHandle(psPHand), PVRSRV_HANDLE_TYPE_NONE);
@@ -1556,7 +1556,7 @@ PVRSRV_ERROR PVRSRVNewHandleBatch(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32Bat
 
        psBase->ui32HandBatchSize = ui32BatchSize;
 
-       
+
        psBase->ui32TotalHandCountPreBatch = psBase->ui32TotalHandCount;
 
        PVR_ASSERT(psBase->ui32BatchHandAllocFailures == 0)
@@ -1589,7 +1589,7 @@ static PVRSRV_ERROR PVRSRVHandleBatchCommitOrRelease(PVRSRV_HANDLE_BASE *psBase,
                }
                bCommitBatch = IMG_FALSE;
        }
-       
+
        PVR_ASSERT(psBase->ui32BatchHandAllocFailures == 0 || !bCommit)
 
        ui32IndexPlusOne = psBase->ui32FirstBatchIndexPlusOne;
@@ -1605,11 +1605,11 @@ static PVRSRV_ERROR PVRSRVHandleBatchCommitOrRelease(PVRSRV_HANDLE_BASE *psBase,
                {
                        PVRSRV_ERROR eError;
 
-                       
+
                        if (!BATCHED_HANDLE_PARTIALLY_FREE(psHandle))
                        {
-                                
-                               SET_UNBATCHED_HANDLE(psHandle);  
+
+                               SET_UNBATCHED_HANDLE(psHandle);
                        }
 
                        eError = FreeHandle(psBase, psHandle);
@@ -1621,7 +1621,7 @@ static PVRSRV_ERROR PVRSRVHandleBatchCommitOrRelease(PVRSRV_HANDLE_BASE *psBase,
                }
                else
                {
-                        
+
                        SET_UNBATCHED_HANDLE(psHandle);
                }
 
@@ -1675,7 +1675,7 @@ PVRSRV_ERROR PVRSRVSetMaxHandle(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32MaxHa
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        if (ui32MaxHandle  == 0 || ui32MaxHandle > DEFAULT_MAX_HANDLE)
        {
                PVR_DPF((PVR_DBG_ERROR, "PVRSRVSetMaxHandle: Limit must be between %u and %u, inclusive", 0, DEFAULT_MAX_HANDLE));
@@ -1683,7 +1683,7 @@ PVRSRV_ERROR PVRSRVSetMaxHandle(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32MaxHa
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        if (psBase->ui32TotalHandCount != 0)
        {
                PVR_DPF((PVR_DBG_ERROR, "PVRSRVSetMaxHandle: Limit cannot be set because handles have already been allocated"));
@@ -1693,7 +1693,7 @@ PVRSRV_ERROR PVRSRVSetMaxHandle(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32MaxHa
 
        ui32MaxHandleRounded = ROUND_DOWN_TO_MULTIPLE_OF_BLOCK_SIZE(ui32MaxHandle);
 
-       
+
        if (ui32MaxHandleRounded != 0 && ui32MaxHandleRounded < psBase->ui32MaxIndexPlusOne)
        {
                psBase->ui32MaxIndexPlusOne = ui32MaxHandleRounded;
@@ -1719,7 +1719,7 @@ PVRSRV_ERROR PVRSRVEnableHandlePurging(PVRSRV_HANDLE_BASE *psBase)
                return PVRSRV_OK;
        }
 
-       
+
        if (psBase->ui32TotalHandCount != 0)
        {
                PVR_DPF((PVR_DBG_ERROR, "PVRSRVEnableHandlePurging: Handles have already been allocated"));
@@ -1759,12 +1759,12 @@ PVRSRV_ERROR PVRSRVPurgeHandles(PVRSRV_HANDLE_BASE *psBase)
        }
        ui32NewHandCount = BLOCK_INDEX_TO_INDEX(ui32BlockIndex);
 
-       
+
        if (ui32NewHandCount <= (psBase->ui32TotalHandCount/2))
        {
                PVRSRV_ERROR eError;
 
-               
+
 
                eError = ReallocHandleArray(psBase, ui32NewHandCount);
                if (eError != PVRSRV_OK)
@@ -1794,7 +1794,7 @@ PVRSRV_ERROR PVRSRVAllocHandleBase(PVRSRV_HANDLE_BASE **ppsBase)
        }
        OSMemSet(psBase, 0, sizeof(*psBase));
 
-       
+
        psBase->psHashTab = HASH_Create_Extended(HANDLE_HASH_TAB_INIT_SIZE, sizeof(HAND_KEY), HASH_Func_Default, HASH_Key_Comp_Default);
        if (psBase->psHashTab == IMG_NULL)
        {
@@ -1873,4 +1873,4 @@ PVRSRV_ERROR PVRSRVHandleDeInit(IMG_VOID)
        return eError;
 }
 #else
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 78eab44..4c0819f
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 
 struct _BUCKET_
 {
-       
+
        struct _BUCKET_ *pNext;
 
-       
+
        IMG_UINTPTR_T v;
 
-       
-       IMG_UINTPTR_T k[];               
+
+       IMG_UINTPTR_T k[];
 };
 typedef struct _BUCKET_ BUCKET;
 
 struct _HASH_TABLE_
 {
-       
+
        BUCKET **ppBucketTable;
 
-       
+
        IMG_UINT32 uSize;
 
-       
+
        IMG_UINT32 uCount;
 
-       
+
        IMG_UINT32 uMinimumSize;
 
-       
+
        IMG_UINT32 uKeySize;
 
-       
+
        HASH_FUNC *pfnHashFunc;
 
-       
+
        HASH_KEY_COMP *pfnKeyComp;
 };
 
@@ -141,7 +141,7 @@ _ChainInsert (HASH_TABLE *pHash, BUCKET *pBucket, BUCKET **ppBucketTable, IMG_UI
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       uIndex = KEY_TO_INDEX(pHash, pBucket->k, uSize);         
+       uIndex = KEY_TO_INDEX(pHash, pBucket->k, uSize);
        pBucket->pNext = ppBucketTable[uIndex];
        ppBucketTable[uIndex] = pBucket;
 
@@ -202,7 +202,7 @@ _Resize (HASH_TABLE *pHash, IMG_UINT32 uNewSize)
                }
 
         OSFreeMem (PVRSRV_PAGEABLE_SELECT, sizeof(BUCKET *)*pHash->uSize, pHash->ppBucketTable, IMG_NULL);
-        
+
         pHash->ppBucketTable = ppNewTable;
         pHash->uSize = uNewSize;
     }
@@ -240,7 +240,7 @@ HASH_TABLE * HASH_Create_Extended (IMG_UINT32 uInitialLen, IMG_SIZE_T uKeySize,
        if (pHash->ppBucketTable == IMG_NULL)
     {
                OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(HASH_TABLE), pHash, IMG_NULL);
-               
+
                return IMG_NULL;
     }
 
@@ -271,7 +271,7 @@ HASH_Delete (HASH_TABLE *pHash)
                OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(BUCKET *)*pHash->uSize, pHash->ppBucketTable, IMG_NULL);
                pHash->ppBucketTable = IMG_NULL;
                OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(HASH_TABLE), pHash, IMG_NULL);
-               
+
     }
 }
 
@@ -301,7 +301,7 @@ HASH_Insert_Extended (HASH_TABLE *pHash, IMG_VOID *pKey, IMG_UINTPTR_T v)
        }
 
        pBucket->v = v;
-        
+
        OSMemCopy(pBucket->k, pKey, pHash->uKeySize);
        if (_ChainInsert (pHash, pBucket, pHash->ppBucketTable, pHash->uSize) != PVRSRV_OK)
        {
@@ -313,10 +313,10 @@ HASH_Insert_Extended (HASH_TABLE *pHash, IMG_VOID *pKey, IMG_UINTPTR_T v)
 
        pHash->uCount++;
 
-       
+
        if (pHash->uCount << 1 > pHash->uSize)
     {
-        
+
 
         _Resize (pHash, pHash->uSize << 1);
     }
@@ -356,7 +356,7 @@ HASH_Remove_Extended(HASH_TABLE *pHash, IMG_VOID *pKey)
 
        for (ppBucket = &(pHash->ppBucketTable[uIndex]); *ppBucket != IMG_NULL; ppBucket = &((*ppBucket)->pNext))
        {
-                
+
                if (KEY_COMPARE(pHash, (*ppBucket)->k, pKey))
                {
                        BUCKET *pBucket = *ppBucket;
@@ -364,15 +364,15 @@ HASH_Remove_Extended(HASH_TABLE *pHash, IMG_VOID *pKey)
                        (*ppBucket) = pBucket->pNext;
 
                        OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(BUCKET) + pHash->uKeySize, pBucket, IMG_NULL);
-                       
+
 
                        pHash->uCount--;
 
-                       
+
                        if (pHash->uSize > (pHash->uCount << 2) &&
                 pHash->uSize > pHash->uMinimumSize)
             {
-                
+
 
                                _Resize (pHash,
                          PRIVATE_MAX (pHash->uSize >> 1,
@@ -421,7 +421,7 @@ HASH_Retrieve_Extended (HASH_TABLE *pHash, IMG_VOID *pKey)
 
        for (ppBucket = &(pHash->ppBucketTable[uIndex]); *ppBucket != IMG_NULL; ppBucket = &((*ppBucket)->pNext))
        {
-                
+
                if (KEY_COMPARE(pHash, (*ppBucket)->k, pKey))
                {
                        BUCKET *pBucket = *ppBucket;
@@ -459,10 +459,10 @@ HASH_Iterate(HASH_TABLE *pHash, HASH_pfnCallback pfnCallback)
                {
                        PVRSRV_ERROR eError;
                        BUCKET *pNextBucket = pBucket->pNext;
-                       
+
                        eError = pfnCallback((IMG_UINTPTR_T) ((IMG_VOID *) *(pBucket->k)), (IMG_UINTPTR_T) pBucket->v);
 
-                       
+
                        if (eError != PVRSRV_OK)
                                return eError;
 
old mode 100755 (executable)
new mode 100644 (file)
index 1081781..29ac4a4
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -69,7 +69,7 @@ IMG_VOID* MatchDeviceKM_AnyVaCb(PVRSRV_DEVICE_NODE* psDeviceNode, va_list va)
        }
        else
        {
-               
+
 
                eDevClass = PVRSRV_DEVICE_CLASS_FORCE_I32;
        }
old mode 100755 (executable)
new mode 100644 (file)
index 746494a..1be0b7d
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -47,7 +47,7 @@ FreeSharedSysMemCallBack(IMG_PVOID  pvParam,
                          sizeof(PVRSRV_KERNEL_MEM_INFO),
                          psKernelMemInfo,
                          IMG_NULL);
-       
+
 
        return PVRSRV_OK;
 }
@@ -94,7 +94,7 @@ PVRSRVAllocSharedSysMemoryKM(PVRSRV_PER_PROCESS_DATA  *psPerProc,
                return PVRSRV_ERROR_OUT_OF_MEMORY;
        }
 
-       
+
        psKernelMemInfo->sMemBlk.hResItem =
                                ResManRegisterRes(psPerProc->hResManContext,
                                                                  RESMAN_TYPE_SHARED_MEM_INFO,
@@ -104,7 +104,7 @@ PVRSRVAllocSharedSysMemoryKM(PVRSRV_PER_PROCESS_DATA        *psPerProc,
 
        *ppsKernelMemInfo = psKernelMemInfo;
 
-       return PVRSRV_OK; 
+       return PVRSRV_OK;
 }
 
 
old mode 100755 (executable)
new mode 100644 (file)
index e721fb3..c905308
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -39,9 +39,9 @@ extern "C"
 
 #define STOP_ON_ERROR 0
 
-       
 
-       
+
+
 
 
 
@@ -60,13 +60,13 @@ extern "C"
                return IMG_TRUE;
        }
 
-       
+
 
        IMG_VOID OSCheckMemDebug(IMG_PVOID pvCpuVAddr, IMG_SIZE_T uSize, const IMG_CHAR *pszFileName, const IMG_UINT32 uLine)
        {
                OSMEM_DEBUG_INFO const *psInfo = (OSMEM_DEBUG_INFO *)((IMG_UINT32)pvCpuVAddr - TEST_BUFFER_PADDING_STATUS);
 
-               
+
                if (pvCpuVAddr == IMG_NULL)
                {
                        PVR_DPF((PVR_DBG_ERROR, "Pointer 0x%X : null pointer"
@@ -77,7 +77,7 @@ extern "C"
                        while (STOP_ON_ERROR);
                }
 
-               
+
                if (((IMG_UINT32)pvCpuVAddr&3) != 0)
                {
                        PVR_DPF((PVR_DBG_ERROR, "Pointer 0x%X : invalid alignment"
@@ -88,7 +88,7 @@ extern "C"
                        while (STOP_ON_ERROR);
                }
 
-               
+
                if (!MemCheck((IMG_PVOID)psInfo->sGuardRegionBefore, 0xB1, sizeof(psInfo->sGuardRegionBefore)))
                {
                        PVR_DPF((PVR_DBG_ERROR, "Pointer 0x%X : guard region before overwritten"
@@ -99,7 +99,7 @@ extern "C"
                        while (STOP_ON_ERROR);
                }
 
-               
+
                if (uSize != psInfo->uSize)
                {
                        PVR_DPF((PVR_DBG_WARNING, "Pointer 0x%X : supplied size was different to stored size (0x%X != 0x%X)"
@@ -110,7 +110,7 @@ extern "C"
                        while (STOP_ON_ERROR);
                }
 
-               
+
                if ((0x01234567 ^ psInfo->uSizeParityCheck) != psInfo->uSize)
                {
                        PVR_DPF((PVR_DBG_WARNING, "Pointer 0x%X : stored size parity error (0x%X != 0x%X)"
@@ -122,11 +122,11 @@ extern "C"
                }
                else
                {
-                       
+
                        uSize = psInfo->uSize;
                }
 
-               
+
                if (uSize)
                {
                        if (!MemCheck((IMG_VOID*)((IMG_UINT32)pvCpuVAddr + uSize), 0xB2, TEST_BUFFER_PADDING_AFTER))
@@ -139,7 +139,7 @@ extern "C"
                        }
                }
 
-               
+
                if (psInfo->eValid != isAllocated)
                {
                        PVR_DPF((PVR_DBG_ERROR, "Pointer 0x%X : not allocated (freed? %d)"
@@ -155,7 +155,7 @@ extern "C"
        {
                IMG_SIZE_T i = 0;
 
-               for (; i < 128; i++) 
+               for (; i < 128; i++)
                {
                        *pDest = *pSrc;
                        if (*pSrc == '\0') break;
@@ -187,11 +187,11 @@ extern "C"
                        return eError;
                }
 
-               
+
                OSMemSet((IMG_CHAR *)(*ppvCpuVAddr) + TEST_BUFFER_PADDING_STATUS, 0xBB, ui32Size);
                OSMemSet((IMG_CHAR *)(*ppvCpuVAddr) + ui32Size + TEST_BUFFER_PADDING_STATUS, 0xB2, TEST_BUFFER_PADDING_AFTER);
 
-               
+
                psInfo = (OSMEM_DEBUG_INFO *)(*ppvCpuVAddr);
 
                OSMemSet(psInfo->sGuardRegionBefore, 0xB1, sizeof(psInfo->sGuardRegionBefore));
@@ -201,11 +201,11 @@ extern "C"
                psInfo->uSize = ui32Size;
                psInfo->uSizeParityCheck = 0x01234567 ^ ui32Size;
 
-               
+
                *ppvCpuVAddr = (IMG_PVOID) ((IMG_UINT32)*ppvCpuVAddr)+TEST_BUFFER_PADDING_STATUS;
 
 #ifdef PVRSRV_LOG_MEMORY_ALLOCS
-               
+
                PVR_TRACE(("Allocated pointer (after debug info): 0x%X from %s:%d", *ppvCpuVAddr, pszFilename, ui32Line));
 #endif
 
@@ -221,16 +221,16 @@ extern "C"
        {
                OSMEM_DEBUG_INFO *psInfo;
 
-               
+
                OSCheckMemDebug(pvCpuVAddr, ui32Size, pszFilename, ui32Line);
 
-               
-               OSMemSet(pvCpuVAddr, 0xBF, ui32Size + TEST_BUFFER_PADDING_AFTER);  
 
-               
+               OSMemSet(pvCpuVAddr, 0xBF, ui32Size + TEST_BUFFER_PADDING_AFTER);
+
+
                psInfo = (OSMEM_DEBUG_INFO *)((IMG_UINT32) pvCpuVAddr - TEST_BUFFER_PADDING_STATUS);
 
-               
+
                psInfo->uSize = 0;
                psInfo->uSizeParityCheck = 0;
                psInfo->eValid = isFree;
@@ -245,6 +245,6 @@ extern "C"
 }
 #endif
 
-#endif 
+#endif
 
-#endif        
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 640eb04..26fe0e6
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -44,7 +44,7 @@ static volatile IMG_UINT32 *pui32TimerRegister = 0;
 #define PVRSRV_TIMER_COUNT(X)                  asTimers[X].ui32Count
 
 
-Temporal_Data asTimers[PVRSRV_NUM_TIMERS]; 
+Temporal_Data asTimers[PVRSRV_NUM_TIMERS];
 
 
 IMG_UINT32 PVRSRVTimeNow(IMG_VOID)
@@ -67,11 +67,11 @@ IMG_UINT32 PVRSRVTimeNow(IMG_VOID)
 
        return (0xffffffff-*pui32TimerRegister);
 
-#else 
+#else
 
        return 0;
 
-#endif 
+#endif
 }
 
 
@@ -106,25 +106,25 @@ IMG_VOID PVRSRVSetupMetricTimers(IMG_VOID *pvDevInfo)
 
        #if defined(__sh__)
 
-               
-               
-               
-               
+
+
+
+
                *TCR_2 = TIMER_DIVISOR;
 
-               
+
                *TCOR_2 = *TCNT_2 = (IMG_UINT)0xffffffff;
 
-               
+
                *TST_REG |= (IMG_UINT8)0x04;
 
                pui32TimerRegister = (IMG_UINT32 *)TCNT_2;
 
-       #else 
+       #else
 
                pui32TimerRegister = 0;
 
-       #endif 
+       #endif
 
 }
 
@@ -149,12 +149,12 @@ IMG_VOID PVRSRVOutputMetricTotals(IMG_VOID)
                }
        }
 #if 0
-       
+
        PVR_DPF((PVR_DBG_ERROR," Timer(%u): Total = %u",PVRSRV_TIMER_EXAMPLE_1, PVRSRV_TIMER_TOTAL_IN_TICKS(PVRSRV_TIMER_EXAMPLE_1)));
        PVR_DPF((PVR_DBG_ERROR," Timer(%u): Time = %ums",PVRSRV_TIMER_EXAMPLE_1, PVRSRV_TIMER_TOTAL_IN_MS(PVRSRV_TIMER_EXAMPLE_1)));
        PVR_DPF((PVR_DBG_ERROR," Timer(%u): Count = %u",PVRSRV_TIMER_EXAMPLE_1, PVRSRV_TIMER_COUNT(PVRSRV_TIMER_EXAMPLE_1)));
 #endif
 }
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index e0a46da..6a944bd
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
old mode 100755 (executable)
new mode 100644 (file)
index 45845b6..c4eefbe
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -66,7 +66,7 @@ IMG_BOOL _PDumpIsPersistent(IMG_VOID)
 
        if(psPerProc == IMG_NULL)
        {
-               
+
                return IMG_FALSE;
        }
        return psPerProc->bPDumpPersistent;
@@ -81,13 +81,13 @@ IMG_BOOL _PDumpIsProcessActive(IMG_VOID)
        PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
        if(psPerProc == IMG_NULL)
        {
-               
+
                return IMG_TRUE;
        }
        return psPerProc->bPDumpActive;
 }
 
-#endif 
+#endif
 
 #if defined(PDUMP_DEBUG_OUTFILES)
 static INLINE
@@ -96,16 +96,16 @@ IMG_UINT32 _PDumpGetPID(IMG_VOID)
        PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
        if(psPerProc == IMG_NULL)
        {
-               
+
                return 0;
        }
        return psPerProc->ui32PID;
 }
-#endif 
+#endif
 
 static IMG_VOID *GetTempBuffer(IMG_VOID)
 {
-       
+
        if (gpvTempBuffer == IMG_NULL)
        {
                PVRSRV_ERROR eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
@@ -144,19 +144,19 @@ static IMG_VOID FreeTempBuffer(IMG_VOID)
 
 IMG_VOID PDumpInitCommon(IMG_VOID)
 {
-       
+
        (IMG_VOID) GetTempBuffer();
 
-       
+
        PDumpInit();
 }
 
 IMG_VOID PDumpDeInitCommon(IMG_VOID)
 {
-       
+
        FreeTempBuffer();
 
-       
+
        PDumpDeInit();
 }
 
@@ -219,13 +219,13 @@ PVRSRV_ERROR PDumpRegKM(IMG_CHAR *pszPDumpRegName,
 }
 
 PVRSRV_ERROR PDumpRegPolWithFlagsKM(IMG_CHAR *pszPDumpRegName,
-                                                                       IMG_UINT32 ui32RegAddr, 
-                                                                       IMG_UINT32 ui32RegValue, 
+                                                                       IMG_UINT32 ui32RegAddr,
+                                                                       IMG_UINT32 ui32RegValue,
                                                                        IMG_UINT32 ui32Mask,
                                                                        IMG_UINT32 ui32Flags,
                                                                        PDUMP_POLL_OPERATOR     eOperator)
 {
-       
+
        #define POLL_DELAY                      1000U
        #define POLL_COUNT_LONG         (2000000000U / POLL_DELAY)
        #define POLL_COUNT_SHORT        (1000000U / POLL_DELAY)
@@ -237,7 +237,7 @@ PVRSRV_ERROR PDumpRegPolWithFlagsKM(IMG_CHAR *pszPDumpRegName,
        PDUMP_DBG(("PDumpRegPolWithFlagsKM"));
        if ( _PDumpIsPersistent() )
        {
-               
+
                return PVRSRV_OK;
        }
 
@@ -294,14 +294,14 @@ PVRSRV_ERROR PDumpMallocPages (PVRSRV_DEVICE_IDENTIFIER   *psDevID,
 
        PDUMP_GET_SCRIPT_STRING();
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-       
+
        ui32Flags |= ( _PDumpIsPersistent() || bShared ) ? PDUMP_FLAGS_PERSISTENT : 0;
 #else
        PVR_UNREFERENCED_PARAMETER(bShared);
        ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
 #endif
 
-       
+
 #if !defined(LINUX)
        PVR_ASSERT(((IMG_UINTPTR_T)pvLinAddr & HOST_PAGEMASK) == 0);
 #endif
@@ -309,7 +309,7 @@ PVRSRV_ERROR PDumpMallocPages (PVRSRV_DEVICE_IDENTIFIER     *psDevID,
        PVR_ASSERT(((IMG_UINT32) ui32DevVAddr & HOST_PAGEMASK) == 0);
        PVR_ASSERT(((IMG_UINT32) ui32NumBytes & HOST_PAGEMASK) == 0);
 
-       
+
 
        eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "-- MALLOC :%s:VA_%08X 0x%08X %u\r\n",
                        psDevID->pszPDumpDevName, ui32DevVAddr, ui32NumBytes, ui32PageSize);
@@ -319,25 +319,25 @@ PVRSRV_ERROR PDumpMallocPages (PVRSRV_DEVICE_IDENTIFIER   *psDevID,
        }
        PDumpOSWriteString2(hScript, ui32Flags);
 
-       
+
 
        pui8LinAddr = (IMG_PUINT8) pvLinAddr;
        ui32Offset = 0;
        ui32NumPages = ui32NumBytes / ui32PageSize;
        while (ui32NumPages)
-       { 
+       {
                ui32NumPages--;
 
-               
 
 
 
 
 
 
-               
-               
-               
+
+
+
+
                PDumpOSCPUVAddrToDevPAddr(psDevID->eDeviceType,
                                hOSMemHandle,
                                ui32Offset,
@@ -345,7 +345,7 @@ PVRSRV_ERROR PDumpMallocPages (PVRSRV_DEVICE_IDENTIFIER     *psDevID,
                                ui32PageSize,
                                &sDevPAddr);
                ui32Page = (IMG_UINT32)(sDevPAddr.uiAddr / ui32PageSize);
-               
+
                pui8LinAddr     += ui32PageSize;
                ui32Offset += ui32PageSize;
 
@@ -382,8 +382,8 @@ PVRSRV_ERROR PDumpMallocPageTable (PVRSRV_DEVICE_IDENTIFIER *psDevId,
        PVR_ASSERT(((IMG_UINTPTR_T)pvLinAddr & (ui32PTSize - 1)) == 0);
        ui32Flags |= PDUMP_FLAGS_CONTINUOUS;
        ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
-       
-       
+
+
 
        eErr = PDumpOSBufprintf(hScript,
                                                        ui32MaxLen,
@@ -397,15 +397,15 @@ PVRSRV_ERROR PDumpMallocPageTable (PVRSRV_DEVICE_IDENTIFIER       *psDevId,
        }
        PDumpOSWriteString2(hScript, ui32Flags);
 
-       
 
-       
-       
-       
-       
+
+
+
+
+
 
        PDumpOSCPUVAddrToDevPAddr(psDevId->eDeviceType,
-                       hOSMemHandle, 
+                       hOSMemHandle,
                        ui32Offset,
                        (IMG_PUINT8) pvLinAddr,
                        ui32PTSize,
@@ -448,9 +448,9 @@ PVRSRV_ERROR PDumpFreePages (BM_HEAP                        *psBMHeap,
        psDeviceNode = psBMHeap->pBMContext->psDeviceNode;
        ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
 
-       
 
-       eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "-- FREE :%s:VA_%08X\r\n", 
+
+       eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "-- FREE :%s:VA_%08X\r\n",
                                                        psDeviceNode->sDevId.pszPDumpDevName, sDevVAddr.uiAddr);
        if(eErr != PVRSRV_OK)
        {
@@ -458,10 +458,10 @@ PVRSRV_ERROR PDumpFreePages       (BM_HEAP                        *psBMHeap,
        }
 
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-       
+
        {
                PVRSRV_DEVICE_NODE *psDeviceNode = psBMHeap->pBMContext->psDeviceNode;
-               
+
                if( psDeviceNode->pfnMMUIsHeapShared(psBMHeap->pMMUHeap) )
                {
                        ui32Flags |= PDUMP_FLAGS_PERSISTENT;
@@ -470,7 +470,7 @@ PVRSRV_ERROR PDumpFreePages (BM_HEAP                        *psBMHeap,
 #endif
        PDumpOSWriteString2(hScript, ui32Flags);
 
-       
+
 
        ui32NumPages = ui32NumBytes / ui32PageSize;
        for (ui32PageCounter = 0; ui32PageCounter < ui32NumPages; ui32PageCounter++)
@@ -491,7 +491,7 @@ PVRSRV_ERROR PDumpFreePages (BM_HEAP                        *psBMHeap,
                }
                else
                {
-                       
+
                }
 
                sDevVAddr.uiAddr += ui32PageSize;
@@ -515,10 +515,10 @@ PVRSRV_ERROR PDumpFreePageTable   (PVRSRV_DEVICE_IDENTIFIER *psDevID,
        ui32Flags |= PDUMP_FLAGS_CONTINUOUS;
        ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
 
-       
-       PVR_ASSERT(((IMG_UINTPTR_T)pvLinAddr & (ui32PTSize-1UL)) == 0); 
 
-       
+       PVR_ASSERT(((IMG_UINTPTR_T)pvLinAddr & (ui32PTSize-1UL)) == 0);
+
+
 
        eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "-- FREE :%s:PAGE_TABLE\r\n", psDevID->pszPDumpDevName);
        if(eErr != PVRSRV_OK)
@@ -527,15 +527,15 @@ PVRSRV_ERROR PDumpFreePageTable   (PVRSRV_DEVICE_IDENTIFIER *psDevID,
        }
        PDumpOSWriteString2(hScript, ui32Flags);
 
-       
 
-       
-       
-       
-       
+
+
+
+
+
 
        PDumpOSCPUVAddrToDevPAddr(psDevID->eDeviceType,
-                                                         hOSMemHandle, 
+                                                         hOSMemHandle,
                        0,
                        (IMG_PUINT8) pvLinAddr,
                        ui32PTSize,
@@ -565,9 +565,9 @@ PVRSRV_ERROR PDumpPDRegWithFlags(PDUMP_MMU_ATTRIB *psMMUAttrib,
        PVRSRV_ERROR eErr;
        IMG_CHAR *pszRegString;
        PDUMP_GET_SCRIPT_STRING()
-       
+
        if(psMMUAttrib->pszPDRegRegion != IMG_NULL)
-       {       
+       {
                pszRegString = psMMUAttrib->pszPDRegRegion;
        }
        else
@@ -575,7 +575,7 @@ PVRSRV_ERROR PDumpPDRegWithFlags(PDUMP_MMU_ATTRIB *psMMUAttrib,
                pszRegString = psMMUAttrib->sDevId.pszPDumpRegName;
        }
 
-       
+
 
 #if defined(SGX_FEATURE_36BIT_MMU)
        eErr = PDumpOSBufprintf(hScript, ui32MaxLen,
@@ -589,7 +589,7 @@ PVRSRV_ERROR PDumpPDRegWithFlags(PDUMP_MMU_ATTRIB *psMMUAttrib,
                return eErr;
        }
        PDumpOSWriteString2(hScript, ui32Flags);
-       eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "SHR :%s:$1 :%s:$1 0x4\r\n", 
+       eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "SHR :%s:$1 :%s:$1 0x4\r\n",
                        psMMUAttrib->sDevId.pszPDumpDevName,
                        psMMUAttrib->sDevId.pszPDumpDevName);
        if(eErr != PVRSRV_OK)
@@ -626,7 +626,7 @@ PVRSRV_ERROR PDumpPDRegWithFlags(PDUMP_MMU_ATTRIB *psMMUAttrib,
        return PVRSRV_OK;
 }
 
-PVRSRV_ERROR PDumpPDReg        (PDUMP_MMU_ATTRIB *psMMUAttrib, 
+PVRSRV_ERROR PDumpPDReg        (PDUMP_MMU_ATTRIB *psMMUAttrib,
                                         IMG_UINT32 ui32Reg,
                                         IMG_UINT32 ui32Data,
                                         IMG_HANDLE hUniqueTag)
@@ -661,16 +661,16 @@ PVRSRV_ERROR PDumpMemPolKM(PVRSRV_KERNEL_MEM_INFO         *psMemInfo,
 
        if ( _PDumpIsPersistent() )
        {
-               
+
                return PVRSRV_OK;
        }
 
-       
+
        PVR_ASSERT((ui32Offset + sizeof(IMG_UINT32)) <= psMemInfo->uAllocSize);
 
        psMMUAttrib = ((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->psMMUAttrib;
 
-       
+
 
        eErr = PDumpOSBufprintf(hScript,
                         ui32MaxLen,
@@ -691,10 +691,10 @@ PVRSRV_ERROR PDumpMemPolKM(PVRSRV_KERNEL_MEM_INFO         *psMemInfo,
 
        pui8LinAddr = psMemInfo->pvLinAddrKM;
 
-       
+
        pui8LinAddr += ui32Offset;
 
-       
+
 
 
        PDumpOSCPUVAddrToPhysPages(psMemInfo->sMemBlk.hOSMemHandle,
@@ -703,15 +703,15 @@ PVRSRV_ERROR PDumpMemPolKM(PVRSRV_KERNEL_MEM_INFO         *psMemInfo,
                        psMMUAttrib->ui32DataPageMask,
                        &ui32PageOffset);
 
-       
+
        sDevVPageAddr.uiAddr = psMemInfo->sDevVAddr.uiAddr + ui32Offset - ui32PageOffset;
 
        PVR_ASSERT((sDevVPageAddr.uiAddr & psMMUAttrib->ui32DataPageMask) == 0);
 
-       
+
        BM_GetPhysPageAddr(psMemInfo, sDevVPageAddr, &sDevPAddr);
 
-       
+
        sDevPAddr.uiAddr += ui32PageOffset;
 
        eErr = PDumpOSBufprintf(hScript,
@@ -756,16 +756,16 @@ PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
        IMG_UINT32 ui32DataPageSize;
 
        PDUMP_GET_SCRIPT_AND_FILE_STRING();
-       
-        
+
+
        if (ui32Bytes == 0 || PDumpOSIsSuspended())
        {
                return PVRSRV_OK;
        }
 
        psMMUAttrib = ((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->psMMUAttrib;
-       
-       
+
+
 
        PVR_ASSERT((ui32Offset + ui32Bytes) <= psMemInfo->uAllocSize);
 
@@ -775,11 +775,11 @@ PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
        }
 
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-       
+
        {
                BM_HEAP *pHeap = ((BM_BUF*)psMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap;
                PVRSRV_DEVICE_NODE *psDeviceNode = pHeap->pBMContext->psDeviceNode;
-               
+
                if( psDeviceNode->pfnMMUIsHeapShared(pHeap->pMMUHeap) )
                {
                        ui32Flags |= PDUMP_FLAGS_PERSISTENT;
@@ -787,7 +787,7 @@ PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
        }
 #endif
 
-       
+
        if(pvAltLinAddr)
        {
                pui8DataLinAddr = pvAltLinAddr;
@@ -799,7 +799,7 @@ PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
        pui8LinAddr = (IMG_UINT8 *)psMemInfo->pvLinAddrKM;
        sDevVAddr = psMemInfo->sDevVAddr;
 
-       
+
        sDevVAddr.uiAddr += ui32Offset;
        pui8LinAddr += ui32Offset;
 
@@ -809,7 +809,7 @@ PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
 
        ui32ParamOutPos = PDumpOSGetStreamOffset(PDUMP_STREAM_PARAM2);
 
-       
+
 
        if(!PDumpOSWriteString(PDumpOSGetStream(PDUMP_STREAM_PARAM2),
                                                pui8DataLinAddr,
@@ -832,7 +832,7 @@ PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
                return eErr;
        }
 
-       
+
 
        eErr = PDumpOSBufprintf(hScript,
                         ui32MaxLenScript,
@@ -850,7 +850,7 @@ PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
        }
        PDumpOSWriteString2(hScript, ui32Flags);
 
-       
+
 
 
        PDumpOSCPUVAddrToPhysPages(psMemInfo->sMemBlk.hOSMemHandle,
@@ -864,31 +864,31 @@ PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
        while(ui32NumPages)
        {
                ui32NumPages--;
-       
-               
+
+
                sDevVPageAddr.uiAddr = sDevVAddr.uiAddr - ui32PageByteOffset;
 
                if (ui32DataPageSize <= PDUMP_TEMP_BUFFER_SIZE)
                {
-                       
+
                        PVR_ASSERT((sDevVPageAddr.uiAddr & psMMUAttrib->ui32DataPageMask) == 0);
                }
 
-               
+
                BM_GetPhysPageAddr(psMemInfo, sDevVPageAddr, &sDevPAddr);
 
-               
+
                sDevPAddr.uiAddr += ui32PageByteOffset;
 
-               
+
                if (ui32PageByteOffset + ui32Bytes > ui32DataPageSize)
                {
-                       
+
                        ui32BlockBytes = ui32DataPageSize - ui32PageByteOffset;
                }
                else
                {
-                       
+
                        ui32BlockBytes = ui32Bytes;
                }
 
@@ -908,22 +908,22 @@ PVRSRV_ERROR PDumpMemKM(IMG_PVOID pvAltLinAddr,
                }
                PDumpOSWriteString2(hScript, ui32Flags);
 
-               
+
 
 #if defined(SGX_FEATURE_VARIABLE_MMU_PAGE_SIZE)
-               
+
                ui32PageByteOffset = (ui32PageByteOffset + ui32BlockBytes) % ui32DataPageSize;
 #else
-               
+
                ui32PageByteOffset = 0;
 #endif
-               
-               ui32Bytes -= ui32BlockBytes;     
-               
+
+               ui32Bytes -= ui32BlockBytes;
+
                sDevVAddr.uiAddr += ui32BlockBytes;
-               
+
                pui8LinAddr += ui32BlockBytes;
-               
+
                ui32ParamOutPos += ui32BlockBytes;
        }
 
@@ -940,8 +940,8 @@ PVRSRV_ERROR PDumpMemPDEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
                                                                 IMG_HANDLE hUniqueTag2)
 {
        PDUMP_MMU_ATTRIB sMMUAttrib;
-       
-       
+
+
        sMMUAttrib = *psMMUAttrib;
        sMMUAttrib.ui32PTSize = (IMG_UINT32)HOST_PAGESIZE();
        return PDumpMemPTEntriesKM(     &sMMUAttrib,
@@ -972,7 +972,7 @@ PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
        IMG_CPU_PHYADDR sCpuPAddr;
        IMG_UINT32 ui32Offset;
        IMG_UINT32 ui32ParamOutPos;
-       IMG_UINT32 ui32PageMask; 
+       IMG_UINT32 ui32PageMask;
 
        PDUMP_GET_SCRIPT_AND_FILE_STRING();
        ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
@@ -998,7 +998,7 @@ PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
 
        if (bInitialisePages)
        {
-               
+
 
 
                if (!PDumpOSWriteString(PDumpOSGetStream(PDUMP_STREAM_PARAM2),
@@ -1023,16 +1023,16 @@ PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
                }
        }
 
-       
+
 
 
 
 
        ui32PageMask = psMMUAttrib->ui32PTSize - 1;
 
-       
 
-       
+
+
        ui32PageOffset  = (IMG_UINT32)((IMG_UINTPTR_T)pvLinAddr & (psMMUAttrib->ui32PTSize - 1));
        ui32NumPages    = (ui32PageOffset + ui32Bytes + psMMUAttrib->ui32PTSize - 1) / psMMUAttrib->ui32PTSize;
        pui8LinAddr             = (IMG_UINT8*) pvLinAddr;
@@ -1040,7 +1040,7 @@ PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
        while (ui32NumPages)
        {
                ui32NumPages--;
-               
+
 
 
 
@@ -1049,21 +1049,21 @@ PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
                sCpuPAddr = OSMapLinToCPUPhys(hOSMemHandle, pui8LinAddr);
                sDevPAddr = SysCpuPAddrToDevPAddr(psMMUAttrib->sDevId.eDeviceType, sCpuPAddr);
 
-               
+
                if (ui32PageOffset + ui32Bytes > psMMUAttrib->ui32PTSize)
                {
-                       
+
                        ui32BlockBytes = psMMUAttrib->ui32PTSize - ui32PageOffset;
                }
                else
                {
-                       
+
                        ui32BlockBytes = ui32Bytes;
                }
 
-               
 
-               
+
+
                if (bInitialisePages)
                {
                        eErr = PDumpOSBufprintf(hScript,
@@ -1086,11 +1086,11 @@ PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
                {
                        for (ui32Offset = 0; ui32Offset < ui32BlockBytes; ui32Offset += sizeof(IMG_UINT32))
                        {
-                               IMG_UINT32 ui32PTE = *((IMG_UINT32 *)(IMG_UINTPTR_T)(pui8LinAddr + ui32Offset));  
+                               IMG_UINT32 ui32PTE = *((IMG_UINT32 *)(IMG_UINTPTR_T)(pui8LinAddr + ui32Offset));
 
                                if ((ui32PTE & psMMUAttrib->ui32PDEMask) != 0)
                                {
-                                       
+
 #if defined(SGX_FEATURE_36BIT_MMU)
                                        eErr = PDumpOSBufprintf(hScript,
                                                        ui32MaxLenScript,
@@ -1176,15 +1176,15 @@ PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
                        }
                }
 
-               
 
-               
+
+
                ui32PageOffset = 0;
-               
+
                ui32Bytes -= ui32BlockBytes;
-               
+
                pui8LinAddr += ui32BlockBytes;
-               
+
                ui32ParamOutPos += ui32BlockBytes;
        }
 
@@ -1205,7 +1205,7 @@ PVRSRV_ERROR PDumpPDDevPAddrKM(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
        IMG_UINT32 ui32Flags = PDUMP_FLAGS_CONTINUOUS;
        IMG_UINT32 ui32ParamOutPos;
        PDUMP_MMU_ATTRIB *psMMUAttrib;
-       IMG_UINT32 ui32PageMask; 
+       IMG_UINT32 ui32PageMask;
 
        PDUMP_GET_SCRIPT_AND_FILE_STRING();
 
@@ -1219,7 +1219,7 @@ PVRSRV_ERROR PDumpPDDevPAddrKM(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
 
        ui32ParamOutPos = PDumpOSGetStreamOffset(PDUMP_STREAM_PARAM2);
 
-       
+
        if(!PDumpOSWriteString(PDumpOSGetStream(PDUMP_STREAM_PARAM2),
                                                (IMG_UINT8 *)&sPDDevPAddr,
                                                sizeof(IMG_DEV_PHYADDR),
@@ -1241,7 +1241,7 @@ PVRSRV_ERROR PDumpPDDevPAddrKM(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
                return eErr;
        }
 
-       
+
        eErr = PDumpOSBufprintf(hScript,
                        ui32MaxLenScript,
                        "-- LDB :%s:PA_0x%08X%08X:0x%08X 0x%08X 0x%08X %s\r\n",
@@ -1258,7 +1258,7 @@ PVRSRV_ERROR PDumpPDDevPAddrKM(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
        }
        PDumpOSWriteString2(hScript, ui32Flags);
 
-       
+
        sDevVAddr = psMemInfo->sDevVAddr;
        ui32PageByteOffset = sDevVAddr.uiAddr & ui32PageMask;
 
@@ -1371,7 +1371,7 @@ PVRSRV_ERROR PDumpPDDevPAddrKM(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
 PVRSRV_ERROR PDumpCommentKM(IMG_CHAR *pszComment, IMG_UINT32 ui32Flags)
 {
        PVRSRV_ERROR eErr;
-       IMG_CHAR pszCommentPrefix[] = "-- "; 
+       IMG_CHAR pszCommentPrefix[] = "-- ";
 #if defined(PDUMP_DEBUG_OUTFILES)
        IMG_CHAR pszTemp[256];
 #endif
@@ -1379,17 +1379,17 @@ PVRSRV_ERROR PDumpCommentKM(IMG_CHAR *pszComment, IMG_UINT32 ui32Flags)
        PDUMP_GET_SCRIPT_STRING();
        PDUMP_DBG(("PDumpCommentKM"));
 #if defined(PDUMP_DEBUG_OUTFILES)
-       
+
        ui32Flags |= ( _PDumpIsPersistent() ) ? PDUMP_FLAGS_PERSISTENT : 0;
 #endif
-       
+
        PDumpOSVerifyLineEnding(pszComment, ui32MaxLen);
 
-       
+
        ui32LenCommentPrefix = PDumpOSBuflen(pszCommentPrefix, sizeof(pszCommentPrefix));
 
-       
-       
+
+
        if (!PDumpOSWriteString(PDumpOSGetStream(PDUMP_STREAM_SCRIPT2),
                          (IMG_UINT8*)pszCommentPrefix,
                          ui32LenCommentPrefix,
@@ -1422,13 +1422,13 @@ PVRSRV_ERROR PDumpCommentKM(IMG_CHAR *pszComment, IMG_UINT32 ui32Flags)
        }
 
 #if defined(PDUMP_DEBUG_OUTFILES)
-       
+
        eErr = PDumpOSSprintf(pszTemp, 256, "%d-%d %s",
                _PDumpGetPID(),
                g_ui32EveryLineCounter,
                pszComment);
 
-       
+
        eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "%s",
                pszTemp);
 #else
@@ -1450,7 +1450,7 @@ PVRSRV_ERROR PDumpCommentWithFlags(IMG_UINT32 ui32Flags, IMG_CHAR * pszFormat, .
        PDUMP_va_list ap;
        PDUMP_GET_MSG_STRING();
 
-       
+
        PDUMP_va_start(ap, pszFormat);
        eErr = PDumpOSVSprintf(pszMsg, ui32MaxLen, pszFormat, ap);
        PDUMP_va_end(ap);
@@ -1468,7 +1468,7 @@ PVRSRV_ERROR PDumpComment(IMG_CHAR *pszFormat, ...)
        PDUMP_va_list ap;
        PDUMP_GET_MSG_STRING();
 
-       
+
        PDUMP_va_start(ap, pszFormat);
        eErr = PDumpOSVSprintf(pszMsg, ui32MaxLen, pszFormat, ap);
        PDUMP_va_end(ap);
@@ -1486,14 +1486,14 @@ PVRSRV_ERROR PDumpDriverInfoKM(IMG_CHAR *pszString, IMG_UINT32 ui32Flags)
        IMG_UINT32      ui32MsgLen;
        PDUMP_GET_MSG_STRING();
 
-       
+
        eErr = PDumpOSSprintf(pszMsg, ui32MaxLen, "%s", pszString);
        if(eErr != PVRSRV_OK)
        {
                return eErr;
        }
 
-       
+
        PDumpOSVerifyLineEnding(pszMsg, ui32MaxLen);
        ui32MsgLen = PDumpOSBuflen(pszMsg, ui32MaxLen);
 
@@ -1539,7 +1539,7 @@ PVRSRV_ERROR PDumpBitmapKM(       PVRSRV_DEVICE_NODE *psDeviceNode,
 
        PDumpCommentWithFlags(ui32PDumpFlags, "\r\n-- Dump bitmap of render\r\n");
 
-       
+
        ui32MMUContextID = psDeviceNode->pfnMMUGetContextID( hDevMemContext );
 
        eErr = PDumpOSBufprintf(hScript,
@@ -1599,7 +1599,7 @@ IMG_BOOL PDumpTestNextFrame(IMG_UINT32 ui32CurrentFrame)
 {
        IMG_BOOL        bFrameDumped;
 
-       
+
 
        (IMG_VOID) PDumpSetFrameKM(ui32CurrentFrame + 1);
        bFrameDumped = PDumpIsCaptureFrameKM();
@@ -1705,11 +1705,11 @@ PVRSRV_ERROR PDumpTASignatureRegisters  (PVRSRV_DEVICE_IDENTIFIER *psDevId,
        }
 
        PDumpRegisterRange(psDevId,
-                                               pszFileName, 
-                                               pui32Registers, 
-                                               ui32NumRegisters, 
-                                               &ui32FileOffset, 
-                                               sizeof(IMG_UINT32), 
+                                               pszFileName,
+                                               pui32Registers,
+                                               ui32NumRegisters,
+                                               &ui32FileOffset,
+                                               sizeof(IMG_UINT32),
                                                ui32Flags);
        return PVRSRV_OK;
 }
@@ -1754,7 +1754,7 @@ PVRSRV_ERROR PDumpRegRead(IMG_CHAR *pszPDumpRegName,
        PDUMP_GET_SCRIPT_STRING();
 
        eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "RDW :%s:0x%X\r\n",
-                                                       pszPDumpRegName, 
+                                                       pszPDumpRegName,
                                                        ui32RegOffset);
        if(eErr != PVRSRV_OK)
        {
@@ -1774,7 +1774,7 @@ PVRSRV_ERROR PDumpSaveMemKM (PVRSRV_DEVICE_IDENTIFIER *psDevId,
 {
        PVRSRV_ERROR eErr;
        PDUMP_GET_SCRIPT_STRING();
-       
+
        eErr = PDumpOSBufprintf(hScript,
                                                        ui32MaxLen,
                                                        "SAB :%s:v%x:0x%08X 0x%08X 0x%08X %s.bin\r\n",
@@ -1800,7 +1800,7 @@ PVRSRV_ERROR PDumpCycleCountRegRead(PVRSRV_DEVICE_IDENTIFIER *psDevId,
        PVRSRV_ERROR eErr;
        PDUMP_GET_SCRIPT_STRING();
 
-       eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "RDW :%s:0x%X\r\n", 
+       eErr = PDumpOSBufprintf(hScript, ui32MaxLen, "RDW :%s:0x%X\r\n",
                                                        psDevId->pszPDumpRegName,
                                                        ui32RegOffset);
        if(eErr != PVRSRV_OK)
@@ -1862,24 +1862,24 @@ PVRSRV_ERROR PDumpCBP(PPVRSRV_KERNEL_MEM_INFO           psROffMemInfo,
        IMG_DEV_VIRTADDR        sDevVAddr;
        IMG_DEV_PHYADDR         sDevPAddr;
        IMG_DEV_VIRTADDR        sDevVPageAddr;
-    
+
        PDUMP_MMU_ATTRIB *psMMUAttrib;
 
        PDUMP_GET_SCRIPT_STRING();
 
        psMMUAttrib = ((BM_BUF*)psROffMemInfo->sMemBlk.hBuffer)->pMapping->pBMHeap->psMMUAttrib;
 
-       
+
        PVR_ASSERT((ui32ROffOffset + sizeof(IMG_UINT32)) <= psROffMemInfo->uAllocSize);
 
        pui8LinAddr = psROffMemInfo->pvLinAddrKM;
        sDevVAddr = psROffMemInfo->sDevVAddr;
 
-       
+
        pui8LinAddr += ui32ROffOffset;
        sDevVAddr.uiAddr += ui32ROffOffset;
 
-       
+
 
 
        PDumpOSCPUVAddrToPhysPages(psROffMemInfo->sMemBlk.hOSMemHandle,
@@ -1888,15 +1888,15 @@ PVRSRV_ERROR PDumpCBP(PPVRSRV_KERNEL_MEM_INFO           psROffMemInfo,
                        psMMUAttrib->ui32DataPageMask,
                        &ui32PageOffset);
 
-       
+
        sDevVPageAddr.uiAddr = sDevVAddr.uiAddr - ui32PageOffset;
 
        PVR_ASSERT((sDevVPageAddr.uiAddr & 0xFFF) == 0);
 
-       
+
        BM_GetPhysPageAddr(psROffMemInfo, sDevVPageAddr, &sDevPAddr);
 
-       
+
        sDevPAddr.uiAddr += ui32PageOffset;
 
        eErr = PDumpOSBufprintf(hScript,
@@ -1955,7 +1955,7 @@ PVRSRV_ERROR PDumpMemUM(PVRSRV_PER_PROCESS_DATA *psPerProc,
 
        if (psMemInfo->pvLinAddrKM != IMG_NULL && pvAltLinAddrUM == IMG_NULL)
        {
-               
+
                return PDumpMemKM(IMG_NULL,
                                           psMemInfo,
                                           ui32Offset,
@@ -1968,7 +1968,7 @@ PVRSRV_ERROR PDumpMemUM(PVRSRV_PER_PROCESS_DATA *psPerProc,
 
        pvAddrKM = GetTempBuffer();
 
-       
+
        PVR_ASSERT(pvAddrUM != IMG_NULL && pvAddrKM != IMG_NULL);
        if (pvAddrUM == IMG_NULL || pvAddrKM == IMG_NULL)
        {
@@ -2006,7 +2006,7 @@ PVRSRV_ERROR PDumpMemUM(PVRSRV_PER_PROCESS_DATA *psPerProc,
 
                if (eError != PVRSRV_OK)
                {
-                       
+
                        if (ui32BytesDumped != 0)
                        {
                                PVR_DPF((PVR_DBG_ERROR, "PDumpMemUM: PDumpMemKM failed (%d)", eError));
@@ -2028,12 +2028,12 @@ static PVRSRV_ERROR _PdumpAllocMMUContext(IMG_UINT32 *pui32MMUContextID)
 {
        IMG_UINT32 i;
 
-       
+
        for(i=0; i<MAX_PDUMP_MMU_CONTEXTS; i++)
        {
                if((gui16MMUContextUsage & (1U << i)) == 0)
                {
-                       
+
                        gui16MMUContextUsage |= 1U << i;
                        *pui32MMUContextID = i;
                        return PVRSRV_OK;
@@ -2050,7 +2050,7 @@ static PVRSRV_ERROR _PdumpFreeMMUContext(IMG_UINT32 ui32MMUContextID)
 {
        if(ui32MMUContextID < MAX_PDUMP_MMU_CONTEXTS)
        {
-               
+
                gui16MMUContextUsage &= ~(1U << ui32MMUContextID);
                return PVRSRV_OK;
        }
@@ -2066,7 +2066,7 @@ PVRSRV_ERROR PDumpSetMMUContext(PVRSRV_DEVICE_TYPE eDeviceType,
                                                                IMG_UINT32 *pui32MMUContextID,
                                                                IMG_UINT32 ui32MMUType,
                                                                IMG_HANDLE hUniqueTag1,
-                                                               IMG_HANDLE hOSMemHandle, 
+                                                               IMG_HANDLE hOSMemHandle,
                                                                IMG_VOID *pvPDCPUAddr)
 {
        IMG_UINT8 *pui8LinAddr = (IMG_UINT8 *)pvPDCPUAddr;
@@ -2083,15 +2083,15 @@ PVRSRV_ERROR PDumpSetMMUContext(PVRSRV_DEVICE_TYPE eDeviceType,
                return eErr;
        }
 
-       
-       
+
+
        sCpuPAddr = OSMapLinToCPUPhys(hOSMemHandle, pui8LinAddr);
        sDevPAddr = SysCpuPAddrToDevPAddr(eDeviceType, sCpuPAddr);
-       
+
        sDevPAddr.uiAddr &= ~((PVRSRV_4K_PAGE_SIZE) -1);
 
        eErr = PDumpOSBufprintf(hScript,
-                                               ui32MaxLen, 
+                                               ui32MaxLen,
                                                "MMU :%s:v%d %d :%s:PA_%08X%08X\r\n",
                                                pszMemSpace,
                                                ui32MMUContextID,
@@ -2105,7 +2105,7 @@ PVRSRV_ERROR PDumpSetMMUContext(PVRSRV_DEVICE_TYPE eDeviceType,
        }
        PDumpOSWriteString2(hScript, PDUMP_FLAGS_CONTINUOUS);
 
-       
+
        *pui32MMUContextID = ui32MMUContextID;
 
        return PVRSRV_OK;
@@ -2122,10 +2122,10 @@ PVRSRV_ERROR PDumpClearMMUContext(PVRSRV_DEVICE_TYPE eDeviceType,
        PVR_UNREFERENCED_PARAMETER(eDeviceType);
        PVR_UNREFERENCED_PARAMETER(ui32MMUType);
 
-       
+
        PDumpComment("Clear MMU Context for memory space %s\r\n", pszMemSpace);
        eErr = PDumpOSBufprintf(hScript,
-                                               ui32MaxLen, 
+                                               ui32MaxLen,
                                                "MMU :%s:v%d\r\n",
                                                pszMemSpace,
                                                ui32MMUContextID);
@@ -2147,9 +2147,9 @@ PVRSRV_ERROR PDumpClearMMUContext(PVRSRV_DEVICE_TYPE eDeviceType,
 
 PVRSRV_ERROR PDumpStoreMemToFile(PDUMP_MMU_ATTRIB *psMMUAttrib,
                                                         IMG_CHAR *pszFileName,
-                                                                IMG_UINT32 ui32FileOffset, 
+                                                                IMG_UINT32 ui32FileOffset,
                                                                 PVRSRV_KERNEL_MEM_INFO *psMemInfo,
-                                                                IMG_UINT32 uiAddr, 
+                                                                IMG_UINT32 uiAddr,
                                                                 IMG_UINT32 ui32Size,
                                                                 IMG_UINT32 ui32PDumpFlags,
                                                                 IMG_HANDLE hUniqueTag)
@@ -2160,18 +2160,18 @@ PVRSRV_ERROR PDumpStoreMemToFile(PDUMP_MMU_ATTRIB *psMMUAttrib,
 
        PDUMP_GET_SCRIPT_STRING();
 
-       
+
 
 
        ui32PageOffset = (IMG_UINT32)((IMG_UINTPTR_T)psMemInfo->pvLinAddrKM & psMMUAttrib->ui32DataPageMask);
-       
-       
+
+
        sDevVPageAddr.uiAddr = uiAddr - ui32PageOffset;
-       
-       
+
+
        BM_GetPhysPageAddr(psMemInfo, sDevVPageAddr, &sDevPAddr);
-       
-       
+
+
        sDevPAddr.uiAddr += ui32PageOffset;
 
        PDumpOSBufprintf(hScript,
@@ -2186,8 +2186,8 @@ PVRSRV_ERROR PDumpStoreMemToFile(PDUMP_MMU_ATTRIB *psMMUAttrib,
                         pszFileName);
 
        PDumpOSWriteString2(hScript, ui32PDumpFlags);
-       
-       return PVRSRV_OK;       
+
+       return PVRSRV_OK;
 }
 
 PVRSRV_ERROR PDumpRegBasedCBP(IMG_CHAR         *pszPDumpRegName,
@@ -2208,12 +2208,12 @@ PVRSRV_ERROR PDumpRegBasedCBP(IMG_CHAR          *pszPDumpRegName,
                         ui32PacketSize,
                         ui32BufferSize);
        PDumpOSWriteString2(hScript, ui32Flags);
-       
-       return PVRSRV_OK;               
+
+       return PVRSRV_OK;
 }
 
 
+
 #include "syscommon.h"
 
 IMG_EXPORT IMG_VOID PDumpConnectionNotify(IMG_VOID)
@@ -2221,16 +2221,16 @@ IMG_EXPORT IMG_VOID PDumpConnectionNotify(IMG_VOID)
        SYS_DATA                        *psSysData;
        PVRSRV_DEVICE_NODE      *psThis;
        PVR_DPF((PVR_DBG_WARNING, "PDump has connected."));
-       
-       
+
+
        SysAcquireData(&psSysData);
-       
+
        psThis = psSysData->psDeviceNodeList;
        while (psThis)
        {
                if (psThis->pfnPDumpInitDevice)
                {
-                       
+
                        psThis->pfnPDumpInitDevice(psThis);
                }
                psThis = psThis->psNext;
@@ -2243,14 +2243,14 @@ IMG_UINT32 DbgWrite(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32BC
        IMG_UINT32      ui32Off = 0;
        PDBG_STREAM_CONTROL psCtrl = psStream->psCtrl;
 
-       
+
        if ((ui32Flags & PDUMP_FLAGS_NEVER) != 0)
        {
                return ui32BCount;
        }
-       
+
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-       
+
        if ( (_PDumpIsProcessActive() == IMG_FALSE ) &&
                 ((ui32Flags & PDUMP_FLAGS_PERSISTENT) == 0) )
        {
@@ -2258,12 +2258,12 @@ IMG_UINT32 DbgWrite(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32BC
        }
 #endif
 
-       
+
        if ( ((ui32Flags & PDUMP_FLAGS_PERSISTENT) != 0) && (psCtrl->bInitPhaseComplete) )
        {
                while (ui32BCount > 0)
                {
-                       
+
 
 
                        ui32BytesWritten = PDumpOSDebugDriverWrite(     psStream,
@@ -2285,14 +2285,14 @@ IMG_UINT32 DbgWrite(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32BC
                                PVR_DPF((PVR_DBG_ERROR, "DbgWrite: Failed to send persistent data"));
                                if( (psCtrl->ui32Flags & DEBUG_FLAGS_READONLY) != 0)
                                {
-                                       
+
                                        PDumpSuspendKM();
                                }
                                return 0xFFFFFFFFU;
                        }
                }
-               
-               
+
+
                ui32BCount = ui32Off; ui32Off = 0; ui32BytesWritten = 0;
        }
 
@@ -2300,7 +2300,7 @@ IMG_UINT32 DbgWrite(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32BC
        {
                if ((ui32Flags & PDUMP_FLAGS_CONTINUOUS) != 0)
                {
-                       
+
 
                        if (((psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED) != 0) &&
                                 (psCtrl->ui32Start == 0xFFFFFFFFU) &&
@@ -2311,7 +2311,7 @@ IMG_UINT32 DbgWrite(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32BC
                        }
                        else
                        {
-                               ui32BytesWritten = PDumpOSDebugDriverWrite(     psStream, 
+                               ui32BytesWritten = PDumpOSDebugDriverWrite(     psStream,
                                                                                                                        PDUMP_WRITE_MODE_CONTINUOUS,
                                                                                                                        &pui8Data[ui32Off], ui32BCount, 1, 0);
                        }
@@ -2321,26 +2321,26 @@ IMG_UINT32 DbgWrite(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32BC
                        if (ui32Flags & PDUMP_FLAGS_LASTFRAME)
                        {
                                IMG_UINT32      ui32DbgFlags;
-       
+
                                ui32DbgFlags = 0;
                                if (ui32Flags & PDUMP_FLAGS_RESETLFBUFFER)
                                {
                                        ui32DbgFlags |= WRITELF_FLAGS_RESETBUF;
                                }
-       
+
                                ui32BytesWritten = PDumpOSDebugDriverWrite(     psStream,
                                                                                                                        PDUMP_WRITE_MODE_LASTFRAME,
                                                                                                                        &pui8Data[ui32Off], ui32BCount, 1, ui32DbgFlags);
                        }
                        else
                        {
-                               ui32BytesWritten = PDumpOSDebugDriverWrite(     psStream, 
+                               ui32BytesWritten = PDumpOSDebugDriverWrite(     psStream,
                                                                                                                        PDUMP_WRITE_MODE_BINCM,
                                                                                                                        &pui8Data[ui32Off], ui32BCount, 1, 0);
                        }
                }
 
-               
+
 
 
                if (ui32BytesWritten == 0)
@@ -2354,15 +2354,15 @@ IMG_UINT32 DbgWrite(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32BC
                        ui32BCount -= ui32BytesWritten;
                }
 
-               
+
        }
 
 
-       
+
        return ui32BytesWritten;
 }
 
 
 
-#else  
-#endif 
+#else
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index eb73166..90cb2e1
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -54,7 +54,7 @@ static PVRSRV_ERROR FreePerProcessData(PVRSRV_PER_PROCESS_DATA *psPerProc)
        if (uiPerProc == 0)
        {
                PVR_DPF((PVR_DBG_ERROR, "FreePerProcessData: Couldn't find process in per-process data hash table"));
-               
+
                PVR_ASSERT(psPerProc->ui32PID == 0);
        }
        else
@@ -63,7 +63,7 @@ static PVRSRV_ERROR FreePerProcessData(PVRSRV_PER_PROCESS_DATA *psPerProc)
                PVR_ASSERT(((PVRSRV_PER_PROCESS_DATA *)uiPerProc)->ui32PID == psPerProc->ui32PID);
        }
 
-       
+
        if (psPerProc->psHandleBase != IMG_NULL)
        {
                eError = PVRSRVFreeHandleBase(psPerProc->psHandleBase);
@@ -74,7 +74,7 @@ static PVRSRV_ERROR FreePerProcessData(PVRSRV_PER_PROCESS_DATA *psPerProc)
                }
        }
 
-       
+
        if (psPerProc->hPerProcData != IMG_NULL)
        {
                eError = PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, psPerProc->hPerProcData, PVRSRV_HANDLE_TYPE_PERPROC_DATA);
@@ -86,7 +86,7 @@ static PVRSRV_ERROR FreePerProcessData(PVRSRV_PER_PROCESS_DATA *psPerProc)
                }
        }
 
-       
+
        eError = OSPerProcessPrivateDataDeInit(psPerProc->hOsPrivateData);
        if (eError != PVRSRV_OK)
        {
@@ -98,7 +98,7 @@ static PVRSRV_ERROR FreePerProcessData(PVRSRV_PER_PROCESS_DATA *psPerProc)
                sizeof(*psPerProc),
                psPerProc,
                psPerProc->hBlockAlloc);
-       
+
        if (eError != PVRSRV_OK)
        {
                PVR_DPF((PVR_DBG_ERROR, "FreePerProcessData: Couldn't free per-process data (%d)", eError));
@@ -115,7 +115,7 @@ PVRSRV_PER_PROCESS_DATA *PVRSRVPerProcessData(IMG_UINT32 ui32PID)
 
        PVR_ASSERT(psHashTab != IMG_NULL);
 
-       
+
        psPerProc = (PVRSRV_PER_PROCESS_DATA *)HASH_Retrieve(psHashTab, (IMG_UINTPTR_T)ui32PID);
        return psPerProc;
 }
@@ -132,12 +132,12 @@ PVRSRV_ERROR PVRSRVPerProcessDataConnect(IMG_UINT32       ui32PID, IMG_UINT32 ui32Flag
                return PVRSRV_ERROR_INIT_FAILURE;
        }
 
-       
+
        psPerProc = (PVRSRV_PER_PROCESS_DATA *)HASH_Retrieve(psHashTab, (IMG_UINTPTR_T)ui32PID);
 
        if (psPerProc == IMG_NULL)
        {
-               
+
                eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                                        sizeof(*psPerProc),
                                                        (IMG_PVOID *)&psPerProc,
@@ -170,7 +170,7 @@ PVRSRV_ERROR PVRSRVPerProcessDataConnect(IMG_UINT32 ui32PID, IMG_UINT32 ui32Flag
                PVR_UNREFERENCED_PARAMETER(ui32Flags);
 #endif
 
-               
+
                eError = OSPerProcessPrivateDataInit(&psPerProc->hOsPrivateData);
                if (eError != PVRSRV_OK)
                {
@@ -178,7 +178,7 @@ PVRSRV_ERROR PVRSRVPerProcessDataConnect(IMG_UINT32 ui32PID, IMG_UINT32 ui32Flag
                        goto failure;
                }
 
-               
+
                eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE,
                                                                   &psPerProc->hPerProcData,
                                                                   psPerProc,
@@ -190,7 +190,7 @@ PVRSRV_ERROR PVRSRVPerProcessDataConnect(IMG_UINT32 ui32PID, IMG_UINT32 ui32Flag
                        goto failure;
                }
 
-               
+
                eError = PVRSRVAllocHandleBase(&psPerProc->psHandleBase);
                if (eError != PVRSRV_OK)
                {
@@ -198,15 +198,15 @@ PVRSRV_ERROR PVRSRVPerProcessDataConnect(IMG_UINT32       ui32PID, IMG_UINT32 ui32Flag
                        goto failure;
                }
 
-               
+
                eError = OSPerProcessSetHandleOptions(psPerProc->psHandleBase);
                if (eError != PVRSRV_OK)
                {
                        PVR_DPF((PVR_DBG_ERROR, "PVRSRVPerProcessDataConnect: Couldn't set handle options (%d)", eError));
                        goto failure;
                }
-               
-               
+
+
                eError = PVRSRVResManConnect(psPerProc, &psPerProc->hResManContext);
                if (eError != PVRSRV_OK)
                {
@@ -217,7 +217,7 @@ PVRSRV_ERROR PVRSRVPerProcessDataConnect(IMG_UINT32 ui32PID, IMG_UINT32 ui32Flag
                PVRSRVTimeTraceBufferCreate(ui32PID);
 #endif
        }
-       
+
        psPerProc->ui32RefCount++;
        PVR_DPF((PVR_DBG_MESSAGE,
                        "PVRSRVPerProcessDataConnect: Process 0x%x has ref-count %d",
@@ -255,10 +255,10 @@ IMG_VOID PVRSRVPerProcessDataDisconnect(IMG_UINT32        ui32PID)
                        PVRSRVTimeTraceBufferDestroy(ui32PID);
 #endif
 
-                       
+
                        PVRSRVResManDisconnect(psPerProc->hResManContext, IMG_FALSE);
-                       
-                       
+
+
                        eError = FreePerProcessData(psPerProc);
                        if (eError != PVRSRV_OK)
                        {
@@ -279,7 +279,7 @@ PVRSRV_ERROR PVRSRVPerProcessDataInit(IMG_VOID)
 {
        PVR_ASSERT(psHashTab == IMG_NULL);
 
-       
+
        psHashTab = HASH_Create(HASH_TAB_INIT_SIZE);
        if (psHashTab == IMG_NULL)
        {
@@ -292,10 +292,10 @@ PVRSRV_ERROR PVRSRVPerProcessDataInit(IMG_VOID)
 
 PVRSRV_ERROR PVRSRVPerProcessDataDeInit(IMG_VOID)
 {
-       
+
        if (psHashTab != IMG_NULL)
        {
-               
+
                HASH_Delete(psHashTab);
                psHashTab = IMG_NULL;
        }
old mode 100755 (executable)
new mode 100644 (file)
index b287797..fa2c990
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -115,7 +115,7 @@ PVRSRV_ERROR PVRSRVPowerLock(IMG_UINT32     ui32CallerID,
                }
                else if (bTryLock)
                {
-                       
+
 
                        eError = PVRSRV_ERROR_RETRY;
                        break;
@@ -130,12 +130,12 @@ PVRSRV_ERROR PVRSRVPowerLock(IMG_UINT32   ui32CallerID,
                OSPowerLockUnwrap();
        }
 
-        
+
        if ((eError == PVRSRV_OK) &&
                !bSystemPowerEvent &&
                !_IsSystemStatePowered(psSysData->eCurrentPowerState))
        {
-               
+
                PVRSRVPowerUnlock(ui32CallerID);
                eError = PVRSRV_ERROR_RETRY;
        }
@@ -157,12 +157,12 @@ static PVRSRV_ERROR PVRSRVDevicePrePowerStateKM_AnyVaCb(PVRSRV_POWER_DEV *psPowe
        PVRSRV_DEV_POWER_STATE  eNewDevicePowerState;
        PVRSRV_ERROR                    eError;
 
-       
+
        IMG_BOOL                                bAllDevices;
        IMG_UINT32                              ui32DeviceIndex;
        PVRSRV_DEV_POWER_STATE  eNewPowerState;
 
-       
+
        bAllDevices = va_arg(va, IMG_BOOL);
        ui32DeviceIndex = va_arg(va, IMG_UINT32);
        eNewPowerState = va_arg(va, PVRSRV_DEV_POWER_STATE);
@@ -176,7 +176,7 @@ static PVRSRV_ERROR PVRSRVDevicePrePowerStateKM_AnyVaCb(PVRSRV_POWER_DEV *psPowe
                {
                        if (psPowerDevice->pfnPrePower != IMG_NULL)
                        {
-                               
+
                                eError = psPowerDevice->pfnPrePower(psPowerDevice->hDevCookie,
                                                                                                        eNewDevicePowerState,
                                                                                                        psPowerDevice->eCurrentPowerState);
@@ -186,7 +186,7 @@ static PVRSRV_ERROR PVRSRVDevicePrePowerStateKM_AnyVaCb(PVRSRV_POWER_DEV *psPowe
                                }
                        }
 
-                       
+
                        eError = SysDevicePrePowerState(psPowerDevice->ui32DeviceIndex,
                                                                                        eNewDevicePowerState,
                                                                                        psPowerDevice->eCurrentPowerState);
@@ -210,7 +210,7 @@ PVRSRV_ERROR PVRSRVDevicePrePowerStateKM(IMG_BOOL                           bAllDevices,
 
        SysAcquireData(&psSysData);
 
-       
+
        eError = List_PVRSRV_POWER_DEV_PVRSRV_ERROR_Any_va(psSysData->psPowerDeviceList,
                                                                                                                &PVRSRVDevicePrePowerStateKM_AnyVaCb,
                                                                                                                bAllDevices,
@@ -225,12 +225,12 @@ static PVRSRV_ERROR PVRSRVDevicePostPowerStateKM_AnyVaCb(PVRSRV_POWER_DEV *psPow
        PVRSRV_DEV_POWER_STATE  eNewDevicePowerState;
        PVRSRV_ERROR                    eError;
 
-       
+
        IMG_BOOL                                bAllDevices;
        IMG_UINT32                              ui32DeviceIndex;
        PVRSRV_DEV_POWER_STATE  eNewPowerState;
 
-       
+
        bAllDevices = va_arg(va, IMG_BOOL);
        ui32DeviceIndex = va_arg(va, IMG_UINT32);
        eNewPowerState = va_arg(va, PVRSRV_DEV_POWER_STATE);
@@ -242,7 +242,7 @@ static PVRSRV_ERROR PVRSRVDevicePostPowerStateKM_AnyVaCb(PVRSRV_POWER_DEV *psPow
 
                if (psPowerDevice->eCurrentPowerState != eNewDevicePowerState)
                {
-                       
+
                        eError = SysDevicePostPowerState(psPowerDevice->ui32DeviceIndex,
                                                                                         eNewDevicePowerState,
                                                                                         psPowerDevice->eCurrentPowerState);
@@ -253,7 +253,7 @@ static PVRSRV_ERROR PVRSRVDevicePostPowerStateKM_AnyVaCb(PVRSRV_POWER_DEV *psPow
 
                        if (psPowerDevice->pfnPostPower != IMG_NULL)
                        {
-                               
+
                                eError = psPowerDevice->pfnPostPower(psPowerDevice->hDevCookie,
                                                                                                         eNewDevicePowerState,
                                                                                                         psPowerDevice->eCurrentPowerState);
@@ -279,7 +279,7 @@ PVRSRV_ERROR PVRSRVDevicePostPowerStateKM(IMG_BOOL                                  bAllDevices,
 
        SysAcquireData(&psSysData);
 
-       
+
        eError = List_PVRSRV_POWER_DEV_PVRSRV_ERROR_Any_va(psSysData->psPowerDeviceList,
                                                                                                                &PVRSRVDevicePostPowerStateKM_AnyVaCb,
                                                                                                                bAllDevices,
@@ -310,7 +310,7 @@ PVRSRV_ERROR PVRSRVSetDevicePowerStateKM(IMG_UINT32                         ui32DeviceIndex,
        #if defined(PDUMP)
        if (eNewPowerState == PVRSRV_DEV_POWER_STATE_DEFAULT)
        {
-               
+
 
 
 
@@ -329,7 +329,7 @@ PVRSRV_ERROR PVRSRVSetDevicePowerStateKM(IMG_UINT32                         ui32DeviceIndex,
 
                PDUMPSUSPEND();
        }
-       #endif 
+       #endif
 
        eError = PVRSRVDevicePrePowerStateKM(IMG_FALSE, ui32DeviceIndex, eNewPowerState);
        if(eError != PVRSRV_OK)
@@ -374,7 +374,7 @@ PVRSRV_ERROR PVRSRVSystemPrePowerStateKM(PVRSRV_SYS_POWER_STATE eNewSysPowerStat
 
        SysAcquireData(&psSysData);
 
-       
+
        eError = PVRSRVPowerLock(KERNEL_ID, IMG_TRUE);
        if(eError != PVRSRV_OK)
        {
@@ -386,7 +386,7 @@ PVRSRV_ERROR PVRSRVSystemPrePowerStateKM(PVRSRV_SYS_POWER_STATE eNewSysPowerStat
        {
                if (_IsSystemStatePowered(eNewSysPowerState))
                {
-                       
+
                        eNewDevicePowerState = PVRSRV_DEV_POWER_STATE_DEFAULT;
                }
                else
@@ -394,7 +394,7 @@ PVRSRV_ERROR PVRSRVSystemPrePowerStateKM(PVRSRV_SYS_POWER_STATE eNewSysPowerStat
                        eNewDevicePowerState = PVRSRV_DEV_POWER_STATE_OFF;
                }
 
-               
+
                eError = PVRSRVDevicePrePowerStateKM(IMG_TRUE, 0, eNewDevicePowerState);
                if (eError != PVRSRV_OK)
                {
@@ -404,7 +404,7 @@ PVRSRV_ERROR PVRSRVSystemPrePowerStateKM(PVRSRV_SYS_POWER_STATE eNewSysPowerStat
 
        if (eNewSysPowerState != psSysData->eCurrentPowerState)
        {
-               
+
                eError = SysSystemPrePowerState(eNewSysPowerState);
                if (eError != PVRSRV_OK)
                {
@@ -420,7 +420,7 @@ ErrorExit:
                        "PVRSRVSystemPrePowerStateKM: Transition from %d to %d FAILED 0x%x",
                        psSysData->eCurrentPowerState, eNewSysPowerState, eError));
 
-       
+
        psSysData->eFailedPowerState = eNewSysPowerState;
 
        PVRSRVPowerUnlock(KERNEL_ID);
@@ -440,7 +440,7 @@ PVRSRV_ERROR PVRSRVSystemPostPowerStateKM(PVRSRV_SYS_POWER_STATE eNewSysPowerSta
 
        if (eNewSysPowerState != psSysData->eCurrentPowerState)
        {
-               
+
                eError = SysSystemPostPowerState(eNewSysPowerState);
                if (eError != PVRSRV_OK)
                {
@@ -453,7 +453,7 @@ PVRSRV_ERROR PVRSRVSystemPostPowerStateKM(PVRSRV_SYS_POWER_STATE eNewSysPowerSta
        {
                if (_IsSystemStatePowered(eNewSysPowerState))
                {
-                       
+
                        eNewDevicePowerState = PVRSRV_DEV_POWER_STATE_DEFAULT;
                }
                else
@@ -461,7 +461,7 @@ PVRSRV_ERROR PVRSRVSystemPostPowerStateKM(PVRSRV_SYS_POWER_STATE eNewSysPowerSta
                        eNewDevicePowerState = PVRSRV_DEV_POWER_STATE_OFF;
                }
 
-               
+
                eError = PVRSRVDevicePostPowerStateKM(IMG_TRUE, 0, eNewDevicePowerState);
                if (eError != PVRSRV_OK)
                {
@@ -479,11 +479,11 @@ Exit:
 
        PVRSRVPowerUnlock(KERNEL_ID);
 
-        
+
        if (_IsSystemStatePowered(eNewSysPowerState) &&
                        PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_SUCCESSFUL))
        {
-               
+
 
 
                PVRSRVScheduleDeviceCallbacks();
@@ -513,7 +513,7 @@ PVRSRV_ERROR PVRSRVSetPowerStateKM(PVRSRV_SYS_POWER_STATE eNewSysPowerState)
                goto ErrorExit;
        }
 
-       
+
        psSysData->eFailedPowerState = PVRSRV_SYS_POWER_STATE_Unspecified;
 
        return PVRSRV_OK;
@@ -524,7 +524,7 @@ ErrorExit:
                        "PVRSRVSetPowerStateKM: Transition from %d to %d FAILED 0x%x",
                        psSysData->eCurrentPowerState, eNewSysPowerState, eError));
 
-       
+
        psSysData->eFailedPowerState = eNewSysPowerState;
 
        return eError;
@@ -562,7 +562,7 @@ PVRSRV_ERROR PVRSRVRegisterPowerDevice(IMG_UINT32                                   ui32DeviceIndex,
                return eError;
        }
 
-       
+
        psPowerDevice->pfnPrePower = pfnPrePower;
        psPowerDevice->pfnPostPower = pfnPostPower;
        psPowerDevice->pfnPreClockSpeedChange = pfnPreClockSpeedChange;
@@ -572,7 +572,7 @@ PVRSRV_ERROR PVRSRVRegisterPowerDevice(IMG_UINT32                                   ui32DeviceIndex,
        psPowerDevice->eCurrentPowerState = eCurrentPowerState;
        psPowerDevice->eDefaultPowerState = eDefaultPowerState;
 
-       
+
        List_PVRSRV_POWER_DEV_Insert(&(psSysData->psPowerDeviceList), psPowerDevice);
 
        return (PVRSRV_OK);
@@ -586,7 +586,7 @@ PVRSRV_ERROR PVRSRVRemovePowerDevice (IMG_UINT32 ui32DeviceIndex)
 
        SysAcquireData(&psSysData);
 
-       
+
        psPowerDev = (PVRSRV_POWER_DEV*)
                                        List_PVRSRV_POWER_DEV_Any_va(psSysData->psPowerDeviceList,
                                                                                                 &MatchPowerDeviceIndex_AnyVaCb,
@@ -596,7 +596,7 @@ PVRSRV_ERROR PVRSRVRemovePowerDevice (IMG_UINT32 ui32DeviceIndex)
        {
                List_PVRSRV_POWER_DEV_Remove(psPowerDev);
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_POWER_DEV), psPowerDev, IMG_NULL);
-               
+
        }
 
        return (PVRSRV_OK);
@@ -611,7 +611,7 @@ IMG_BOOL PVRSRVIsDevicePowered(IMG_UINT32 ui32DeviceIndex)
 
        SysAcquireData(&psSysData);
 
-        
+
        if (OSIsResourceLocked(&psSysData->sPowerStateChangeResource, KERNEL_ID) ||
                OSIsResourceLocked(&psSysData->sPowerStateChangeResource, ISR_ID))
        {
@@ -641,7 +641,7 @@ PVRSRV_ERROR PVRSRVDevicePreClockSpeedChange(IMG_UINT32     ui32DeviceIndex,
 
        if (bIdleDevice)
        {
-               
+
                eError = PVRSRVPowerLock(KERNEL_ID, IMG_FALSE);
                if (eError != PVRSRV_OK)
                {
@@ -650,7 +650,7 @@ PVRSRV_ERROR PVRSRVDevicePreClockSpeedChange(IMG_UINT32     ui32DeviceIndex,
                }
        }
 
-       
+
        psPowerDevice = (PVRSRV_POWER_DEV*)
                                        List_PVRSRV_POWER_DEV_Any_va(psSysData->psPowerDeviceList,
                                                                                                 &MatchPowerDeviceIndex_AnyVaCb,
@@ -690,7 +690,7 @@ IMG_VOID PVRSRVDevicePostClockSpeedChange(IMG_UINT32        ui32DeviceIndex,
 
        SysAcquireData(&psSysData);
 
-       
+
        psPowerDevice = (PVRSRV_POWER_DEV*)
                                        List_PVRSRV_POWER_DEV_Any_va(psSysData->psPowerDeviceList,
                                                                                                 &MatchPowerDeviceIndex_AnyVaCb,
@@ -712,7 +712,7 @@ IMG_VOID PVRSRVDevicePostClockSpeedChange(IMG_UINT32        ui32DeviceIndex,
 
        if (bIdleDevice)
        {
-               
+
                PVRSRVPowerUnlock(KERNEL_ID);
        }
 }
old mode 100755 (executable)
new mode 100644 (file)
index ac63704..9b8e77e
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -54,7 +54,7 @@ PVRSRV_ERROR AllocateDeviceID(SYS_DATA *psSysData, IMG_UINT32 *pui32DevID)
        psDeviceWalker = &psSysData->sDeviceID[0];
        psDeviceEnd = psDeviceWalker + psSysData->ui32NumDevices;
 
-       
+
        while (psDeviceWalker < psDeviceEnd)
        {
                if (!psDeviceWalker->bInUse)
@@ -68,7 +68,7 @@ PVRSRV_ERROR AllocateDeviceID(SYS_DATA *psSysData, IMG_UINT32 *pui32DevID)
 
        PVR_DPF((PVR_DBG_ERROR,"AllocateDeviceID: No free and valid device IDs available!"));
 
-       
+
        PVR_ASSERT(psDeviceWalker < psDeviceEnd);
 
        return PVRSRV_ERROR_NO_FREE_DEVICEIDS_AVALIABLE;
@@ -83,10 +83,10 @@ PVRSRV_ERROR FreeDeviceID(SYS_DATA *psSysData, IMG_UINT32 ui32DevID)
        psDeviceWalker = &psSysData->sDeviceID[0];
        psDeviceEnd = psDeviceWalker + psSysData->ui32NumDevices;
 
-       
+
        while (psDeviceWalker < psDeviceEnd)
        {
-               
+
                if      (
                                (psDeviceWalker->uiID == ui32DevID) &&
                                (psDeviceWalker->bInUse)
@@ -100,7 +100,7 @@ PVRSRV_ERROR FreeDeviceID(SYS_DATA *psSysData, IMG_UINT32 ui32DevID)
 
        PVR_DPF((PVR_DBG_ERROR,"FreeDeviceID: no matching dev ID that is in use!"));
 
-       
+
        PVR_ASSERT(psDeviceWalker < psDeviceEnd);
 
        return PVRSRV_ERROR_INVALID_DEVICEID;
@@ -174,17 +174,17 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDevicesKM(IMG_UINT32 *pui32NumDevices,
 
        SysAcquireData(&psSysData);
 
-       
+
 
        for (i=0; i<PVRSRV_MAX_DEVICES; i++)
        {
                psDevIdList[i].eDeviceType = PVRSRV_DEVICE_TYPE_UNKNOWN;
        }
 
-       
+
        *pui32NumDevices = 0;
 
-       
+
 
 
 
@@ -202,7 +202,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInit(PSYS_DATA psSysData)
 {
        PVRSRV_ERROR    eError;
 
-       
+
        eError = ResManInit();
        if (eError != PVRSRV_OK)
        {
@@ -215,25 +215,25 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInit(PSYS_DATA psSysData)
                goto Error;
        }
 
-       
+
        eError = PVRSRVHandleInit();
        if(eError != PVRSRV_OK)
        {
                goto Error;
        }
 
-       
+
        eError = OSCreateResource(&psSysData->sPowerStateChangeResource);
        if (eError != PVRSRV_OK)
        {
                goto Error;
        }
 
-       
+
        psSysData->eCurrentPowerState = PVRSRV_SYS_POWER_STATE_D0;
        psSysData->eFailedPowerState = PVRSRV_SYS_POWER_STATE_Unspecified;
 
-       
+
        if(OSAllocMem( PVRSRV_PAGEABLE_SELECT,
                                         sizeof(PVRSRV_EVENTOBJECT) ,
                                         (IMG_VOID **)&psSysData->psGlobalEventObject, 0,
@@ -248,7 +248,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInit(PSYS_DATA psSysData)
                goto Error;
        }
 
-       
+
        psSysData->pfnHighResTimerCreate = OSFuncHighResTimerCreate;
        psSysData->pfnHighResTimerGetus = OSFuncHighResTimerGetus;
        psSysData->pfnHighResTimerDestroy = OSFuncHighResTimerDestroy;
@@ -260,7 +260,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInit(PSYS_DATA psSysData)
        g_ui32InitFlags |= INIT_DATA_ENABLE_TTARCE;
 #endif
 
-       
+
        PDUMPINIT();
        g_ui32InitFlags |= INIT_DATA_ENABLE_PDUMPINIT;
 
@@ -289,19 +289,19 @@ IMG_VOID IMG_CALLCONV PVRSRVDeInit(PSYS_DATA psSysData)
        PERFDEINIT();
 
 #if defined(TTRACE)
-       
+
        if ((g_ui32InitFlags & INIT_DATA_ENABLE_TTARCE) > 0)
        {
                PVRSRVTimeTraceDeinit();
        }
 #endif
-       
+
        if( (g_ui32InitFlags & INIT_DATA_ENABLE_PDUMPINIT) > 0)
        {
                PDUMPDEINIT();
        }
-       
-       
+
+
        if(psSysData->psGlobalEventObject)
        {
                OSEventObjectDestroyKM(psSysData->psGlobalEventObject);
@@ -336,7 +336,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVRegisterDevice(PSYS_DATA psSysData,
        PVRSRV_ERROR            eError;
        PVRSRV_DEVICE_NODE      *psDeviceNode;
 
-       
+
        if(OSAllocMem( PVRSRV_OS_NON_PAGEABLE_HEAP,
                                         sizeof(PVRSRV_DEVICE_NODE),
                                         (IMG_VOID **)&psDeviceNode, IMG_NULL,
@@ -352,12 +352,12 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVRegisterDevice(PSYS_DATA psSysData,
        {
                OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                        sizeof(PVRSRV_DEVICE_NODE), psDeviceNode, IMG_NULL);
-               
+
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterDevice : Failed to register device"));
                return (PVRSRV_ERROR_DEVICE_REGISTER_FAILED);
        }
 
-       
+
 
 
 
@@ -366,13 +366,13 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVRegisterDevice(PSYS_DATA psSysData,
        psDeviceNode->psSysData = psSysData;
        psDeviceNode->ui32SOCInterruptBit = ui32SOCInterruptBit;
 
-       
+
        AllocateDeviceID(psSysData, &psDeviceNode->sDevId.ui32DeviceIndex);
 
-       
+
        List_PVRSRV_DEVICE_NODE_Insert(&psSysData->psDeviceNodeList, psDeviceNode);
 
-       
+
        *pui32DeviceIndex = psDeviceNode->sDevId.ui32DeviceIndex;
 
        return PVRSRV_OK;
@@ -389,7 +389,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInitialiseDevice (IMG_UINT32 ui32DevIndex)
 
        SysAcquireData(&psSysData);
 
-       
+
        psDeviceNode = (PVRSRV_DEVICE_NODE*)
                                         List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
                                                                                                        &MatchDeviceKM_AnyVaCb,
@@ -397,13 +397,13 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInitialiseDevice (IMG_UINT32 ui32DevIndex)
                                                                                                        IMG_TRUE);
        if(!psDeviceNode)
        {
-               
+
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitialiseDevice: requested device is not present"));
                return PVRSRV_ERROR_INIT_FAILURE;
        }
        PVR_ASSERT (psDeviceNode->ui32RefCount > 0);
 
-       
+
 
        eError = PVRSRVResManConnect(IMG_NULL, &psDeviceNode->hResManContext);
        if (eError != PVRSRV_OK)
@@ -412,7 +412,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInitialiseDevice (IMG_UINT32 ui32DevIndex)
                return eError;
        }
 
-       
+
        if(psDeviceNode->pfnInitDevice != IMG_NULL)
        {
                eError = psDeviceNode->pfnInitDevice(psDeviceNode);
@@ -470,7 +470,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful)
                        return eError;
                }
 
-               
+
                eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList,
                                                                                                                &PVRSRVFinaliseSystem_SetPowerState_AnyCb);
                if (eError != PVRSRV_OK)
@@ -478,7 +478,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful)
                        return eError;
                }
 
-               
+
                eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList,
                                                                                                        &PVRSRVFinaliseSystem_CompatCheck_AnyCb);
                if (eError != PVRSRV_OK)
@@ -487,7 +487,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful)
                }
        }
 
-       
+
 
 
 
@@ -499,7 +499,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful)
 
 PVRSRV_ERROR PVRSRVDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
 {
-       
+
        if (psDeviceNode->pfnInitDeviceCompatCheck)
                return psDeviceNode->pfnInitDeviceCompatCheck(psDeviceNode);
        else
@@ -539,7 +539,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVAcquireDeviceDataKM (IMG_UINT32                     ui32DevIndex,
 
        SysAcquireData(&psSysData);
 
-       
+
        psDeviceNode = List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
                                                                                                &PVRSRVAcquireDeviceDataKM_Match_AnyVaCb,
                                                                                                eDeviceType,
@@ -548,14 +548,14 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVAcquireDeviceDataKM (IMG_UINT32                   ui32DevIndex,
 
        if (!psDeviceNode)
        {
-               
+
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVAcquireDeviceDataKM: requested device is not present"));
                return PVRSRV_ERROR_INIT_FAILURE;
        }
 
        PVR_ASSERT (psDeviceNode->ui32RefCount > 0);
 
-       
+
        if (phDevCookie)
        {
                *phDevCookie = (IMG_HANDLE)psDeviceNode;
@@ -585,7 +585,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDeinitialiseDevice(IMG_UINT32 ui32DevIndex)
                return PVRSRV_ERROR_DEVICEID_NOT_FOUND;
        }
 
-       
+
 
        eError = PVRSRVSetDevicePowerStateKM(ui32DevIndex,
                                                                                 PVRSRV_DEV_POWER_STATE_OFF,
@@ -597,7 +597,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDeinitialiseDevice(IMG_UINT32 ui32DevIndex)
                return eError;
        }
 
-       
+
 
        eError = ResManFreeResByCriteria(psDeviceNode->hResManContext,
                                                                         RESMAN_CRITERIA_RESTYPE,
@@ -609,7 +609,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDeinitialiseDevice(IMG_UINT32 ui32DevIndex)
                return eError;
        }
 
-       
+
 
        if(psDeviceNode->pfnDeInitDevice != IMG_NULL)
        {
@@ -621,19 +621,19 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDeinitialiseDevice(IMG_UINT32 ui32DevIndex)
                }
        }
 
-       
+
 
        PVRSRVResManDisconnect(psDeviceNode->hResManContext, IMG_TRUE);
        psDeviceNode->hResManContext = IMG_NULL;
 
-       
+
        List_PVRSRV_DEVICE_NODE_Remove(psDeviceNode);
 
-       
+
        (IMG_VOID)FreeDeviceID(psSysData, ui32DevIndex);
        OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                sizeof(PVRSRV_DEVICE_NODE), psDeviceNode, IMG_NULL);
-       
+
 
        return (PVRSRV_OK);
 }
@@ -673,14 +673,14 @@ PVRSRV_ERROR IMG_CALLCONV PollForValueKM (volatile IMG_UINT32*    pui32LinMemAddr,
        }
 #else
        {
-               IMG_UINT32      ui32ActualValue = 0xFFFFFFFFU; 
+               IMG_UINT32      ui32ActualValue = 0xFFFFFFFFU;
 
                if (bAllowPreemption)
                {
                        PVR_ASSERT(ui32PollPeriodus >= 1000);
                }
 
-                
+
                LOOP_UNTIL_TIMEOUT(ui32Timeoutus)
                {
                        ui32ActualValue = (*pui32LinMemAddr & ui32Mask);
@@ -688,7 +688,7 @@ PVRSRV_ERROR IMG_CALLCONV PollForValueKM (volatile IMG_UINT32*      pui32LinMemAddr,
                        {
                                return PVRSRV_OK;
                        }
-                       
+
                        if (bAllowPreemption)
                        {
                                OSSleepms(ui32PollPeriodus / 1000);
@@ -698,7 +698,7 @@ PVRSRV_ERROR IMG_CALLCONV PollForValueKM (volatile IMG_UINT32*      pui32LinMemAddr,
                                OSWaitus(ui32PollPeriodus);
                        }
                } END_LOOP_UNTIL_TIMEOUT();
-       
+
                PVR_DPF((PVR_DBG_ERROR,"PollForValueKM: Timeout. Expected 0x%x but found 0x%x (mask 0x%x).",
                                ui32Value, ui32ActualValue, ui32Mask));
        }
@@ -719,7 +719,7 @@ static IMG_VOID PVRSRVGetMiscInfoKM_RA_GetStats_ForEachVaCb(BM_HEAP *psBMHeap, v
        pui32StrLen = va_arg(va, IMG_UINT32*);
        ui32Mode = va_arg(va, IMG_UINT32);
 
-       
+
        switch(ui32Mode)
        {
                case PVRSRV_MISC_INFO_MEMSTATS_PRESENT:
@@ -790,7 +790,7 @@ static PVRSRV_ERROR PVRSRVGetMiscInfoKM_Device_AnyVaCb(PVRSRV_DEVICE_NODE *psDev
        *pi32Count = OSSNPrintf(*ppszStr, 100, "\n\nDevice Type %d:\n", psDeviceNode->sDevId.eDeviceType);
        UPDATE_SPACE(*ppszStr, *pi32Count, *pui32StrLen);
 
-       
+
        if(psDeviceNode->sDevMemoryInfo.pBMKernelContext)
        {
                CHECK_SPACE(*pui32StrLen);
@@ -804,7 +804,7 @@ static PVRSRV_ERROR PVRSRVGetMiscInfoKM_Device_AnyVaCb(PVRSRV_DEVICE_NODE *psDev
                                                                ui32Mode);
        }
 
-       
+
        return List_BM_CONTEXT_PVRSRV_ERROR_Any_va(psDeviceNode->sDevMemoryInfo.pBMContext,
                                                                                                &PVRSRVGetMiscInfoKM_BMContext_AnyVaCb,
                                                                                                pui32StrLen,
@@ -831,7 +831,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
 
        psMiscInfo->ui32StatePresent = 0;
 
-       
+
        if(psMiscInfo->ui32StateRequest & ~(PVRSRV_MISC_INFO_TIMER_PRESENT
                                                                                |PVRSRV_MISC_INFO_CLOCKGATE_PRESENT
                                                                                |PVRSRV_MISC_INFO_MEMSTATS_PRESENT
@@ -848,7 +848,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
 
        SysAcquireData(&psSysData);
 
-       
+
        if(((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_TIMER_PRESENT) != 0UL) &&
                (psSysData->pvSOCTimerRegisterKM != IMG_NULL))
        {
@@ -862,7 +862,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
                psMiscInfo->hSOCTimerRegisterOSMemHandle = IMG_NULL;
        }
 
-       
+
        if(((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_CLOCKGATE_PRESENT) != 0UL) &&
                (psSysData->pvSOCClockGateRegsBase != IMG_NULL))
        {
@@ -871,7 +871,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
                psMiscInfo->ui32SOCClockGateRegsSize = psSysData->ui32SOCClockGateRegsSize;
        }
 
-       
+
        if(((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_MEMSTATS_PRESENT) != 0UL) &&
                (psMiscInfo->pszMemoryStr != IMG_NULL))
        {
@@ -885,7 +885,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
 
                psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_MEMSTATS_PRESENT;
 
-               
+
                ppArena = &psSysData->apsLocalDevMemArena[0];
                while(*ppArena)
                {
@@ -896,12 +896,12 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
                        RA_GetStats(*ppArena,
                                                        &pszStr,
                                                        &ui32StrLen);
-                       
+
                        ppArena++;
                }
 
-               
-               
+
+
                List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any_va(psSysData->psDeviceNodeList,
                                                                                                        &PVRSRVGetMiscInfoKM_Device_AnyVaCb,
                                                                                                        &ui32StrLen,
@@ -909,32 +909,32 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
                                                                                                        &pszStr,
                                                                                                        PVRSRV_MISC_INFO_MEMSTATS_PRESENT);
 
-               
+
                i32Count = OSSNPrintf(pszStr, 100, "\n");
                UPDATE_SPACE(pszStr, i32Count, ui32StrLen);
        }
 
-       
+
        if(((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_FREEMEM_PRESENT) != 0)
                && psMiscInfo->pszMemoryStr)
        {
                IMG_CHAR                        *pszStr;
                IMG_UINT32                      ui32StrLen;
                IMG_INT32                       i32Count;
-               
+
                pszStr = psMiscInfo->pszMemoryStr;
                ui32StrLen = psMiscInfo->ui32MemoryStrLen;
-  
+
                psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_FREEMEM_PRESENT;
 
-               
+
                List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any_va(psSysData->psDeviceNodeList,
                                                                                                        &PVRSRVGetMiscInfoKM_Device_AnyVaCb,
                                                                                                        &ui32StrLen,
                                                                                                        &i32Count,
                                                                                                        &pszStr,
                                                                                                        PVRSRV_MISC_INFO_FREEMEM_PRESENT);
-               
+
                i32Count = OSSNPrintf(pszStr, 100, "\n");
                UPDATE_SPACE(pszStr, i32Count, ui32StrLen);
        }
@@ -946,7 +946,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
                psMiscInfo->sGlobalEventObject = *psSysData->psGlobalEventObject;
        }
 
-       
+
 
        if (((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_DDKVERSION_PRESENT) != 0UL)
                && ((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_MEMSTATS_PRESENT) == 0UL)
@@ -954,12 +954,12 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
        {
                IMG_CHAR        *pszStr;
                IMG_UINT32      ui32StrLen;
-               IMG_UINT32      ui32LenStrPerNum = 12; 
+               IMG_UINT32      ui32LenStrPerNum = 12;
                IMG_INT32       i32Count;
                IMG_INT i;
                psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_DDKVERSION_PRESENT;
 
-               
+
                psMiscInfo->aui32DDKVersion[0] = PVRVERSION_MAJ;
                psMiscInfo->aui32DDKVersion[1] = PVRVERSION_MIN;
                psMiscInfo->aui32DDKVersion[2] = PVRVERSION_BUILD_HI;
@@ -991,7 +991,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
 
                if(psMiscInfo->sCacheOpCtl.bDeferOp)
                {
-                       
+
                        psSysData->ePendingCacheOpType = psMiscInfo->sCacheOpCtl.eCacheOpType;
                }
                else
@@ -1092,7 +1092,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
                PVR_LOG(("User requested OS reset"));
                OSPanic();
        }
-#endif 
+#endif
 
        return PVRSRV_OK;
 }
@@ -1111,7 +1111,7 @@ IMG_BOOL IMG_CALLCONV PVRSRVDeviceLISR(PVRSRV_DEVICE_NODE *psDeviceNode)
        }
        psSysData = psDeviceNode->psSysData;
 
-       
+
        ui32InterruptSource = SysGetInterruptSource(psSysData, psDeviceNode);
        if(ui32InterruptSource & psDeviceNode->ui32SOCInterruptBit)
        {
@@ -1145,10 +1145,10 @@ static IMG_VOID PVRSRVSystemLISR_ForEachVaCb(PVRSRV_DEVICE_NODE *psDeviceNode, v
                {
                        if((*psDeviceNode->pfnDeviceISR)(psDeviceNode->pvISRData))
                        {
-                               
+
                                *pbStatus = IMG_TRUE;
                        }
-                       
+
                        *pui32ClearInterrupts |= psDeviceNode->ui32SOCInterruptBit;
                }
        }
@@ -1166,13 +1166,13 @@ IMG_BOOL IMG_CALLCONV PVRSRVSystemLISR(IMG_VOID *pvSysData)
        }
        else
        {
-               
+
                ui32InterruptSource = SysGetInterruptSource(psSysData, IMG_NULL);
 
-               
+
                if(ui32InterruptSource)
                {
-                       
+
                        List_PVRSRV_DEVICE_NODE_ForEach_va(psSysData->psDeviceNodeList,
                                                                                                &PVRSRVSystemLISR_ForEachVaCb,
                                                                                                &bStatus,
@@ -1203,17 +1203,17 @@ IMG_VOID IMG_CALLCONV PVRSRVMISR(IMG_VOID *pvSysData)
                return;
        }
 
-       
+
        List_PVRSRV_DEVICE_NODE_ForEach(psSysData->psDeviceNodeList,
                                                                        &PVRSRVMISR_ForEachCb);
 
-       
+
        if (PVRSRVProcessQueues(IMG_FALSE) == PVRSRV_ERROR_PROCESSING_BLOCKED)
        {
                PVRSRVProcessQueues(IMG_FALSE);
        }
 
-       
+
        if (psSysData->psGlobalEventObject)
        {
                IMG_HANDLE hOSEventKM = psSysData->psGlobalEventObject->hOSEventKM;
@@ -1255,12 +1255,12 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSaveRestoreLiveSegments(IMG_HANDLE hArena, IMG_P
        sSegDetails.sCpuPhyAddr.uiAddr = 0;
        sSegDetails.hSegment = 0;
 
-       
+
        while (RA_GetNextLiveSegment(hArena, &sSegDetails))
        {
                if (pbyBuffer == IMG_NULL)
                {
-                       
+
                        uiBytesSaved += sizeof(sSegDetails.uiSize) + sSegDetails.uiSize;
                }
                else
@@ -1272,7 +1272,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSaveRestoreLiveSegments(IMG_HANDLE hArena, IMG_P
 
                        PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVSaveRestoreLiveSegments: Base %08x size %08x", sSegDetails.sCpuPhyAddr.uiAddr, sSegDetails.uiSize));
 
-                       
+
                        pvLocalMemCPUVAddr = OSMapPhysToLin(sSegDetails.sCpuPhyAddr,
                                                                        sSegDetails.uiSize,
                                                                        PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
@@ -1285,7 +1285,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSaveRestoreLiveSegments(IMG_HANDLE hArena, IMG_P
 
                        if (bSave)
                        {
-                               
+
                                OSMemCopy(pbyBuffer, &sSegDetails.uiSize, sizeof(sSegDetails.uiSize));
                                pbyBuffer += sizeof(sSegDetails.uiSize);
 
@@ -1295,7 +1295,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSaveRestoreLiveSegments(IMG_HANDLE hArena, IMG_P
                        else
                        {
                                IMG_UINT32 uiSize;
-                               
+
                                OSMemCopy(&uiSize, pbyBuffer, sizeof(sSegDetails.uiSize));
 
                                if (uiSize != sSegDetails.uiSize)
@@ -1332,8 +1332,8 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSaveRestoreLiveSegments(IMG_HANDLE hArena, IMG_P
 
 IMG_EXPORT
 const IMG_CHAR *PVRSRVGetErrorStringKM(PVRSRV_ERROR eError)
-{ 
+{
+
 #include "pvrsrv_errors.h"
 }
 
@@ -1341,7 +1341,7 @@ static IMG_VOID PVRSRVCommandCompleteCallbacks_ForEachCb(PVRSRV_DEVICE_NODE *psD
 {
        if(psDeviceNode->pfnDeviceCommandComplete != IMG_NULL)
        {
-               
+
                (*psDeviceNode->pfnDeviceCommandComplete)(psDeviceNode);
        }
 }
@@ -1351,7 +1351,7 @@ IMG_VOID PVRSRVScheduleDeviceCallbacks(IMG_VOID)
        SYS_DATA                                *psSysData;
        SysAcquireData(&psSysData);
 
-       
+
        List_PVRSRV_DEVICE_NODE_ForEach(psSysData->psDeviceNodeList,
                                                                        &PVRSRVCommandCompleteCallbacks_ForEachCb);
 }
old mode 100755 (executable)
new mode 100644 (file)
index 2b60f96..f1e39e9
@@ -1,30 +1,31 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #include "services_headers.h"
+#include "pvr_bridge_km.h"
 
 #include "lists.h"
 #include "ttrace.h"
@@ -98,7 +99,7 @@ void ProcSeqShowQueue(struct seq_file *sfile,void* el)
                        }
                }
 
-               
+
                ui32ReadOffset += psCmd->uCmdSize;
                ui32ReadOffset &= psQueue->ui32QueueSize - 1;
                cmds++;
@@ -131,7 +132,7 @@ void* ProcSeqOff2ElementQueue(struct seq_file * sfile, loff_t off)
 
        return psQueue;
 }
-#endif 
+#endif
 
 #define GET_SPACE_IN_CMDQ(psQueue)                                                                             \
        ((((psQueue)->ui32ReadOffset - (psQueue)->ui32WriteOffset)                              \
@@ -296,7 +297,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_SIZE_T ui32QueueSize,
 
        SysAcquireData(&psSysData);
 
-       
+
        eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                         sizeof(PVRSRV_QUEUE_INFO),
                                         (IMG_VOID **)&psQueueInfo, &hMemBlock,
@@ -311,7 +312,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_SIZE_T ui32QueueSize,
        psQueueInfo->hMemBlock[0] = hMemBlock;
        psQueueInfo->ui32ProcessID = OSGetCurrentProcessIDKM();
 
-       
+
        eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                         ui32Power2QueueSize + PVRSRV_MAX_CMD_SIZE,
                                         &psQueueInfo->pvLinQueueKM, &hMemBlock,
@@ -325,13 +326,13 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_SIZE_T ui32QueueSize,
        psQueueInfo->hMemBlock[1] = hMemBlock;
        psQueueInfo->pvLinQueueUM = psQueueInfo->pvLinQueueKM;
 
-       
+
        PVR_ASSERT(psQueueInfo->ui32ReadOffset == 0);
        PVR_ASSERT(psQueueInfo->ui32WriteOffset == 0);
 
        psQueueInfo->ui32QueueSize = ui32Power2QueueSize;
 
-       
+
        if (psSysData->psQueueList == IMG_NULL)
        {
                eError = OSCreateResource(&psSysData->sQProcessResource);
@@ -341,7 +342,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_SIZE_T ui32QueueSize,
                }
        }
 
-       
+
        eError = OSLockResource(&psSysData->sQProcessResource,
                                                        KERNEL_ID);
        if (eError != PVRSRV_OK)
@@ -379,7 +380,7 @@ ErrorExit:
                                        sizeof(PVRSRV_QUEUE_INFO),
                                        psQueueInfo,
                                        psQueueInfo->hMemBlock[0]);
-               
+
        }
 
        return eError;
@@ -398,7 +399,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyCommandQueueKM(PVRSRV_QUEUE_INFO *psQueue
 
        psQueue = psSysData->psQueueList;
 
-        
+
        LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
        {
                if(psQueueInfo->ui32ReadOffset == psQueueInfo->ui32WriteOffset)
@@ -411,13 +412,13 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyCommandQueueKM(PVRSRV_QUEUE_INFO *psQueue
 
        if (bTimeout)
        {
-               
+
                PVR_DPF((PVR_DBG_ERROR,"PVRSRVDestroyCommandQueueKM : Failed to empty queue"));
                eError = PVRSRV_ERROR_CANNOT_FLUSH_QUEUE;
                goto ErrorExit;
        }
 
-       
+
        eError = OSLockResource(&psSysData->sQProcessResource,
                                                                KERNEL_ID);
        if (eError != PVRSRV_OK)
@@ -438,8 +439,8 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyCommandQueueKM(PVRSRV_QUEUE_INFO *psQueue
                                        sizeof(PVRSRV_QUEUE_INFO),
                                        psQueueInfo,
                                        psQueueInfo->hMemBlock[0]);
-                
-               psQueueInfo = IMG_NULL; 
+
+               psQueueInfo = IMG_NULL;
        }
        else
        {
@@ -458,8 +459,8 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyCommandQueueKM(PVRSRV_QUEUE_INFO *psQueue
                                                        sizeof(PVRSRV_QUEUE_INFO),
                                                        psQueueInfo,
                                                        psQueueInfo->hMemBlock[0]);
-                                
-                               psQueueInfo = IMG_NULL; 
+
+                               psQueueInfo = IMG_NULL;
                                break;
                        }
                        psQueue = psQueue->psNextKM;
@@ -477,14 +478,14 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyCommandQueueKM(PVRSRV_QUEUE_INFO *psQueue
                }
        }
 
-       
+
        eError = OSUnlockResource(&psSysData->sQProcessResource, KERNEL_ID);
        if (eError != PVRSRV_OK)
        {
                goto ErrorExit;
        }
 
-       
+
        if (psSysData->psQueueList == IMG_NULL)
        {
                eError = OSDestroyResource(&psSysData->sQProcessResource);
@@ -507,7 +508,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetQueueSpaceKM(PVRSRV_QUEUE_INFO *psQueue,
 {
        IMG_BOOL bTimeout = IMG_TRUE;
 
-       
+
        ui32ParamSize =  (ui32ParamSize+3) & 0xFFFFFFFC;
 
        if (ui32ParamSize > PVRSRV_MAX_CMD_SIZE)
@@ -516,7 +517,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetQueueSpaceKM(PVRSRV_QUEUE_INFO *psQueue,
                return PVRSRV_ERROR_CMD_TOO_BIG;
        }
 
-        
+
        LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
        {
                if (GET_SPACE_IN_CMDQ(psQueue) > ui32ParamSize)
@@ -573,15 +574,15 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO *psQueue,
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        ui32DataByteSize = (ui32DataByteSize + 3UL) & ~3UL;
 
-       
+
        ui32CommandSize = sizeof(PVRSRV_COMMAND)
                                        + ((ui32DstSyncCount + ui32SrcSyncCount) * sizeof(PVRSRV_SYNC_OBJECT))
                                        + ui32DataByteSize;
 
-       
+
        eError = PVRSRVGetQueueSpaceKM (psQueue, ui32CommandSize, (IMG_VOID**)&psCommand);
        if(eError != PVRSRV_OK)
        {
@@ -590,14 +591,14 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO *psQueue,
 
        psCommand->ui32ProcessID        = OSGetCurrentProcessIDKM();
 
-       
-       psCommand->uCmdSize             = ui32CommandSize; 
+
+       psCommand->uCmdSize             = ui32CommandSize;
        psCommand->ui32DevIndex         = ui32DevIndex;
        psCommand->CommandType          = CommandType;
        psCommand->ui32DstSyncCount     = ui32DstSyncCount;
        psCommand->ui32SrcSyncCount     = ui32SrcSyncCount;
-       
-       
+
+
        psCommand->psDstSync            = (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psCommand) + sizeof(PVRSRV_COMMAND));
 
 
@@ -615,7 +616,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO   *psQueue,
        PVR_TTRACE_UI32(PVRSRV_TRACE_GROUP_QUEUE, PVRSRV_TRACE_CLASS_NONE,
                        QUEUE_TOKEN_COMMAND_TYPE, CommandType);
 
-       
+
        for (i=0; i<ui32DstSyncCount; i++)
        {
                PVR_TTRACE_SYNC_OBJECT(PVRSRV_TRACE_GROUP_QUEUE, QUEUE_TOKEN_DST_SYNC,
@@ -625,6 +626,8 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO   *psQueue,
                psCommand->psDstSync[i].ui32WriteOpsPending = PVRSRVGetWriteOpsPending(apsDstSync[i], IMG_FALSE);
                psCommand->psDstSync[i].ui32ReadOps2Pending = PVRSRVGetReadOpsPending(apsDstSync[i], IMG_FALSE);
 
+               PVRSRVKernelSyncInfoIncRef(apsDstSync[i], IMG_NULL);
+
                PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVInsertCommandKM: Dst %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x",
                                i, psCommand->psDstSync[i].psKernelSyncInfoKM->sReadOps2CompleteDevVAddr.uiAddr,
                                psCommand->psDstSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
@@ -632,7 +635,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO   *psQueue,
                                psCommand->psDstSync[i].ui32WriteOpsPending));
        }
 
-       
+
        for (i=0; i<ui32SrcSyncCount; i++)
        {
                PVR_TTRACE_SYNC_OBJECT(PVRSRV_TRACE_GROUP_QUEUE, QUEUE_TOKEN_DST_SYNC,
@@ -642,6 +645,8 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO   *psQueue,
                psCommand->psSrcSync[i].ui32WriteOpsPending = PVRSRVGetWriteOpsPending(apsSrcSync[i], IMG_TRUE);
                psCommand->psSrcSync[i].ui32ReadOps2Pending = PVRSRVGetReadOpsPending(apsSrcSync[i], IMG_TRUE);
 
+               PVRSRVKernelSyncInfoIncRef(apsSrcSync[i], IMG_NULL);
+
                PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVInsertCommandKM: Src %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x",
                                i, psCommand->psSrcSync[i].psKernelSyncInfoKM->sReadOps2CompleteDevVAddr.uiAddr,
                                psCommand->psSrcSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
@@ -650,7 +655,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO   *psQueue,
        }
        PVR_TTRACE(PVRSRV_TRACE_GROUP_QUEUE, PVRSRV_TRACE_CLASS_CMD_END, QUEUE_TOKEN_INSERTKM);
 
-       
+
        *ppsCommand = psCommand;
 
        return PVRSRV_OK;
@@ -661,9 +666,9 @@ IMG_EXPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSubmitCommandKM(PVRSRV_QUEUE_INFO *psQueue,
                                                                                                PVRSRV_COMMAND *psCommand)
 {
-       
-       
-       
+
+
+
        if (psCommand->ui32DstSyncCount > 0)
        {
                psCommand->psDstSync = (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psQueue->pvLinQueueKM)
@@ -682,7 +687,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSubmitCommandKM(PVRSRV_QUEUE_INFO *psQueue,
                                                                        + (psCommand->ui32DstSyncCount * sizeof(PVRSRV_SYNC_OBJECT))
                                                                        + (psCommand->ui32SrcSyncCount * sizeof(PVRSRV_SYNC_OBJECT)));
 
-       
+
        UPDATE_QUEUE_WOFF(psQueue, psCommand->uCmdSize);
 
        return PVRSRV_OK;
@@ -740,7 +745,7 @@ PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA                  *psSysData,
        DEVICE_COMMAND_DATA             *psDeviceCommandData;
        IMG_UINT32                              ui32CCBOffset;
 
-       
+
        psWalkerObj = psCommand->psDstSync;
        psEndObj = psWalkerObj + psCommand->ui32DstSyncCount;
        while (psWalkerObj < psEndObj)
@@ -749,7 +754,7 @@ PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA                  *psSysData,
 
                ui32WriteOpsComplete = psSyncData->ui32WriteOpsComplete;
                ui32ReadOpsComplete = psSyncData->ui32ReadOps2Complete;
-               
+
                if ((ui32WriteOpsComplete != psWalkerObj->ui32WriteOpsPending)
                ||      (ui32ReadOpsComplete != psWalkerObj->ui32ReadOps2Pending))
                {
@@ -764,7 +769,7 @@ PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA                  *psSysData,
                psWalkerObj++;
        }
 
-       
+
        psWalkerObj = psCommand->psSrcSync;
        psEndObj = psWalkerObj + psCommand->ui32SrcSyncCount;
        while (psWalkerObj < psEndObj)
@@ -773,7 +778,7 @@ PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA                  *psSysData,
 
                ui32ReadOpsComplete = psSyncData->ui32ReadOps2Complete;
                ui32WriteOpsComplete = psSyncData->ui32WriteOpsComplete;
-               
+
                if ((ui32WriteOpsComplete != psWalkerObj->ui32WriteOpsPending)
                || (ui32ReadOpsComplete != psWalkerObj->ui32ReadOps2Pending))
                {
@@ -811,7 +816,7 @@ PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA                  *psSysData,
                psWalkerObj++;
        }
 
-       
+
        if (psCommand->ui32DevIndex >= SYS_DEVICE_COUNT)
        {
                PVR_DPF((PVR_DBG_ERROR,
@@ -820,20 +825,20 @@ PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA                        *psSysData,
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        psDeviceCommandData = psSysData->apsDeviceCommandData[psCommand->ui32DevIndex];
        ui32CCBOffset = psDeviceCommandData[psCommand->CommandType].ui32CCBOffset;
        psCmdCompleteData = psDeviceCommandData[psCommand->CommandType].apsCmdCompleteData[ui32CCBOffset];
        if (psCmdCompleteData->bInUse)
        {
-               
+
                return PVRSRV_ERROR_FAILED_DEPENDENCIES;
        }
 
-       
+
        psCmdCompleteData->bInUse = IMG_TRUE;
 
-       
+
        psCmdCompleteData->ui32DstSyncCount = psCommand->ui32DstSyncCount;
        for (i=0; i<psCommand->ui32DstSyncCount; i++)
        {
@@ -850,7 +855,7 @@ PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA                  *psSysData,
        psCmdCompleteData->pfnCommandComplete = psCommand->pfnCommandComplete;
        psCmdCompleteData->hCallbackData = psCommand->hCallbackData;
 
-       
+
        psCmdCompleteData->ui32SrcSyncCount = psCommand->ui32SrcSyncCount;
        for (i=0; i<psCommand->ui32SrcSyncCount; i++)
        {
@@ -864,7 +869,7 @@ PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA                  *psSysData,
                                ui32CCBOffset));
        }
 
-       
+
 
 
 
@@ -878,14 +883,14 @@ PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA                        *psSysData,
                                                                                                                           (IMG_UINT32)psCommand->uDataSize,
                                                                                                                           psCommand->pvData) == IMG_FALSE)
        {
-               
+
 
 
                psCmdCompleteData->bInUse = IMG_FALSE;
                eError = PVRSRV_ERROR_CMD_NOT_PROCESSED;
        }
-       
-       
+
+
        psDeviceCommandData[psCommand->CommandType].ui32CCBOffset = (ui32CCBOffset + 1) % DC_NUM_COMMANDS_PER_TYPE;
 
        return eError;
@@ -909,13 +914,13 @@ PVRSRV_ERROR PVRSRVProcessQueues(IMG_BOOL bFlush)
        PVRSRV_COMMAND          *psCommand;
        SysAcquireData(&psSysData);
 
-       
+
 
        while (OSLockResource(&psSysData->sQProcessResource, ISR_ID) != PVRSRV_OK)
        {
                OSWaitus(1);
        };
-       
+
        psQueue = psSysData->psQueueList;
 
        if(!psQueue)
@@ -936,7 +941,7 @@ PVRSRV_ERROR PVRSRVProcessQueues(IMG_BOOL   bFlush)
 
                        if (PVRSRVProcessCommand(psSysData, psCommand, bFlush) == PVRSRV_OK)
                        {
-                               
+
                                UPDATE_QUEUE_ROFF(psQueue, psCommand->uCmdSize)
                                continue;
                        }
@@ -951,7 +956,7 @@ PVRSRV_ERROR PVRSRVProcessQueues(IMG_BOOL   bFlush)
                PVRSRVSetDCState(DC_STATE_NO_FLUSH_COMMANDS);
        }
 
-       
+
        List_PVRSRV_DEVICE_NODE_ForEach(psSysData->psDeviceNodeList,
                                                                        &PVRSRVProcessQueues_ForEachCb);
 
@@ -970,10 +975,10 @@ IMG_VOID PVRSRVFreeCommandCompletePacketKM(IMG_HANDLE     hCmdCookie,
 
        SysAcquireData(&psSysData);
 
-       
+
        psCmdCompleteData->bInUse = IMG_FALSE;
 
-       
+
        PVRSRVScheduleDeviceCallbacks();
 
        if(bScheduleMISR)
@@ -982,7 +987,7 @@ IMG_VOID PVRSRVFreeCommandCompletePacketKM(IMG_HANDLE       hCmdCookie,
        }
 }
 
-#endif 
+#endif
 
 
 IMG_EXPORT
@@ -998,11 +1003,17 @@ IMG_VOID PVRSRVCommandCompleteKM(IMG_HANDLE      hCmdCookie,
        PVR_TTRACE(PVRSRV_TRACE_GROUP_QUEUE, PVRSRV_TRACE_CLASS_CMD_COMP_START,
                        QUEUE_TOKEN_COMMAND_COMPLETE);
 
-       
+
        for (i=0; i<psCmdCompleteData->ui32DstSyncCount; i++)
        {
                psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM->psSyncData->ui32WriteOpsComplete++;
 
+               PVRSRVKernelSyncInfoDecRef(psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM, IMG_NULL);
+               if (psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM->ui32RefCount == 0)
+               {
+                       PVRSRVFreeSyncInfoKM(psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM);
+               }
+
                PVR_TTRACE_SYNC_OBJECT(PVRSRV_TRACE_GROUP_QUEUE, QUEUE_TOKEN_UPDATE_DST,
                                          psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM,
                                          PVRSRV_SYNCOP_COMPLETE);
@@ -1014,11 +1025,17 @@ IMG_VOID PVRSRVCommandCompleteKM(IMG_HANDLE     hCmdCookie,
                                psCmdCompleteData->psDstSync[i].ui32WriteOpsPending));
        }
 
-       
+
        for (i=0; i<psCmdCompleteData->ui32SrcSyncCount; i++)
        {
                psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM->psSyncData->ui32ReadOps2Complete++;
 
+               PVRSRVKernelSyncInfoDecRef(psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM, IMG_NULL);
+               if (psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM->ui32RefCount == 0)
+               {
+                       PVRSRVFreeSyncInfoKM(psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM);
+               }
+
                PVR_TTRACE_SYNC_OBJECT(PVRSRV_TRACE_GROUP_QUEUE, QUEUE_TOKEN_UPDATE_SRC,
                                          psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM,
                                          PVRSRV_SYNCOP_COMPLETE);
@@ -1038,10 +1055,10 @@ IMG_VOID PVRSRVCommandCompleteKM(IMG_HANDLE     hCmdCookie,
                psCmdCompleteData->pfnCommandComplete(psCmdCompleteData->hCallbackData);
        }
 
-       
+
        psCmdCompleteData->bInUse = IMG_FALSE;
 
-       
+
        PVRSRVScheduleDeviceCallbacks();
 
        if(bScheduleMISR)
@@ -1066,7 +1083,7 @@ PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(IMG_UINT32               ui32DevIndex,
        DEVICE_COMMAND_DATA             *psDeviceCommandData;
        COMMAND_COMPLETE_DATA   *psCmdCompleteData;
 
-       
+
        if(ui32DevIndex >= SYS_DEVICE_COUNT)
        {
                PVR_DPF((PVR_DBG_ERROR,
@@ -1075,10 +1092,10 @@ PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(IMG_UINT32             ui32DevIndex,
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        SysAcquireData(&psSysData);
 
-       
+
        ui32AllocSize = ui32CmdCount * sizeof(*psDeviceCommandData);
        eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                                ui32AllocSize,
@@ -1100,12 +1117,12 @@ PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(IMG_UINT32             ui32DevIndex,
                psDeviceCommandData[ui32CmdTypeCounter].ui32MaxSrcSyncCount = ui32MaxSyncsPerCmd[ui32CmdTypeCounter][1];
                for (ui32CmdCounter = 0; ui32CmdCounter < DC_NUM_COMMANDS_PER_TYPE; ui32CmdCounter++)
                {
-                       
 
-                       ui32AllocSize = sizeof(COMMAND_COMPLETE_DATA) 
+
+                       ui32AllocSize = sizeof(COMMAND_COMPLETE_DATA)
                                                  + ((ui32MaxSyncsPerCmd[ui32CmdTypeCounter][0]
                                                  +     ui32MaxSyncsPerCmd[ui32CmdTypeCounter][1])
-                                                 * sizeof(PVRSRV_SYNC_OBJECT));         
+                                                 * sizeof(PVRSRV_SYNC_OBJECT));
 
                        eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                                                ui32AllocSize,
@@ -1117,13 +1134,13 @@ PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(IMG_UINT32             ui32DevIndex,
                                PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterCmdProcListKM: Failed to alloc cmd %d", ui32CmdTypeCounter));
                                goto ErrorExit;
                        }
-                       
+
                        psDeviceCommandData[ui32CmdTypeCounter].apsCmdCompleteData[ui32CmdCounter] = psCmdCompleteData;
-                       
-                       
+
+
                        OSMemSet(psCmdCompleteData, 0x00, ui32AllocSize);
 
-                       
+
                        psCmdCompleteData->psDstSync = (PVRSRV_SYNC_OBJECT*)
                                                                                        (((IMG_UINTPTR_T)psCmdCompleteData)
                                                                                        + sizeof(COMMAND_COMPLETE_DATA));
@@ -1139,14 +1156,14 @@ PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(IMG_UINT32             ui32DevIndex,
 
 ErrorExit:
 
-       
+
        if (PVRSRVRemoveCmdProcListKM(ui32DevIndex, ui32CmdCount) != PVRSRV_OK)
        {
                PVR_DPF((PVR_DBG_ERROR,
                                "PVRSRVRegisterCmdProcListKM: Failed to clean up after error, device 0x%x",
                                ui32DevIndex));
        }
-       
+
        return eError;
 }
 
@@ -1161,7 +1178,7 @@ PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32 ui32DevIndex,
        COMMAND_COMPLETE_DATA   *psCmdCompleteData;
        IMG_SIZE_T                              ui32AllocSize;
 
-       
+
        if(ui32DevIndex >= SYS_DEVICE_COUNT)
        {
                PVR_DPF((PVR_DBG_ERROR,
@@ -1170,7 +1187,7 @@ PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32 ui32DevIndex,
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        SysAcquireData(&psSysData);
 
        psDeviceCommandData = psSysData->apsDeviceCommandData[ui32DevIndex];
@@ -1181,10 +1198,11 @@ PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32 ui32DevIndex,
                        for (ui32CmdCounter = 0; ui32CmdCounter < DC_NUM_COMMANDS_PER_TYPE; ui32CmdCounter++)
                        {
                                psCmdCompleteData = psDeviceCommandData[ui32CmdTypeCounter].apsCmdCompleteData[ui32CmdCounter];
-                               
-                               
+
+
                                if (psCmdCompleteData != IMG_NULL)
                                {
+                                       PVR_ASSERT(psCmdCompleteData->bInUse == IMG_FALSE);
                                        OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, psCmdCompleteData->ui32AllocSize,
                                                          psCmdCompleteData, IMG_NULL);
                                        psDeviceCommandData[ui32CmdTypeCounter].apsCmdCompleteData[ui32CmdCounter] = IMG_NULL;
@@ -1192,7 +1210,7 @@ PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32 ui32DevIndex,
                        }
                }
 
-               
+
                ui32AllocSize = ui32CmdCount * sizeof(*psDeviceCommandData);
                OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, ui32AllocSize, psDeviceCommandData, IMG_NULL);
                psSysData->apsDeviceCommandData[ui32DevIndex] = IMG_NULL;
old mode 100755 (executable)
new mode 100644 (file)
index 84a2162..fe47b70
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -71,29 +71,29 @@ struct _BT_
 {
        enum bt_type
        {
-               btt_span,                               
-               btt_free,                               
-               btt_live                                
+               btt_span,
+               btt_free,
+               btt_live
        } type;
 
-       
+
        IMG_UINTPTR_T base;
        IMG_SIZE_T uSize;
 
-       
+
        struct _BT_ *pNextSegment;
        struct _BT_ *pPrevSegment;
-       
+
        struct _BT_ *pNextFree;
        struct _BT_ *pPrevFree;
-       
+
        BM_MAPPING *psMapping;
 
 #if defined(VALIDATE_ARENA_TEST)
        RESOURCE_DESCRIPTOR eResourceSpan;
        RESOURCE_TYPE           eResourceType;
 
-       
+
        IMG_UINT32                      ui32BoundaryTagID;
 #endif
 
@@ -103,13 +103,13 @@ typedef struct _BT_ BT;
 
 struct _RA_ARENA_
 {
-       
+
        IMG_CHAR *name;
 
-       
+
        IMG_SIZE_T uQuantum;
 
-       
+
        IMG_BOOL (*pImportAlloc)(IMG_VOID *,
                                                         IMG_SIZE_T uSize,
                                                         IMG_SIZE_T *pActualSize,
@@ -123,20 +123,20 @@ struct _RA_ARENA_
                                                 BM_MAPPING *psMapping);
        IMG_VOID (*pBackingStoreFree) (IMG_VOID *, IMG_SIZE_T, IMG_SIZE_T, IMG_HANDLE);
 
-       
+
        IMG_VOID *pImportHandle;
 
-       
+
 #define FREE_TABLE_LIMIT 32
 
-       
+
        BT *aHeadFree [FREE_TABLE_LIMIT];
 
-       
+
        BT *pHeadSegment;
        BT *pTailSegment;
 
-       
+
        HASH_TABLE *pSegmentHash;
 
 #ifdef RA_STATS
@@ -164,7 +164,7 @@ static void* RA_ProcSeqOff2ElementInfo(struct seq_file * sfile, loff_t off);
 static void RA_ProcSeqShowRegs(struct seq_file *sfile, void* el);
 static void* RA_ProcSeqOff2ElementRegs(struct seq_file * sfile, loff_t off);
 
-#endif 
+#endif
 
 #ifdef USE_BM_FREESPACE_CHECK
 IMG_VOID CheckBMFreespace(IMG_VOID);
@@ -252,7 +252,7 @@ _SegmentListInsert (RA_ARENA *pArena, BT *pBT)
 {
        PVRSRV_ERROR eError = PVRSRV_OK;
 
-       
+
        if (pArena->pHeadSegment == IMG_NULL)
        {
                pArena->pHeadSegment = pArena->pTailSegment = pBT;
@@ -264,7 +264,7 @@ _SegmentListInsert (RA_ARENA *pArena, BT *pBT)
 
                if (pBT->base < pArena->pHeadSegment->base)
                {
-                       
+
                        pBT->pNextSegment = pArena->pHeadSegment;
                        pArena->pHeadSegment->pPrevSegment = pBT;
                        pArena->pHeadSegment = pBT;
@@ -273,7 +273,7 @@ _SegmentListInsert (RA_ARENA *pArena, BT *pBT)
                else
                {
 
-                       
+
 
 
                        pBTScan = pArena->pHeadSegment;
@@ -562,13 +562,13 @@ _InsertResourceSpan (RA_ARENA *pArena, IMG_UINTPTR_T base, IMG_SIZE_T uSize)
 
   fail_SegListInsert:
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pBT, IMG_NULL);
-       
+
   fail_bt:
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pSpanEnd, IMG_NULL);
-       
+
   fail_end:
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pSpanStart, IMG_NULL);
-       
+
   fail_start:
        return IMG_NULL;
 }
@@ -598,7 +598,7 @@ _FreeBT (RA_ARENA *pArena, BT *pBT, IMG_BOOL bFreeBackingStore)
        uOrigBase = pBT->base;
        uOrigSize = pBT->uSize;
 
-       
+
        pNeighbour = pBT->pPrevSegment;
        if (pNeighbour!=IMG_NULL
                && pNeighbour->type == btt_free
@@ -609,13 +609,13 @@ _FreeBT (RA_ARENA *pArena, BT *pBT, IMG_BOOL bFreeBackingStore)
                pBT->base = pNeighbour->base;
                pBT->uSize += pNeighbour->uSize;
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pNeighbour, IMG_NULL);
-               
+
 #ifdef RA_STATS
                pArena->sStatistics.uFreeSegmentCount--;
 #endif
        }
 
-       
+
        pNeighbour = pBT->pNextSegment;
        if (pNeighbour!=IMG_NULL
                && pNeighbour->type == btt_free
@@ -625,28 +625,28 @@ _FreeBT (RA_ARENA *pArena, BT *pBT, IMG_BOOL bFreeBackingStore)
                _SegmentListRemove (pArena, pNeighbour);
                pBT->uSize += pNeighbour->uSize;
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pNeighbour, IMG_NULL);
-               
+
 #ifdef RA_STATS
                pArena->sStatistics.uFreeSegmentCount--;
 #endif
        }
 
-       
+
        if (pArena->pBackingStoreFree != IMG_NULL && bFreeBackingStore)
        {
                IMG_UINTPTR_T   uRoundedStart, uRoundedEnd;
 
-               
+
                uRoundedStart = (uOrigBase / pArena->uQuantum) * pArena->uQuantum;
-               
+
                if (uRoundedStart < pBT->base)
                {
                        uRoundedStart += pArena->uQuantum;
                }
 
-               
+
                uRoundedEnd = ((uOrigBase + uOrigSize + pArena->uQuantum - 1) / pArena->uQuantum) * pArena->uQuantum;
-               
+
                if (uRoundedEnd > (pBT->base + pBT->uSize))
                {
                        uRoundedEnd -= pArena->uQuantum;
@@ -675,11 +675,11 @@ _FreeBT (RA_ARENA *pArena, BT *pBT, IMG_BOOL bFreeBackingStore)
                pArena->sStatistics.uTotalResourceCount-=pBT->uSize;
 #endif
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), next, IMG_NULL);
-               
+
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), prev, IMG_NULL);
-               
+
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pBT, IMG_NULL);
-               
+
        }
        else
                _FreeListInsert (pArena, pBT);
@@ -706,12 +706,12 @@ _AttemptAllocAligned (RA_ARENA *pArena,
        if (uAlignment>1)
                uAlignmentOffset %= uAlignment;
 
-       
+
 
        uIndex = pvr_log2 (uSize);
 
 #if 0
-       
+
        if (1u<<uIndex < uSize)
                uIndex++;
 #endif
@@ -723,7 +723,7 @@ _AttemptAllocAligned (RA_ARENA *pArena,
        {
                if (pArena->aHeadFree[uIndex]!=IMG_NULL)
                {
-                       
+
                        BT *pBT;
 
                        pBT = pArena->aHeadFree [uIndex];
@@ -754,16 +754,16 @@ _AttemptAllocAligned (RA_ARENA *pArena,
                                                pArena->sStatistics.uFreeResourceCount-=pBT->uSize;
 #endif
 
-                                               
+
                                                if (aligned_base > pBT->base)
                                                {
                                                        BT *pNeighbour;
                                                        pNeighbour = _SegmentSplit (pArena, pBT, (IMG_SIZE_T)(aligned_base - pBT->base));
-                                                       
+
                                                        if (pNeighbour==IMG_NULL)
                                                        {
                                                                PVR_DPF ((PVR_DBG_ERROR,"_AttemptAllocAligned: Front split failed"));
-                                                               
+
                                                                _FreeListInsert (pArena, pBT);
                                                                return IMG_FALSE;
                                                        }
@@ -776,16 +776,16 @@ _AttemptAllocAligned (RA_ARENA *pArena,
                                                        pBT = pNeighbour;
                                                }
 
-                                               
+
                                                if (pBT->uSize > uSize)
                                                {
                                                        BT *pNeighbour;
                                                        pNeighbour = _SegmentSplit (pArena, pBT, uSize);
-                                                       
+
                                                        if (pNeighbour==IMG_NULL)
                                                        {
                                                                PVR_DPF ((PVR_DBG_ERROR,"_AttemptAllocAligned: Back split failed"));
-                                                               
+
                                                                _FreeListInsert (pArena, pBT);
                                                                return IMG_FALSE;
                                                        }
@@ -916,7 +916,7 @@ RA_Create (IMG_CHAR *name,
 
                pArena->bInitProcEntry = !PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_SUCCESSFUL);
 
-               
+
                pfnCreateProcEntrySeq = pArena->bInitProcEntry ? CreateProcEntrySeq : CreatePerProcessProcEntrySeq;
 
                ret = snprintf(szProcInfoName, sizeof(szProcInfoName), "ra_info_%s", pArena->name);
@@ -943,7 +943,7 @@ RA_Create (IMG_CHAR *name,
                        PVR_DPF((PVR_DBG_ERROR, "RA_Create: couldn't create ra_segs proc entry for arena %s", pArena->name));
                }
        }
-#endif 
+#endif
 
        pArena->pSegmentHash = HASH_Create (MINIMUM_HASH_SIZE);
        if (pArena->pSegmentHash==IMG_NULL)
@@ -967,7 +967,7 @@ insert_fail:
        HASH_Delete (pArena->pSegmentHash);
 hash_fail:
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RA_ARENA), pArena, IMG_NULL);
-       
+
 arena_fail:
        return IMG_NULL;
 }
@@ -1004,7 +1004,7 @@ RA_Delete (RA_ARENA *pArena)
 
                _SegmentListRemove (pArena, pBT);
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(BT), pBT, IMG_NULL);
-               
+
 #ifdef RA_STATS
                pArena->sStatistics.uSpanCount--;
 #endif
@@ -1028,7 +1028,7 @@ RA_Delete (RA_ARENA *pArena)
 #endif
        HASH_Delete (pArena->pSegmentHash);
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RA_ARENA), pArena, IMG_NULL);
-       
+
 }
 
 IMG_BOOL
@@ -1111,7 +1111,7 @@ RA_Alloc (RA_ARENA *pArena,
                          "RA_Alloc: arena='%s', size=0x%x(0x%x), alignment=0x%x, offset=0x%x",
                   pArena->name, uSize, uRequestSize, uAlignment, uAlignmentOffset));
 
-       
+
 
        bResult = _AttemptAllocAligned (pArena, uSize, ppsMapping, uFlags,
                                                                        uAlignment, uAlignmentOffset, base);
@@ -1121,7 +1121,7 @@ RA_Alloc (RA_ARENA *pArena,
                IMG_UINTPTR_T import_base;
                IMG_SIZE_T uImportSize = uSize;
 
-               
+
 
 
                if (uAlignment > pArena->uQuantum)
@@ -1129,7 +1129,7 @@ RA_Alloc (RA_ARENA *pArena,
                        uImportSize += (uAlignment - 1);
                }
 
-               
+
                uImportSize = ((uImportSize + pArena->uQuantum - 1)/pArena->uQuantum)*pArena->uQuantum;
 
                bResult =
@@ -1140,16 +1140,16 @@ RA_Alloc (RA_ARENA *pArena,
                {
                        BT *pBT;
                        pBT = _InsertResourceSpan (pArena, import_base, uImportSize);
-                       
+
                        if (pBT == IMG_NULL)
                        {
-                               
+
                                pArena->pImportFree(pArena->pImportHandle, import_base,
                                                                        psImportMapping);
                                PVR_DPF ((PVR_DBG_MESSAGE,
                                                  "RA_Alloc: name='%s', size=0x%x failed!",
                                                  pArena->name, uSize));
-                               
+
                                return IMG_FALSE;
                        }
                        pBT->psMapping = psImportMapping;
@@ -1179,7 +1179,7 @@ RA_Alloc (RA_ARENA *pArena,
                          "RA_Alloc: name='%s', size=0x%x, *base=0x%x = %d",
                          pArena->name, uSize, *base, bResult));
 
-       
+
 
 #if defined(VALIDATE_ARENA_TEST)
        ValidateArena(pArena);
@@ -1219,7 +1219,7 @@ IMG_UINT32 ValidateArena(RA_ARENA *pArena)
                                                  (eNextSpan == IMPORTED_RESOURCE_SPAN_FREE) ||
                                                  (eNextSpan == IMPORTED_RESOURCE_SPAN_END)))
                                        {
-                                               
+
                                                PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
                                                                pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
 
@@ -1232,7 +1232,7 @@ IMG_UINT32 ValidateArena(RA_ARENA *pArena)
                                        if (!((eNextSpan == IMPORTED_RESOURCE_SPAN_LIVE) ||
                                                  (eNextSpan == IMPORTED_RESOURCE_SPAN_END)))
                                        {
-                                               
+
                                                PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
                                                                pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
 
@@ -1246,7 +1246,7 @@ IMG_UINT32 ValidateArena(RA_ARENA *pArena)
                                                (eNextSpan == IMPORTED_RESOURCE_SPAN_FREE) ||
                                                (eNextSpan == IMPORTED_RESOURCE_SPAN_END))
                                        {
-                                               
+
                                                PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
                                                                pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
 
@@ -1260,7 +1260,7 @@ IMG_UINT32 ValidateArena(RA_ARENA *pArena)
                                        if (!((eNextSpan == IMPORTED_RESOURCE_SPAN_LIVE) ||
                                                  (eNextSpan == IMPORTED_RESOURCE_SPAN_FREE)))
                                        {
-                                               
+
                                                PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
                                                                pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
 
@@ -1293,7 +1293,7 @@ IMG_UINT32 ValidateArena(RA_ARENA *pArena)
                                        if (!((eNextSpan == RESOURCE_SPAN_FREE) ||
                                                  (eNextSpan == RESOURCE_SPAN_LIVE)))
                                        {
-                                               
+
                                                PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
                                                                pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
 
@@ -1306,7 +1306,7 @@ IMG_UINT32 ValidateArena(RA_ARENA *pArena)
                                        if (!((eNextSpan == RESOURCE_SPAN_FREE) ||
                                                  (eNextSpan == RESOURCE_SPAN_LIVE)))
                                        {
-                                               
+
                                                PVR_DPF((PVR_DBG_ERROR, "ValidateArena ERROR: adjacent boundary tags %d (base=0x%x) and %d (base=0x%x) are incompatible (arena: %s)",
                                                                pSegment->ui32BoundaryTagID, pSegment->base, pSegment->pNextSegment->ui32BoundaryTagID, pSegment->pNextSegment->base, pArena->name));
 
@@ -1411,7 +1411,7 @@ IMG_BOOL RA_GetNextLiveSegment(IMG_HANDLE hArena, RA_SEGMENT_DETAILS *psSegDetai
 
                pBT = pArena->pHeadSegment;
        }
-       
+
        while (pBT != IMG_NULL)
        {
                if (pBT->type == btt_live)
@@ -1490,7 +1490,7 @@ _BTType (IMG_INT eType)
        }
        return "junk";
 }
-#endif 
+#endif
 
 #if defined(ENABLE_RA_DUMP)
 IMG_VOID
@@ -1521,7 +1521,7 @@ RA_Dump (RA_ARENA *pArena)
        HASH_Dump (pArena->pSegmentHash);
 #endif
 }
-#endif 
+#endif
 
 
 #if defined(CONFIG_PROC_FS) && defined(DEBUG)
@@ -1618,7 +1618,7 @@ static void* RA_ProcSeqOff2ElementRegs(struct seq_file * sfile, loff_t off)
        return (void*)pBT;
 }
 
-#endif 
+#endif
 
 
 #ifdef RA_STATS
@@ -1716,7 +1716,7 @@ PVRSRV_ERROR RA_GetStats(RA_ARENA *pArena,
 }
 
 PVRSRV_ERROR RA_GetStatsFreeMem(RA_ARENA *pArena,
-                                                               IMG_CHAR **ppszStr, 
+                                                               IMG_CHAR **ppszStr,
                                                                IMG_UINT32 *pui32StrLen)
 {
        IMG_CHAR        *pszStr = *ppszStr;
@@ -1729,7 +1729,7 @@ PVRSRV_ERROR RA_GetStatsFreeMem(RA_ARENA *pArena,
        UPDATE_SPACE(pszStr, i32Count, ui32StrLen);
        *ppszStr = pszStr;
        *pui32StrLen = ui32StrLen;
-       
+
        return PVRSRV_OK;
 }
 #endif
index 8b00972..6871034 100644 (file)
@@ -1,7 +1,27 @@
-/*************************************************************************/ /*!
-@Title          Services reference count debugging
-@Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
-@License        Strictly Confidential.
+/**********************************************************************
+ *
+ * Copyright (C) Imagination Technologies Ltd. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * The full GNU General Public License is included in this distribution in
+ * the file called "COPYING".
+ *
+ * Contact Information:
+ * Imagination Technologies Ltd. <gpl-support@imgtec.com>
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ *
 */ /**************************************************************************/
 
 #if defined(PVRSRV_REFCOUNT_DEBUG)
old mode 100755 (executable)
new mode 100644 (file)
index 5088c7f..9620653
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -86,14 +86,14 @@ typedef struct _RESMAN_ITEM_
 #ifdef DEBUG
        IMG_UINT32                              ui32Signature;
 #endif
-       struct _RESMAN_ITEM_    **ppsThis;      
-       struct _RESMAN_ITEM_    *psNext;        
+       struct _RESMAN_ITEM_    **ppsThis;
+       struct _RESMAN_ITEM_    *psNext;
 
-       IMG_UINT32                              ui32Flags;      
+       IMG_UINT32                              ui32Flags;
        IMG_UINT32                              ui32ResType;
 
-       IMG_PVOID                               pvParam;        
-       IMG_UINT32                              ui32Param;      
+       IMG_PVOID                               pvParam;
+       IMG_UINT32                              ui32Param;
 
        RESMAN_FREE_FN                  pfnFreeResource;
 } RESMAN_ITEM;
@@ -107,7 +107,7 @@ typedef struct _RESMAN_CONTEXT_
        struct  _RESMAN_CONTEXT_        **ppsThis;
        struct  _RESMAN_CONTEXT_        *psNext;
 
-       PVRSRV_PER_PROCESS_DATA         *psPerProc; 
+       PVRSRV_PER_PROCESS_DATA         *psPerProc;
 
        RESMAN_ITEM                                     *psResItemList;
 
@@ -116,14 +116,14 @@ typedef struct _RESMAN_CONTEXT_
 
 typedef struct
 {
-       RESMAN_CONTEXT  *psContextList; 
+       RESMAN_CONTEXT  *psContextList;
 
-} RESMAN_LIST, *PRESMAN_LIST;  
+} RESMAN_LIST, *PRESMAN_LIST;
 
 
 PRESMAN_LIST   gpsResList = IMG_NULL;
 
-#include "lists.h"      
+#include "lists.h"
 
 static IMPLEMENT_LIST_ANY_VA(RESMAN_ITEM)
 static IMPLEMENT_LIST_ANY_VA_2(RESMAN_ITEM, IMG_BOOL, IMG_FALSE)
@@ -163,7 +163,7 @@ PVRSRV_ERROR ResManInit(IMG_VOID)
 {
        if (gpsResList == IMG_NULL)
        {
-               
+
                if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                                sizeof(*gpsResList),
                                                (IMG_VOID **)&gpsResList, IMG_NULL,
@@ -172,10 +172,10 @@ PVRSRV_ERROR ResManInit(IMG_VOID)
                        return PVRSRV_ERROR_OUT_OF_MEMORY;
                }
 
-               
+
                gpsResList->psContextList = IMG_NULL;
 
-               
+
                VALIDATERESLIST();
        }
 
@@ -187,7 +187,7 @@ IMG_VOID ResManDeInit(IMG_VOID)
 {
        if (gpsResList != IMG_NULL)
        {
-               
+
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(*gpsResList), gpsResList, IMG_NULL);
                gpsResList = IMG_NULL;
        }
@@ -200,13 +200,13 @@ PVRSRV_ERROR PVRSRVResManConnect(IMG_HANDLE                       hPerProc,
        PVRSRV_ERROR    eError;
        PRESMAN_CONTEXT psResManContext;
 
-       
+
        ACQUIRE_SYNC_OBJ;
 
-       
+
        VALIDATERESLIST();
 
-       
+
        eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(*psResManContext),
                                                (IMG_VOID **)&psResManContext, IMG_NULL,
                                                "Resource Manager Context");
@@ -214,10 +214,10 @@ PVRSRV_ERROR PVRSRVResManConnect(IMG_HANDLE                       hPerProc,
        {
                PVR_DPF((PVR_DBG_ERROR, "PVRSRVResManConnect: ERROR allocating new RESMAN context struct"));
 
-               
+
                VALIDATERESLIST();
 
-               
+
                RELEASE_SYNC_OBJ;
 
                return eError;
@@ -225,17 +225,17 @@ PVRSRV_ERROR PVRSRVResManConnect(IMG_HANDLE                       hPerProc,
 
 #ifdef DEBUG
        psResManContext->ui32Signature = RESMAN_SIGNATURE;
-#endif 
+#endif
        psResManContext->psResItemList  = IMG_NULL;
        psResManContext->psPerProc = hPerProc;
 
-       
+
        List_RESMAN_CONTEXT_Insert(&gpsResList->psContextList, psResManContext);
 
-       
+
        VALIDATERESLIST();
 
-       
+
        RELEASE_SYNC_OBJ;
 
        *phResManContext = psResManContext;
@@ -247,45 +247,45 @@ PVRSRV_ERROR PVRSRVResManConnect(IMG_HANDLE                       hPerProc,
 IMG_VOID PVRSRVResManDisconnect(PRESMAN_CONTEXT psResManContext,
                                                                IMG_BOOL                bKernelContext)
 {
-       
+
        ACQUIRE_SYNC_OBJ;
 
-       
+
        VALIDATERESLIST();
 
-       
+
        PRINT_RESLIST(gpsResList, psResManContext, IMG_TRUE);
 
-       
+
 
        if (!bKernelContext)
        {
-               
+
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_OS_USERMODE_MAPPING, 0, 0, IMG_TRUE);
 
-               
+
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DMA_CLIENT_FIFO_DATA, 0, 0, IMG_TRUE);
 
-               
+
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_EVENT_OBJECT, 0, 0, IMG_TRUE);
 
-               
-               
+
+
                List_RESMAN_ITEM_Reverse(&psResManContext->psResItemList);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_MODIFY_SYNC_OPS, 0, 0, IMG_TRUE);
-               List_RESMAN_ITEM_Reverse(&psResManContext->psResItemList);  
+               List_RESMAN_ITEM_Reverse(&psResManContext->psResItemList);
+
 
-               
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_HW_RENDER_CONTEXT, 0, 0, IMG_TRUE);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_HW_TRANSFER_CONTEXT, 0, 0, IMG_TRUE);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_HW_2D_CONTEXT, 0, 0, IMG_TRUE);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_TRANSFER_CONTEXT, 0, 0, IMG_TRUE);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_SHARED_PB_DESC_CREATE_LOCK, 0, 0, IMG_TRUE);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_SHARED_PB_DESC, 0, 0, IMG_TRUE);
-               
-               
 
-               
+
+
+
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_SYNC_INFO, 0, 0, IMG_TRUE);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICECLASSMEM_MAPPING, 0, 0, IMG_TRUE);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_WRAP, 0, 0, IMG_TRUE);
@@ -295,32 +295,32 @@ IMG_VOID PVRSRVResManDisconnect(PRESMAN_CONTEXT psResManContext,
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_CONTEXT, 0, 0, IMG_TRUE);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_SHARED_MEM_INFO, 0, 0, IMG_TRUE);
 
-               
+
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DISPLAYCLASS_SWAPCHAIN_REF, 0, 0, IMG_TRUE);
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DISPLAYCLASS_DEVICE, 0, 0, IMG_TRUE);
 
-               
+
                FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_BUFFERCLASS_DEVICE, 0, 0, IMG_TRUE);
        }
 
-       
+
        PVR_ASSERT(psResManContext->psResItemList == IMG_NULL);
 
-       
+
        List_RESMAN_CONTEXT_Remove(psResManContext);
 
-       
+
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RESMAN_CONTEXT), psResManContext, IMG_NULL);
-       
 
 
-       
+
+
        VALIDATERESLIST();
 
-       
+
        PRINT_RESLIST(gpsResList, psResManContext, IMG_FALSE);
 
-       
+
        RELEASE_SYNC_OBJ;
 }
 
@@ -342,10 +342,10 @@ PRESMAN_ITEM ResManRegisterRes(PRESMAN_CONTEXT    psResManContext,
                return (PRESMAN_ITEM) IMG_NULL;
        }
 
-       
+
        ACQUIRE_SYNC_OBJ;
 
-       
+
        VALIDATERESLIST();
 
        PVR_DPF((PVR_DBG_MESSAGE, "ResManRegisterRes: register resource "
@@ -357,7 +357,7 @@ PRESMAN_ITEM ResManRegisterRes(PRESMAN_CONTEXT      psResManContext,
                        ui32Param,
                        (IMG_UINTPTR_T)pfnFreeResource));
 
-       
+
        if (OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                                   sizeof(RESMAN_ITEM), (IMG_VOID **)&psNewResItem,
                                   IMG_NULL,
@@ -366,29 +366,29 @@ PRESMAN_ITEM ResManRegisterRes(PRESMAN_CONTEXT    psResManContext,
                PVR_DPF((PVR_DBG_ERROR, "ResManRegisterRes: "
                                "ERROR allocating new resource item"));
 
-               
+
                RELEASE_SYNC_OBJ;
 
                return((PRESMAN_ITEM)IMG_NULL);
        }
 
-       
+
 #ifdef DEBUG
        psNewResItem->ui32Signature             = RESMAN_SIGNATURE;
-#endif 
+#endif
        psNewResItem->ui32ResType               = ui32ResType;
        psNewResItem->pvParam                   = pvParam;
        psNewResItem->ui32Param                 = ui32Param;
        psNewResItem->pfnFreeResource   = pfnFreeResource;
        psNewResItem->ui32Flags             = 0;
 
-       
+
        List_RESMAN_ITEM_Insert(&psResManContext->psResItemList, psNewResItem);
 
-       
+
        VALIDATERESLIST();
 
-       
+
        RELEASE_SYNC_OBJ;
 
        return(psNewResItem);
@@ -409,19 +409,19 @@ PVRSRV_ERROR ResManFreeResByPtr(RESMAN_ITEM       *psResItem, IMG_BOOL bForceCleanup)
        PVR_DPF((PVR_DBG_MESSAGE, "ResManFreeResByPtr: freeing resource at %08X",
                        (IMG_UINTPTR_T)psResItem));
 
-       
+
        ACQUIRE_SYNC_OBJ;
 
-       
+
        VALIDATERESLIST();
 
-       
+
        eError = FreeResourceByPtr(psResItem, IMG_TRUE, bForceCleanup);
 
-       
+
        VALIDATERESLIST();
 
-       
+
        RELEASE_SYNC_OBJ;
 
        return(eError);
@@ -438,10 +438,10 @@ PVRSRV_ERROR ResManFreeResByCriteria(PRESMAN_CONTEXT      psResManContext,
 
        PVR_ASSERT(psResManContext != IMG_NULL);
 
-       
+
        ACQUIRE_SYNC_OBJ;
 
-       
+
        VALIDATERESLIST();
 
        PVR_DPF((PVR_DBG_MESSAGE, "ResManFreeResByCriteria: "
@@ -449,15 +449,15 @@ PVRSRV_ERROR ResManFreeResByCriteria(PRESMAN_CONTEXT      psResManContext,
                        (IMG_UINTPTR_T)psResManContext, ui32SearchCriteria, ui32ResType,
                        (IMG_UINTPTR_T)pvParam, ui32Param));
 
-       
+
        eError = FreeResourceByCriteria(psResManContext, ui32SearchCriteria,
                                                                        ui32ResType, pvParam, ui32Param,
                                                                        IMG_TRUE);
 
-       
+
        VALIDATERESLIST();
 
-       
+
        RELEASE_SYNC_OBJ;
 
        return eError;
@@ -478,16 +478,16 @@ PVRSRV_ERROR ResManDissociateRes(RESMAN_ITEM              *psResItem,
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-#ifdef DEBUG 
+#ifdef DEBUG
        PVR_ASSERT(psResItem->ui32Signature == RESMAN_SIGNATURE);
 #endif
 
        if (psNewResManContext != IMG_NULL)
        {
-               
+
                List_RESMAN_ITEM_Remove(psResItem);
 
-               
+
                List_RESMAN_ITEM_Insert(&psNewResManContext->psResItemList, psResItem);
 
        }
@@ -529,11 +529,11 @@ IMG_INTERNAL PVRSRV_ERROR ResManFindResourceByPtr(PRESMAN_CONTEXT psResManContex
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-#ifdef DEBUG   
+#ifdef DEBUG
        PVR_ASSERT(psItem->ui32Signature == RESMAN_SIGNATURE);
 #endif
 
-       
+
        ACQUIRE_SYNC_OBJ;
 
        PVR_DPF((PVR_DBG_MESSAGE,
@@ -550,7 +550,7 @@ IMG_INTERNAL PVRSRV_ERROR ResManFindResourceByPtr(PRESMAN_CONTEXT   psResManContex
                        (IMG_UINTPTR_T)psItem->pfnFreeResource,
                        psItem->ui32Flags));
 
-       
+
        if(List_RESMAN_ITEM_IMG_BOOL_Any_va(psResManContext->psResItemList,
                                                                                &ResManFindResourceByPtr_AnyVaCb,
                                                                                psItem))
@@ -562,7 +562,7 @@ IMG_INTERNAL PVRSRV_ERROR ResManFindResourceByPtr(PRESMAN_CONTEXT   psResManContex
                eResult = PVRSRV_ERROR_NOT_OWNER;
        }
 
-       
+
        RELEASE_SYNC_OBJ;
 
        return eResult;
@@ -582,7 +582,7 @@ static PVRSRV_ERROR FreeResourceByPtr(RESMAN_ITEM   *psItem,
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-#ifdef DEBUG   
+#ifdef DEBUG
        PVR_ASSERT(psItem->ui32Signature == RESMAN_SIGNATURE);
 #endif
 
@@ -597,14 +597,14 @@ static PVRSRV_ERROR FreeResourceByPtr(RESMAN_ITEM *psItem,
                        (IMG_UINTPTR_T)psItem->pvParam, psItem->ui32Param,
                        (IMG_UINTPTR_T)psItem->pfnFreeResource, psItem->ui32Flags));
 
-       
+
        List_RESMAN_ITEM_Remove(psItem);
 
 
-       
+
        RELEASE_SYNC_OBJ;
 
-       
+
        if (bExecuteCallback)
        {
                eError = psItem->pfnFreeResource(psItem->pvParam, psItem->ui32Param, bForceCleanup);
@@ -614,10 +614,10 @@ static PVRSRV_ERROR FreeResourceByPtr(RESMAN_ITEM *psItem,
                }
        }
 
-       
+
        ACQUIRE_SYNC_OBJ;
 
-       
+
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RESMAN_ITEM), psItem, IMG_NULL);
 
        return(eError);
@@ -635,17 +635,17 @@ static IMG_VOID* FreeResourceByCriteria_AnyVaCb(RESMAN_ITEM *psCurItem, va_list
        pvParam = va_arg(va, IMG_PVOID);
        ui32Param = va_arg(va, IMG_UINT32);
 
-       
+
        if(
-       
+
                (((ui32SearchCriteria & RESMAN_CRITERIA_RESTYPE) == 0UL) ||
                (psCurItem->ui32ResType == ui32ResType))
        &&
-       
+
                (((ui32SearchCriteria & RESMAN_CRITERIA_PVOID_PARAM) == 0UL) ||
                         (psCurItem->pvParam == pvParam))
        &&
-       
+
                (((ui32SearchCriteria & RESMAN_CRITERIA_UI32_PARAM) == 0UL) ||
                         (psCurItem->ui32Param == ui32Param))
                )
@@ -668,8 +668,8 @@ static PVRSRV_ERROR FreeResourceByCriteria(PRESMAN_CONTEXT  psResManContext,
        PRESMAN_ITEM    psCurItem;
        PVRSRV_ERROR    eError = PVRSRV_OK;
 
-       
-       
+
+
        while((psCurItem = (PRESMAN_ITEM)
                                List_RESMAN_ITEM_Any_va(psResManContext->psResItemList,
                                                                                &FreeResourceByCriteria_AnyVaCb,
@@ -692,7 +692,7 @@ static IMG_VOID ValidateResList(PRESMAN_LIST psResList)
        PRESMAN_ITEM    psCurItem, *ppsThisItem;
        PRESMAN_CONTEXT psCurContext, *ppsThisContext;
 
-       
+
        if (psResList == IMG_NULL)
        {
                PVR_DPF((PVR_DBG_MESSAGE, "ValidateResList: resman not initialised yet"));
@@ -702,10 +702,10 @@ static IMG_VOID ValidateResList(PRESMAN_LIST psResList)
        psCurContext = psResList->psContextList;
        ppsThisContext = &psResList->psContextList;
 
-       
+
        while(psCurContext != IMG_NULL)
        {
-               
+
                PVR_ASSERT(psCurContext->ui32Signature == RESMAN_SIGNATURE);
                if (psCurContext->ppsThis != ppsThisContext)
                {
@@ -718,12 +718,12 @@ static IMG_VOID ValidateResList(PRESMAN_LIST psResList)
                        PVR_ASSERT(psCurContext->ppsThis == ppsThisContext);
                }
 
-               
+
                psCurItem = psCurContext->psResItemList;
                ppsThisItem = &psCurContext->psResItemList;
                while(psCurItem != IMG_NULL)
                {
-                       
+
                        PVR_ASSERT(psCurItem->ui32Signature == RESMAN_SIGNATURE);
                        if (psCurItem->ppsThis != ppsThisItem)
                        {
@@ -736,16 +736,16 @@ static IMG_VOID ValidateResList(PRESMAN_LIST psResList)
                                PVR_ASSERT(psCurItem->ppsThis == ppsThisItem);
                        }
 
-                       
+
                        ppsThisItem = &psCurItem->psNext;
                        psCurItem = psCurItem->psNext;
                }
 
-               
+
                ppsThisContext = &psCurContext->psNext;
                psCurContext = psCurContext->psNext;
        }
 }
-#endif 
+#endif
 
 
diff --git a/drivers/staging/mrst/pvr/services4/srvkm/common/ttrace.c b/drivers/staging/mrst/pvr/services4/srvkm/common/ttrace.c
new file mode 100644 (file)
index 0000000..b2d0e74
--- /dev/null
@@ -0,0 +1,578 @@
+/**********************************************************************
+ *
+ * Copyright (C) Imagination Technologies Ltd. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * The full GNU General Public License is included in this distribution in
+ * the file called "COPYING".
+ *
+ * Contact Information:
+ * Imagination Technologies Ltd. <gpl-support@imgtec.com>
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ *
+*****************************************************************************/
+#if defined (TTRACE)
+
+#include "services_headers.h"
+#include "ttrace.h"
+
+#define CHECKSIZE(n,m) \
+       if ((n & m) != n) \
+               PVR_DPF((PVR_DBG_ERROR,"Size check failed for " #m)) \
+
+#define TIME_TRACE_HASH_TABLE_SIZE     32
+
+HASH_TABLE *g_psBufferTable;
+IMG_UINT32 g_ui32HostUID;
+IMG_HANDLE g_psTimer;
+
+/* Trace buffer struct */
+typedef struct
+{
+       IMG_UINT32      ui32Woff;       /* Offset to where next item will be written */
+       IMG_UINT32      ui32Roff;       /* Offset to where to start reading from */
+       IMG_UINT32      ui32ByteCount;  /* Number of bytes in buffer */
+       IMG_UINT8       ui8Data[0];
+} sTimeTraceBuffer;
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVTimeTraceItemSize
+
+ @Description
+
+ Calculate the size of a trace item
+
+ @Input psTraceItem :  Trace item
+
+ @Return size of trace item
+
+******************************************************************************/
+static IMG_UINT32
+PVRSRVTimeTraceItemSize(IMG_UINT32 *psTraceItem)
+{
+       IMG_UINT32 ui32Size = PVRSRV_TRACE_ITEM_SIZE;
+
+       ui32Size += READ_HEADER(SIZE, psTraceItem[PVRSRV_TRACE_DATA_HEADER]);
+
+       return ui32Size;
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVTimeTraceAllocItem
+
+ @Description
+
+ Allocate a trace item from the buffer of the current process
+
+ @Output ppsTraceItem :        Pointer to allocated trace item
+
+ @Input ui32Size : Size of data packet to be allocated
+
+ @Return none
+
+******************************************************************************/
+static IMG_VOID
+PVRSRVTimeTraceAllocItem(IMG_UINT32 **pui32Item, IMG_UINT32 ui32Size)
+{
+       IMG_UINT32 ui32PID = OSGetCurrentProcessIDKM();
+       IMG_UINT32 ui32AllocOffset;
+       sTimeTraceBuffer *psBuffer = (sTimeTraceBuffer *) HASH_Retrieve(g_psBufferTable, (IMG_UINTPTR_T) ui32PID);
+
+       /* The caller only asks for extra data space */
+       ui32Size += PVRSRV_TRACE_ITEM_SIZE;
+
+       /* Always round to 32-bit */
+       ui32Size = ((ui32Size - 1) & (~0x3)) + 0x04;
+
+       if (!psBuffer)
+       {
+               PVRSRV_ERROR eError;
+
+               PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVTimeTraceAllocItem: Creating buffer for PID %u", (IMG_UINT32) ui32PID));
+               eError = PVRSRVTimeTraceBufferCreate(ui32PID);
+               if (eError != PVRSRV_OK)
+               {
+                       *pui32Item = IMG_NULL;
+                       PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceAllocItem: Failed to create buffer"));
+                       return;
+               }
+
+               psBuffer = (sTimeTraceBuffer *) HASH_Retrieve(g_psBufferTable, (IMG_UINTPTR_T) ui32PID);
+               if (psBuffer == IMG_NULL)
+               {
+                       *pui32Item = NULL;
+                       PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceAllocItem: Failed to retrieve buffer"));
+                       return;
+               }
+       }
+
+       /* Can't allocate more then buffer size */
+       if (ui32Size >= TIME_TRACE_BUFFER_SIZE)
+       {
+               *pui32Item = NULL;
+               PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceAllocItem: Error trace item too large (%d)", ui32Size));
+               return;
+       }
+
+       /* FIXME: Enter critical section? */
+
+       /* Always ensure we have enough space to write a padding message */
+       if ((psBuffer->ui32Woff + ui32Size + PVRSRV_TRACE_ITEM_SIZE) > TIME_TRACE_BUFFER_SIZE)
+       {
+               IMG_UINT32 *ui32WriteEOB = (IMG_UINT32 *) &psBuffer->ui8Data[psBuffer->ui32Woff];
+               IMG_UINT32 ui32Remain = TIME_TRACE_BUFFER_SIZE - psBuffer->ui32Woff;
+
+               /* Not enough space at the end of the buffer, back to the start */
+               *ui32WriteEOB++ = WRITE_HEADER(GROUP, PVRSRV_TRACE_GROUP_PADDING);
+               *ui32WriteEOB++ = 0;            /* Don't need timestamp */
+               *ui32WriteEOB++ = 0;            /* Don't need UID */
+               *ui32WriteEOB = WRITE_HEADER(SIZE, (ui32Remain - PVRSRV_TRACE_ITEM_SIZE));
+               psBuffer->ui32ByteCount += ui32Remain;
+               psBuffer->ui32Woff = ui32AllocOffset = 0;
+       }
+       else
+               ui32AllocOffset = psBuffer->ui32Woff;
+
+       psBuffer->ui32Woff = psBuffer->ui32Woff + ui32Size;
+       psBuffer->ui32ByteCount += ui32Size;
+
+       /* This allocation will start overwritting past our read pointer, move the read pointer along */
+       while (psBuffer->ui32ByteCount > TIME_TRACE_BUFFER_SIZE)
+       {
+               IMG_UINT32 *psReadItem = (IMG_UINT32 *) &psBuffer->ui8Data[psBuffer->ui32Roff];
+               IMG_UINT32 ui32ReadSize;
+
+               ui32ReadSize = PVRSRVTimeTraceItemSize(psReadItem);
+               psBuffer->ui32Roff = (psBuffer->ui32Roff + ui32ReadSize) & (TIME_TRACE_BUFFER_SIZE - 1);
+               psBuffer->ui32ByteCount -= ui32ReadSize;
+       }
+
+       *pui32Item = (IMG_UINT32 *) &psBuffer->ui8Data[ui32AllocOffset];
+       /* FIXME: Exit critical section? */
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVTimeTraceBufferCreate
+
+ @Description
+
+ Create a trace buffer.
+
+ Note: We assume that this will only be called once per process.
+
+ @Input ui32PID : PID of the process that is creating the buffer
+
+ @Return none
+
+******************************************************************************/
+PVRSRV_ERROR PVRSRVTimeTraceBufferCreate(IMG_UINT32 ui32PID)
+{
+       sTimeTraceBuffer *psBuffer;
+       PVRSRV_ERROR eError = PVRSRV_OK;
+
+       eError = OSAllocMem(PVRSRV_PAGEABLE_SELECT,
+                                       sizeof(sTimeTraceBuffer) + TIME_TRACE_BUFFER_SIZE,
+                                       (IMG_VOID **)&psBuffer, IMG_NULL,
+                                       "Time Trace Buffer");
+       if (eError != PVRSRV_OK)
+       {
+               PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceBufferCreate: Error allocating trace buffer"));
+               return eError;
+       }
+
+       OSMemSet(psBuffer, 0, TIME_TRACE_BUFFER_SIZE);
+
+       if (!HASH_Insert(g_psBufferTable, (IMG_UINTPTR_T) ui32PID, (IMG_UINTPTR_T) psBuffer))
+       {
+               OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(sTimeTraceBuffer) + TIME_TRACE_BUFFER_SIZE,
+                               psBuffer, NULL);
+               PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceBufferCreate: Error adding trace buffer to hash table"));
+               return PVRSRV_ERROR_OUT_OF_MEMORY;
+       }
+
+       return eError;
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVTimeTraceBufferDestroy
+
+ @Description
+
+ Destroy a trace buffer.
+
+ Note: We assume that this will only be called once per process.
+
+ @Input ui32PID : PID of the process that is creating the buffer
+
+ @Return none
+
+******************************************************************************/
+PVRSRV_ERROR PVRSRVTimeTraceBufferDestroy(IMG_UINT32 ui32PID)
+{
+       sTimeTraceBuffer *psBuffer;
+
+#if defined(DUMP_TTRACE_BUFFERS_ON_EXIT)
+       PVRSRVDumpTimeTraceBuffers();
+#endif
+       psBuffer = (sTimeTraceBuffer *) HASH_Retrieve(g_psBufferTable, (IMG_UINTPTR_T) ui32PID);
+       if (psBuffer)
+       {
+               OSFreeMem(PVRSRV_PAGEABLE_SELECT, sizeof(sTimeTraceBuffer) + TIME_TRACE_BUFFER_SIZE,
+                               psBuffer, NULL);
+               HASH_Remove(g_psBufferTable, (IMG_UINTPTR_T) ui32PID);
+               return PVRSRV_OK;
+       }
+
+       PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceBufferDestroy: Can't find trace buffer in hash table"));
+       return PVRSRV_ERROR_INVALID_PARAMS;
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVTimeTraceInit
+
+ @Description
+
+ Initialise the timed trace subsystem.
+
+ @Return Error
+
+******************************************************************************/
+PVRSRV_ERROR PVRSRVTimeTraceInit(IMG_VOID)
+{
+       g_psBufferTable = HASH_Create(TIME_TRACE_HASH_TABLE_SIZE);
+
+       /* Create hash table to store the per process buffers in */
+       if (!g_psBufferTable)
+       {
+               PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceInit: Error creating hash table"));
+               return PVRSRV_ERROR_OUT_OF_MEMORY;
+       }
+
+       /* Create the kernel buffer */
+       PVRSRVTimeTraceBufferCreate(KERNEL_ID);
+
+       g_psTimer = OSFuncHighResTimerCreate();
+
+       if (!g_psTimer)
+       {
+               PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceInit: Error creating timer"));
+               return PVRSRV_ERROR_INIT_FAILURE;
+       }
+       return PVRSRV_OK;
+}
+
+static PVRSRV_ERROR _PVRSRVTimeTraceBufferDestroy(IMG_UINTPTR_T hKey, IMG_UINTPTR_T hData)
+{
+       PVR_UNREFERENCED_PARAMETER(hData);
+       PVR_DPF((PVR_DBG_MESSAGE, "_PVRSRVTimeTraceBufferDestroy: Destroying buffer for PID %u", (IMG_UINT32) hKey));
+
+       PVRSRVTimeTraceBufferDestroy(hKey);
+       return PVRSRV_OK;
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVTimeTraceDeinit
+
+ @Description
+
+  De-initialise the timed trace subsystem.
+
+ @Return Error
+
+******************************************************************************/
+IMG_VOID PVRSRVTimeTraceDeinit(IMG_VOID)
+{
+       PVRSRVTimeTraceBufferDestroy(KERNEL_ID);
+       /* Free any buffers the where created at alloc item time */
+       HASH_Iterate(g_psBufferTable, _PVRSRVTimeTraceBufferDestroy);
+       HASH_Delete(g_psBufferTable);
+       OSFuncHighResTimerDestroy(g_psTimer);
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVTimeTraceWriteHeader
+
+ @Description
+
+ Write the header for a trace item.
+
+ @Input pui32TraceItem : Pointer to trace item
+
+ @Input ui32Group : Trace item's group ID
+
+ @Input ui32Class : Trace item's class ID
+
+ @Input ui32Token : Trace item's ui32Token ID
+
+ @Input ui32Size : Trace item's data payload size
+
+ @Input ui32Type : Trace item's data type
+
+ @Input ui32Count : Trace item's data count
+
+ @Return Pointer to data payload space, or NULL if no data payload
+
+******************************************************************************/
+#ifdef INLINE_IS_PRAGMA
+#pragma inline(PVRSRVTimeTraceWriteHeader)
+#endif
+static INLINE IMG_VOID *PVRSRVTimeTraceWriteHeader(IMG_UINT32 *pui32TraceItem, IMG_UINT32 ui32Group,
+                                                       IMG_UINT32 ui32Class, IMG_UINT32 ui32Token,
+                                                       IMG_UINT32 ui32Size, IMG_UINT32 ui32Type,
+                                                       IMG_UINT32 ui32Count)
+{
+       /* Sanity check arg's */
+       CHECKSIZE(ui32Group, PVRSRV_TRACE_GROUP_MASK);
+       CHECKSIZE(ui32Class, PVRSRV_TRACE_CLASS_MASK);
+       CHECKSIZE(ui32Token, PVRSRV_TRACE_TOKEN_MASK);
+
+       CHECKSIZE(ui32Size, PVRSRV_TRACE_SIZE_MASK);
+       CHECKSIZE(ui32Type, PVRSRV_TRACE_TYPE_MASK);
+       CHECKSIZE(ui32Count, PVRSRV_TRACE_COUNT_MASK);
+
+       /* Trace header */
+       pui32TraceItem[PVRSRV_TRACE_HEADER] = WRITE_HEADER(GROUP, ui32Group);
+       pui32TraceItem[PVRSRV_TRACE_HEADER] |= WRITE_HEADER(CLASS, ui32Class);
+       pui32TraceItem[PVRSRV_TRACE_HEADER] |= WRITE_HEADER(TOKEN, ui32Token);
+
+       /* Data header */
+       pui32TraceItem[PVRSRV_TRACE_DATA_HEADER] = WRITE_HEADER(SIZE, ui32Size);
+       pui32TraceItem[PVRSRV_TRACE_DATA_HEADER] |= WRITE_HEADER(TYPE, ui32Type);
+       pui32TraceItem[PVRSRV_TRACE_DATA_HEADER] |= WRITE_HEADER(COUNT, ui32Count);
+
+       pui32TraceItem[PVRSRV_TRACE_TIMESTAMP] = OSFuncHighResTimerGetus(g_psTimer);
+       pui32TraceItem[PVRSRV_TRACE_HOSTUID] = g_ui32HostUID++;
+
+       return ui32Size?((IMG_VOID *) &pui32TraceItem[PVRSRV_TRACE_DATA_PAYLOAD]):NULL;
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVTimeTraceArray
+
+ @Description
+
+ Write trace item with an array of data
+
+ @Input ui32Group : Trace item's group ID
+
+ @Input ui32Class : Trace item's class ID
+
+ @Input ui32Token : Trace item's ui32Token ID
+
+ @Input ui32Size : Trace item's data payload size
+
+ @Input ui32Type : Trace item's data type
+
+ @Input ui32Count : Trace item's data count
+
+ @Input pui8Data : Pointer to data array
+
+ @Return Pointer to data payload space, or NULL if no data payload
+
+******************************************************************************/
+IMG_VOID PVRSRVTimeTraceArray(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class, IMG_UINT32 ui32Token,
+                               IMG_UINT32 ui32Type, IMG_UINT32 ui32Count, IMG_UINT8 *pui8Data)
+{
+       IMG_UINT32 *pui32TraceItem;
+       IMG_UINT32 ui32Size, ui32TypeSize;
+       IMG_UINT8 *ui8Ptr;
+
+       /* Only the 1st 4 sizes are for ui types, others are "special" */
+       switch (ui32Type)
+       {
+               case PVRSRV_TRACE_TYPE_UI8:     ui32TypeSize = 1;
+                                               break;
+               case PVRSRV_TRACE_TYPE_UI16:    ui32TypeSize = 2;
+                                               break;
+               case PVRSRV_TRACE_TYPE_UI32:    ui32TypeSize = 4;
+                                               break;
+               case PVRSRV_TRACE_TYPE_UI64:    ui32TypeSize = 8;
+                                               break;
+               default:
+                       PVR_DPF((PVR_DBG_ERROR, "Unsupported size\n"));
+                       return;
+       }
+
+       ui32Size = ui32TypeSize * ui32Count;
+
+       /* Allocate space from the buffer */
+       PVRSRVTimeTraceAllocItem(&pui32TraceItem, ui32Size);
+
+       if (!pui32TraceItem)
+       {
+               PVR_DPF((PVR_DBG_ERROR, "Can't find buffer\n"));
+               return;
+       }
+
+       ui8Ptr = PVRSRVTimeTraceWriteHeader(pui32TraceItem, ui32Group, ui32Class, ui32Token,
+                                               ui32Size, ui32Type, ui32Count);
+
+       if (ui8Ptr)
+       {
+               OSMemCopy(ui8Ptr, pui8Data, ui32Size);
+       }
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVTimeTraceSyncObject
+
+ @Description
+
+ Write trace item with a sync object
+
+ @Input ui32Group : Trace item's group ID
+
+ @Input ui32Token : Trace item's ui32Token ID
+
+ @Input psSync : Sync object
+
+ @Input ui8SyncOpp : Sync object operation
+
+ @Return None
+
+******************************************************************************/
+IMG_VOID PVRSRVTimeTraceSyncObject(IMG_UINT32 ui32Group, IMG_UINT32 ui32Token,
+                                  PVRSRV_KERNEL_SYNC_INFO *psSync, IMG_UINT8 ui8SyncOp)
+{
+       IMG_UINT32 *pui32TraceItem;
+       IMG_UINT32 *ui32Ptr;
+       IMG_UINT32 ui32Size = PVRSRV_TRACE_TYPE_SYNC_SIZE;
+
+
+       PVRSRVTimeTraceAllocItem(&pui32TraceItem, ui32Size);
+
+       if (!pui32TraceItem)
+       {
+               PVR_DPF((PVR_DBG_ERROR, "Can't find buffer\n"));
+               return;
+       }
+
+       ui32Ptr = PVRSRVTimeTraceWriteHeader(pui32TraceItem, ui32Group, PVRSRV_TRACE_CLASS_SYNC,
+                                               ui32Token, ui32Size, PVRSRV_TRACE_TYPE_SYNC, 1);
+
+       ui32Ptr[PVRSRV_TRACE_SYNC_UID] = psSync->ui32UID;
+       ui32Ptr[PVRSRV_TRACE_SYNC_WOP] = psSync->psSyncData->ui32WriteOpsPending;
+       ui32Ptr[PVRSRV_TRACE_SYNC_WOC] = psSync->psSyncData->ui32WriteOpsComplete;
+       ui32Ptr[PVRSRV_TRACE_SYNC_ROP] = psSync->psSyncData->ui32ReadOpsPending;
+       ui32Ptr[PVRSRV_TRACE_SYNC_ROC] = psSync->psSyncData->ui32ReadOpsComplete;
+       ui32Ptr[PVRSRV_TRACE_SYNC_RO2P] = psSync->psSyncData->ui32ReadOps2Pending;
+       ui32Ptr[PVRSRV_TRACE_SYNC_RO2C] = psSync->psSyncData->ui32ReadOps2Complete;
+       ui32Ptr[PVRSRV_TRACE_SYNC_WO_DEV_VADDR] = psSync->sWriteOpsCompleteDevVAddr.uiAddr;
+       ui32Ptr[PVRSRV_TRACE_SYNC_RO_DEV_VADDR] = psSync->sReadOpsCompleteDevVAddr.uiAddr;
+       ui32Ptr[PVRSRV_TRACE_SYNC_RO2_DEV_VADDR] = psSync->sReadOps2CompleteDevVAddr.uiAddr;
+       ui32Ptr[PVRSRV_TRACE_SYNC_OP] = ui8SyncOp;
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVDumpTimeTraceBuffer
+
+ @Description
+
+ Dump the contents of the trace buffer.
+
+ @Input hKey : Trace item's group ID
+
+ @Input hData : Trace item's ui32Token ID
+
+ @Return Error
+
+******************************************************************************/
+static PVRSRV_ERROR PVRSRVDumpTimeTraceBuffer(IMG_UINTPTR_T hKey, IMG_UINTPTR_T hData)
+{
+       sTimeTraceBuffer *psBuffer = (sTimeTraceBuffer *) hData;
+       IMG_UINT32 ui32ByteCount = psBuffer->ui32ByteCount;
+       IMG_UINT32 ui32Walker = psBuffer->ui32Roff;
+       IMG_UINT32 ui32Read, ui32LineLen, ui32EOL, ui32MinLine;
+
+       PVR_DPF((PVR_DBG_ERROR, "TTB for PID %u:\n", (IMG_UINT32) hKey));
+
+       while (ui32ByteCount)
+       {
+               IMG_UINT32 *pui32Buffer = (IMG_UINT32 *) &psBuffer->ui8Data[ui32Walker];
+
+               ui32LineLen = (ui32ByteCount/sizeof(IMG_UINT32));
+               ui32EOL = (TIME_TRACE_BUFFER_SIZE - ui32Walker)/sizeof(IMG_UINT32);
+               ui32MinLine = (ui32LineLen < ui32EOL)?ui32LineLen:ui32EOL;
+
+               if (ui32MinLine >= 4)
+               {
+                       PVR_DPF((PVR_DBG_ERROR, "\t(TTB-%X) %08X %08X %08X %08X", ui32ByteCount,
+                                       pui32Buffer[0], pui32Buffer[1], pui32Buffer[2], pui32Buffer[3]));
+                       ui32Read = 4 * sizeof(IMG_UINT32);
+               }
+               else if (ui32MinLine >= 3)
+               {
+                       PVR_DPF((PVR_DBG_ERROR, "\t(TTB-%X) %08X %08X %08X", ui32ByteCount,
+                                       pui32Buffer[0], pui32Buffer[1], pui32Buffer[2]));
+                       ui32Read = 3 * sizeof(IMG_UINT32);
+               }
+               else if (ui32MinLine >= 2)
+               {
+                       PVR_DPF((PVR_DBG_ERROR, "\t(TTB-%X) %08X %08X", ui32ByteCount,
+                                       pui32Buffer[0], pui32Buffer[1]));
+                       ui32Read = 2 * sizeof(IMG_UINT32);
+               }
+               else
+               {
+                       PVR_DPF((PVR_DBG_ERROR, "\t(TTB-%X) %08X", ui32ByteCount,
+                                       pui32Buffer[0]));
+                       ui32Read = sizeof(IMG_UINT32);
+               }
+
+               ui32Walker = (ui32Walker + ui32Read) & (TIME_TRACE_BUFFER_SIZE - 1);
+               ui32ByteCount -= ui32Read;
+       }
+
+       return PVRSRV_OK;
+}
+
+/*!
+******************************************************************************
+
+ @Function     PVRSRVDumpTimeTraceBuffers
+
+ @Description
+
+ Dump the contents of all the trace buffers.
+
+ @Return None
+
+******************************************************************************/
+IMG_VOID PVRSRVDumpTimeTraceBuffers(IMG_VOID)
+{
+       HASH_Iterate(g_psBufferTable, PVRSRVDumpTimeTraceBuffer);
+}
+
+#endif /* TTRACE */
old mode 100755 (executable)
new mode 100644 (file)
index 761cd4c..49bf6c6
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 
 typedef struct _MMU_PT_INFO_
 {
-       
+
        IMG_VOID *hPTPageOSMemHandle;
        IMG_CPU_VIRTADDR PTPageCpuVAddr;
-       
-       
+
+
        IMG_UINT32 ui32ValidPTECount;
 } MMU_PT_INFO;
 
 struct _MMU_CONTEXT_
 {
-       
+
        PVRSRV_DEVICE_NODE *psDeviceNode;
 
-       
+
        IMG_CPU_VIRTADDR pvPDCpuVAddr;
        IMG_DEV_PHYADDR sPDDevPAddr;
 
        IMG_VOID *hPDOSMemHandle;
 
-       
+
        MMU_PT_INFO *apsPTInfoList[SGX_MAX_PD_ENTRIES];
 
        PVRSRV_SGXDEV_INFO *psDevInfo;
@@ -118,54 +118,54 @@ struct _MMU_CONTEXT_
 
 struct _MMU_HEAP_
 {
-       
+
        MMU_CONTEXT                     *psMMUContext;
 
-       
 
-       
+
+
        IMG_UINT32                      ui32PDBaseIndex;
-       
+
        IMG_UINT32                      ui32PageTableCount;
-       
+
        IMG_UINT32                      ui32PTETotalUsable;
-       
+
        IMG_UINT32                      ui32PDEPageSizeCtrl;
 
-       
 
-       
+
+
        IMG_UINT32                      ui32DataPageSize;
-       
+
        IMG_UINT32                      ui32DataPageBitWidth;
-       
+
        IMG_UINT32                      ui32DataPageMask;
 
-       
 
-       
+
+
        IMG_UINT32                      ui32PTShift;
-       
+
        IMG_UINT32                      ui32PTBitWidth;
-       
+
        IMG_UINT32                      ui32PTMask;
-       
+
        IMG_UINT32                      ui32PTSize;
-       
+
        IMG_UINT32                      ui32PTNumEntriesAllocated;
-       
+
        IMG_UINT32                      ui32PTNumEntriesUsable;
 
-       
 
-       
+
+
        IMG_UINT32                      ui32PDShift;
-       
+
        IMG_UINT32                      ui32PDBitWidth;
-       
+
        IMG_UINT32                      ui32PDMask;
 
-       
+
 
        RA_ARENA *psVMArena;
        DEV_ARENA_DESCRIPTOR *psDevArena;
@@ -190,7 +190,7 @@ MMU_PDumpPageTables (MMU_HEAP *pMMUHeap,
                                         IMG_SIZE_T uSize,
                                         IMG_BOOL bForUnmap,
                                         IMG_HANDLE hUniqueTag);
-#endif 
+#endif
 
 #define PAGE_TEST                                      0
 #if PAGE_TEST
@@ -228,7 +228,7 @@ static IMG_VOID CheckPT(MMU_PT_INFO *psPTInfoList)
        IMG_UINT32 *p = (IMG_UINT32*) psPTInfoList->PTPageCpuVAddr;
        IMG_UINT32 i, ui32Count = 0;
 
-       
+
        for(i = 0; i < 1024; i++)
                if(p[i] & SGX_MMU_PTE_VALID)
                        ui32Count++;
@@ -241,13 +241,127 @@ static IMG_VOID CheckPT(MMU_PT_INFO *psPTInfoList)
                BUG();
        }
 }
-#else 
+#else
 static INLINE IMG_VOID CheckPT(MMU_PT_INFO *psPTInfoList)
 {
        PVR_UNREFERENCED_PARAMETER(psPTInfoList);
 }
-#endif 
+#endif
+
+#if defined(PVRSRV_MMU_MAKE_READWRITE_ON_DEMAND)
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
+#ifndef AUTOCONF_INCLUDED
+#include <linux/config.h>
+#endif
+#else
+#include <generated/autoconf.h>
+#endif
+
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/highmem.h>
+#include <asm/pgtable.h>
+#include <asm/tlbflush.h>
+
+static IMG_VOID MakeKernelPageReadWrite(IMG_PVOID ulCPUVAddr)
+{
+    pgd_t *psPGD;
+    pud_t *psPUD;
+    pmd_t *psPMD;
+    pte_t *psPTE;
+    pte_t ptent;
+    spinlock_t *psPTLock;
+    IMG_UINT32 ui32CPUVAddr = (IMG_UINT32) ulCPUVAddr;
+    struct mm_struct *psMM = current->active_mm;
+
+
+    psPGD = pgd_offset(psMM, ui32CPUVAddr);
+    if (pgd_none(*psPGD) || pgd_bad(*psPGD))
+    {
+        PVR_ASSERT(0);
+    }
+
+    psPUD = pud_offset(psPGD, ui32CPUVAddr);
+    if (pud_none(*psPUD) || pud_bad(*psPUD))
+    {
+        PVR_ASSERT(0);
+    }
+
+    psPMD = pmd_offset(psPUD, ui32CPUVAddr);
+    if (pmd_none(*psPMD) || pmd_bad(*psPMD))
+    {
+        PVR_ASSERT(0);
+    }
+
+    psPTE = (pte_t *)pte_offset_map_lock(psMM, psPMD, ui32CPUVAddr, &psPTLock);
+
+       ptent = ptep_modify_prot_start(psMM, ui32CPUVAddr, psPTE);
+       ptent = pte_mkwrite(ptent);
+       ptep_modify_prot_commit(psMM, ui32CPUVAddr, psPTE, ptent);
+       pte_unmap_unlock(psPTE, psPTLock);
+
+       flush_tlb_all();
+}
+
+static IMG_VOID MakeKernelPageReadOnly(IMG_PVOID ulCPUVAddr)
+{
+    pgd_t *psPGD;
+    pud_t *psPUD;
+    pmd_t *psPMD;
+    pte_t *psPTE;
+    pte_t ptent;
+    spinlock_t *psPTLock;
+    IMG_UINT32 ui32CPUVAddr = (IMG_UINT32) ulCPUVAddr;
+    struct mm_struct *psMM = current->active_mm;
+
+       OSWriteMemoryBarrier();
+
+    psPGD = pgd_offset(psMM, ui32CPUVAddr);
+    if (pgd_none(*psPGD) || pgd_bad(*psPGD))
+    {
+        PVR_ASSERT(0);
+    }
 
+    psPUD = pud_offset(psPGD, ui32CPUVAddr);
+    if (pud_none(*psPUD) || pud_bad(*psPUD))
+    {
+        PVR_ASSERT(0);
+    }
+
+    psPMD = pmd_offset(psPUD, ui32CPUVAddr);
+    if (pmd_none(*psPMD) || pmd_bad(*psPMD))
+    {
+        PVR_ASSERT(0);
+    }
+
+
+    psPTE = (pte_t *)pte_offset_map_lock(psMM, psPMD, ui32CPUVAddr, &psPTLock);
+
+       ptent = ptep_modify_prot_start(psMM, ui32CPUVAddr, psPTE);
+       ptent = pte_wrprotect(ptent);
+       ptep_modify_prot_commit(psMM, ui32CPUVAddr, psPTE, ptent);
+       pte_unmap_unlock(psPTE, psPTLock);
+
+       flush_tlb_all();
+
+}
+
+#else
+
+static INLINE IMG_VOID MakeKernelPageReadWrite(IMG_PVOID ulCPUVAddr)
+{
+       PVR_UNREFERENCED_PARAMETER(ulCPUVAddr);
+}
+
+static INLINE IMG_VOID MakeKernelPageReadOnly(IMG_PVOID ulCPUVAddr)
+{
+       PVR_UNREFERENCED_PARAMETER(ulCPUVAddr);
+}
+
+#endif
 
 IMG_BOOL MMU_IsHeapShared(MMU_HEAP* pMMUHeap)
 {
@@ -274,7 +388,7 @@ EnableHostAccess (MMU_CONTEXT *psMMUContext)
        IMG_UINT32 ui32RegVal;
        IMG_VOID *pvRegsBaseKM = psMMUContext->psDevInfo->pvRegsBaseKM;
 
-       
+
 
 
        ui32RegVal = OSReadHWReg(pvRegsBaseKM, EUR_CR_BIF_CTRL);
@@ -282,7 +396,7 @@ EnableHostAccess (MMU_CONTEXT *psMMUContext)
        OSWriteHWReg(pvRegsBaseKM,
                                EUR_CR_BIF_CTRL,
                                ui32RegVal | EUR_CR_BIF_CTRL_MMU_BYPASS_HOST_MASK);
-       
+
        PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, EUR_CR_BIF_CTRL_MMU_BYPASS_HOST_MASK);
 }
 
@@ -292,14 +406,14 @@ DisableHostAccess (MMU_CONTEXT *psMMUContext)
        IMG_UINT32 ui32RegVal;
        IMG_VOID *pvRegsBaseKM = psMMUContext->psDevInfo->pvRegsBaseKM;
 
-       
+
 
 
 
        OSWriteHWReg(pvRegsBaseKM,
                                EUR_CR_BIF_CTRL,
                                ui32RegVal & ~EUR_CR_BIF_CTRL_MMU_BYPASS_HOST_MASK);
-       
+
        PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, 0);
 }
 #endif
@@ -311,18 +425,18 @@ static IMG_VOID MMU_InvalidateSystemLevelCache(PVRSRV_SGXDEV_INFO *psDevInfo)
        #if defined(SGX_FEATURE_MP)
        psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_SL;
        #else
-       
+
        PVR_UNREFERENCED_PARAMETER(psDevInfo);
-       #endif 
+       #endif
 }
-#endif 
+#endif
 
 IMG_VOID MMU_InvalidateDirectoryCache(PVRSRV_SGXDEV_INFO *psDevInfo)
 {
        psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_PD;
        #if defined(SGX_FEATURE_SYSTEM_CACHE)
        MMU_InvalidateSystemLevelCache(psDevInfo);
-       #endif 
+       #endif
 }
 
 
@@ -331,7 +445,7 @@ static IMG_VOID MMU_InvalidatePageTableCache(PVRSRV_SGXDEV_INFO *psDevInfo)
        psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_PT;
        #if defined(SGX_FEATURE_SYSTEM_CACHE)
        MMU_InvalidateSystemLevelCache(psDevInfo);
-       #endif 
+       #endif
 }
 
 #if defined(FIX_HW_BRN_31620)
@@ -339,7 +453,7 @@ static IMG_VOID BRN31620InvalidatePageTableEntry(MMU_CONTEXT *psMMUContext, IMG_
 {
        PVRSRV_SGXDEV_INFO *psDevInfo = psMMUContext->psDevInfo;
 
-       
+
        if (((ui32PDIndex % (BRN31620_PDE_CACHE_FILL_SIZE/BRN31620_PT_ADDRESS_RANGE_SIZE)) == BRN31620_DUMMY_PDE_INDEX)
                && (ui32PTIndex == BRN31620_DUMMY_PTE_INDEX))
        {
@@ -364,13 +478,13 @@ static IMG_BOOL BRN31620FreePageTable(MMU_HEAP *psMMUHeap, IMG_UINT32 ui32PDInde
 
        PVR_ASSERT(psMMUHeap != IMG_NULL);
 
-       
+
        PVR_ASSERT(psMMUContext->apsPTInfoListSave[ui32PDIndex] == IMG_NULL);
 
        psMMUContext->apsPTInfoListSave[ui32PDIndex] = psMMUContext->apsPTInfoList[ui32PDIndex];
        psMMUContext->apsPTInfoList[ui32PDIndex] = IMG_NULL;
 
-       
+
        if (--psMMUContext->ui32PDCacheRangeRefCount[ui32PDCacheLine] == 0)
        {
                IMG_UINT32 i;
@@ -378,10 +492,10 @@ static IMG_BOOL BRN31620FreePageTable(MMU_HEAP *psMMUHeap, IMG_UINT32 ui32PDInde
                IMG_UINT32 ui32PDIndexEnd = ui32PDIndexStart + BRN31620_PDES_PER_CACHE_LINE_SIZE;
                IMG_UINT32 ui32PDBitMaskIndex, ui32PDBitMaskShift;
 
-               
+
                for (i=ui32PDIndexStart;i<ui32PDIndexEnd;i++)
                {
-                       
+
                        psMMUContext->apsPTInfoList[i] = psMMUContext->apsPTInfoListSave[i];
                        psMMUContext->apsPTInfoListSave[i] = IMG_NULL;
                        _DeferredFreePageTable(psMMUHeap, i - psMMUHeap->ui32PDBaseIndex, IMG_TRUE);
@@ -390,22 +504,24 @@ static IMG_BOOL BRN31620FreePageTable(MMU_HEAP *psMMUHeap, IMG_UINT32 ui32PDInde
                ui32PDBitMaskIndex = ui32PDCacheLine >> BRN31620_CACHE_FLUSH_BITS_SHIFT;
                ui32PDBitMaskShift = ui32PDCacheLine & BRN31620_CACHE_FLUSH_BITS_MASK;
 
-               
+
                if (MMU_IsHeapShared(psMMUHeap))
                {
-                       
+
                        MMU_CONTEXT *psMMUContextWalker = (MMU_CONTEXT*) psMMUHeap->psMMUContext->psDevInfo->pvMMUContextList;
 
                        while(psMMUContextWalker)
                        {
                                psMMUContextWalker->ui32PDChangeMask[ui32PDBitMaskIndex] |= 1 << ui32PDBitMaskShift;
 
-                               
+
+                               MakeKernelPageReadWrite(psMMUContextWalker->pvPDCpuVAddr);
                                pui32Tmp = (IMG_UINT32 *) psMMUContextWalker->pvPDCpuVAddr;
                                pui32Tmp[ui32PDIndexStart + BRN31620_DUMMY_PDE_INDEX] = (psDevInfo->sBRN31620DummyPTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                                                                                | SGX_MMU_PDE_PAGE_SIZE_4K
                                                                                                | SGX_MMU_PDE_DUMMY_PAGE
                                                                                                | SGX_MMU_PDE_VALID;
+                               MakeKernelPageReadOnly(psMMUContextWalker->pvPDCpuVAddr);
 
                                PDUMPCOMMENT("BRN31620 Re-wire dummy PT due to releasing PT allocation block");
                                PDUMPPDENTRIES(&psMMUHeap->sMMUAttrib, psMMUContextWalker->hPDOSMemHandle, (IMG_VOID*)&pui32Tmp[ui32PDIndexStart + BRN31620_DUMMY_PDE_INDEX], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
@@ -416,17 +532,19 @@ static IMG_BOOL BRN31620FreePageTable(MMU_HEAP *psMMUHeap, IMG_UINT32 ui32PDInde
                {
                        psMMUContext->ui32PDChangeMask[ui32PDBitMaskIndex] |= 1 << ui32PDBitMaskShift;
 
-                       
+
+                       MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
                        pui32Tmp = (IMG_UINT32 *) psMMUContext->pvPDCpuVAddr;
                        pui32Tmp[ui32PDIndexStart + BRN31620_DUMMY_PDE_INDEX] = (psDevInfo->sBRN31620DummyPTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                                                                        | SGX_MMU_PDE_PAGE_SIZE_4K
                                                                                        | SGX_MMU_PDE_DUMMY_PAGE
                                                                                        | SGX_MMU_PDE_VALID;
+                       MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
 
                        PDUMPCOMMENT("BRN31620 Re-wire dummy PT due to releasing PT allocation block");
                        PDUMPPDENTRIES(&psMMUHeap->sMMUAttrib, psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32Tmp[ui32PDIndexStart + BRN31620_DUMMY_PDE_INDEX], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                }
-               
+
                bFreePTs = IMG_TRUE;
        }
 
@@ -442,12 +560,12 @@ _AllocPageTableMemory (MMU_HEAP *pMMUHeap,
        IMG_DEV_PHYADDR sDevPAddr;
        IMG_CPU_PHYADDR sCpuPAddr;
 
-       
+
 
 
        if(pMMUHeap->psDevArena->psDeviceMemoryHeapInfo->psLocalDevMemArena == IMG_NULL)
        {
-               
+
                if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
                                                 pMMUHeap->ui32PTSize,
                                                 SGX_MMU_PAGE_SIZE,
@@ -460,7 +578,12 @@ _AllocPageTableMemory (MMU_HEAP *pMMUHeap,
                        return IMG_FALSE;
                }
 
-               
+
+
+
+               MakeKernelPageReadOnly(psPTInfoList->PTPageCpuVAddr);
+
+
                if(psPTInfoList->PTPageCpuVAddr)
                {
                        sCpuPAddr = OSMapLinToCPUPhys(psPTInfoList->hPTPageOSMemHandle,
@@ -468,7 +591,7 @@ _AllocPageTableMemory (MMU_HEAP *pMMUHeap,
                }
                else
                {
-                       
+
                        sCpuPAddr = OSMemHandleToCpuPAddr(psPTInfoList->hPTPageOSMemHandle, 0);
                }
 
@@ -478,10 +601,10 @@ _AllocPageTableMemory (MMU_HEAP *pMMUHeap,
        {
                IMG_SYS_PHYADDR sSysPAddr;
 
-               
 
 
-               
+
+
                if(RA_Alloc(pMMUHeap->psDevArena->psDeviceMemoryHeapInfo->psLocalDevMemArena,
                                        SGX_MMU_PAGE_SIZE,
                                        IMG_NULL,
@@ -497,9 +620,9 @@ _AllocPageTableMemory (MMU_HEAP *pMMUHeap,
                        return IMG_FALSE;
                }
 
-               
+
                sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
-               
+
                psPTInfoList->PTPageCpuVAddr = OSMapPhysToLin(sCpuPAddr,
                                                                                                        SGX_MMU_PAGE_SIZE,
                                                                                                        PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
@@ -510,7 +633,7 @@ _AllocPageTableMemory (MMU_HEAP *pMMUHeap,
                        return IMG_FALSE;
                }
 
-               
+
                sDevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
 
                #if PAGE_TEST
@@ -518,44 +641,46 @@ _AllocPageTableMemory (MMU_HEAP *pMMUHeap,
                #endif
        }
 
+       MakeKernelPageReadWrite(psPTInfoList->PTPageCpuVAddr);
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
        {
                IMG_UINT32 *pui32Tmp;
                IMG_UINT32 i;
 
                pui32Tmp = (IMG_UINT32*)psPTInfoList->PTPageCpuVAddr;
-               
+
                for(i=0; i<pMMUHeap->ui32PTNumEntriesUsable; i++)
                {
                        pui32Tmp[i] = (pMMUHeap->psMMUContext->psDevInfo->sDummyDataDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                | SGX_MMU_PTE_VALID;
                }
-               
+
                for(; i<pMMUHeap->ui32PTNumEntriesAllocated; i++)
                {
                        pui32Tmp[i] = 0;
                }
        }
 #else
-       
+
        OSMemSet(psPTInfoList->PTPageCpuVAddr, 0, pMMUHeap->ui32PTSize);
 #endif
+       MakeKernelPageReadOnly(psPTInfoList->PTPageCpuVAddr);
 
 #if defined(PDUMP)
        {
                IMG_UINT32 ui32Flags = 0;
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-               
+
                ui32Flags |= ( MMU_IsHeapShared(pMMUHeap) ) ? PDUMP_FLAGS_PERSISTENT : 0;
 #endif
-               
+
                PDUMPMALLOCPAGETABLE(&pMMUHeap->psMMUContext->psDeviceNode->sDevId, psPTInfoList->hPTPageOSMemHandle, 0, psPTInfoList->PTPageCpuVAddr, pMMUHeap->ui32PTSize, ui32Flags, PDUMP_PT_UNIQUETAG);
-               
+
                PDUMPMEMPTENTRIES(&pMMUHeap->sMMUAttrib, psPTInfoList->hPTPageOSMemHandle, psPTInfoList->PTPageCpuVAddr, pMMUHeap->ui32PTSize, ui32Flags, IMG_TRUE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
        }
 #endif
-       
-       
+
+
        *psDevPAddr = sDevPAddr;
 
        return IMG_TRUE;
@@ -565,13 +690,16 @@ _AllocPageTableMemory (MMU_HEAP *pMMUHeap,
 static IMG_VOID
 _FreePageTableMemory (MMU_HEAP *pMMUHeap, MMU_PT_INFO *psPTInfoList)
 {
-       
+
 
 
 
        if(pMMUHeap->psDevArena->psDeviceMemoryHeapInfo->psLocalDevMemArena == IMG_NULL)
        {
-               
+
+               MakeKernelPageReadWrite(psPTInfoList->PTPageCpuVAddr);
+
+
                OSFreePages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
                                          pMMUHeap->ui32PTSize,
                                          psPTInfoList->PTPageCpuVAddr,
@@ -582,19 +710,19 @@ _FreePageTableMemory (MMU_HEAP *pMMUHeap, MMU_PT_INFO *psPTInfoList)
                IMG_SYS_PHYADDR sSysPAddr;
                IMG_CPU_PHYADDR sCpuPAddr;
 
-               
-               sCpuPAddr = OSMapLinToCPUPhys(psPTInfoList->hPTPageOSMemHandle, 
+
+               sCpuPAddr = OSMapLinToCPUPhys(psPTInfoList->hPTPageOSMemHandle,
                                                                          psPTInfoList->PTPageCpuVAddr);
                sSysPAddr = SysCpuPAddrToSysPAddr (sCpuPAddr);
 
-               
-               
+
+
                OSUnMapPhysToLin(psPTInfoList->PTPageCpuVAddr,
                          SGX_MMU_PAGE_SIZE,
                          PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
                          psPTInfoList->hPTPageOSMemHandle);
 
-               
+
 
 
                RA_Free (pMMUHeap->psDevArena->psDeviceMemoryHeapInfo->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
@@ -614,10 +742,10 @@ _DeferredFreePageTable (MMU_HEAP *pMMUHeap, IMG_UINT32 ui32PTIndex, IMG_BOOL bOS
 
        SysAcquireData(&psSysData);
 
-       
+
        ui32PDIndex = pMMUHeap->psDevArena->BaseDevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
 
-       
+
        ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
 
        {
@@ -625,11 +753,11 @@ _DeferredFreePageTable (MMU_HEAP *pMMUHeap, IMG_UINT32 ui32PTIndex, IMG_BOOL bOS
                if(ppsPTInfoList[ui32PTIndex] && ppsPTInfoList[ui32PTIndex]->ui32ValidPTECount > 0)
                {
                        DumpPT(ppsPTInfoList[ui32PTIndex]);
-                       
+
                }
 #endif
 
-               
+
                PVR_ASSERT(ppsPTInfoList[ui32PTIndex] == IMG_NULL || ppsPTInfoList[ui32PTIndex]->ui32ValidPTECount == 0);
        }
 
@@ -639,7 +767,7 @@ _DeferredFreePageTable (MMU_HEAP *pMMUHeap, IMG_UINT32 ui32PTIndex, IMG_BOOL bOS
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
                ui32Flags |= ( MMU_IsHeapShared(pMMUHeap) ) ? PDUMP_FLAGS_PERSISTENT : 0;
 #endif
-               
+
                PDUMPCOMMENT("Free page table (page count == %08X)", pMMUHeap->ui32PageTableCount);
                if(ppsPTInfoList[ui32PTIndex] && ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr)
                {
@@ -653,30 +781,32 @@ _DeferredFreePageTable (MMU_HEAP *pMMUHeap, IMG_UINT32 ui32PTIndex, IMG_BOOL bOS
                case DEVICE_MEMORY_HEAP_SHARED :
                case DEVICE_MEMORY_HEAP_SHARED_EXPORTED :
                {
-                       
+
                        MMU_CONTEXT *psMMUContext = (MMU_CONTEXT*)pMMUHeap->psMMUContext->psDevInfo->pvMMUContextList;
 
                        while(psMMUContext)
                        {
-                               
+
+                               MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
                                pui32PDEntry = (IMG_UINT32*)psMMUContext->pvPDCpuVAddr;
                                pui32PDEntry += ui32PDIndex;
 
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-                               
+
                                pui32PDEntry[ui32PTIndex] = (psMMUContext->psDevInfo->sDummyPTDevPAddr.uiAddr
                                                                                        >>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                                                                        | SGX_MMU_PDE_PAGE_SIZE_4K
                                                                                        | SGX_MMU_PDE_VALID;
 #else
-                               
+
                                if(bOSFreePT)
                                {
                                        pui32PDEntry[ui32PTIndex] = 0;
                                }
 #endif
+                               MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
                        #if defined(PDUMP)
-                               
+
                        #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
                                if(psMMUContext->bPDumpActive)
                        #endif
@@ -684,7 +814,7 @@ _DeferredFreePageTable (MMU_HEAP *pMMUHeap, IMG_UINT32 ui32PTIndex, IMG_BOOL bOS
                                        PDUMPPDENTRIES(&pMMUHeap->sMMUAttrib, psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32PDEntry[ui32PTIndex], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                                }
                        #endif
-                               
+
                                psMMUContext = psMMUContext->psNext;
                        }
                        break;
@@ -692,25 +822,27 @@ _DeferredFreePageTable (MMU_HEAP *pMMUHeap, IMG_UINT32 ui32PTIndex, IMG_BOOL bOS
                case DEVICE_MEMORY_HEAP_PERCONTEXT :
                case DEVICE_MEMORY_HEAP_KERNEL :
                {
-                       
+                       MakeKernelPageReadWrite(pMMUHeap->psMMUContext->pvPDCpuVAddr);
+
                        pui32PDEntry = (IMG_UINT32*)pMMUHeap->psMMUContext->pvPDCpuVAddr;
                        pui32PDEntry += ui32PDIndex;
 
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-                       
+
                        pui32PDEntry[ui32PTIndex] = (pMMUHeap->psMMUContext->psDevInfo->sDummyPTDevPAddr.uiAddr
                                                                                >>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                                                                | SGX_MMU_PDE_PAGE_SIZE_4K
                                                                                | SGX_MMU_PDE_VALID;
 #else
-                       
+
                        if(bOSFreePT)
                        {
                                pui32PDEntry[ui32PTIndex] = 0;
                        }
 #endif
+                       MakeKernelPageReadOnly(pMMUHeap->psMMUContext->pvPDCpuVAddr);
+
 
-                       
                        PDUMPPDENTRIES(&pMMUHeap->sMMUAttrib, pMMUHeap->psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32PDEntry[ui32PTIndex], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                        break;
                }
@@ -721,45 +853,47 @@ _DeferredFreePageTable (MMU_HEAP *pMMUHeap, IMG_UINT32 ui32PTIndex, IMG_BOOL bOS
                }
        }
 
-       
+
        if(ppsPTInfoList[ui32PTIndex] != IMG_NULL)
        {
                if(ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr != IMG_NULL)
                {
                        IMG_PUINT32 pui32Tmp;
 
+                       MakeKernelPageReadWrite(ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr);
                        pui32Tmp = (IMG_UINT32*)ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr;
 
-                       
+
                        for(i=0;
                                (i<pMMUHeap->ui32PTETotalUsable) && (i<pMMUHeap->ui32PTNumEntriesUsable);
                                 i++)
                        {
-                               
+
                                pui32Tmp[i] = 0;
                        }
+                       MakeKernelPageReadOnly(ppsPTInfoList[ui32PTIndex]->PTPageCpuVAddr);
+
 
-                       
 
                        if(bOSFreePT)
                        {
                                _FreePageTableMemory(pMMUHeap, ppsPTInfoList[ui32PTIndex]);
                        }
 
-                       
+
 
 
                        pMMUHeap->ui32PTETotalUsable -= i;
                }
                else
                {
-                       
+
                        pMMUHeap->ui32PTETotalUsable -= pMMUHeap->ui32PTNumEntriesUsable;
                }
 
                if(bOSFreePT)
                {
-                       
+
                        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
                                                sizeof(MMU_PT_INFO),
                                                ppsPTInfoList[ui32PTIndex],
@@ -769,7 +903,7 @@ _DeferredFreePageTable (MMU_HEAP *pMMUHeap, IMG_UINT32 ui32PTIndex, IMG_BOOL bOS
        }
        else
        {
-               
+
                pMMUHeap->ui32PTETotalUsable -= pMMUHeap->ui32PTNumEntriesUsable;
        }
 
@@ -802,14 +936,14 @@ _DeferredFreePageTables (MMU_HEAP *pMMUHeap)
                {
                        if (psMMUContext->apsPTInfoList[ui32PDIndex]->PTPageCpuVAddr)
                        {
-                               
+
                                for (j=0;j<SGX_MMU_PT_SIZE;j++)
                                {
                                        pui32Tmp = (IMG_UINT32 *) psMMUContext->apsPTInfoList[ui32PDIndex]->PTPageCpuVAddr;
                                        BRN31620InvalidatePageTableEntry(psMMUContext, ui32PDIndex, j, &pui32Tmp[j]);
                                }
                        }
-                       
+
                        if (BRN31620FreePageTable(pMMUHeap, ui32PDIndex) == IMG_TRUE)
                        {
                                bInvalidateDirectoryCache = IMG_TRUE;
@@ -817,7 +951,7 @@ _DeferredFreePageTables (MMU_HEAP *pMMUHeap)
                }
        }
 
-       
+
        if (bInvalidateDirectoryCache)
        {
                MMU_InvalidateDirectoryCache(pMMUHeap->psMMUContext->psDevInfo);
@@ -856,23 +990,23 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
        IMG_UINT32 ui32ModifiedCachelines[BRN31620_CACHE_FLUSH_INDEX_SIZE];
 #endif
 
-       
+
 #if SGX_FEATURE_ADDRESS_SPACE_SIZE < 32
        PVR_ASSERT(DevVAddr.uiAddr < (1<<SGX_FEATURE_ADDRESS_SPACE_SIZE));
 #endif
 
-       
+
        SysAcquireData(&psSysData);
 
-       
+
        ui32PDIndex = DevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
 
-       
-       
+
+
        if((UINT32_MAX_VALUE - DevVAddr.uiAddr)
                < (ui32Size + pMMUHeap->ui32DataPageMask + pMMUHeap->ui32PTMask))
        {
-               
+
                sHighDevVAddr.uiAddr = UINT32_MAX_VALUE;
        }
        else
@@ -885,7 +1019,7 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
 
        ui32PageTableCount = sHighDevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
 
-       
+
        if (ui32PageTableCount == 0)
                ui32PageTableCount = 1024;
 
@@ -895,42 +1029,42 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                ui32ModifiedCachelines[i] = 0;
        }
 
-       
-       
-       
+
+
+
        sDevVAddrRequestStart = DevVAddr;
        ui32PDRequestStart = ui32PDIndex;
        sDevVAddrRequestEnd = sHighDevVAddr;
        ui32PDRequestEnd = ui32PageTableCount - 1;
 
-       
+
        DevVAddr.uiAddr = DevVAddr.uiAddr & (~BRN31620_PDE_CACHE_FILL_MASK);
 
-       
+
        sHighDevVAddr.uiAddr = ((sHighDevVAddr.uiAddr + (BRN31620_PDE_CACHE_FILL_SIZE - 1)) & (~BRN31620_PDE_CACHE_FILL_MASK));
 
        ui32PDIndex = DevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
        ui32PageTableCount = sHighDevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
 
-       
+
        if (ui32PageTableCount == 0)
                ui32PageTableCount = 1024;
 #endif
 
        ui32PageTableCount -= ui32PDIndex;
 
-       
+
        pui32PDEntry = (IMG_UINT32*)pMMUHeap->psMMUContext->pvPDCpuVAddr;
        pui32PDEntry += ui32PDIndex;
 
-       
+
        ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
 
 #if defined(PDUMP)
        {
                IMG_UINT32 ui32Flags = 0;
-               
-               
+
+
                if( MMU_IsHeapShared(pMMUHeap) )
                {
                        ui32Flags |= PDUMP_FLAGS_CONTINUOUS;
@@ -943,16 +1077,16 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                PDUMPCOMMENTWITHFLAGS(ui32Flags, "Page directory mods (page count == %08X)", ui32PageTableCount);
        }
 #endif
-       
+
        for(i=0; i<ui32PageTableCount; i++)
        {
                if(ppsPTInfoList[i] == IMG_NULL)
                {
 #if defined(FIX_HW_BRN_31620)
-                       
+
                        if (pMMUHeap->psMMUContext->apsPTInfoListSave[ui32PDIndex + i])
                        {
-                               
+
                                if (((ui32PDIndex + i) >= ui32PDRequestStart) && ((ui32PDIndex + i) <= ui32PDRequestEnd))
                                {
                                        IMG_UINT32 ui32PDCacheLine = (ui32PDIndex + i) >> BRN31620_PDES_PER_CACHE_LINE_SHIFT;
@@ -981,7 +1115,7 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
 #endif
                }
 #if defined(FIX_HW_BRN_31620)
-               
+
                if (ppsPTInfoList[i])
                {
 #endif
@@ -994,7 +1128,7 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                        IMG_UINT32 j;
 #else
 #if !defined(FIX_HW_BRN_31620)
-                       
+
                        PVR_ASSERT(pui32PDEntry[i] == 0);
 #endif
 #endif
@@ -1005,7 +1139,7 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                        }
 #if defined(FIX_HW_BRN_31620)
                        bFlushSystemCache = IMG_TRUE;
-                       
+
                        {
                                IMG_UINT32 ui32PD;
                                IMG_UINT32 ui32PDCacheLine;
@@ -1018,7 +1152,7 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                                ui32PDBitMaskShift = ui32PDCacheLine & BRN31620_CACHE_FLUSH_BITS_MASK;
                                ui32ModifiedCachelines[ui32PDBitMaskIndex] |= 1 << ui32PDBitMaskShift;
 
-                               
+
                                if ((pMMUHeap->ui32PDBaseIndex + pMMUHeap->ui32PageTableCount) < (ui32PD + 1))
                                {
                                        pMMUHeap->ui32PageTableCount = (ui32PD + 1) - pMMUHeap->ui32PDBaseIndex;
@@ -1035,30 +1169,32 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                                case DEVICE_MEMORY_HEAP_SHARED :
                                case DEVICE_MEMORY_HEAP_SHARED_EXPORTED :
                                {
-                                       
+
                                        MMU_CONTEXT *psMMUContext = (MMU_CONTEXT*)pMMUHeap->psMMUContext->psDevInfo->pvMMUContextList;
 
                                        while(psMMUContext)
                                        {
-                                               
+                                               MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
+
                                                pui32PDEntry = (IMG_UINT32*)psMMUContext->pvPDCpuVAddr;
                                                pui32PDEntry += ui32PDIndex;
 
-                                               
+
                                                pui32PDEntry[i] = (sDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                                                                | pMMUHeap->ui32PDEPageSizeCtrl
                                                                                | SGX_MMU_PDE_VALID;
+                                               MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
                                                #if defined(PDUMP)
-                                               
+
                                                #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
                                                if(psMMUContext->bPDumpActive)
                                                #endif
                                                {
-                                                       
+
                                                        PDUMPPDENTRIES(&pMMUHeap->sMMUAttrib, psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32PDEntry[i], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                                                }
-                                               #endif 
-                                               
+                                               #endif
+
                                                psMMUContext = psMMUContext->psNext;
                                        }
 #if defined(FIX_HW_BRN_31620)
@@ -1069,13 +1205,14 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                                case DEVICE_MEMORY_HEAP_PERCONTEXT :
                                case DEVICE_MEMORY_HEAP_KERNEL :
                                {
-                                       
+                                       MakeKernelPageReadWrite(pMMUHeap->psMMUContext->pvPDCpuVAddr);
+
                                        pui32PDEntry[i] = (sDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                                                        | pMMUHeap->ui32PDEPageSizeCtrl
                                                                        | SGX_MMU_PDE_VALID;
+                                       MakeKernelPageReadOnly(pMMUHeap->psMMUContext->pvPDCpuVAddr);
+
 
-                                       
-                                       
                                        PDUMPPDENTRIES(&pMMUHeap->sMMUAttrib, pMMUHeap->psMMUContext->hPDOSMemHandle, (IMG_VOID*)&pui32PDEntry[i], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                                        break;
                                }
@@ -1087,14 +1224,14 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                        }
 
 #if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-                       
+
 
 
 
                        MMU_InvalidateDirectoryCache(pMMUHeap->psMMUContext->psDevInfo);
 #endif
 #if defined(FIX_HW_BRN_31620)
-                       
+
                        if (((ui32PDIndex + i) < ui32PDRequestStart) || ((ui32PDIndex + i) > ui32PDRequestEnd))
                        {
                                        pMMUHeap->psMMUContext->apsPTInfoListSave[ui32PDIndex + i] = ppsPTInfoList[i];
@@ -1105,7 +1242,7 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                else
                {
 #if !defined(FIX_HW_BRN_31620)
-                       
+
                        PVR_ASSERT(pui32PDEntry[i] != 0);
 #endif
                }
@@ -1116,20 +1253,20 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
 
        #if defined(SGX_FEATURE_SYSTEM_CACHE)
        #if defined(FIX_HW_BRN_31620)
-       
+
        if (bFlushSystemCache)
        {
        #endif
 
        MMU_InvalidateSystemLevelCache(pMMUHeap->psMMUContext->psDevInfo);
-       #endif 
+       #endif
        #if defined(FIX_HW_BRN_31620)
        }
 
-       
+
        sHighDevVAddr.uiAddr = sHighDevVAddr.uiAddr - 1;
 
-       
+
        if (bFlushSystemCache)
        {
                MMU_CONTEXT *psMMUContext;
@@ -1145,7 +1282,7 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                                        psMMUContext->ui32PDChangeMask[i] |= ui32ModifiedCachelines[i];
                                }
 
-                               
+
                                psMMUContext = psMMUContext->psNext;
                        }
                }
@@ -1157,7 +1294,7 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
                        }
                }
 
-               
+
                psMMUContext = pMMUHeap->psMMUContext;
                for (i=0;i<BRN31620_CACHE_FLUSH_INDEX_SIZE;i++)
                {
@@ -1173,7 +1310,7 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
 
                                        ui32PDIndex = (((i * BRN31620_CACHE_FLUSH_BITS_SIZE) + j) * BRN31620_PDES_PER_CACHE_LINE_SIZE) + BRN31620_DUMMY_PDE_INDEX;
 
-                                       
+
                                        if (psMMUContext->apsPTInfoList[ui32PDIndex])
                                        {
                                                psTempPTInfo = psMMUContext->apsPTInfoList[ui32PDIndex];
@@ -1185,13 +1322,14 @@ _DeferredAllocPagetables(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR DevVAddr, IMG_UINT
 
                                        PVR_ASSERT(psTempPTInfo != IMG_NULL);
 
+                                       MakeKernelPageReadWrite(psTempPTInfo->PTPageCpuVAddr);
                                        pui32Tmp = (IMG_UINT32 *) psTempPTInfo->PTPageCpuVAddr;
                                        PVR_ASSERT(pui32Tmp != IMG_NULL);
                                        pui32Tmp[BRN31620_DUMMY_PTE_INDEX] = (psDevInfo->sBRN31620DummyPageDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                                                                                        | SGX_MMU_PTE_DUMMY_PAGE
                                                                                                                        | SGX_MMU_PTE_READONLY
                                                                                                                        | SGX_MMU_PTE_VALID;
-
+                                       MakeKernelPageReadOnly(psTempPTInfo->PTPageCpuVAddr);
                                        PDUMPCOMMENT("BRN31620 Dump PTE for dummy page after wireing up new PT");
                                        PDUMPMEMPTENTRIES(&pMMUHeap->sMMUAttrib, psTempPTInfo->hPTPageOSMemHandle, (IMG_VOID *) &pui32Tmp[BRN31620_DUMMY_PTE_INDEX], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                                }
@@ -1209,7 +1347,7 @@ IMG_UINT32 MMU_GetPDumpContextID(IMG_HANDLE hDevMemContext)
 {
        BM_CONTEXT *pBMContext = hDevMemContext;
        PVR_ASSERT(pBMContext);
-        
+
        return pBMContext->psMMUContext->ui32PDumpMMUContextID;
 }
 
@@ -1218,20 +1356,20 @@ static IMG_VOID MMU_SetPDumpAttribs(PDUMP_MMU_ATTRIB *psMMUAttrib,
        IMG_UINT32 ui32DataPageMask,
        IMG_UINT32 ui32PTSize)
 {
-       
+
        psMMUAttrib->sDevId = psDeviceNode->sDevId;
-       
+
        psMMUAttrib->pszPDRegRegion = IMG_NULL;
        psMMUAttrib->ui32DataPageMask = ui32DataPageMask;
-       
+
        psMMUAttrib->ui32PTEValid = SGX_MMU_PTE_VALID;
        psMMUAttrib->ui32PTSize = ui32PTSize;
        psMMUAttrib->ui32PTEAlignShift = SGX_MMU_PTE_ADDR_ALIGNSHIFT;
-       
+
        psMMUAttrib->ui32PDEMask = SGX_MMU_PDE_ADDR_MASK;
        psMMUAttrib->ui32PDEAlignShift = SGX_MMU_PDE_ADDR_ALIGNSHIFT;
 }
-#endif 
+#endif
 
 PVRSRV_ERROR
 MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, IMG_DEV_PHYADDR *psPDDevPAddr)
@@ -1252,8 +1390,8 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
 
        SysAcquireData(&psSysData);
 #if defined(PDUMP)
-       
-       
+
+
        MMU_SetPDumpAttribs(&sMMUAttrib, psDeviceNode,
                                                SGX_MMU_PAGE_MASK,
                                                SGX_MMU_PT_SIZE * sizeof(IMG_UINT32));
@@ -1270,14 +1408,14 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
        }
        OSMemSet (psMMUContext, 0, sizeof(MMU_CONTEXT));
 
-       
+
        psDevInfo = (PVRSRV_SGXDEV_INFO*)psDeviceNode->pvDevice;
        psMMUContext->psDevInfo = psDevInfo;
 
-       
+
        psMMUContext->psDeviceNode = psDeviceNode;
 
-       
+
        if(psDeviceNode->psLocalDevMemArena == IMG_NULL)
        {
                if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
@@ -1299,7 +1437,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                }
                else
                {
-                       
+
                        sCpuPAddr = OSMemHandleToCpuPAddr(hPDOSMemHandle, 0);
                }
                sPDDevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
@@ -1309,10 +1447,10 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                #endif
 
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-               
+
                if(!psDevInfo->pvMMUContextList)
                {
-                       
+
                        if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
                                                         SGX_MMU_PAGE_SIZE,
                                                         SGX_MMU_PAGE_SIZE,
@@ -1332,12 +1470,12 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                        }
                        else
                        {
-                               
+
                                sCpuPAddr = OSMemHandleToCpuPAddr(psDevInfo->hDummyPTPageOSMemHandle, 0);
                        }
                        psDevInfo->sDummyPTDevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
 
-                       
+
                        if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
                                                         SGX_MMU_PAGE_SIZE,
                                                         SGX_MMU_PAGE_SIZE,
@@ -1361,13 +1499,13 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                        }
                        psDevInfo->sDummyDataDevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
                }
-#endif 
+#endif
 #if defined(FIX_HW_BRN_31620)
-               
+
                if(!psDevInfo->pvMMUContextList)
                {
                        IMG_UINT32 j;
-                       
+
                        if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
                                                         SGX_MMU_PAGE_SIZE,
                                                         SGX_MMU_PAGE_SIZE,
@@ -1378,9 +1516,9 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                        {
                                PVR_DPF((PVR_DBG_ERROR, "MMU_Initialise: ERROR call to OSAllocPages failed"));
                                return PVRSRV_ERROR_FAILED_TO_ALLOC_PAGES;
-                       }                               
+                       }
+
 
-                       
                        if(psDevInfo->pvBRN31620DummyPageCpuVAddr)
                        {
                                sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hBRN31620DummyPageOSMemHandle,
@@ -1400,7 +1538,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                        psDevInfo->sBRN31620DummyPageDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
                        PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPageOSMemHandle, 0, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
 
-                       
+
                        if (OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
                                                         SGX_MMU_PAGE_SIZE,
                                                         SGX_MMU_PAGE_SIZE,
@@ -1411,9 +1549,9 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                        {
                                PVR_DPF((PVR_DBG_ERROR, "MMU_Initialise: ERROR call to OSAllocPages failed"));
                                return PVRSRV_ERROR_FAILED_TO_ALLOC_PAGES;
-                       }                               
+                       }
+
 
-                       
                        if(psDevInfo->pvBRN31620DummyPTCpuVAddr)
                        {
                                sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hBRN31620DummyPTOSMemHandle,
@@ -1434,7 +1572,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
        {
                IMG_SYS_PHYADDR sSysPAddr;
 
-               
+
                if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
                                        SGX_MMU_PAGE_SIZE,
                                        IMG_NULL,
@@ -1450,7 +1588,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                        return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
                }
 
-               
+
                sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
                sPDDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
                pvPDCpuVAddr = OSMapPhysToLin(sCpuPAddr,
@@ -1468,10 +1606,10 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                #endif
 
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-               
+
                if(!psDevInfo->pvMMUContextList)
                {
-                       
+
                        if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
                                                SGX_MMU_PAGE_SIZE,
                                                IMG_NULL,
@@ -1487,7 +1625,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                                return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
                        }
 
-                       
+
                        sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
                        psDevInfo->sDummyPTDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
                        psDevInfo->pvDummyPTPageCpuVAddr = OSMapPhysToLin(sCpuPAddr,
@@ -1500,7 +1638,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                                return PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE;
                        }
 
-                       
+
                        if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
                                                SGX_MMU_PAGE_SIZE,
                                                IMG_NULL,
@@ -1516,7 +1654,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                                return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
                        }
 
-                       
+
                        sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
                        psDevInfo->sDummyDataDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
                        psDevInfo->pvDummyDataPageCpuVAddr = OSMapPhysToLin(sCpuPAddr,
@@ -1529,13 +1667,13 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                                return PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE;
                        }
                }
-#endif 
+#endif
 #if defined(FIX_HW_BRN_31620)
-               
+
                if(!psDevInfo->pvMMUContextList)
                {
                        IMG_UINT32 j;
-                       
+
                        if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
                                                SGX_MMU_PAGE_SIZE,
                                                IMG_NULL,
@@ -1551,7 +1689,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                                return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
                        }
 
-                       
+
                        sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
                        psDevInfo->sBRN31620DummyPageDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
                        psDevInfo->pvBRN31620DummyPageCpuVAddr = OSMapPhysToLin(sCpuPAddr,
@@ -1564,14 +1702,16 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                                return PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE;
                        }
 
+                       MakeKernelPageReadWrite(psDevInfo->pvBRN31620DummyPageCpuVAddr);
                        pui32Tmp = (IMG_UINT32 *)psDevInfo->pvBRN31620DummyPageCpuVAddr;
                        for(j=0; j<(SGX_MMU_PAGE_SIZE/4); j++)
                        {
                                pui32Tmp[j] = BRN31620_DUMMY_PAGE_SIGNATURE;
                        }
+                       MakeKernelPageReadOnly(psDevInfo->pvBRN31620DummyPageCpuVAddr);
                        PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPageOSMemHandle, 0, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
 
-                       
+
                        if(RA_Alloc(psDeviceNode->psLocalDevMemArena,
                                                SGX_MMU_PAGE_SIZE,
                                                IMG_NULL,
@@ -1587,7 +1727,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                                return PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY;
                        }
 
-                       
+
                        sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
                        psDevInfo->sBRN31620DummyPTDevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysPAddr);
                        psDevInfo->pvBRN31620DummyPTCpuVAddr = OSMapPhysToLin(sCpuPAddr,
@@ -1601,16 +1741,16 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                                return PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE;
                        }
 
-                       OSMemSet(psDevInfo->pvBRN31620DummyPTCpuVAddr,0,SGX_MMU_PAGE_SIZE);             
+                       OSMemSet(psDevInfo->pvBRN31620DummyPTCpuVAddr,0,SGX_MMU_PAGE_SIZE);
                        PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPTOSMemHandle, 0, psDevInfo->pvBRN31620DummyPTCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
                }
-#endif 
+#endif
        }
 
 #if defined(FIX_HW_BRN_31620)
        if (!psDevInfo->pvMMUContextList)
        {
-               
+
                psDevInfo->hKernelMMUContext = psMMUContext;
                PVR_DPF((PVR_DBG_ERROR, "MMU_Initialise: saving kernel mmu context: %p", psMMUContext));
        }
@@ -1618,12 +1758,12 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
 
 #if defined(PDUMP)
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-       
+
        {
                PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
                if(psPerProc == IMG_NULL)
                {
-                       
+
                        psMMUContext->bPDumpActive = IMG_TRUE;
                }
                else
@@ -1631,8 +1771,8 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                        psMMUContext->bPDumpActive = psPerProc->bPDumpActive;
                }
        }
-#endif 
-       
+#endif
+
 #if IMG_ADDRSPACE_PHYSADDR_BITS == 32
        PDUMPCOMMENT("Alloc page directory for new MMU context (PDDevPAddr == 0x%08x)",
                        sPDDevPAddr.uiAddr);
@@ -1641,7 +1781,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                        sPDDevPAddr.uiHighAddr, sPDDevPAddr.uiAddr);
 #endif
        PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, hPDOSMemHandle, 0, pvPDCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PD_UNIQUETAG);
-#endif 
+#endif
 
 #ifdef SUPPORT_SGX_MMU_BYPASS
        EnableHostAccess(psMMUContext);
@@ -1659,55 +1799,63 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
 
 
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-       
+       MakeKernelPageReadWrite(pvPDCpuVAddr);
+
        for(i=0; i<SGX_MMU_PD_SIZE; i++)
        {
                pui32Tmp[i] = (psDevInfo->sDummyPTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                        | SGX_MMU_PDE_PAGE_SIZE_4K
                                        | SGX_MMU_PDE_VALID;
        }
+       MakeKernelPageReadOnly(pvPDCpuVAddr);
 
        if(!psDevInfo->pvMMUContextList)
        {
-               
 
 
+
+               MakeKernelPageReadWrite(psDevInfo->pvDummyPTPageCpuVAddr);
                pui32Tmp = (IMG_UINT32 *)psDevInfo->pvDummyPTPageCpuVAddr;
                for(i=0; i<SGX_MMU_PT_SIZE; i++)
                {
                        pui32Tmp[i] = (psDevInfo->sDummyDataDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                | SGX_MMU_PTE_VALID;
                }
-               
+               MakeKernelPageReadOnly(psDevInfo->pvDummyPTPageCpuVAddr);
+
                PDUMPCOMMENT("Dummy Page table contents");
                PDUMPMEMPTENTRIES(&sMMUAttrib, psDevInfo->hDummyPTOSMemHandle, psDevInfo->pvDummyPTPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
 
-               
 
+
+               MakeKernelPageReadWrite(psDevInfo->pvDummyDataPageCpuVAddr);
                pui32Tmp = (IMG_UINT32 *)psDevInfo->pvDummyDataPageCpuVAddr;
                for(i=0; i<(SGX_MMU_PAGE_SIZE/4); i++)
                {
                        pui32Tmp[i] = DUMMY_DATA_PAGE_SIGNATURE;
                }
-               
+               MakeKernelPageReadOnly(psDevInfo->pvDummyDataPageCpuVAddr);
+
                PDUMPCOMMENT("Dummy Data Page contents");
                PDUMPMEMPTENTRIES(PVRSRV_DEVICE_TYPE_SGX, psDevInfo->hDummyDataPageOSMemHandle, psDevInfo->pvDummyDataPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
        }
-#else 
-       
+#else
+
+       MakeKernelPageReadWrite(pvPDCpuVAddr);
        for(i=0; i<SGX_MMU_PD_SIZE; i++)
        {
-               
+
                pui32Tmp[i] = 0;
        }
-#endif 
+       MakeKernelPageReadOnly(pvPDCpuVAddr);
+#endif
 
 #if defined(PDUMP)
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
        if(psMMUContext->bPDumpActive)
-#endif 
+#endif
        {
-               
+
                PDUMPCOMMENT("Page directory contents");
                PDUMPPDENTRIES(&sMMUAttrib, hPDOSMemHandle, pvPDCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
        }
@@ -1721,59 +1869,62 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
 
                PDUMPCOMMENT("BRN31620 Set up dummy PT");
 
+               MakeKernelPageReadWrite(psDevInfo->pvBRN31620DummyPTCpuVAddr);
                pui32PT = (IMG_UINT32 *) psDevInfo->pvBRN31620DummyPTCpuVAddr;
                pui32PT[BRN31620_DUMMY_PTE_INDEX] = (psDevInfo->sBRN31620DummyPageDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                                | SGX_MMU_PTE_DUMMY_PAGE
                                                                | SGX_MMU_PTE_READONLY
                                                                | SGX_MMU_PTE_VALID;
-
+               MakeKernelPageReadOnly(psDevInfo->pvBRN31620DummyPTCpuVAddr);
 
 #if defined(PDUMP)
-               
+
                PDUMPCOMMENT("BRN31620 Dump dummy PT contents");
                PDUMPMEMPTENTRIES(&sMMUAttrib,  psDevInfo->hBRN31620DummyPTOSMemHandle, psDevInfo->pvBRN31620DummyPTCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                PDUMPCOMMENT("BRN31620 Dump dummy page contents");
                PDUMPMEMPTENTRIES(&sMMUAttrib,  psDevInfo->hBRN31620DummyPageOSMemHandle, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
 
-                               
+
                for(i=0;i<SGX_MMU_PT_SIZE;i++)
                {
                        PDUMPMEMPTENTRIES(&sMMUAttrib, psDevInfo->hBRN31620DummyPTOSMemHandle, &pui32PT[i], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                }
 #endif
                PDUMPCOMMENT("BRN31620 Dump PDE wire up");
-               
+
                for(i=0;i<SGX_MMU_PD_SIZE;i++)
                {
                        pui32Tmp[i] = 0;
 
                        if (ui32PDCount == BRN31620_DUMMY_PDE_INDEX)
                        {
+                               MakeKernelPageReadWrite(pvPDCpuVAddr);
                                pui32Tmp[i] = (psDevInfo->sBRN31620DummyPTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                                | SGX_MMU_PDE_PAGE_SIZE_4K
                                                | SGX_MMU_PDE_DUMMY_PAGE
                                                | SGX_MMU_PDE_VALID;
+                               MakeKernelPageReadOnly(pvPDCpuVAddr);
                        }
                                PDUMPMEMPTENTRIES(&sMMUAttrib, hPDOSMemHandle, (IMG_VOID *) &pui32Tmp[i], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PT_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                        ui32PDCount++;
                        if (ui32PDCount == BRN31620_PDES_PER_CACHE_LINE_SIZE)
                        {
-                               
+
                                ui32PDCount = 0;
                        }
                }
 
 
-               
+
                PDUMPCOMMENT("BRN31620 dummy Page table contents");
                PDUMPMEMPTENTRIES(&sMMUAttrib, psDevInfo->hBRN31620DummyPageOSMemHandle, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
        }
 #endif
 #if defined(PDUMP)
-       
+
        {
                PVRSRV_ERROR eError;
-               
+
                IMG_UINT32 ui32MMUType = 1;
 
                #if defined(SGX_FEATURE_36BIT_MMU)
@@ -1798,7 +1949,7 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                }
        }
 
-       
+
        PDUMPCOMMENT("Set MMU context complete (MMU Context ID == %u)", psMMUContext->ui32PDumpMMUContextID);
 #endif
 
@@ -1818,18 +1969,18 @@ MMU_Initialise (PVRSRV_DEVICE_NODE *psDeviceNode, MMU_CONTEXT **ppsMMUContext, I
                psMMUContext->apsPTInfoListSave[i] = IMG_NULL;
        }
 #endif
-       
+
        psMMUContext->pvPDCpuVAddr = pvPDCpuVAddr;
        psMMUContext->sPDDevPAddr = sPDDevPAddr;
        psMMUContext->hPDOSMemHandle = hPDOSMemHandle;
 
-       
+
        *ppsMMUContext = psMMUContext;
 
-       
+
        *psPDDevPAddr = sPDDevPAddr;
 
-       
+
        psMMUContext->psNext = (MMU_CONTEXT*)psDevInfo->pvMMUContextList;
        psDevInfo->pvMMUContextList = (IMG_VOID*)psMMUContext;
 
@@ -1854,11 +2005,11 @@ MMU_Finalise (MMU_CONTEXT *psMMUContext)
        SysAcquireData(&psSysData);
 
 #if defined(PDUMP)
-       
+
        PDUMPCOMMENT("Clear MMU context (MMU Context ID == %u)", psMMUContext->ui32PDumpMMUContextID);
        PDUMPCLEARMMUCONTEXT(PVRSRV_DEVICE_TYPE_SGX, psMMUContext->psDeviceNode->sDevId.pszPDumpDevName, psMMUContext->ui32PDumpMMUContextID, 2);
 
-       
+
 #if IMG_ADDRSPACE_PHYSADDR_BITS == 32
        PDUMPCOMMENT("Free page directory (PDDevPAddr == 0x%08x)",
                        psMMUContext->sPDDevPAddr.uiAddr);
@@ -1866,7 +2017,7 @@ MMU_Finalise (MMU_CONTEXT *psMMUContext)
        PDUMPCOMMENT("Free page directory, 64-bit arch detected (PDDevPAddr == 0x%08x%08x)",
                        psMMUContext->sPDDevPAddr.uiHighAddr, psMMUContext->sPDDevPAddr.uiAddr);
 #endif
-#endif 
+#endif
 
        PDUMPFREEPAGETABLE(&psMMUContext->psDeviceNode->sDevId, psMMUContext->hPDOSMemHandle, psMMUContext->pvPDCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
@@ -1876,14 +2027,16 @@ MMU_Finalise (MMU_CONTEXT *psMMUContext)
 
        pui32Tmp = (IMG_UINT32 *)psMMUContext->pvPDCpuVAddr;
 
-       
+       MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
+
        for(i=0; i<SGX_MMU_PD_SIZE; i++)
        {
-               
+
                pui32Tmp[i] = 0;
        }
+       MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
+
 
-       
 
 
 
@@ -1898,7 +2051,7 @@ MMU_Finalise (MMU_CONTEXT *psMMUContext)
                                                psMMUContext->hPDOSMemHandle);
 
 #if defined(FIX_HW_BRN_31620)
-               
+
                if (!psMMUContextList->psNext)
                {
                        PDUMPFREEPAGETABLE(&psMMUContext->psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPageOSMemHandle, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
@@ -1912,11 +2065,11 @@ MMU_Finalise (MMU_CONTEXT *psMMUContext)
                                                        SGX_MMU_PAGE_SIZE,
                                                        psDevInfo->pvBRN31620DummyPTCpuVAddr,
                                                        psDevInfo->hBRN31620DummyPTOSMemHandle);
-       
+
                }
 #endif
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-               
+
                if(!psMMUContextList->psNext)
                {
                        OSFreePages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
@@ -1935,82 +2088,82 @@ MMU_Finalise (MMU_CONTEXT *psMMUContext)
                IMG_SYS_PHYADDR sSysPAddr;
                IMG_CPU_PHYADDR sCpuPAddr;
 
-               
+
                sCpuPAddr = OSMapLinToCPUPhys(psMMUContext->hPDOSMemHandle,
                                                                          psMMUContext->pvPDCpuVAddr);
                sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
 
-               
+
                OSUnMapPhysToLin(psMMUContext->pvPDCpuVAddr,
                                                        SGX_MMU_PAGE_SIZE,
                             PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
                                                        psMMUContext->hPDOSMemHandle);
-               
+
                RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
 
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-               
+
                if(!psMMUContextList->psNext)
                {
-                       
+
                        sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hDummyPTPageOSMemHandle,
                                                                                  psDevInfo->pvDummyPTPageCpuVAddr);
                        sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
 
-                       
+
                        OSUnMapPhysToLin(psDevInfo->pvDummyPTPageCpuVAddr,
                                                                SGX_MMU_PAGE_SIZE,
                                 PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
                                                                psDevInfo->hDummyPTPageOSMemHandle);
-                       
+
                        RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
 
-                       
+
                        sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hDummyDataPageOSMemHandle,
                                                                                  psDevInfo->pvDummyDataPageCpuVAddr);
                        sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
 
-                       
+
                        OSUnMapPhysToLin(psDevInfo->pvDummyDataPageCpuVAddr,
                                                                SGX_MMU_PAGE_SIZE,
                                 PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
                                                                psDevInfo->hDummyDataPageOSMemHandle);
-                       
+
                        RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
                }
 #endif
 #if defined(FIX_HW_BRN_31620)
-               
+
                if(!psMMUContextList->psNext)
                {
-                       
+
                        PDUMPFREEPAGETABLE(&psMMUContext->psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPageOSMemHandle, psDevInfo->pvBRN31620DummyPageCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
 
                        sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hBRN31620DummyPageOSMemHandle,
                                                                                  psDevInfo->pvBRN31620DummyPageCpuVAddr);
                        sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
 
-                       
+
                        OSUnMapPhysToLin(psDevInfo->pvBRN31620DummyPageCpuVAddr,
                                                                SGX_MMU_PAGE_SIZE,
                                 PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
                                                                psDevInfo->hBRN31620DummyPageOSMemHandle);
-                       
+
                        RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
 
-                       
+
                        PDUMPFREEPAGETABLE(&psMMUContext->psDeviceNode->sDevId, psDevInfo->hBRN31620DummyPTOSMemHandle, psDevInfo->pvBRN31620DummyPTCpuVAddr, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
 
                        sCpuPAddr = OSMapLinToCPUPhys(psDevInfo->hBRN31620DummyPTOSMemHandle,
                                                                                  psDevInfo->pvBRN31620DummyPTCpuVAddr);
                        sSysPAddr = SysCpuPAddrToSysPAddr(sCpuPAddr);
 
-                       
+
                        OSUnMapPhysToLin(psDevInfo->pvBRN31620DummyPTCpuVAddr,
                                                                SGX_MMU_PAGE_SIZE,
                                 PVRSRV_HAP_WRITECOMBINE|PVRSRV_HAP_KERNEL_ONLY,
                                                                psDevInfo->hBRN31620DummyPTOSMemHandle);
-                       
+
                        RA_Free (psMMUContext->psDeviceNode->psLocalDevMemArena, sSysPAddr.uiAddr, IMG_FALSE);
                }
 #endif
@@ -2018,24 +2171,24 @@ MMU_Finalise (MMU_CONTEXT *psMMUContext)
 
        PVR_DPF ((PVR_DBG_MESSAGE, "MMU_Finalise"));
 
-       
+
        ppsMMUContext = (MMU_CONTEXT**)&psMMUContext->psDevInfo->pvMMUContextList;
        while(*ppsMMUContext)
        {
                if(*ppsMMUContext == psMMUContext)
                {
-                       
+
                        *ppsMMUContext = psMMUContext->psNext;
                        break;
                }
 
-               
+
                ppsMMUContext = &((*ppsMMUContext)->psNext);
        }
 
-       
+
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(MMU_CONTEXT), psMMUContext, IMG_NULL);
-       
+
 }
 
 
@@ -2049,11 +2202,11 @@ MMU_InsertHeap(MMU_CONTEXT *psMMUContext, MMU_HEAP *psMMUHeap)
        IMG_BOOL bInvalidateDirectoryCache = IMG_FALSE;
 #endif
 
-       
+
        pui32PDCpuVAddr += psMMUHeap->psDevArena->BaseDevVAddr.uiAddr >> psMMUHeap->ui32PDShift;
        pui32KernelPDCpuVAddr += psMMUHeap->psDevArena->BaseDevVAddr.uiAddr >> psMMUHeap->ui32PDShift;
 
-       
+
 
 
 #if defined(PDUMP)
@@ -2062,7 +2215,7 @@ MMU_InsertHeap(MMU_CONTEXT *psMMUContext, MMU_HEAP *psMMUHeap)
                        psMMUHeap->psMMUContext->ui32PDumpMMUContextID,
                        psMMUHeap->ui32PageTableCount);
        PDUMPCOMMENT("  (Destination MMU Context ID == %u)", psMMUContext->ui32PDumpMMUContextID);
-#endif 
+#endif
 #ifdef SUPPORT_SGX_MMU_BYPASS
        EnableHostAccess(psMMUContext);
 #endif
@@ -2070,20 +2223,21 @@ MMU_InsertHeap(MMU_CONTEXT *psMMUContext, MMU_HEAP *psMMUHeap)
        for (ui32PDEntry = 0; ui32PDEntry < psMMUHeap->ui32PageTableCount; ui32PDEntry++)
        {
 #if (!defined(SUPPORT_SGX_MMU_DUMMY_PAGE)) && (!defined(FIX_HW_BRN_31620))
-               
+
                PVR_ASSERT(pui32PDCpuVAddr[ui32PDEntry] == 0);
 #endif
+               MakeKernelPageReadWrite(psMMUContext->pvPDCpuVAddr);
 
-               
                pui32PDCpuVAddr[ui32PDEntry] = pui32KernelPDCpuVAddr[ui32PDEntry];
+               MakeKernelPageReadOnly(psMMUContext->pvPDCpuVAddr);
                if (pui32PDCpuVAddr[ui32PDEntry])
                {
-                       
+
                #if defined(PDUMP)
-                       
+
                #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
                        if(psMMUContext->bPDumpActive)
-               #endif 
+               #endif
                        {
                                PDUMPPDENTRIES(&psMMUHeap->sMMUAttrib, psMMUContext->hPDOSMemHandle, (IMG_VOID *) &pui32PDCpuVAddr[ui32PDEntry], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
                        }
@@ -2101,7 +2255,7 @@ MMU_InsertHeap(MMU_CONTEXT *psMMUContext, MMU_HEAP *psMMUHeap)
 #if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
        if (bInvalidateDirectoryCache)
        {
-               
+
 
 
 
@@ -2127,39 +2281,39 @@ MMU_UnmapPagesAndFreePTs (MMU_HEAP *psMMUHeap,
 #if !defined (PDUMP)
        PVR_UNREFERENCED_PARAMETER(hUniqueTag);
 #endif
-       
+
        sTmpDevVAddr = sDevVAddr;
 
        for(i=0; i<ui32PageCount; i++)
        {
                MMU_PT_INFO **ppsPTInfoList;
 
-               
+
                ui32PDIndex = sTmpDevVAddr.uiAddr >> psMMUHeap->ui32PDShift;
 
-               
+
                ppsPTInfoList = &psMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
 
                {
-                       
+
                        ui32PTIndex = (sTmpDevVAddr.uiAddr & psMMUHeap->ui32PTMask) >> psMMUHeap->ui32PTShift;
 
-                       
+
                        if (!ppsPTInfoList[0])
                        {
                                PVR_DPF((PVR_DBG_MESSAGE, "MMU_UnmapPagesAndFreePTs: Invalid PT for alloc at VAddr:0x%08X (VaddrIni:0x%08X AllocPage:%u) PDIdx:%u PTIdx:%u",sTmpDevVAddr.uiAddr, sDevVAddr.uiAddr,i, ui32PDIndex, ui32PTIndex ));
 
-                               
+
                                sTmpDevVAddr.uiAddr += psMMUHeap->ui32DataPageSize;
 
-                               
+
                                continue;
                        }
 
-                       
+
                        pui32Tmp = (IMG_UINT32*)ppsPTInfoList[0]->PTPageCpuVAddr;
 
-                       
+
                        if (!pui32Tmp)
                        {
                                continue;
@@ -2167,7 +2321,7 @@ MMU_UnmapPagesAndFreePTs (MMU_HEAP *psMMUHeap,
 
                        CheckPT(ppsPTInfoList[0]);
 
-                       
+
                        if (pui32Tmp[ui32PTIndex] & SGX_MMU_PTE_VALID)
                        {
                                ppsPTInfoList[0]->ui32ValidPTECount--;
@@ -2177,26 +2331,26 @@ MMU_UnmapPagesAndFreePTs (MMU_HEAP *psMMUHeap,
                                PVR_DPF((PVR_DBG_MESSAGE, "MMU_UnmapPagesAndFreePTs: Page is already invalid for alloc at VAddr:0x%08X (VAddrIni:0x%08X AllocPage:%u) PDIdx:%u PTIdx:%u",sTmpDevVAddr.uiAddr, sDevVAddr.uiAddr,i, ui32PDIndex, ui32PTIndex ));
                        }
 
-                       
-                       PVR_ASSERT((IMG_INT32)ppsPTInfoList[0]->ui32ValidPTECount >= 0);
 
+                       PVR_ASSERT((IMG_INT32)ppsPTInfoList[0]->ui32ValidPTECount >= 0);
+                       MakeKernelPageReadWrite(ppsPTInfoList[0]->PTPageCpuVAddr);
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-                       
+
                        pui32Tmp[ui32PTIndex] = (psMMUHeap->psMMUContext->psDevInfo->sDummyDataDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                                        | SGX_MMU_PTE_VALID;
 #else
-                       
+
 #if defined(FIX_HW_BRN_31620)
                        BRN31620InvalidatePageTableEntry(psMMUHeap->psMMUContext, ui32PDIndex, ui32PTIndex, &pui32Tmp[ui32PTIndex]);
 #else
                        pui32Tmp[ui32PTIndex] = 0;
 #endif
 #endif
-
+                       MakeKernelPageReadOnly(ppsPTInfoList[0]->PTPageCpuVAddr);
                        CheckPT(ppsPTInfoList[0]);
                }
 
-               
+
 
                if (ppsPTInfoList[0] && (ppsPTInfoList[0]->ui32ValidPTECount == 0)
                        )
@@ -2212,7 +2366,7 @@ MMU_UnmapPagesAndFreePTs (MMU_HEAP *psMMUHeap,
 #endif
                }
 
-               
+
                sTmpDevVAddr.uiAddr += psMMUHeap->ui32DataPageSize;
        }
 
@@ -2231,7 +2385,7 @@ MMU_UnmapPagesAndFreePTs (MMU_HEAP *psMMUHeap,
                                                psMMUHeap->ui32DataPageSize * ui32PageCount,
                                                IMG_TRUE,
                                                hUniqueTag);
-#endif 
+#endif
 }
 
 
@@ -2280,7 +2434,7 @@ MMU_Create (MMU_CONTEXT *psMMUContext,
        pMMUHeap->psMMUContext = psMMUContext;
        pMMUHeap->psDevArena = psDevArena;
 
-       
+
 
 
        switch(pMMUHeap->psDevArena->ui32DataPageSize)
@@ -2310,46 +2464,46 @@ MMU_Create (MMU_CONTEXT *psMMUContext,
                        ui32ScaleSize = 10;
                        pMMUHeap->ui32PDEPageSizeCtrl = SGX_MMU_PDE_PAGE_SIZE_4M;
                        break;
-#endif 
+#endif
                default:
                        PVR_DPF((PVR_DBG_ERROR, "MMU_Create: invalid data page size"));
                        goto ErrorFreeHeap;
        }
 
-       
+
        pMMUHeap->ui32DataPageSize = psDevArena->ui32DataPageSize;
        pMMUHeap->ui32DataPageBitWidth = SGX_MMU_PAGE_SHIFT + ui32ScaleSize;
        pMMUHeap->ui32DataPageMask = pMMUHeap->ui32DataPageSize - 1;
-       
+
        pMMUHeap->ui32PTShift = pMMUHeap->ui32DataPageBitWidth;
        pMMUHeap->ui32PTBitWidth = SGX_MMU_PT_SHIFT - ui32ScaleSize;
        pMMUHeap->ui32PTMask = SGX_MMU_PT_MASK & (SGX_MMU_PT_MASK<<ui32ScaleSize);
        pMMUHeap->ui32PTSize = (IMG_UINT32)(1UL<<pMMUHeap->ui32PTBitWidth) * sizeof(IMG_UINT32);
 
-       
+
        if(pMMUHeap->ui32PTSize < 4 * sizeof(IMG_UINT32))
        {
                pMMUHeap->ui32PTSize = 4 * sizeof(IMG_UINT32);
        }
        pMMUHeap->ui32PTNumEntriesAllocated = pMMUHeap->ui32PTSize >> 2;
 
-       
+
        pMMUHeap->ui32PTNumEntriesUsable = (IMG_UINT32)(1UL << pMMUHeap->ui32PTBitWidth);
 
-       
+
        pMMUHeap->ui32PDShift = pMMUHeap->ui32PTBitWidth + pMMUHeap->ui32PTShift;
        pMMUHeap->ui32PDBitWidth = SGX_FEATURE_ADDRESS_SPACE_SIZE - pMMUHeap->ui32PTBitWidth - pMMUHeap->ui32DataPageBitWidth;
        pMMUHeap->ui32PDMask = SGX_MMU_PD_MASK & (SGX_MMU_PD_MASK>>(32-SGX_FEATURE_ADDRESS_SPACE_SIZE));
 
-       
+
 #if !defined (SUPPORT_EXTERNAL_SYSTEM_CACHE)
-       
+
 
 
 
        if(psDevArena->BaseDevVAddr.uiAddr > (pMMUHeap->ui32DataPageMask | pMMUHeap->ui32PTMask))
        {
-               
+
 
 
                PVR_ASSERT ((psDevArena->BaseDevVAddr.uiAddr
@@ -2357,20 +2511,20 @@ MMU_Create (MMU_CONTEXT *psMMUContext,
                                                        | pMMUHeap->ui32PTMask)) == 0);
        }
 #endif
-       
+
        pMMUHeap->ui32PTETotalUsable = pMMUHeap->psDevArena->ui32Size >> pMMUHeap->ui32PTShift;
 
-       
+
        pMMUHeap->ui32PDBaseIndex = (pMMUHeap->psDevArena->BaseDevVAddr.uiAddr & pMMUHeap->ui32PDMask) >> pMMUHeap->ui32PDShift;
 
-       
+
 
 
        pMMUHeap->ui32PageTableCount = (pMMUHeap->ui32PTETotalUsable + pMMUHeap->ui32PTNumEntriesUsable - 1)
                                                                                >> pMMUHeap->ui32PTBitWidth;
        PVR_ASSERT(pMMUHeap->ui32PageTableCount > 0);
 
-       
+
        pMMUHeap->psVMArena = RA_Create(psDevArena->pszName,
                                                                        psDevArena->BaseDevVAddr.uiAddr,
                                                                        psDevArena->ui32Size,
@@ -2388,7 +2542,7 @@ MMU_Create (MMU_CONTEXT *psMMUContext,
        }
 
 #if defined(PDUMP)
-       
+
        MMU_SetPDumpAttribs(&pMMUHeap->sMMUAttrib,
                                                psMMUContext->psDeviceNode,
                                                pMMUHeap->ui32DataPageMask,
@@ -2400,16 +2554,16 @@ MMU_Create (MMU_CONTEXT *psMMUContext,
                        psDevArena->ui32Size,
                        pMMUHeap->ui32DataPageSize,
                        psDevArena->BaseDevVAddr.uiAddr);
-#endif 
+#endif
+
+#if 0
 
-#if 0 
-       
        if(psDevArena->ui32HeapID == SGX_TILED_HEAP_ID)
        {
                IMG_UINT32 ui32RegVal;
                IMG_UINT32 ui32XTileStride;
 
-               
+
 
 
 
@@ -2428,19 +2582,19 @@ MMU_Create (MMU_CONTEXT *psMMUContext,
        }
 #endif
 
-       
+
 
        *ppsVMArena = pMMUHeap->psVMArena;
 
        return pMMUHeap;
 
-       
+
 ErrorFreePagetables:
        _DeferredFreePageTables (pMMUHeap);
 
 ErrorFreeHeap:
        OSFreeMem (PVRSRV_OS_PAGEABLE_HEAP, sizeof(MMU_HEAP), pMMUHeap, IMG_NULL);
-       
+
 
        return IMG_NULL;
 }
@@ -2462,7 +2616,7 @@ MMU_Delete (MMU_HEAP *pMMUHeap)
                                pMMUHeap->psDevArena->pszName,
                                pMMUHeap->psDevArena->BaseDevVAddr.uiAddr,
                                pMMUHeap->ui32PageTableCount);
-#endif 
+#endif
 
 #ifdef SUPPORT_SGX_MMU_BYPASS
                EnableHostAccess(pMMUHeap->psMMUContext);
@@ -2473,7 +2627,7 @@ MMU_Delete (MMU_HEAP *pMMUHeap)
 #endif
 
                OSFreeMem (PVRSRV_OS_PAGEABLE_HEAP, sizeof(MMU_HEAP), pMMUHeap, IMG_NULL);
-               
+
        }
 }
 
@@ -2491,7 +2645,7 @@ MMU_Alloc (MMU_HEAP *pMMUHeap,
                "MMU_Alloc: uSize=0x%x, flags=0x%x, align=0x%x",
                uSize, uFlags, uDevVAddrAlignment));
 
-       
+
 
        if((uFlags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR) == 0)
        {
@@ -2523,7 +2677,7 @@ MMU_Alloc (MMU_HEAP *pMMUHeap,
        EnableHostAccess(pMMUHeap->psMMUContext);
        #endif
 
-       
+
        bStatus = _DeferredAllocPagetables(pMMUHeap, *psDevVAddr, (IMG_UINT32)uSize);
 
        #ifdef SUPPORT_SGX_MMU_BYPASS
@@ -2539,7 +2693,7 @@ MMU_Alloc (MMU_HEAP *pMMUHeap,
                                                                pMMUHeap->psDevArena->ui32HeapID));
                if((uFlags & PVRSRV_MEM_USER_SUPPLIED_DEVVADDR) == 0)
                {
-                       
+
                        RA_Free (pMMUHeap->psVMArena, psDevVAddr->uiAddr, IMG_FALSE);
                }
        }
@@ -2580,14 +2734,14 @@ IMG_VOID
 MMU_Enable (MMU_HEAP *pMMUHeap)
 {
        PVR_UNREFERENCED_PARAMETER(pMMUHeap);
-       
+
 }
 
 IMG_VOID
 MMU_Disable (MMU_HEAP *pMMUHeap)
 {
        PVR_UNREFERENCED_PARAMETER(pMMUHeap);
-       
+
 }
 
 #if defined(FIX_HW_BRN_31620)
@@ -2599,7 +2753,7 @@ IMG_VOID MMU_GetCacheFlushRange(MMU_CONTEXT *pMMUContext, IMG_UINT32 *pui32Range
        {
                pui32RangeMask[i] = pMMUContext->ui32PDChangeMask[i];
 
-               
+
                pMMUContext->ui32PDChangeMask[i] = 0;
        }
 }
@@ -2626,22 +2780,22 @@ MMU_PDumpPageTables     (MMU_HEAP *pMMUHeap,
        IMG_UINT32 ui32PDIndex;
        IMG_UINT32 ui32PTDumpCount;
 
-       
+
        ui32NumPTEntries = (IMG_UINT32)((uSize + pMMUHeap->ui32DataPageMask) >> pMMUHeap->ui32PTShift);
 
-       
+
        ui32PDIndex = DevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
 
-       
+
        ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
 
-       
+
        ui32PTIndex = (DevVAddr.uiAddr & pMMUHeap->ui32PTMask) >> pMMUHeap->ui32PTShift;
 
-       
+
        PDUMPCOMMENT("Page table mods (num entries == %08X) %s", ui32NumPTEntries, bForUnmap ? "(for unmap)" : "");
 
-       
+
        while(ui32NumPTEntries > 0)
        {
                MMU_PT_INFO* psPTInfo = *ppsPTInfoList++;
@@ -2665,16 +2819,16 @@ MMU_PDumpPageTables     (MMU_HEAP *pMMUHeap,
                        PDUMPMEMPTENTRIES(&pMMUHeap->sMMUAttrib, psPTInfo->hPTPageOSMemHandle, (IMG_VOID *) &pui32PTEntry[ui32PTIndex], ui32PTDumpCount * sizeof(IMG_UINT32), ui32Flags, IMG_FALSE, PDUMP_PT_UNIQUETAG, hUniqueTag);
                }
 
-               
+
                ui32NumPTEntries -= ui32PTDumpCount;
 
-               
+
                ui32PTIndex = 0;
        }
 
        PDUMPCOMMENT("Finished page table mods %s", bForUnmap ? "(for unmap)" : "");
 }
-#endif 
+#endif
 
 
 static IMG_VOID
@@ -2688,63 +2842,63 @@ MMU_MapPage (MMU_HEAP *pMMUHeap,
        IMG_UINT32 ui32MMUFlags = 0;
        MMU_PT_INFO **ppsPTInfoList;
 
-       
+
        PVR_ASSERT((DevPAddr.uiAddr & pMMUHeap->ui32DataPageMask) == 0);
 
-       
+
 
        if(((PVRSRV_MEM_READ|PVRSRV_MEM_WRITE) & ui32MemFlags) == (PVRSRV_MEM_READ|PVRSRV_MEM_WRITE))
        {
-               
+
                ui32MMUFlags = 0;
        }
        else if(PVRSRV_MEM_READ & ui32MemFlags)
        {
-               
+
                ui32MMUFlags |= SGX_MMU_PTE_READONLY;
        }
        else if(PVRSRV_MEM_WRITE & ui32MemFlags)
        {
-               
+
                ui32MMUFlags |= SGX_MMU_PTE_WRITEONLY;
        }
 
-       
+
        if(PVRSRV_MEM_CACHE_CONSISTENT & ui32MemFlags)
        {
                ui32MMUFlags |= SGX_MMU_PTE_CACHECONSISTENT;
        }
 
 #if !defined(FIX_HW_BRN_25503)
-       
+
        if(PVRSRV_MEM_EDM_PROTECT & ui32MemFlags)
        {
                ui32MMUFlags |= SGX_MMU_PTE_EDMPROTECT;
        }
 #endif
 
-       
 
 
-       
+
+
        ui32Index = DevVAddr.uiAddr >> pMMUHeap->ui32PDShift;
 
-       
+
        ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32Index];
 
        CheckPT(ppsPTInfoList[0]);
 
-       
+
        ui32Index = (DevVAddr.uiAddr & pMMUHeap->ui32PTMask) >> pMMUHeap->ui32PTShift;
 
-       
+
        pui32Tmp = (IMG_UINT32*)ppsPTInfoList[0]->PTPageCpuVAddr;
 
 #if !defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
        {
                IMG_UINT32 uTmp = pui32Tmp[ui32Index];
-               
-               
+
+
 #if defined(FIX_HW_BRN_31620)
                if ((uTmp & SGX_MMU_PTE_VALID) && ((DevVAddr.uiAddr & BRN31620_PDE_CACHE_FILL_MASK) != BRN31620_DUMMY_PAGE_OFFSET))
 #else
@@ -2768,15 +2922,16 @@ MMU_MapPage (MMU_HEAP *pMMUHeap,
        }
 #endif
 
-       
+
        ppsPTInfoList[0]->ui32ValidPTECount++;
 
-       
+       MakeKernelPageReadWrite(ppsPTInfoList[0]->PTPageCpuVAddr);
+
        pui32Tmp[ui32Index] = ((DevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                & ((~pMMUHeap->ui32DataPageMask)>>SGX_MMU_PTE_ADDR_ALIGNSHIFT))
                                                | SGX_MMU_PTE_VALID
                                                | ui32MMUFlags;
-
+       MakeKernelPageReadOnly(ppsPTInfoList[0]->PTPageCpuVAddr);
        CheckPT(ppsPTInfoList[0]);
 }
 
@@ -2791,7 +2946,7 @@ MMU_MapScatter (MMU_HEAP *pMMUHeap,
 {
 #if defined(PDUMP)
        IMG_DEV_VIRTADDR MapBaseDevVAddr;
-#endif 
+#endif
        IMG_UINT32 uCount, i;
        IMG_DEV_PHYADDR DevPAddr;
 
@@ -2801,7 +2956,7 @@ MMU_MapScatter (MMU_HEAP *pMMUHeap,
        MapBaseDevVAddr = DevVAddr;
 #else
        PVR_UNREFERENCED_PARAMETER(hUniqueTag);
-#endif 
+#endif
 
        for (i=0, uCount=0; uCount<uSize; i++, uCount+=pMMUHeap->ui32DataPageSize)
        {
@@ -2810,7 +2965,7 @@ MMU_MapScatter (MMU_HEAP *pMMUHeap,
                sSysAddr = psSysAddr[i];
 
 
-               
+
                PVR_ASSERT((sSysAddr.uiAddr & pMMUHeap->ui32DataPageMask) == 0);
 
                DevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sSysAddr);
@@ -2825,7 +2980,7 @@ MMU_MapScatter (MMU_HEAP *pMMUHeap,
 
 #if defined(PDUMP)
        MMU_PDumpPageTables (pMMUHeap, MapBaseDevVAddr, uSize, IMG_FALSE, hUniqueTag);
-#endif 
+#endif
 }
 
 IMG_VOID
@@ -2839,7 +2994,7 @@ MMU_MapPages (MMU_HEAP *pMMUHeap,
        IMG_DEV_PHYADDR DevPAddr;
 #if defined(PDUMP)
        IMG_DEV_VIRTADDR MapBaseDevVAddr;
-#endif 
+#endif
        IMG_UINT32 uCount;
        IMG_UINT32 ui32VAdvance;
        IMG_UINT32 ui32PAdvance;
@@ -2849,11 +3004,11 @@ MMU_MapPages (MMU_HEAP *pMMUHeap,
        PVR_DPF ((PVR_DBG_MESSAGE, "MMU_MapPages: heap:%s, heap_id:%d devVAddr=%08X, SysPAddr=%08X, size=0x%x",
                                                                pMMUHeap->psDevArena->pszName,
                                                                pMMUHeap->psDevArena->ui32HeapID,
-                                                               DevVAddr.uiAddr, 
+                                                               DevVAddr.uiAddr,
                                                                SysPAddr.uiAddr,
                                                                uSize));
 
-       
+
        ui32VAdvance = pMMUHeap->ui32DataPageSize;
        ui32PAdvance = pMMUHeap->ui32DataPageSize;
 
@@ -2861,11 +3016,11 @@ MMU_MapPages (MMU_HEAP *pMMUHeap,
        MapBaseDevVAddr = DevVAddr;
 #else
        PVR_UNREFERENCED_PARAMETER(hUniqueTag);
-#endif 
+#endif
 
        DevPAddr = SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, SysPAddr);
 
-       
+
        PVR_ASSERT((DevPAddr.uiAddr & pMMUHeap->ui32DataPageMask) == 0);
 
 #if defined(FIX_HW_BRN_23281)
@@ -2875,7 +3030,7 @@ MMU_MapPages (MMU_HEAP *pMMUHeap,
        }
 #endif
 
-       
+
 
 
        if(ui32MemFlags & PVRSRV_MEM_DUMMY)
@@ -2892,7 +3047,7 @@ MMU_MapPages (MMU_HEAP *pMMUHeap,
 
 #if defined(PDUMP)
        MMU_PDumpPageTables (pMMUHeap, MapBaseDevVAddr, uSize, IMG_FALSE, hUniqueTag);
-#endif 
+#endif
 }
 
 IMG_VOID
@@ -2921,11 +3076,11 @@ MMU_MapShadow (MMU_HEAP          *pMMUHeap,
                        uByteSize,
                        (IMG_UINTPTR_T)CpuVAddr));
 
-       
+
        ui32VAdvance = pMMUHeap->ui32DataPageSize;
        ui32PAdvance = pMMUHeap->ui32DataPageSize;
 
-       
+
        PVR_ASSERT(((IMG_UINTPTR_T)CpuVAddr & (SGX_MMU_PAGE_SIZE - 1)) == 0);
        PVR_ASSERT(((IMG_UINT32)uByteSize & pMMUHeap->ui32DataPageMask) == 0);
        pDevVAddr->uiAddr = MapBaseDevVAddr.uiAddr;
@@ -2937,7 +3092,7 @@ MMU_MapShadow (MMU_HEAP          *pMMUHeap,
        }
 #endif
 
-       
+
 
 
        if(ui32MemFlags & PVRSRV_MEM_DUMMY)
@@ -2945,7 +3100,7 @@ MMU_MapShadow (MMU_HEAP          *pMMUHeap,
                ui32PAdvance = 0;
        }
 
-       
+
        MapDevVAddr = MapBaseDevVAddr;
        for (i=0; i<uByteSize; i+=ui32VAdvance)
        {
@@ -2963,7 +3118,7 @@ MMU_MapShadow (MMU_HEAP          *pMMUHeap,
                }
                DevPAddr = SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE_SGX, CpuPAddr);
 
-               
+
                PVR_ASSERT((DevPAddr.uiAddr & pMMUHeap->ui32DataPageMask) == 0);
 
                PVR_DPF ((PVR_DBG_MESSAGE,
@@ -2976,14 +3131,14 @@ MMU_MapShadow (MMU_HEAP          *pMMUHeap,
 
                MMU_MapPage (pMMUHeap, MapDevVAddr, DevPAddr, ui32MemFlags);
 
-               
+
                MapDevVAddr.uiAddr += ui32VAdvance;
                uOffset += ui32PAdvance;
        }
 
 #if defined(PDUMP)
        MMU_PDumpPageTables (pMMUHeap, MapBaseDevVAddr, uByteSize, IMG_FALSE, hUniqueTag);
-#endif 
+#endif
 }
 
 
@@ -3004,23 +3159,23 @@ MMU_UnmapPages (MMU_HEAP *psMMUHeap,
        PVR_UNREFERENCED_PARAMETER(hUniqueTag);
 #endif
 
-       
+
        sTmpDevVAddr = sDevVAddr;
 
        for(i=0; i<ui32PageCount; i++)
        {
                MMU_PT_INFO **ppsPTInfoList;
 
-               
+
                ui32PDIndex = sTmpDevVAddr.uiAddr >> psMMUHeap->ui32PDShift;
 
-               
+
                ppsPTInfoList = &psMMUHeap->psMMUContext->apsPTInfoList[ui32PDIndex];
 
-               
+
                ui32PTIndex = (sTmpDevVAddr.uiAddr & psMMUHeap->ui32PTMask) >> psMMUHeap->ui32PTShift;
 
-               
+
                if (!ppsPTInfoList[0])
                {
                        PVR_DPF((PVR_DBG_ERROR, "MMU_UnmapPages: ERROR Invalid PT for alloc at VAddr:0x%08X (VaddrIni:0x%08X AllocPage:%u) PDIdx:%u PTIdx:%u",
@@ -3030,19 +3185,19 @@ MMU_UnmapPages (MMU_HEAP *psMMUHeap,
                                                                        ui32PDIndex,
                                                                        ui32PTIndex));
 
-                       
+
                        sTmpDevVAddr.uiAddr += uPageSize;
 
-                       
+
                        continue;
                }
 
                CheckPT(ppsPTInfoList[0]);
 
-               
+
                pui32Tmp = (IMG_UINT32*)ppsPTInfoList[0]->PTPageCpuVAddr;
 
-               
+
                if (pui32Tmp[ui32PTIndex] & SGX_MMU_PTE_VALID)
                {
                        ppsPTInfoList[0]->ui32ValidPTECount--;
@@ -3058,25 +3213,27 @@ MMU_UnmapPages (MMU_HEAP *psMMUHeap,
                        PVR_DPF((PVR_DBG_ERROR, "MMU_UnmapPages: Page table entry value: 0x%08X", pui32Tmp[ui32PTIndex]));
                }
 
-               
+
                PVR_ASSERT((IMG_INT32)ppsPTInfoList[0]->ui32ValidPTECount >= 0);
 
+               MakeKernelPageReadWrite(ppsPTInfoList[0]->PTPageCpuVAddr);
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-               
+
                pui32Tmp[ui32PTIndex] = (psMMUHeap->psMMUContext->psDevInfo->sDummyDataDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                                | SGX_MMU_PTE_VALID;
 #else
-               
+
 #if defined(FIX_HW_BRN_31620)
                BRN31620InvalidatePageTableEntry(psMMUHeap->psMMUContext, ui32PDIndex, ui32PTIndex, &pui32Tmp[ui32PTIndex]);
 #else
                pui32Tmp[ui32PTIndex] = 0;
 #endif
 #endif
+               MakeKernelPageReadOnly(ppsPTInfoList[0]->PTPageCpuVAddr);
 
                CheckPT(ppsPTInfoList[0]);
 
-               
+
                sTmpDevVAddr.uiAddr += uPageSize;
        }
 
@@ -3084,7 +3241,7 @@ MMU_UnmapPages (MMU_HEAP *psMMUHeap,
 
 #if defined(PDUMP)
        MMU_PDumpPageTables (psMMUHeap, sDevVAddr, uPageSize*ui32PageCount, IMG_TRUE, hUniqueTag);
-#endif 
+#endif
 }
 
 
@@ -3096,10 +3253,10 @@ MMU_GetPhysPageAddr(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR sDevVPageAddr)
        IMG_DEV_PHYADDR sDevPAddr;
        MMU_PT_INFO **ppsPTInfoList;
 
-       
+
        ui32Index = sDevVPageAddr.uiAddr >> pMMUHeap->ui32PDShift;
 
-       
+
        ppsPTInfoList = &pMMUHeap->psMMUContext->apsPTInfoList[ui32Index];
        if (!ppsPTInfoList[0])
        {
@@ -3108,19 +3265,19 @@ MMU_GetPhysPageAddr(MMU_HEAP *pMMUHeap, IMG_DEV_VIRTADDR sDevVPageAddr)
                return sDevPAddr;
        }
 
-       
+
        ui32Index = (sDevVPageAddr.uiAddr & pMMUHeap->ui32PTMask) >> pMMUHeap->ui32PTShift;
 
-       
+
        pui32PageTable = (IMG_UINT32*)ppsPTInfoList[0]->PTPageCpuVAddr;
 
-       
+
        sDevPAddr.uiAddr = pui32PageTable[ui32Index];
 
-       
+
        sDevPAddr.uiAddr &= ~(pMMUHeap->ui32DataPageMask>>SGX_MMU_PTE_ADDR_ALIGNSHIFT);
 
-       
+
        sDevPAddr.uiAddr <<= SGX_MMU_PTE_ADDR_ALIGNSHIFT;
 
        return sDevPAddr;
@@ -3142,12 +3299,12 @@ PVRSRV_ERROR SGXGetPhysPageAddrKM (IMG_HANDLE hDevMemHeap,
        MMU_HEAP *pMMUHeap;
        IMG_DEV_PHYADDR DevPAddr;
 
-       
+
 
        pMMUHeap = (MMU_HEAP*)BM_GetMMUHeap(hDevMemHeap);
 
        DevPAddr = MMU_GetPhysPageAddr(pMMUHeap, sDevVAddr);
-       pCpuPAddr->uiAddr = DevPAddr.uiAddr; 
+       pCpuPAddr->uiAddr = DevPAddr.uiAddr;
        pDevPAddr->uiAddr = DevPAddr.uiAddr;
 
        return (pDevPAddr->uiAddr != 0) ? PVRSRV_OK : PVRSRV_ERROR_INVALID_PARAMS;
@@ -3163,7 +3320,7 @@ PVRSRV_ERROR SGXGetMMUPDAddrKM(IMG_HANDLE         hDevCookie,
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        *psPDDevPAddr = ((BM_CONTEXT*)hDevMemContext)->psMMUContext->sPDDevPAddr;
 
        return PVRSRV_OK;
@@ -3183,10 +3340,10 @@ PVRSRV_ERROR MMU_BIFResetPDAlloc(PVRSRV_SGXDEV_INFO *psDevInfo)
 
        psLocalDevMemArena = psSysData->apsLocalDevMemArena[0];
 
-       
+
        if(psLocalDevMemArena == IMG_NULL)
        {
-               
+
                eError = OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
                                                      3 * SGX_MMU_PAGE_SIZE,
                                                      SGX_MMU_PAGE_SIZE,
@@ -3200,7 +3357,7 @@ PVRSRV_ERROR MMU_BIFResetPDAlloc(PVRSRV_SGXDEV_INFO *psDevInfo)
                        return eError;
                }
 
-               
+
                if(pui8MemBlock)
                {
                        sMemBlockCpuPAddr = OSMapLinToCPUPhys(hOSMemHandle,
@@ -3208,13 +3365,13 @@ PVRSRV_ERROR MMU_BIFResetPDAlloc(PVRSRV_SGXDEV_INFO *psDevInfo)
                }
                else
                {
-                       
+
                        sMemBlockCpuPAddr = OSMemHandleToCpuPAddr(hOSMemHandle, 0);
                }
        }
        else
        {
-               
+
 
                if(RA_Alloc(psLocalDevMemArena,
                                        3 * SGX_MMU_PAGE_SIZE,
@@ -3231,7 +3388,7 @@ PVRSRV_ERROR MMU_BIFResetPDAlloc(PVRSRV_SGXDEV_INFO *psDevInfo)
                        return PVRSRV_ERROR_OUT_OF_MEMORY;
                }
 
-               
+
                sMemBlockCpuPAddr = SysSysPAddrToCpuPAddr(sMemBlockSysPAddr);
                pui8MemBlock = OSMapPhysToLin(sMemBlockCpuPAddr,
                                                                          SGX_MMU_PAGE_SIZE * 3,
@@ -3248,15 +3405,15 @@ PVRSRV_ERROR MMU_BIFResetPDAlloc(PVRSRV_SGXDEV_INFO *psDevInfo)
        psDevInfo->sBIFResetPDDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sMemBlockCpuPAddr);
        psDevInfo->sBIFResetPTDevPAddr.uiAddr = psDevInfo->sBIFResetPDDevPAddr.uiAddr + SGX_MMU_PAGE_SIZE;
        psDevInfo->sBIFResetPageDevPAddr.uiAddr = psDevInfo->sBIFResetPTDevPAddr.uiAddr + SGX_MMU_PAGE_SIZE;
-       
-       
+
+
        psDevInfo->pui32BIFResetPD = (IMG_UINT32 *)pui8MemBlock;
        psDevInfo->pui32BIFResetPT = (IMG_UINT32 *)(pui8MemBlock + SGX_MMU_PAGE_SIZE);
 
-       
+
        OSMemSet(psDevInfo->pui32BIFResetPD, 0, SGX_MMU_PAGE_SIZE);
        OSMemSet(psDevInfo->pui32BIFResetPT, 0, SGX_MMU_PAGE_SIZE);
-       
+
        OSMemSet(pui8MemBlock + (2 * SGX_MMU_PAGE_SIZE), 0xDB, SGX_MMU_PAGE_SIZE);
 
        return PVRSRV_OK;
@@ -3272,7 +3429,7 @@ IMG_VOID MMU_BIFResetPDFree(PVRSRV_SGXDEV_INFO *psDevInfo)
 
        psLocalDevMemArena = psSysData->apsLocalDevMemArena[0];
 
-       
+
        if(psLocalDevMemArena == IMG_NULL)
        {
                OSFreePages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
@@ -3316,10 +3473,10 @@ PVRSRV_ERROR WorkaroundBRN22997Alloc(PVRSRV_DEVICE_NODE *psDeviceNode)
 
        psLocalDevMemArena = psSysData->apsLocalDevMemArena[0];
 
-       
+
        if(psLocalDevMemArena == IMG_NULL)
        {
-               
+
                eError = OSAllocPages(PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
                                                          SGX_MMU_PAGE_SIZE,
                                                          SGX_MMU_PAGE_SIZE,
@@ -3348,7 +3505,7 @@ PVRSRV_ERROR WorkaroundBRN22997Alloc(PVRSRV_DEVICE_NODE   *psDeviceNode)
                }
                ui32PDOffset = 0;
 
-               
+
                if(pui32PT)
         {
             sCpuPAddr = OSMapLinToCPUPhys(hPTPageOSMemHandle,
@@ -3356,7 +3513,7 @@ PVRSRV_ERROR WorkaroundBRN22997Alloc(PVRSRV_DEVICE_NODE   *psDeviceNode)
         }
         else
         {
-            
+
             sCpuPAddr = OSMemHandleToCpuPAddr(hPTPageOSMemHandle, 0);
         }
                sPTDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
@@ -3368,7 +3525,7 @@ PVRSRV_ERROR WorkaroundBRN22997Alloc(PVRSRV_DEVICE_NODE   *psDeviceNode)
         }
         else
         {
-            
+
             sCpuPAddr = OSMemHandleToCpuPAddr(hPDPageOSMemHandle, 0);
         }
                sPDDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
@@ -3376,7 +3533,7 @@ PVRSRV_ERROR WorkaroundBRN22997Alloc(PVRSRV_DEVICE_NODE   *psDeviceNode)
        }
        else
        {
-               
+
 
                if(RA_Alloc(psLocalDevMemArena,
                                        SGX_MMU_PAGE_SIZE * 2,
@@ -3393,7 +3550,7 @@ PVRSRV_ERROR WorkaroundBRN22997Alloc(PVRSRV_DEVICE_NODE   *psDeviceNode)
                        return PVRSRV_ERROR_OUT_OF_MEMORY;
                }
 
-               
+
                sCpuPAddr = SysSysPAddrToCpuPAddr(psDevInfo->sBRN22997SysPAddr);
                pui32PT = OSMapPhysToLin(sCpuPAddr,
                                                                SGX_MMU_PAGE_SIZE * 2,
@@ -3406,9 +3563,9 @@ PVRSRV_ERROR WorkaroundBRN22997Alloc(PVRSRV_DEVICE_NODE   *psDeviceNode)
                }
                ui32PTOffset = 0;
 
-               
+
                sPTDevPAddr = SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
-               
+
                pui32PD = pui32PT + SGX_MMU_PAGE_SIZE/sizeof(IMG_UINT32);
                ui32PDOffset = SGX_MMU_PAGE_SIZE;
                hPDPageOSMemHandle = hPTPageOSMemHandle;
@@ -3418,7 +3575,7 @@ PVRSRV_ERROR WorkaroundBRN22997Alloc(PVRSRV_DEVICE_NODE   *psDeviceNode)
        OSMemSet(pui32PD, 0, SGX_MMU_PAGE_SIZE);
        OSMemSet(pui32PT, 0, SGX_MMU_PAGE_SIZE);
 
-       
+
        PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, hPDPageOSMemHandle, ui32PDOffset, pui32PD, SGX_MMU_PAGE_SIZE, 0, PDUMP_PD_UNIQUETAG);
        PDUMPMALLOCPAGETABLE(&psDeviceNode->sDevId, hPTPageOSMemHandle, ui32PTOffset, pui32PT, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
        PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, hPDPageOSMemHandle, pui32PD, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
@@ -3445,43 +3602,43 @@ IMG_VOID WorkaroundBRN22997ReadHostPort(PVRSRV_SGXDEV_INFO *psDevInfo)
        volatile IMG_UINT32 *pui32HostPort;
        IMG_UINT32 ui32BIFCtrl;
 
-       
-       
-       
+
+
+
        pui32HostPort = (volatile IMG_UINT32*)(((IMG_UINT8*)psDevInfo->pvHostPortBaseKM) + SYS_SGX_HOSTPORT_BRN23030_OFFSET);
 
-       
+
        sDevVAddr.uiAddr = SYS_SGX_HOSTPORT_BASE_DEVVADDR + SYS_SGX_HOSTPORT_BRN23030_OFFSET;
 
        ui32PDIndex = (sDevVAddr.uiAddr & SGX_MMU_PD_MASK) >> (SGX_MMU_PAGE_SHIFT + SGX_MMU_PT_SHIFT);
        ui32PTIndex = (sDevVAddr.uiAddr & SGX_MMU_PT_MASK) >> SGX_MMU_PAGE_SHIFT;
 
-       
+
        pui32PD[ui32PDIndex] = (psDevInfo->sBRN22997PTDevPAddr.uiAddr>>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                                        | SGX_MMU_PDE_VALID;
-       
+
        pui32PT[ui32PTIndex] = (psDevInfo->sBRN22997PTDevPAddr.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                        | SGX_MMU_PTE_VALID;
 
        PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, psDevInfo->hBRN22997PDPageOSMemHandle, pui32PD, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
        PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, psDevInfo->hBRN22997PTPageOSMemHandle, pui32PT, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PT_UNIQUETAG, PDUMP_PD_UNIQUETAG);
 
-       
+
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_DIR_LIST_BASE0,
                                 psDevInfo->sBRN22997PDDevPAddr.uiAddr);
        PDUMPPDREG(&psDevInfo->sMMUAttrib, EUR_CR_BIF_DIR_LIST_BASE0, psDevInfo->sBRN22997PDDevPAddr.uiAddr, PDUMP_PD_UNIQUETAG);
 
-       
+
        ui32BIFCtrl = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL);
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32BIFCtrl | EUR_CR_BIF_CTRL_INVALDC_MASK);
        PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, ui32BIFCtrl | EUR_CR_BIF_CTRL_INVALDC_MASK);
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32BIFCtrl);
        PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, ui32BIFCtrl);
 
-       
+
        if (pui32HostPort)
        {
-                
+
                IMG_UINT32 ui32Tmp;
                ui32Tmp = *pui32HostPort;
        }
@@ -3490,21 +3647,21 @@ IMG_VOID WorkaroundBRN22997ReadHostPort(PVRSRV_SGXDEV_INFO *psDevInfo)
                PVR_DPF((PVR_DBG_ERROR,"Host Port not present for BRN22997 workaround"));
        }
 
-       
 
 
 
 
-       
+
+
        PDUMPCOMMENT("RDW :SGXMEM:v4:%08X\r\n", sDevVAddr.uiAddr);
-       
+
     PDUMPCOMMENT("SAB :SGXMEM:v4:%08X 4 0 hostport.bin", sDevVAddr.uiAddr);
 
-       
+
        pui32PD[ui32PDIndex] = 0;
        pui32PT[ui32PTIndex] = 0;
 
-       
+
        PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, psDevInfo->hBRN22997PDPageOSMemHandle, pui32PD, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
        PDUMPMEMPTENTRIES(&psDevInfo->sMMUAttrib, psDevInfo->hBRN22997PTPageOSMemHandle, pui32PT, SGX_MMU_PAGE_SIZE, 0, IMG_TRUE, PDUMP_PT_UNIQUETAG, PDUMP_PD_UNIQUETAG);
 
@@ -3529,7 +3686,7 @@ IMG_VOID WorkaroundBRN22997Free(PVRSRV_DEVICE_NODE *psDeviceNode)
        PDUMPFREEPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN22997PDPageOSMemHandle, psDevInfo->pui32BRN22997PD, SGX_MMU_PAGE_SIZE, 0, PDUMP_PD_UNIQUETAG);
        PDUMPFREEPAGETABLE(&psDeviceNode->sDevId, psDevInfo->hBRN22997PTPageOSMemHandle, psDevInfo->pui32BRN22997PT, SGX_MMU_PAGE_SIZE, 0, PDUMP_PT_UNIQUETAG);
 
-       
+
        if(psLocalDevMemArena == IMG_NULL)
        {
                if (psDevInfo->pui32BRN22997PD != IMG_NULL)
@@ -3562,7 +3719,7 @@ IMG_VOID WorkaroundBRN22997Free(PVRSRV_DEVICE_NODE *psDeviceNode)
                }
        }
 }
-#endif 
+#endif
 
 
 #if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
@@ -3599,12 +3756,13 @@ PVRSRV_ERROR MMU_MapExtSystemCacheRegs(PVRSRV_DEVICE_NODE *psDeviceNode)
 
        pui32PT = (IMG_UINT32 *) psDeviceNode->sDevMemoryInfo.pBMKernelContext->psMMUContext->apsPTInfoList[ui32PDIndex]->PTPageCpuVAddr;
 
-       
+       MakeKernelPageReadWrite(pui32PT);
+
        pui32PT[ui32PTIndex] = (psDevInfo->sExtSysCacheRegsDevPBase.uiAddr>>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                        | SGX_MMU_PTE_VALID;
-
+       MakeKernelPageReadOnly(pui32PT);
 #if defined(PDUMP)
-       
+
        {
                IMG_DEV_PHYADDR sDevPAddr;
                IMG_CPU_PHYADDR sCpuPAddr;
@@ -3666,11 +3824,11 @@ PVRSRV_ERROR MMU_UnmapExtSystemCacheRegs(PVRSRV_DEVICE_NODE *psDeviceNode)
 
        psLocalDevMemArena = psSysData->apsLocalDevMemArena[0];
 
-       
+
        ui32PDIndex = (SGX_EXT_SYSTEM_CACHE_REGS_DEVVADDR_BASE & SGX_MMU_PD_MASK) >> (SGX_MMU_PAGE_SHIFT + SGX_MMU_PT_SHIFT);
        ui32PTIndex = (SGX_EXT_SYSTEM_CACHE_REGS_DEVVADDR_BASE & SGX_MMU_PT_MASK) >> SGX_MMU_PAGE_SHIFT;
 
-       
+
        if (psDeviceNode->sDevMemoryInfo.pBMKernelContext->psMMUContext->apsPTInfoList[ui32PDIndex])
        {
                if (psDeviceNode->sDevMemoryInfo.pBMKernelContext->psMMUContext->apsPTInfoList[ui32PDIndex]->PTPageCpuVAddr)
@@ -3679,7 +3837,9 @@ PVRSRV_ERROR MMU_UnmapExtSystemCacheRegs(PVRSRV_DEVICE_NODE *psDeviceNode)
                }
        }
 
+       MakeKernelPageReadWrite(pui32PT);
        pui32PT[ui32PTIndex] = 0;
+       MakeKernelPageReadOnly(pui32PT);
 
        PDUMPMEMPTENTRIES(&sMMUAttrib, psDeviceNode->sDevMemoryInfo.pBMKernelContext->psMMUContext->hPDOSMemHandle, &pui32PT[ui32PTIndex], sizeof(IMG_UINT32), 0, IMG_FALSE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
 
@@ -3706,7 +3866,7 @@ static IMG_VOID PageTest(IMG_VOID* pMem, IMG_DEV_PHYADDR sDevPAddr)
 
                if (ui32WriteData != ui32ReadData)
                {
-                       
+
                        PVR_DPF ((PVR_DBG_ERROR, "Error - memory page test failed at device phys address 0x%08X", sDevPAddr.uiAddr + (n<<2) ));
                        PVR_DBG_BREAK;
                        bOK = IMG_FALSE;
@@ -3722,7 +3882,7 @@ static IMG_VOID PageTest(IMG_VOID* pMem, IMG_DEV_PHYADDR sDevPAddr)
 
                if (ui32WriteData != ui32ReadData)
                {
-                       
+
                        PVR_DPF ((PVR_DBG_ERROR, "Error - memory page test failed at device phys address 0x%08X", sDevPAddr.uiAddr + (n<<2) ));
                        PVR_DBG_BREAK;
                        bOK = IMG_FALSE;
old mode 100755 (executable)
new mode 100644 (file)
index 59b24c4..d78f5c5
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -61,10 +61,10 @@ MMU_Free (MMU_HEAP *pMMUHeap,
           IMG_DEV_VIRTADDR DevVAddr,
                  IMG_UINT32 ui32Size);
 
-IMG_VOID 
+IMG_VOID
 MMU_Enable (MMU_HEAP *pMMUHeap);
 
-IMG_VOID 
+IMG_VOID
 MMU_Disable (MMU_HEAP *pMMUHeap);
 
 IMG_VOID
@@ -78,7 +78,7 @@ MMU_MapPages (MMU_HEAP *pMMUHeap,
 IMG_VOID
 MMU_MapShadow (MMU_HEAP          * pMMUHeap,
                IMG_DEV_VIRTADDR    MapBaseDevVAddr,
-               IMG_SIZE_T          uByteSize, 
+               IMG_SIZE_T          uByteSize,
                IMG_CPU_VIRTADDR    CpuVAddr,
                IMG_HANDLE          hOSMemHandle,
                IMG_DEV_VIRTADDR  * pDevVAddr,
@@ -129,13 +129,13 @@ PVRSRV_ERROR WorkaroundBRN22997Alloc(PVRSRV_DEVICE_NODE   *psDeviceNode);
 IMG_VOID WorkaroundBRN22997ReadHostPort(PVRSRV_SGXDEV_INFO *psDevInfo);
 
 IMG_VOID WorkaroundBRN22997Free(PVRSRV_DEVICE_NODE *psDeviceNode);
-#endif 
+#endif
 
 #if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
 PVRSRV_ERROR MMU_MapExtSystemCacheRegs(PVRSRV_DEVICE_NODE *psDeviceNode);
 
 PVRSRV_ERROR MMU_UnmapExtSystemCacheRegs(PVRSRV_DEVICE_NODE *psDeviceNode);
-#endif 
+#endif
 
 IMG_BOOL MMU_IsHeapShared(MMU_HEAP* pMMU_Heap);
 
@@ -149,6 +149,6 @@ IMG_VOID MMU_GetPDPhysAddr(MMU_CONTEXT *pMMUContext, IMG_DEV_PHYADDR *psDevPAddr
 
 #if defined(PDUMP)
 IMG_UINT32 MMU_GetPDumpContextID(IMG_HANDLE hDevMemContext);
-#endif 
+#endif
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index ab6523a..2bd974a
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -108,7 +108,7 @@ SGXFindSharedPBDescKM(PVRSRV_PER_PROCESS_DATA       *psPerProc,
                                          sizeof(PVRSRV_KERNEL_MEM_INFO *) * psStubPBDesc->ui32SubKernelMemInfosCount,
                                          ppsSharedPBDescSubKernelMemInfos,
                                          0);
-                       
+
 
                        PVR_DPF((PVR_DBG_ERROR, "SGXFindSharedPBDescKM: ResManRegisterRes failed"));
 
@@ -173,15 +173,15 @@ ExitNotFound:
 static PVRSRV_ERROR
 SGXCleanupSharedPBDescKM(PVRSRV_STUB_PBDESC *psStubPBDescIn)
 {
-       
+
        IMG_UINT32 i;
        PVRSRV_DEVICE_NODE *psDeviceNode;
 
        psDeviceNode = (PVRSRV_DEVICE_NODE*)psStubPBDescIn->hDevCookie;
 
-       
 
-       
+
+
        psStubPBDescIn->ui32RefCount--;
        if (psStubPBDescIn->ui32RefCount == 0)
        {
@@ -189,7 +189,7 @@ SGXCleanupSharedPBDescKM(PVRSRV_STUB_PBDESC *psStubPBDescIn)
                List_PVRSRV_STUB_PBDESC_Remove(psStubPBDescIn);
                for(i=0 ; i<psStubPBDescIn->ui32SubKernelMemInfosCount; i++)
                {
-                       
+
                        PVRSRVFreeDeviceMemKM(psStubPBDescIn->hDevCookie,
                                                                  psStubPBDescIn->ppsSubKernelMemInfos[i]);
                }
@@ -212,16 +212,16 @@ SGXCleanupSharedPBDescKM(PVRSRV_STUB_PBDESC *psStubPBDescIn)
                                  sizeof(PVRSRV_STUB_PBDESC),
                                  psStubPBDescIn,
                                  0);
-               
 
-               
+
+
                SGXCleanupRequest(psDeviceNode,
                                                  &sHWPBDescDevVAddr,
                                                  PVRSRV_CLEANUPCMD_PB,
                                                  CLEANUP_WITH_POLL);
        }
        return PVRSRV_OK;
-       
+
 }
 
 static PVRSRV_ERROR SGXCleanupSharedPBDescCallback(IMG_PVOID pvParam, IMG_UINT32 ui32Param, IMG_BOOL bDummy)
@@ -281,7 +281,7 @@ SGXAddSharedPBDescKM(PVRSRV_PER_PROCESS_DATA        *psPerProc,
        PVRSRV_SGXDEV_INFO *psSGXDevInfo;
        PRESMAN_ITEM psResItem;
 
-       
+
        if (psPerProcCreateSharedPB != psPerProc)
        {
                goto NoAdd;
@@ -309,7 +309,7 @@ SGXAddSharedPBDescKM(PVRSRV_PER_PROCESS_DATA        *psPerProc,
 
                }
 
-               
+
                psResItem = ResManRegisterRes(psPerProc->hResManContext,
                                                                          RESMAN_TYPE_SHARED_PB_DESC,
                                                                          psStubPBDesc,
@@ -324,7 +324,7 @@ SGXAddSharedPBDescKM(PVRSRV_PER_PROCESS_DATA        *psPerProc,
                        goto NoAddKeepPB;
                }
 
-               
+
                psStubPBDesc->ui32RefCount++;
 
                *phSharedPBDesc = (IMG_HANDLE)psResItem;
@@ -423,7 +423,7 @@ SGXAddSharedPBDescKM(PVRSRV_PER_PROCESS_DATA        *psPerProc,
        }
        psStubPBDesc->hDevCookie = hDevCookie;
 
-       
+
        List_PVRSRV_STUB_PBDESC_Insert(&(psSGXDevInfo->psStubPBDescListKM),
                                                                        psStubPBDesc);
 
@@ -446,7 +446,7 @@ NoAdd:
                                  sizeof(PVRSRV_STUB_PBDESC),
                                  psStubPBDesc,
                                  0);
-               
+
        }
 
 NoAddKeepPB:
old mode 100755 (executable)
new mode 100644 (file)
index 8fb3002..6db7941
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -156,5 +156,5 @@ SGXGetInternalDevInfoKM(IMG_HANDLE hDevCookie,
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 90f6dd5..3cddfca
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
        #define SGX_GENERAL_HEAP_BASE                            0x08000000
        #define SGX_GENERAL_HEAP_SIZE                           (0xB8000000-0x00001000)
 
-       
+
        #define SGX_3DPARAMETERS_HEAP_SIZE                      0x10000000
 
-       
+
 #if !defined(HYBRID_SHARED_PB_SIZE)
        #define HYBRID_SHARED_PB_SIZE                           (SGX_3DPARAMETERS_HEAP_SIZE >> 1)
 #endif
 #endif
 
        #define SGX_SHARED_3DPARAMETERS_HEAP_BASE                0xC0000000
-       
+
 
        #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE            (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE)
-       
+
 
        #define SGX_TADATA_HEAP_BASE                             0xD0000000
        #define SGX_TADATA_HEAP_SIZE                            (0x0D000000-0x00001000)
        #define SGX_KERNEL_DATA_HEAP_BASE                       0xF0000000
        #define SGX_KERNEL_DATA_HEAP_SIZE                       (0x03000000-(0x00001000+SGX_KERNEL_DATA_HEAP_OFFSET))
 
-       
+
        #define SGX_PIXELSHADER_HEAP_BASE                        0xF4000000
        #define SGX_PIXELSHADER_HEAP_SIZE                       (0x05000000-0x00001000)
-       
+
        #define SGX_VERTEXSHADER_HEAP_BASE                       0xFC000000
        #define SGX_VERTEXSHADER_HEAP_SIZE                      (0x02000000-0x00001000)
-#else 
+#else
        #if defined(SGX_FEATURE_2D_HARDWARE)
        #define SGX_2D_HEAP_BASE                                         0x00100000
        #define SGX_2D_HEAP_SIZE                                        (0x08000000-0x00100000-0x00001000)
        #define SGX_GENERAL_HEAP_SIZE                           (0xC2000000-0x00001000)
        #else
                #include <sgx_msvdx_defs.h>
-               
-               
+
+
                #define SGX_GENERAL_HEAP_BASE                            0x10000000
                #define SGX_GENERAL_HEAP_SIZE                           (0xB5000000-0x00001000)
 
                #define SGX_VPB_TILED_HEAP_BASE          0xC5000000
                #define SGX_VPB_TILED_HEAP_SIZE (0x0D000000-0x00001000)
 
-               
+
                #if((SGX_VPB_TILED_HEAP_BASE & SGX_BIF_TILING_ADDR_INV_MASK) != 0)
                #error "sgxconfig.h: SGX_VPB_TILED_HEAP has insufficient alignment"
                #endif
 
-       #endif 
+       #endif
+
 
-       
        #define SGX_3DPARAMETERS_HEAP_SIZE                      0x10000000
 
-       
+
 #if !defined(HYBRID_SHARED_PB_SIZE)
        #define HYBRID_SHARED_PB_SIZE                           (SGX_3DPARAMETERS_HEAP_SIZE >> 1)
 #endif
 #endif
 
        #define SGX_SHARED_3DPARAMETERS_HEAP_BASE                0xD2000000
-       
+
 
        #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE            (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE)
-       
+
 
        #define SGX_TADATA_HEAP_BASE                             0xE2000000
        #define SGX_TADATA_HEAP_SIZE                            (0x0D000000-0x00001000)
        #define SGX_KERNEL_DATA_HEAP_BASE                       0xF4000000
        #define SGX_KERNEL_DATA_HEAP_SIZE                       (0x05000000-(0x00001000+SGX_KERNEL_DATA_HEAP_OFFSET))
 
-       
+
        #define SGX_PIXELSHADER_HEAP_BASE                        0xF9000000
        #define SGX_PIXELSHADER_HEAP_SIZE                       (0x05000000-0x00001000)
-       
+
        #define SGX_VERTEXSHADER_HEAP_BASE                       0xFE000000
        #define SGX_VERTEXSHADER_HEAP_SIZE                      (0x02000000-0x00001000)
-#endif 
-       
+#endif
+
        #define SGX_CORE_IDENTIFIED
-#endif 
+#endif
 
 #if SGX_FEATURE_ADDRESS_SPACE_SIZE == 28
 
        #define SGX_GENERAL_HEAP_SIZE                           (0x08800000-0x00001000-0x00001000)
 #endif
 #endif
-       
+
 #if defined(SUPPORT_LARGE_GENERAL_HEAP)
        #define SGX_3DPARAMETERS_HEAP_SIZE                      0x01000000
 #else
        #define SGX_3DPARAMETERS_HEAP_SIZE                      0x04000000
 #endif
 
-       
+
 #if !defined(HYBRID_SHARED_PB_SIZE)
        #define HYBRID_SHARED_PB_SIZE                           (SGX_3DPARAMETERS_HEAP_SIZE >> 1)
 #endif
        #define SGX_SHARED_3DPARAMETERS_HEAP_BASE                0x08800000
 #endif
 
-       
+
 
        #define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE            (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE)
-       
+
 
        #define SGX_TADATA_HEAP_BASE                             0x0C800000
        #define SGX_TADATA_HEAP_SIZE                            (0x01000000-0x00001000)
        #define SGX_VERTEXSHADER_HEAP_BASE                       0x0FC00000
        #define SGX_VERTEXSHADER_HEAP_SIZE                      (0x00200000-0x00001000)
 
-       
+
        #define SGX_CORE_IDENTIFIED
 
-#endif 
+#endif
 
 #if !defined(SGX_CORE_IDENTIFIED)
        #error "sgxconfig.h: ERROR: unspecified SGX Core version"
        #if ((SGX_KERNEL_CODE_HEAP_BASE + SGX_KERNEL_CODE_HEAP_SIZE - SGX_PDSPIXEL_CODEDATA_HEAP_BASE) >  0x4000000)
                #error "sgxconfig.h: ERROR: SGX_KERNEL_CODE_HEAP_BASE out of range of SGX_PDSPIXEL_CODEDATA_HEAP_BASE"
        #endif
-       
+
        #if ((SGX_PDSVERTEX_CODEDATA_HEAP_BASE + SGX_PDSVERTEX_CODEDATA_HEAP_SIZE - SGX_PDSPIXEL_CODEDATA_HEAP_BASE) >  0x4000000)
                #error "sgxconfig.h: ERROR: SGX_PDSVERTEX_CODEDATA_HEAP_BASE out of range of SGX_PDSPIXEL_CODEDATA_HEAP_BASE"
        #endif
-#endif 
+#endif
 
 #if defined(SGX_FEATURE_2D_HARDWARE) && defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
        #if ((SGX_GENERAL_MAPPING_HEAP_BASE + SGX_GENERAL_MAPPING_HEAP_SIZE - SGX_2D_HEAP_BASE) >= EUR_CR_BIF_TWOD_REQ_BASE_ADDR_MASK)
        #error "sgxconfig.h: ERROR: SGX_VERTEXSHADER_HEAP_BASE size cause wraparound"
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 8fe92e3..2a5ad79
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -58,40 +58,40 @@ typedef struct _PVRSRV_SGXDEV_INFO_
        IMG_UINT32                              ui32CoreConfig;
        IMG_UINT32                              ui32CoreFlags;
 
-       
+
        IMG_PVOID                               pvRegsBaseKM;
 
 #if defined(SGX_FEATURE_HOST_PORT)
-       
+
        IMG_PVOID                               pvHostPortBaseKM;
-       
+
        IMG_UINT32                              ui32HPSize;
-       
+
        IMG_SYS_PHYADDR                 sHPSysPAddr;
 #endif
 
-       
+
        IMG_HANDLE                              hRegMapping;
 
-       
+
        IMG_SYS_PHYADDR                 sRegsPhysBase;
-       
+
        IMG_UINT32                              ui32RegSize;
 
 #if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
-       
+
        IMG_UINT32                              ui32ExtSysCacheRegsSize;
-       
+
        IMG_DEV_PHYADDR                 sExtSysCacheRegsDevPBase;
-       
+
        IMG_UINT32                              *pui32ExtSystemCacheRegsPT;
-       
+
        IMG_HANDLE                              hExtSystemCacheRegsPTPageOSMemHandle;
-       
+
        IMG_SYS_PHYADDR                 sExtSystemCacheRegsPTSysPAddr;
 #endif
 
-       
+
        IMG_UINT32                              ui32CoreClockSpeed;
        IMG_UINT32                              ui32uKernelTimerClock;
        IMG_BOOL                                bSGXIdle;
@@ -99,34 +99,34 @@ typedef struct _PVRSRV_SGXDEV_INFO_
        PVRSRV_STUB_PBDESC              *psStubPBDescListKM;
 
 
-       
+
        IMG_DEV_PHYADDR                 sKernelPDDevPAddr;
 
        IMG_UINT32                              ui32HeapCount;
        IMG_VOID                                *pvDeviceMemoryHeap;
-       PPVRSRV_KERNEL_MEM_INFO psKernelCCBMemInfo;                     
-       PVRSRV_SGX_KERNEL_CCB   *psKernelCCB;                   
-       PPVRSRV_SGX_CCB_INFO    psKernelCCBInfo;                
-       PPVRSRV_KERNEL_MEM_INFO psKernelCCBCtlMemInfo;  
-       PVRSRV_SGX_CCB_CTL              *psKernelCCBCtl;                
-       PPVRSRV_KERNEL_MEM_INFO psKernelCCBEventKickerMemInfo; 
-       IMG_UINT32                              *pui32KernelCCBEventKicker; 
+       PPVRSRV_KERNEL_MEM_INFO psKernelCCBMemInfo;
+       PVRSRV_SGX_KERNEL_CCB   *psKernelCCB;
+       PPVRSRV_SGX_CCB_INFO    psKernelCCBInfo;
+       PPVRSRV_KERNEL_MEM_INFO psKernelCCBCtlMemInfo;
+       PVRSRV_SGX_CCB_CTL              *psKernelCCBCtl;
+       PPVRSRV_KERNEL_MEM_INFO psKernelCCBEventKickerMemInfo;
+       IMG_UINT32                              *pui32KernelCCBEventKicker;
 #if defined(PDUMP)
-       IMG_UINT32                              ui32KernelCCBEventKickerDumpVal; 
-#endif 
-       PVRSRV_KERNEL_MEM_INFO  *psKernelSGXMiscMemInfo;        
-       IMG_UINT32                              aui32HostKickAddr[SGXMKIF_CMD_MAX];             
+       IMG_UINT32                              ui32KernelCCBEventKickerDumpVal;
+#endif
+       PVRSRV_KERNEL_MEM_INFO  *psKernelSGXMiscMemInfo;
+       IMG_UINT32                              aui32HostKickAddr[SGXMKIF_CMD_MAX];
 #if defined(SGX_SUPPORT_HWPROFILING)
        PPVRSRV_KERNEL_MEM_INFO psKernelHWProfilingMemInfo;
 #endif
-       PPVRSRV_KERNEL_MEM_INFO         psKernelHWPerfCBMemInfo;                
-       PPVRSRV_KERNEL_MEM_INFO         psKernelTASigBufferMemInfo;             
-       PPVRSRV_KERNEL_MEM_INFO         psKernel3DSigBufferMemInfo;             
+       PPVRSRV_KERNEL_MEM_INFO         psKernelHWPerfCBMemInfo;
+       PPVRSRV_KERNEL_MEM_INFO         psKernelTASigBufferMemInfo;
+       PPVRSRV_KERNEL_MEM_INFO         psKernel3DSigBufferMemInfo;
 #if defined(FIX_HW_BRN_29702)
-       PPVRSRV_KERNEL_MEM_INFO psKernelCFIMemInfo;     
+       PPVRSRV_KERNEL_MEM_INFO psKernelCFIMemInfo;
 #endif
 #if defined(FIX_HW_BRN_29823)
-       PPVRSRV_KERNEL_MEM_INFO psKernelDummyTermStreamMemInfo; 
+       PPVRSRV_KERNEL_MEM_INFO psKernelDummyTermStreamMemInfo;
 #endif
 #if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && defined(FIX_HW_BRN_31425)
        PPVRSRV_KERNEL_MEM_INFO psKernelVDMSnapShotBufferMemInfo;
@@ -137,29 +137,29 @@ typedef struct _PVRSRV_SGXDEV_INFO_
        PPVRSRV_KERNEL_MEM_INFO psKernelVDMStateUpdateBufferMemInfo;
 #endif
 #if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
-       PPVRSRV_KERNEL_MEM_INFO psKernelEDMStatusBufferMemInfo; 
+       PPVRSRV_KERNEL_MEM_INFO psKernelEDMStatusBufferMemInfo;
 #endif
 #if defined(SGX_FEATURE_OVERLAPPED_SPM)
-       PPVRSRV_KERNEL_MEM_INFO psKernelTmpRgnHeaderMemInfo; 
+       PPVRSRV_KERNEL_MEM_INFO psKernelTmpRgnHeaderMemInfo;
 #endif
-       
+
        IMG_UINT32                              ui32ClientRefCount;
 
-       
+
        IMG_UINT32                              ui32CacheControl;
 
-       
+
        IMG_UINT32                              ui32ClientBuildOptions;
 
-       
+
        SGX_MISCINFO_STRUCT_SIZES       sSGXStructSizes;
 
-       
+
 
 
        IMG_VOID                                *pvMMUContextList;
 
-       
+
        IMG_BOOL                                bForcePTOff;
 
        IMG_UINT32                              ui32EDMTaskReg0;
@@ -174,10 +174,10 @@ typedef struct _PVRSRV_SGXDEV_INFO_
        IMG_UINT32                              ui32MasterClkGateStatusMask;
        IMG_UINT32                              ui32MasterClkGateStatus2Reg;
        IMG_UINT32                              ui32MasterClkGateStatus2Mask;
-#endif 
+#endif
        SGX_INIT_SCRIPTS                sScripts;
 
-       
+
        IMG_HANDLE                              hBIFResetPDOSMemHandle;
        IMG_DEV_PHYADDR                 sBIFResetPDDevPAddr;
        IMG_DEV_PHYADDR                 sBIFResetPTDevPAddr;
@@ -186,7 +186,7 @@ typedef struct _PVRSRV_SGXDEV_INFO_
        IMG_UINT32                              *pui32BIFResetPT;
 
 #if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
-       
+
        IMG_HANDLE                              hBRN22997PTPageOSMemHandle;
        IMG_HANDLE                              hBRN22997PDPageOSMemHandle;
        IMG_DEV_PHYADDR                 sBRN22997PTDevPAddr;
@@ -194,23 +194,23 @@ typedef struct _PVRSRV_SGXDEV_INFO_
        IMG_UINT32                              *pui32BRN22997PT;
        IMG_UINT32                              *pui32BRN22997PD;
        IMG_SYS_PHYADDR                 sBRN22997SysPAddr;
-#endif 
+#endif
 
 #if defined(SUPPORT_HW_RECOVERY)
-       
+
        IMG_HANDLE                              hTimer;
-       
+
        IMG_UINT32                              ui32TimeStamp;
 #endif
 
-       
+
        IMG_UINT32                              ui32NumResets;
 
-       
+
        PVRSRV_KERNEL_MEM_INFO                  *psKernelSGXHostCtlMemInfo;
        SGXMKIF_HOST_CTL                                *psSGXHostCtl;
 
-       
+
        PVRSRV_KERNEL_MEM_INFO                  *psKernelSGXTA3DCtlMemInfo;
 
 #if defined(FIX_HW_BRN_31272) || defined(FIX_HW_BRN_31780) || defined(FIX_HW_BRN_33920)
@@ -219,7 +219,7 @@ typedef struct _PVRSRV_SGXDEV_INFO_
 
        IMG_UINT32                              ui32Flags;
 
-       
+
        IMG_UINT32                              ui32MemTilingUsage;
 
        #if defined(PDUMP)
@@ -227,7 +227,7 @@ typedef struct _PVRSRV_SGXDEV_INFO_
        #endif
 
 #if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-       
+
        IMG_VOID                                *pvDummyPTPageCpuVAddr;
        IMG_DEV_PHYADDR                 sDummyPTDevPAddr;
        IMG_HANDLE                              hDummyPTPageOSMemHandle;
@@ -241,12 +241,12 @@ typedef struct _PVRSRV_SGXDEV_INFO_
        IMG_UINT32                              asSGXDevData[SGX_MAX_DEV_DATA];
 
 #if defined(FIX_HW_BRN_31620)
-       
+
        IMG_VOID                        *pvBRN31620DummyPageCpuVAddr;
        IMG_HANDLE                      hBRN31620DummyPageOSMemHandle;
        IMG_DEV_PHYADDR                 sBRN31620DummyPageDevPAddr;
 
-       
+
        IMG_VOID                        *pvBRN31620DummyPTCpuVAddr;
        IMG_HANDLE                      hBRN31620DummyPTOSMemHandle;
        IMG_DEV_PHYADDR                 sBRN31620DummyPTDevPAddr;
@@ -270,7 +270,7 @@ typedef struct _SGX_DEVICE_MAP_
 {
        IMG_UINT32                              ui32Flags;
 
-       
+
        IMG_SYS_PHYADDR                 sRegsSysPBase;
        IMG_CPU_PHYADDR                 sRegsCpuPBase;
        IMG_CPU_VIRTADDR                pvRegsCpuVBase;
@@ -282,7 +282,7 @@ typedef struct _SGX_DEVICE_MAP_
        IMG_UINT32                              ui32HPSize;
 #endif
 
-       
+
        IMG_SYS_PHYADDR                 sLocalMemSysPBase;
        IMG_DEV_PHYADDR                 sLocalMemDevPBase;
        IMG_CPU_PHYADDR                 sLocalMemCpuPBase;
@@ -293,15 +293,15 @@ typedef struct _SGX_DEVICE_MAP_
        IMG_DEV_PHYADDR                 sExtSysCacheRegsDevPBase;
 #endif
 
-       
+
        IMG_UINT32                              ui32IRQ;
 
 #if !defined(SGX_DYNAMIC_TIMING_INFO)
-       
+
        SGX_TIMING_INFORMATION  sTimingInfo;
 #endif
 #if defined(PDUMP)
-       
+
        IMG_CHAR                                *pszPDumpDevName;
 #endif
 } SGX_DEVICE_MAP;
@@ -325,13 +325,13 @@ struct _PVRSRV_STUB_PBDESC_
 
 typedef struct _PVRSRV_SGX_CCB_INFO_
 {
-       PVRSRV_KERNEL_MEM_INFO  *psCCBMemInfo;                  
-       PVRSRV_KERNEL_MEM_INFO  *psCCBCtlMemInfo;               
-       SGXMKIF_COMMAND         *psCommands;                    
-       IMG_UINT32                              *pui32WriteOffset;              
-       volatile IMG_UINT32             *pui32ReadOffset;               
+       PVRSRV_KERNEL_MEM_INFO  *psCCBMemInfo;
+       PVRSRV_KERNEL_MEM_INFO  *psCCBCtlMemInfo;
+       SGXMKIF_COMMAND         *psCommands;
+       IMG_UINT32                              *pui32WriteOffset;
+       volatile IMG_UINT32             *pui32ReadOffset;
 #if defined(PDUMP)
-       IMG_UINT32                              ui32CCBDumpWOff;                
+       IMG_UINT32                              ui32CCBDumpWOff;
 #endif
 } PVRSRV_SGX_CCB_INFO;
 
@@ -383,7 +383,7 @@ typedef struct _SGX_BRIDGE_INIT_INFO_KM_
        IMG_UINT32 ui32ClkGateStatusReg;
        IMG_UINT32 ui32ClkGateStatusMask;
 #if defined(SGX_FEATURE_MP)
-#endif 
+#endif
 
        IMG_UINT32 ui32CacheControl;
 
@@ -408,7 +408,7 @@ typedef struct _SGX_CCB_KICK_KM_
        IMG_UINT32      ui32NumDstSyncObjects;
        IMG_HANDLE      hKernelHWSyncListMemInfo;
 
-       
+
        IMG_HANDLE      *pahDstSyncHandles;
 
        IMG_UINT32      ui32NumTAStatusVals;
@@ -427,11 +427,11 @@ typedef struct _SGX_CCB_KICK_KM_
        IMG_BOOL        bTerminateOrAbort;
 #endif
 
-       
+
        IMG_UINT32      ui32CCBOffset;
 
 #if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-       
+
        IMG_UINT32      ui32NumTASrcSyncs;
        IMG_HANDLE      ahTASrcKernelSyncInfo[SGX_MAX_TA_SRC_SYNCS];
        IMG_UINT32      ui32NumTADstSyncs;
@@ -439,12 +439,12 @@ typedef struct _SGX_CCB_KICK_KM_
        IMG_UINT32      ui32Num3DSrcSyncs;
        IMG_HANDLE      ah3DSrcKernelSyncInfo[SGX_MAX_3D_SRC_SYNCS];
 #else
-       
+
        IMG_UINT32      ui32NumSrcSyncs;
        IMG_HANDLE      ahSrcKernelSyncInfo[SGX_MAX_SRC_SYNCS];
 #endif
 
-       
+
        IMG_BOOL        bTADependency;
        IMG_HANDLE      hTA3DSyncInfo;
 
@@ -495,13 +495,13 @@ typedef struct _PVRSRV_2D_SGX_KICK_KM_
        IMG_UINT32              ui32NumSrcSync;
        IMG_HANDLE              ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
 
-       
+
        IMG_HANDLE              hDstSyncInfo;
 
-       
+
        IMG_HANDLE              hTASyncInfo;
 
-       
+
        IMG_HANDLE              h3DSyncInfo;
 
        IMG_UINT32              ui32PDumpFlags;
@@ -509,8 +509,8 @@ typedef struct _PVRSRV_2D_SGX_KICK_KM_
        IMG_UINT32              ui32CCBDumpWOff;
 #endif
 } PVRSRV_2D_SGX_KICK_KM, *PPVRSRV_2D_SGX_KICK_KM;
-#endif 
-#endif 
+#endif
+#endif
 
 PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode);
 
@@ -527,12 +527,12 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO     *psDevInfo,
                                                   IMG_BOOL                             bHardwareRecovery);
 PVRSRV_ERROR SGXDeinitialise(IMG_HANDLE hDevCookie);
 
-PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE                               hDevHandle, 
-                                                         PVRSRV_DEV_POWER_STATE        eNewPowerState, 
+PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE                               hDevHandle,
+                                                         PVRSRV_DEV_POWER_STATE        eNewPowerState,
                                                          PVRSRV_DEV_POWER_STATE        eCurrentPowerState);
 
-PVRSRV_ERROR SGXPostPowerState(IMG_HANDLE                              hDevHandle, 
-                                                          PVRSRV_DEV_POWER_STATE       eNewPowerState, 
+PVRSRV_ERROR SGXPostPowerState(IMG_HANDLE                              hDevHandle,
+                                                          PVRSRV_DEV_POWER_STATE       eNewPowerState,
                                                           PVRSRV_DEV_POWER_STATE       eCurrentPowerState);
 
 PVRSRV_ERROR SGXPreClockSpeedChange(IMG_HANDLE                         hDevHandle,
@@ -575,5 +575,5 @@ static INLINE IMG_VOID NoHardwareGenerateEvent(PVRSRV_SGXDEV_INFO           *psDevInfo,
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index b0fc7b2..5f26b20
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #include "lists.h"
 #include "srvkm.h"
 #include "ttrace.h"
-
 #define VAR(x) #x
 
+
 #define CHECK_SIZE(NAME) \
 {      \
        if (psSGXStructSizes->ui32Sizeof_##NAME != psDevInfo->sSGXStructSizes.ui32Sizeof_##NAME) \
@@ -87,7 +86,7 @@ static IMG_VOID SGXCommandComplete(PVRSRV_DEVICE_NODE *psDeviceNode)
 #if defined(OS_SUPPORTS_IN_LISR)
        if (OSInLISR(psDeviceNode->psSysData))
        {
-               
+
                psDeviceNode->bReProcessDeviceCommandComplete = IMG_TRUE;
        }
        else
@@ -103,7 +102,7 @@ static IMG_UINT32 DeinitDevInfo(PVRSRV_SGXDEV_INFO *psDevInfo)
 {
        if (psDevInfo->psKernelCCBInfo != IMG_NULL)
        {
-               
+
 
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_SGX_CCB_INFO), psDevInfo->psKernelCCBInfo, IMG_NULL);
        }
@@ -175,13 +174,13 @@ static PVRSRV_ERROR InitDevInfo(PVRSRV_PER_PROCESS_DATA *psPerProc,
 #if defined(SGX_FEATURE_OVERLAPPED_SPM)
        psDevInfo->psKernelTmpRgnHeaderMemInfo = (PVRSRV_KERNEL_MEM_INFO *)psInitInfo->hKernelTmpRgnHeaderMemInfo;
 #endif
-       
+
        psDevInfo->ui32ClientBuildOptions = psInitInfo->ui32ClientBuildOptions;
 
-       
+
        psDevInfo->sSGXStructSizes = psInitInfo->sSGXStructSizes;
 
-       
+
 
        eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                                sizeof(PVRSRV_SGX_CCB_INFO),
@@ -202,7 +201,7 @@ static PVRSRV_ERROR InitDevInfo(PVRSRV_PER_PROCESS_DATA *psPerProc,
        psKernelCCBInfo->pui32ReadOffset        = &psDevInfo->psKernelCCBCtl->ui32ReadOffset;
        psDevInfo->psKernelCCBInfo = psKernelCCBInfo;
 
-       
+
 
        OSMemCopy(psDevInfo->aui32HostKickAddr, psInitInfo->aui32HostKickAddr,
                          SGXMKIF_CMD_MAX * sizeof(psDevInfo->aui32HostKickAddr[0]));
@@ -222,10 +221,10 @@ static PVRSRV_ERROR InitDevInfo(PVRSRV_PER_PROCESS_DATA *psPerProc,
        psDevInfo->ui32MasterClkGateStatusMask = psInitInfo->ui32MasterClkGateStatusMask;
        psDevInfo->ui32MasterClkGateStatus2Reg = psInitInfo->ui32MasterClkGateStatus2Reg;
        psDevInfo->ui32MasterClkGateStatus2Mask = psInitInfo->ui32MasterClkGateStatus2Mask;
-#endif 
+#endif
+
 
 
-       
        OSMemCopy(&psDevInfo->asSGXDevData, &psInitInfo->asInitDevData, sizeof(psDevInfo->asSGXDevData));
 
        return PVRSRV_OK;
@@ -270,7 +269,7 @@ static PVRSRV_ERROR SGXRunScript(PVRSRV_SGXDEV_INFO *psDevInfo, SGX_INIT_COMMAND
                                return PVRSRV_OK;
                        }
                        case SGX_INIT_OP_ILLEGAL:
-                       
+
                        default:
                        {
                                PVR_DPF((PVR_DBG_ERROR,"SGXRunScript: PC %d: Illegal command: %d", ui32PC, psComm->eOp));
@@ -361,15 +360,15 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO     *psDevInfo,
        static IMG_BOOL                 bFirstTime = IMG_TRUE;
 #if defined(PDUMP)
        IMG_BOOL                                bPDumpIsSuspended = PDumpIsSuspended();
-#endif 
+#endif
 
 #if defined(SGX_FEATURE_MP)
-       
+
 #else
        SGXInitClocks(psDevInfo, PDUMP_FLAGS_CONTINUOUS);
-#endif 
-       
-       
+#endif
+
+
 
        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "SGX initialisation script part 1\n");
        eError = SGXRunScript(psDevInfo, psDevInfo->sScripts.asInitCommandsPart1, SGX_MAX_INIT_COMMANDS);
@@ -380,13 +379,13 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO     *psDevInfo,
        }
        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "End of SGX initialisation script part 1\n");
 
-       
+
        psDevInfo->ui32NumResets++;
        SGXReset(psDevInfo, bFirstTime || bHardwareRecovery, PDUMP_FLAGS_CONTINUOUS);
 
 #if defined(EUR_CR_POWER)
 #if defined(SGX531)
-       
+
 
 
 
@@ -394,13 +393,13 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO     *psDevInfo,
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_POWER, 1);
        PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_POWER, 1);
 #else
-       
+
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_POWER, 0);
        PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_POWER, 0);
 #endif
 #endif
 
-       
+
        *psDevInfo->pui32KernelCCBEventKicker = 0;
 #if defined(PDUMP)
        if (!bPDumpIsSuspended)
@@ -411,7 +410,7 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO       *psDevInfo,
                                 sizeof(*psDevInfo->pui32KernelCCBEventKicker), PDUMP_FLAGS_CONTINUOUS,
                                 MAKEUNIQUETAG(psDevInfo->psKernelCCBEventKickerMemInfo));
        }
-#endif 
+#endif
 
 #if defined(SUPPORT_MEMORY_TILING)
        {
@@ -444,7 +443,7 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO       *psDevInfo,
        }
 #endif
 
-       
+
 
        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "SGX initialisation script part 2\n");
        eError = SGXRunScript(psDevInfo, psDevInfo->sScripts.asInitCommandsPart2, SGX_MAX_INIT_COMMANDS);
@@ -455,7 +454,7 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO       *psDevInfo,
        }
        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "End of SGX initialisation script part 2\n");
 
-       
+
        psSGXHostCtl->ui32HostClock = OSClockus();
 
        psSGXHostCtl->ui32InitStatus = 0;
@@ -468,7 +467,7 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO       *psDevInfo,
                         MAKEUNIQUETAG(psSGXHostCtlMemInfo));
        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS,
                                                  "Initialise the microkernel\n");
-#endif 
+#endif
 
 #if defined(SGX_FEATURE_MULTI_EVENT_KICK)
        OSWriteMemoryBarrier();
@@ -481,12 +480,12 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO     *psDevInfo,
        OSWriteHWReg(psDevInfo->pvRegsBaseKM,
                                 SGX_MP_CORE_SELECT(EUR_CR_EVENT_KICK, 0),
                                 EUR_CR_EVENT_KICK_NOW_MASK);
-#endif 
+#endif
 
        OSMemoryBarrier();
 
 #if defined(PDUMP)
-       
+
 
        if (!bPDumpIsSuspended)
        {
@@ -503,12 +502,12 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO     *psDevInfo,
                                 PDUMP_FLAGS_CONTINUOUS,
                                 MAKEUNIQUETAG(psDevInfo->psKernelCCBEventKickerMemInfo));
                PDUMPREG(SGX_PDUMPREG_NAME, SGX_MP_CORE_SELECT(EUR_CR_EVENT_KICK, 0), EUR_CR_EVENT_KICK_NOW_MASK);
-#endif 
+#endif
        }
-#endif 
+#endif
 
 #if !defined(NO_HARDWARE)
-       
+
 
        if (PollForValueKM(&psSGXHostCtl->ui32InitStatus,
                                           PVRSRV_USSE_EDM_INIT_COMPLETE,
@@ -521,10 +520,10 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO     *psDevInfo,
                #if !defined(FIX_HW_BRN_23281)
                SGXDumpDebugInfo(psDevInfo, IMG_FALSE);
                PVR_DBG_BREAK;
-               #endif 
+               #endif
                return PVRSRV_ERROR_RETRY;
        }
-#endif 
+#endif
 
 #if defined(PDUMP)
        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS,
@@ -536,19 +535,19 @@ PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO     *psDevInfo,
                                PDUMP_POLL_OPERATOR_EQUAL,
                                PDUMP_FLAGS_CONTINUOUS,
                                MAKEUNIQUETAG(psSGXHostCtlMemInfo));
-#endif 
+#endif
 
 #if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
-       
+
 
 
        WorkaroundBRN22997ReadHostPort(psDevInfo);
-#endif 
+#endif
 
        PVR_ASSERT(psDevInfo->psKernelCCBCtl->ui32ReadOffset == psDevInfo->psKernelCCBCtl->ui32WriteOffset);
 
        bFirstTime = IMG_FALSE;
-       
+
        return PVRSRV_OK;
 }
 
@@ -558,7 +557,7 @@ PVRSRV_ERROR SGXDeinitialise(IMG_HANDLE hDevCookie)
        PVRSRV_SGXDEV_INFO      *psDevInfo = (PVRSRV_SGXDEV_INFO *) hDevCookie;
        PVRSRV_ERROR            eError;
 
-       
+
        if (psDevInfo->pvRegsBaseKM == IMG_NULL)
        {
                return PVRSRV_OK;
@@ -586,16 +585,16 @@ static PVRSRV_ERROR DevInitSGXPart1 (IMG_VOID *pvDeviceNode)
        DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeap = psDeviceNode->sDevMemoryInfo.psDeviceMemoryHeap;
        PVRSRV_ERROR            eError;
 
-       
+
        PDUMPCOMMENT("SGX Core Version Information: %s", SGX_CORE_FRIENDLY_NAME);
-       
+
        #if defined(SGX_FEATURE_MP)
        #if !defined(SGX_FEATURE_MP_PLUS)
        PDUMPCOMMENT("SGX Multi-processor: %d cores", SGX_FEATURE_MP_CORE_COUNT);
        #else
        PDUMPCOMMENT("SGX Multi-processor: %d TA cores, %d 3D cores", SGX_FEATURE_MP_CORE_COUNT_TA, SGX_FEATURE_MP_CORE_COUNT_3D);
        #endif
-       #endif 
+       #endif
 
 #if (SGX_CORE_REV == 0)
        PDUMPCOMMENT("SGX Core Revision Information: head RTL");
@@ -607,12 +606,12 @@ static PVRSRV_ERROR DevInitSGXPart1 (IMG_VOID *pvDeviceNode)
        PDUMPCOMMENT("SGX System Level Cache is present\r\n");
        #if defined(SGX_BYPASS_SYSTEM_CACHE)
        PDUMPCOMMENT("SGX System Level Cache is bypassed\r\n");
-       #endif 
-       #endif 
+       #endif
+       #endif
 
        PDUMPCOMMENT("SGX Initialisation Part 1");
 
-       
+
        if(OSAllocMem( PVRSRV_OS_NON_PAGEABLE_HEAP,
                                         sizeof(PVRSRV_SGXDEV_INFO),
                                         (IMG_VOID **)&psDevInfo, IMG_NULL,
@@ -623,18 +622,18 @@ static PVRSRV_ERROR DevInitSGXPart1 (IMG_VOID *pvDeviceNode)
        }
        OSMemSet (psDevInfo, 0, sizeof(PVRSRV_SGXDEV_INFO));
 
-       
+
        psDevInfo->eDeviceType          = DEV_DEVICE_TYPE;
        psDevInfo->eDeviceClass         = DEV_DEVICE_CLASS;
 
-       
+
        psDeviceNode->pvDevice = (IMG_PVOID)psDevInfo;
 
-       
+
        psDevInfo->ui32HeapCount = psDeviceNode->sDevMemoryInfo.ui32HeapCount;
        psDevInfo->pvDeviceMemoryHeap = (IMG_VOID*)psDeviceMemoryHeap;
 
-       
+
        hKernelDevMemContext = BM_CreateContext(psDeviceNode,
                                                                                        &sPDDevPAddr,
                                                                                        IMG_NULL,
@@ -647,7 +646,7 @@ static PVRSRV_ERROR DevInitSGXPart1 (IMG_VOID *pvDeviceNode)
 
        psDevInfo->sKernelPDDevPAddr = sPDDevPAddr;
 
-       
+
        for(i=0; i<psDeviceNode->sDevMemoryInfo.ui32HeapCount; i++)
        {
                switch(psDeviceMemoryHeap[i].DevMemHeapType)
@@ -656,12 +655,12 @@ static PVRSRV_ERROR DevInitSGXPart1 (IMG_VOID *pvDeviceNode)
                        case DEVICE_MEMORY_HEAP_SHARED:
                        case DEVICE_MEMORY_HEAP_SHARED_EXPORTED:
                        {
-                               
+
                                if (psDeviceMemoryHeap[i].ui32HeapSize > 0)
                                {
                                        hDevMemHeap = BM_CreateHeap (hKernelDevMemContext,
                                                                                                &psDeviceMemoryHeap[i]);
-                                       
+
 
 
                                        psDeviceMemoryHeap[i].hDevMemHeap = hDevMemHeap;
@@ -673,7 +672,7 @@ static PVRSRV_ERROR DevInitSGXPart1 (IMG_VOID *pvDeviceNode)
 #if defined(PDUMP)
        if(hDevMemHeap)
        {
-               
+
                psDevInfo->sMMUAttrib = *((BM_HEAP*)hDevMemHeap)->psMMUAttrib;
        }
 #endif
@@ -741,7 +740,7 @@ PVRSRV_ERROR DevInitSGXPart2KM (PVRSRV_PER_PROCESS_DATA *psPerProc,
        psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevHandle;
        psDevInfo = (PVRSRV_SGXDEV_INFO *)psDeviceNode->pvDevice;
 
-       
+
 
        eError = InitDevInfo(psPerProc, psDeviceNode, psInitInfo);
        if (eError != PVRSRV_OK)
@@ -759,14 +758,14 @@ PVRSRV_ERROR DevInitSGXPart2KM (PVRSRV_PER_PROCESS_DATA *psPerProc,
                return PVRSRV_ERROR_INIT_FAILURE;
        }
 
-       
+
        if (psSGXDeviceMap->pvRegsCpuVBase)
        {
                psDevInfo->pvRegsBaseKM = psSGXDeviceMap->pvRegsCpuVBase;
        }
        else
        {
-               
+
                psDevInfo->pvRegsBaseKM = OSMapPhysToLin(psSGXDeviceMap->sRegsCpuPBase,
                                                                                           psSGXDeviceMap->ui32RegsSize,
                                                                                           PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
@@ -784,7 +783,7 @@ PVRSRV_ERROR DevInitSGXPart2KM (PVRSRV_PER_PROCESS_DATA *psPerProc,
 #if defined(SGX_FEATURE_HOST_PORT)
        if (psSGXDeviceMap->ui32Flags & SGX_HOSTPORT_PRESENT)
        {
-               
+
                psDevInfo->pvHostPortBaseKM = OSMapPhysToLin(psSGXDeviceMap->sHPCpuPBase,
                                                                                           psSGXDeviceMap->ui32HPSize,
                                                                                           PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
@@ -801,17 +800,17 @@ PVRSRV_ERROR DevInitSGXPart2KM (PVRSRV_PER_PROCESS_DATA *psPerProc,
 
 #if defined (SYS_USING_INTERRUPTS)
 
-       
+
        psDeviceNode->pvISRData = psDeviceNode;
-       
+
        PVR_ASSERT(psDeviceNode->pfnDeviceISR == SGX_ISRHandler);
 
-#endif 
+#endif
+
 
-       
        psDevInfo->psSGXHostCtl->ui32PowerStatus |= PVRSRV_USSE_EDM_POWMAN_NO_WORK;
        eDefaultPowerState = PVRSRV_DEV_POWER_STATE_OFF;
-       
+
        eError = PVRSRVRegisterPowerDevice (psDeviceNode->sDevId.ui32DeviceIndex,
                                                                                &SGXPrePowerState, &SGXPostPowerState,
                                                                                &SGXPreClockSpeedChange, &SGXPostClockSpeedChange,
@@ -831,10 +830,10 @@ PVRSRV_ERROR DevInitSGXPart2KM (PVRSRV_PER_PROCESS_DATA *psPerProc,
                PVR_DPF((PVR_DBG_ERROR,"SGXInitialise : Failed to alloc memory for BRN22997 workaround"));
                return eError;
        }
-#endif 
+#endif
 
 #if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
-       
+
        psDevInfo->ui32ExtSysCacheRegsSize = psSGXDeviceMap->ui32ExtSysCacheRegsSize;
        psDevInfo->sExtSysCacheRegsDevPBase = psSGXDeviceMap->sExtSysCacheRegsDevPBase;
        eError = MMU_MapExtSystemCacheRegs(psDeviceNode);
@@ -843,9 +842,9 @@ PVRSRV_ERROR DevInitSGXPart2KM (PVRSRV_PER_PROCESS_DATA *psPerProc,
                PVR_DPF((PVR_DBG_ERROR,"SGXInitialise : Failed to map external system cache registers"));
                return eError;
        }
-#endif 
+#endif
+
 
-       
 
        OSMemSet(psDevInfo->psKernelCCB, 0, sizeof(PVRSRV_SGX_KERNEL_CCB));
        OSMemSet(psDevInfo->psKernelCCBCtl, 0, sizeof(PVRSRV_SGX_CCB_CTL));
@@ -874,7 +873,7 @@ static PVRSRV_ERROR DevDeInitSGX (IMG_VOID *pvDeviceNode)
 
        if (!psDevInfo)
        {
-               
+
                PVR_DPF((PVR_DBG_ERROR,"DevDeInitSGX: Null DevInfo"));
                return PVRSRV_OK;
        }
@@ -890,29 +889,29 @@ static PVRSRV_ERROR DevDeInitSGX (IMG_VOID *pvDeviceNode)
                }
                psDevInfo->hTimer = IMG_NULL;
        }
-#endif 
+#endif
 
 #if defined(SUPPORT_EXTERNAL_SYSTEM_CACHE)
-       
+
        eError = MMU_UnmapExtSystemCacheRegs(psDeviceNode);
        if (eError != PVRSRV_OK)
        {
                PVR_DPF((PVR_DBG_ERROR,"DevDeInitSGX: Failed to unmap ext system cache registers"));
                return eError;
        }
-#endif 
+#endif
 
 #if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
        WorkaroundBRN22997Free(psDeviceNode);
-#endif 
+#endif
 
        MMU_BIFResetPDFree(psDevInfo);
 
-       
+
 
        DeinitDevInfo(psDevInfo);
 
-       
+
        psDeviceMemoryHeap = (DEVICE_MEMORY_HEAP_INFO *)psDevInfo->pvDeviceMemoryHeap;
        for(ui32Heap=0; ui32Heap<psDeviceNode->sDevMemoryInfo.ui32HeapCount; ui32Heap++)
        {
@@ -931,7 +930,7 @@ static PVRSRV_ERROR DevDeInitSGX (IMG_VOID *pvDeviceNode)
                }
        }
 
-       
+
        eError = BM_DestroyContext(psDeviceNode->sDevMemoryInfo.pBMKernelContext, IMG_NULL);
        if (eError != PVRSRV_OK)
        {
@@ -939,7 +938,7 @@ static PVRSRV_ERROR DevDeInitSGX (IMG_VOID *pvDeviceNode)
                return eError;
        }
 
-       
+
        eError = PVRSRVRemovePowerDevice (((PVRSRV_DEVICE_NODE*)pvDeviceNode)->sDevId.ui32DeviceIndex);
        if (eError != PVRSRV_OK)
        {
@@ -954,10 +953,10 @@ static PVRSRV_ERROR DevDeInitSGX (IMG_VOID *pvDeviceNode)
                return eError;
        }
 
-       
+
        if (!psSGXDeviceMap->pvRegsCpuVBase)
        {
-               
+
                if (psDevInfo->pvRegsBaseKM != IMG_NULL)
                {
                        OSUnMapPhysToLin(psDevInfo->pvRegsBaseKM,
@@ -970,7 +969,7 @@ static PVRSRV_ERROR DevDeInitSGX (IMG_VOID *pvDeviceNode)
 #if defined(SGX_FEATURE_HOST_PORT)
        if (psSGXDeviceMap->ui32Flags & SGX_HOSTPORT_PRESENT)
        {
-               
+
                if (psDevInfo->pvHostPortBaseKM != IMG_NULL)
                {
                        OSUnMapPhysToLin(psDevInfo->pvHostPortBaseKM,
@@ -979,10 +978,10 @@ static PVRSRV_ERROR DevDeInitSGX (IMG_VOID *pvDeviceNode)
                                                   IMG_NULL);
                }
        }
-#endif 
+#endif
+
 
 
-       
        OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                sizeof(PVRSRV_SGXDEV_INFO),
                                psDevInfo,
@@ -992,7 +991,7 @@ static PVRSRV_ERROR DevDeInitSGX (IMG_VOID *pvDeviceNode)
 
        if (psDeviceMemoryHeap != IMG_NULL)
        {
-       
+
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
                                sizeof(DEVICE_MEMORY_HEAP_INFO) * SGX_MAX_HEAP_ID,
                                psDeviceMemoryHeap,
@@ -1003,6 +1002,19 @@ static PVRSRV_ERROR DevDeInitSGX (IMG_VOID *pvDeviceNode)
 }
 
 
+#if defined(RESTRICTED_REGISTERS) && defined(SGX_FEATURE_MP)
+
+static IMG_VOID SGXDumpMasterDebugReg (PVRSRV_SGXDEV_INFO      *psDevInfo,
+                                                                IMG_CHAR                       *pszName,
+                                                                IMG_UINT32                     ui32RegAddr)
+{
+       IMG_UINT32      ui32RegVal;
+       ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, ui32RegAddr);
+       PVR_LOG(("(HYD) %s%08X", pszName, ui32RegVal));
+}
+
+#endif
+
 static IMG_VOID SGXDumpDebugReg (PVRSRV_SGXDEV_INFO    *psDevInfo,
                                                                 IMG_UINT32                     ui32CoreNum,
                                                                 IMG_CHAR                       *pszName,
@@ -1027,10 +1039,30 @@ IMG_VOID SGXDumpDebugInfo (PVRSRV_SGXDEV_INFO   *psDevInfo,
 
                SGXDumpDebugReg(psDevInfo, 0, "EUR_CR_CORE_ID:          ", EUR_CR_CORE_ID);
                SGXDumpDebugReg(psDevInfo, 0, "EUR_CR_CORE_REVISION:    ", EUR_CR_CORE_REVISION);
-
+#if defined(RESTRICTED_REGISTERS) && defined(SGX_FEATURE_MP)
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_BIF_INT_STAT:   ", EUR_CR_MASTER_BIF_INT_STAT);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_BIF_FAULT:      ",EUR_CR_MASTER_BIF_FAULT);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_CLKGATESTATUS2: ",EUR_CR_MASTER_CLKGATESTATUS2 );
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_PIM_STATUS: ",EUR_CR_MASTER_VDM_PIM_STATUS);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_BIF_BANK_SET:   ",EUR_CR_MASTER_BIF_BANK_SET);
+
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_EVENT_STATUS:   ",EUR_CR_MASTER_EVENT_STATUS);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_EVENT_STATUS2:  ",EUR_CR_MASTER_EVENT_STATUS2);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_MP_PRIMITIVE:   ",EUR_CR_MASTER_MP_PRIMITIVE);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_DPM_DPLIST_STATUS: ",EUR_CR_MASTER_DPM_DPLIST_STATUS);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_DPM_PROACTIVE_PIM_SPEC: ",EUR_CR_MASTER_DPM_PROACTIVE_PIM_SPEC);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_PAGE_MANAGEOP:  ",EUR_CR_MASTER_DPM_PAGE_MANAGEOP);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_SNAPSHOT: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_SNAPSHOT);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_LOAD_STATUS: ",EUR_CR_MASTER_VDM_CONTEXT_LOAD_STATUS);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_STREAM: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_STREAM);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_STATUS: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_STATUS);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_STATE0: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_STATE0);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_CONTEXT_STORE_STATE1: ",EUR_CR_MASTER_VDM_CONTEXT_STORE_STATE1);
+               SGXDumpMasterDebugReg(psDevInfo, "EUR_CR_MASTER_VDM_WAIT_FOR_KICK: ",EUR_CR_MASTER_VDM_WAIT_FOR_KICK);
+#endif
                for (ui32CoreNum = 0; ui32CoreNum < SGX_FEATURE_MP_CORE_COUNT_3D; ui32CoreNum++)
                {
-                       
+
                        SGXDumpDebugReg(psDevInfo, ui32CoreNum, "EUR_CR_EVENT_STATUS:     ", EUR_CR_EVENT_STATUS);
                        SGXDumpDebugReg(psDevInfo, ui32CoreNum, "EUR_CR_EVENT_STATUS2:    ", EUR_CR_EVENT_STATUS2);
                        SGXDumpDebugReg(psDevInfo, ui32CoreNum, "EUR_CR_BIF_CTRL:         ", EUR_CR_BIF_CTRL);
@@ -1047,12 +1079,12 @@ IMG_VOID SGXDumpDebugInfo (PVRSRV_SGXDEV_INFO   *psDevInfo,
                }
        }
 
-       
+
 
        QueueDumpDebugInfo();
 
        {
-               
+
 
                SGXMKIF_HOST_CTL        *psSGXHostCtl = psDevInfo->psSGXHostCtl;
                IMG_UINT32                      *pui32HostCtlBuffer = (IMG_UINT32 *)psSGXHostCtl;
@@ -1077,7 +1109,7 @@ IMG_VOID SGXDumpDebugInfo (PVRSRV_SGXDEV_INFO     *psDevInfo,
        }
 
        {
-               
+
 
                IMG_UINT32      *pui32TA3DCtlBuffer = psDevInfo->psKernelSGXTA3DCtlMemInfo->pvLinAddrKM;
                IMG_UINT32      ui32LoopCounter;
@@ -1107,7 +1139,7 @@ IMG_VOID SGXDumpDebugInfo (PVRSRV_SGXDEV_INFO     *psDevInfo,
                PVR_LOG(("Last SGX microkernel status code: %08X", ui32LastStatusCode));
 
                #if defined(PVRSRV_DUMP_MK_TRACE)
-               
+
 
                {
                        IMG_UINT32      ui32LoopCounter;
@@ -1123,12 +1155,12 @@ IMG_VOID SGXDumpDebugInfo (PVRSRV_SGXDEV_INFO   *psDevInfo,
                                                 pui32BufPtr[2], pui32BufPtr[3], pui32BufPtr[1], pui32BufPtr[0]));
                        }
                }
-               #endif 
+               #endif
        }
-       #endif 
+       #endif
 
        {
-               
+
 
                PVR_LOG(("SGX Kernel CCB WO:0x%X RO:0x%X",
                                psDevInfo->psKernelCCBCtl->ui32WriteOffset,
@@ -1151,7 +1183,7 @@ IMG_VOID SGXDumpDebugInfo (PVRSRV_SGXDEV_INFO     *psDevInfo,
                                                psCommand->ui32Data[2], psCommand->ui32Data[3]));
                        }
                }
-               #endif 
+               #endif
        }
        #if defined (TTRACE)
        PVRSRVDumpTimeTraceBuffers();
@@ -1172,12 +1204,12 @@ IMG_VOID HWRecoveryResetSGX (PVRSRV_DEVICE_NODE *psDeviceNode,
 
        PVR_UNREFERENCED_PARAMETER(ui32Component);
 
-       
+
 
        eError = PVRSRVPowerLock(ui32CallerID, IMG_FALSE);
        if(eError != PVRSRV_OK)
        {
-               
+
 
 
                PVR_DPF((PVR_DBG_WARNING,"HWRecoveryResetSGX: Power transition in progress"));
@@ -1190,14 +1222,14 @@ IMG_VOID HWRecoveryResetSGX (PVRSRV_DEVICE_NODE *psDeviceNode,
 
        SGXDumpDebugInfo(psDeviceNode->pvDevice, IMG_TRUE);
 
-       
+
        PDUMPSUSPEND();
 
-       
+
 #if defined(FIX_HW_BRN_23281)
-       
+
        for (eError = PVRSRV_ERROR_RETRY; eError == PVRSRV_ERROR_RETRY;)
-#endif 
+#endif
        {
                eError = SGXInitialise(psDevInfo, IMG_TRUE);
        }
@@ -1206,19 +1238,19 @@ IMG_VOID HWRecoveryResetSGX (PVRSRV_DEVICE_NODE *psDeviceNode,
                PVR_DPF((PVR_DBG_ERROR,"HWRecoveryResetSGX: SGXInitialise failed (%d)", eError));
        }
 
-       
+
        PDUMPRESUME();
 
        PVRSRVPowerUnlock(ui32CallerID);
 
-       
+
        SGXScheduleProcessQueuesKM(psDeviceNode);
 
-       
-       
+
+
        PVRSRVProcessQueues(IMG_TRUE);
 }
-#endif 
+#endif
 
 
 #if defined(SUPPORT_HW_RECOVERY)
@@ -1227,7 +1259,7 @@ IMG_VOID SGXOSTimer(IMG_VOID *pvData)
        PVRSRV_DEVICE_NODE *psDeviceNode = pvData;
        PVRSRV_SGXDEV_INFO *psDevInfo = psDeviceNode->pvDevice;
        static IMG_UINT32       ui32EDMTasks = 0;
-       static IMG_UINT32       ui32LockupCounter = 0; 
+       static IMG_UINT32       ui32LockupCounter = 0;
        static IMG_UINT32       ui32OpenCLDelayCounter = 0;
        static IMG_UINT32       ui32NumResets = 0;
 #if defined(FIX_HW_BRN_31093)
@@ -1238,17 +1270,17 @@ IMG_VOID SGXOSTimer(IMG_VOID *pvData)
        IMG_BOOL                bLockup = IMG_FALSE;
        IMG_BOOL                bPoweredDown;
 
-       
+
        psDevInfo->ui32TimeStamp++;
 
 #if defined(NO_HARDWARE)
        bPoweredDown = IMG_TRUE;
 #else
        bPoweredDown = (SGXIsDevicePowered(psDeviceNode)) ? IMG_FALSE : IMG_TRUE;
-#endif 
+#endif
+
+
 
-       
-       
        if (bPoweredDown)
        {
                ui32LockupCounter = 0;
@@ -1258,7 +1290,7 @@ IMG_VOID SGXOSTimer(IMG_VOID *pvData)
        }
        else
        {
-               
+
                ui32CurrentEDMTasks = OSReadHWReg(psDevInfo->pvRegsBaseKM, psDevInfo->ui32EDMTaskReg0);
                if (psDevInfo->ui32EDMTaskReg1 != 0)
                {
@@ -1287,24 +1319,24 @@ IMG_VOID SGXOSTimer(IMG_VOID *pvData)
        #if defined(FIX_HW_BRN_31093)
                                if (bBRN31093Inval == IMG_FALSE)
                                {
-                                       
+
                #if defined(FIX_HW_BRN_29997)
                                        IMG_UINT32      ui32BIFCtrl;
 
                                        ui32BIFCtrl = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL);
                                        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32BIFCtrl | EUR_CR_BIF_CTRL_PAUSE_MASK);
-                                       
-                                       OSWaitus(200 * 1000000 / psDevInfo->ui32CoreClockSpeed);
+
+                                       SGXWaitClocks(psDevInfo, 200);
                #endif
-                                       
+
                                        bBRN31093Inval = IMG_TRUE;
-                                       
+
                                        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL_INVAL, EUR_CR_BIF_CTRL_INVAL_PTE_MASK);
-                                       
-                                       OSWaitus(200 * 1000000 / psDevInfo->ui32CoreClockSpeed);
-                                               
-               #if defined(FIX_HW_BRN_29997)   
-                                               
+
+                                       SGXWaitClocks(psDevInfo, 200);
+
+               #if defined(FIX_HW_BRN_29997)
+
                                        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32BIFCtrl);
                #endif
                                }
@@ -1334,14 +1366,14 @@ SGX_NoUKernel_LockUp:
        {
                SGXMKIF_HOST_CTL        *psSGXHostCtl = (SGXMKIF_HOST_CTL *)psDevInfo->psSGXHostCtl;
 
-               
+
                psSGXHostCtl->ui32HostDetectedLockups ++;
 
-               
+
                HWRecoveryResetSGX(psDeviceNode, 0, ISR_ID);
        }
 }
-#endif 
+#endif
 
 
 
@@ -1352,18 +1384,18 @@ IMG_BOOL SGX_ISRHandler (IMG_VOID *pvData)
        IMG_BOOL bInterruptProcessed = IMG_FALSE;
 
 
-       
+
        {
                IMG_UINT32 ui32EventStatus, ui32EventEnable;
                IMG_UINT32 ui32EventClear = 0;
 #if defined(SGX_FEATURE_DATA_BREAKPOINTS)
                IMG_UINT32 ui32EventStatus2, ui32EventEnable2;
-#endif         
+#endif
                IMG_UINT32 ui32EventClear2 = 0;
                PVRSRV_DEVICE_NODE *psDeviceNode;
                PVRSRV_SGXDEV_INFO *psDevInfo;
 
-               
+
                if(pvData == IMG_NULL)
                {
                        PVR_DPF((PVR_DBG_ERROR, "SGX_ISRHandler: Invalid params\n"));
@@ -1376,18 +1408,18 @@ IMG_BOOL SGX_ISRHandler (IMG_VOID *pvData)
                ui32EventStatus = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS);
                ui32EventEnable = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_ENABLE);
 
-               
+
                ui32EventStatus &= ui32EventEnable;
 
 #if defined(SGX_FEATURE_DATA_BREAKPOINTS)
                ui32EventStatus2 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS2);
                ui32EventEnable2 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_ENABLE2);
 
-               
+
                ui32EventStatus2 &= ui32EventEnable2;
-#endif 
+#endif
+
 
-               
 
                if (ui32EventStatus & EUR_CR_EVENT_STATUS_SW_EVENT_MASK)
                {
@@ -1404,16 +1436,16 @@ IMG_BOOL SGX_ISRHandler (IMG_VOID *pvData)
                {
                        ui32EventClear2 |= EUR_CR_EVENT_HOST_CLEAR2_DATA_BREAKPOINT_TRAPPED_MASK;
                }
-#endif 
+#endif
 
                if (ui32EventClear || ui32EventClear2)
                {
                        bInterruptProcessed = IMG_TRUE;
 
-                       
+
                        ui32EventClear |= EUR_CR_EVENT_HOST_CLEAR_MASTER_INTERRUPT_MASK;
 
-                       
+
                        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR, ui32EventClear);
                        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR2, ui32EventClear2);
                }
@@ -1444,7 +1476,7 @@ static IMG_VOID SGX_MISRHandler (IMG_VOID *pvData)
 
        SGXTestActivePowerEvent(psDeviceNode, ISR_ID);
 }
-#endif 
+#endif
 
 #if defined(SUPPORT_MEMORY_TILING)
 
@@ -1475,14 +1507,14 @@ PVRSRV_ERROR SGX_FreeMemTilingRange(PVRSRV_DEVICE_NODE *psDeviceNode,
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
 
-       
+
        psDevInfo->ui32MemTilingUsage &= ~(1<<ui32RangeIndex);
 
-       
+
        ui32Offset = EUR_CR_BIF_TILE0 + (ui32RangeIndex<<2);
        ui32Val = 0;
 
-       
+
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, ui32Offset, ui32Val);
        PDUMPREG(SGX_PDUMPREG_NAME, ui32Offset, ui32Val);
 
@@ -1500,7 +1532,7 @@ static IMG_VOID SGXCacheInvalidate(PVRSRV_DEVICE_NODE *psDeviceNode)
        psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_SL;
        #else
        PVR_UNREFERENCED_PARAMETER(psDevInfo);
-       #endif 
+       #endif
 }
 
 PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
@@ -1508,12 +1540,12 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        DEVICE_MEMORY_INFO *psDevMemoryInfo;
        DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeap;
 
-       
+
        psDeviceNode->sDevId.eDeviceType                = DEV_DEVICE_TYPE;
        psDeviceNode->sDevId.eDeviceClass               = DEV_DEVICE_CLASS;
 #if defined(PDUMP)
        {
-               
+
                SGX_DEVICE_MAP *psSGXDeviceMemMap;
                SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE_SGX,
                                                          (IMG_VOID**)&psSGXDeviceMemMap);
@@ -1521,9 +1553,9 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
                psDeviceNode->sDevId.pszPDumpDevName = psSGXDeviceMemMap->pszPDumpDevName;
                PVR_ASSERT(psDeviceNode->sDevId.pszPDumpDevName != IMG_NULL);
        }
-       
+
        psDeviceNode->sDevId.pszPDumpRegName    = SGX_PDUMPREG_NAME;
-#endif 
+#endif
 
        psDeviceNode->pfnInitDevice             = &DevInitSGXPart1;
        psDeviceNode->pfnDeInitDevice   = &DevDeInitSGX;
@@ -1533,7 +1565,7 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceNode->pfnPDumpInitDevice = &SGXResetPDump;
        psDeviceNode->pfnMMUGetContextID = &MMU_GetPDumpContextID;
 #endif
-       
+
 
        psDeviceNode->pfnMMUInitialise = &MMU_Initialise;
        psDeviceNode->pfnMMUFinalise = &MMU_Finalise;
@@ -1559,7 +1591,7 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceNode->pfnMMUGetPDPhysAddr = IMG_NULL;
 #endif
 #if defined (SYS_USING_INTERRUPTS)
-       
+
 
        psDeviceNode->pfnDeviceISR = SGX_ISRHandler;
        psDeviceNode->pfnDeviceMISR = SGX_MISRHandler;
@@ -1570,22 +1602,22 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceNode->pfnFreeMemTilingRange = SGX_FreeMemTilingRange;
 #endif
 
-       
+
 
        psDeviceNode->pfnDeviceCommandComplete = &SGXCommandComplete;
 
        psDeviceNode->pfnCacheInvalidate = SGXCacheInvalidate;
 
-       
+
 
        psDevMemoryInfo = &psDeviceNode->sDevMemoryInfo;
-       
+
        psDevMemoryInfo->ui32AddressSpaceSizeLog2 = SGX_FEATURE_ADDRESS_SPACE_SIZE;
 
-       
+
        psDevMemoryInfo->ui32Flags = 0;
 
-       
+
        if(OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
                                         sizeof(DEVICE_MEMORY_HEAP_INFO) * SGX_MAX_HEAP_ID,
                                         (IMG_VOID **)&psDevMemoryInfo->psDeviceMemoryHeap, 0,
@@ -1598,7 +1630,7 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
 
        psDeviceMemoryHeap = psDevMemoryInfo->psDeviceMemoryHeap;
 
-       
+
 
 
 
@@ -1614,7 +1646,7 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
 
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
 #if !defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
-       
+
        psDevMemoryInfo->ui32MappingHeapID = (IMG_UINT32)(psDeviceMemoryHeap - psDevMemoryInfo->psDeviceMemoryHeap);
 #endif
        psDeviceMemoryHeap++;
@@ -1637,7 +1669,7 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap++;
 #endif
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_TADATA_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_TADATA_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_TADATA_HEAP_SIZE;
@@ -1647,12 +1679,12 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszName = "TA Data";
        psDeviceMemoryHeap->pszBSName = "TA Data BS";
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
 
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_KERNEL_CODE_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_KERNEL_CODE_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_KERNEL_CODE_HEAP_SIZE;
@@ -1662,12 +1694,12 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszName = "Kernel Code";
        psDeviceMemoryHeap->pszBSName = "Kernel Code BS";
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
 
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_KERNEL_DATA_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_KERNEL_DATA_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_KERNEL_DATA_HEAP_SIZE;
@@ -1677,15 +1709,15 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszName = "KernelData";
        psDeviceMemoryHeap->pszBSName = "KernelData BS";
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
 
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_PIXELSHADER_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_PIXELSHADER_HEAP_BASE;
-       
+
 
 
 
@@ -1699,15 +1731,15 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszName = "PixelShaderUSSE";
        psDeviceMemoryHeap->pszBSName = "PixelShaderUSSE BS";
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
 
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_VERTEXSHADER_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_VERTEXSHADER_HEAP_BASE;
-       
+
        psDeviceMemoryHeap->ui32HeapSize = ((4 << SGX_USE_CODE_SEGMENT_RANGE_BITS) - 0x00001000);
        PVR_ASSERT(psDeviceMemoryHeap->ui32HeapSize <= SGX_VERTEXSHADER_HEAP_SIZE);
        psDeviceMemoryHeap->ui32Attribs = PVRSRV_HAP_WRITECOMBINE
@@ -1716,12 +1748,12 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszName = "VertexShaderUSSE";
        psDeviceMemoryHeap->pszBSName = "VertexShaderUSSE BS";
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
 
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_PDSPIXEL_CODEDATA_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_PDSPIXEL_CODEDATA_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_PDSPIXEL_CODEDATA_HEAP_SIZE;
@@ -1731,12 +1763,12 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszName = "PDSPixelCodeData";
        psDeviceMemoryHeap->pszBSName = "PDSPixelCodeData BS";
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
 
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_PDSVERTEX_CODEDATA_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_PDSVERTEX_CODEDATA_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_PDSVERTEX_CODEDATA_HEAP_SIZE;
@@ -1746,12 +1778,12 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszName = "PDSVertexCodeData";
        psDeviceMemoryHeap->pszBSName = "PDSVertexCodeData BS";
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
 
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_SYNCINFO_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_SYNCINFO_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_SYNCINFO_HEAP_SIZE;
@@ -1761,14 +1793,14 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszName = "CacheCoherent";
        psDeviceMemoryHeap->pszBSName = "CacheCoherent BS";
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
-       
+
        psDevMemoryInfo->ui32SyncHeapID = (IMG_UINT32)(psDeviceMemoryHeap - psDevMemoryInfo->psDeviceMemoryHeap);
        psDeviceMemoryHeap++;
 
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_SHARED_3DPARAMETERS_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_SHARED_3DPARAMETERS_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_SHARED_3DPARAMETERS_HEAP_SIZE;
@@ -1779,11 +1811,11 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
                                                                                                        | PVRSRV_HAP_MULTI_PROCESS;
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
 
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
 
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE;
@@ -1793,13 +1825,13 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
                                                                                                                        | PVRSRV_MEM_RAM_BACKED_ALLOCATION
                                                                                                                        | PVRSRV_HAP_SINGLE_PROCESS;
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
 
 
 #if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_GENERAL_MAPPING_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_GENERAL_MAPPING_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_GENERAL_MAPPING_HEAP_SIZE;
@@ -1809,7 +1841,7 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszName = "GeneralMapping";
        psDeviceMemoryHeap->pszBSName = "GeneralMapping BS";
        #if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS) && defined(FIX_HW_BRN_23410)
-       
+
 
 
 
@@ -1817,20 +1849,20 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
 
 
                psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-       #else 
+       #else
                psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-       #endif 
+       #endif
+
 
-       
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
-       
+
        psDevMemoryInfo->ui32MappingHeapID = (IMG_UINT32)(psDeviceMemoryHeap - psDevMemoryInfo->psDeviceMemoryHeap);
        psDeviceMemoryHeap++;
-#endif 
+#endif
 
 
 #if defined(SGX_FEATURE_2D_HARDWARE)
-       
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_2D_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_2D_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_2D_HEAP_SIZE;
@@ -1839,17 +1871,17 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
                                                                                                                | PVRSRV_HAP_SINGLE_PROCESS;
        psDeviceMemoryHeap->pszName = "2D";
        psDeviceMemoryHeap->pszBSName = "2D BS";
-       
+
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
-#endif 
+#endif
 
 
 #if defined(FIX_HW_BRN_26915)
-       
-       
+
+
        psDeviceMemoryHeap->ui32HeapID = HEAP_ID( PVRSRV_DEVICE_TYPE_SGX, SGX_CGBUFFER_HEAP_ID);
        psDeviceMemoryHeap->sDevVAddrBase.uiAddr = SGX_CGBUFFER_HEAP_BASE;
        psDeviceMemoryHeap->ui32HeapSize = SGX_CGBUFFER_HEAP_SIZE;
@@ -1860,12 +1892,12 @@ PVRSRV_ERROR SGXRegisterDevice (PVRSRV_DEVICE_NODE *psDeviceNode)
        psDeviceMemoryHeap->pszBSName = "CGBuffer BS";
 
        psDeviceMemoryHeap->DevMemHeapType = DEVICE_MEMORY_HEAP_PERCONTEXT;
-       
+
        psDeviceMemoryHeap->ui32DataPageSize = SGX_MMU_PAGE_SIZE;
        psDeviceMemoryHeap++;
-#endif 
+#endif
+
 
-       
        psDevMemoryInfo->ui32HeapCount = (IMG_UINT32)(psDeviceMemoryHeap - psDevMemoryInfo->psDeviceMemoryHeap);
 
        return PVRSRV_OK;
@@ -1878,10 +1910,10 @@ PVRSRV_ERROR SGXResetPDump(PVRSRV_DEVICE_NODE *psDeviceNode)
        PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO *)(psDeviceNode->pvDevice);
        psDevInfo->psKernelCCBInfo->ui32CCBDumpWOff = 0;
        PVR_DPF((PVR_DBG_MESSAGE, "Reset pdump CCB write offset."));
-       
+
        return PVRSRV_OK;
 }
-#endif 
+#endif
 
 
 IMG_EXPORT
@@ -1890,19 +1922,19 @@ PVRSRV_ERROR SGXGetClientInfoKM(IMG_HANDLE                                      hDevCookie,
 {
        PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO *)((PVRSRV_DEVICE_NODE *)hDevCookie)->pvDevice;
 
-       
+
 
        psDevInfo->ui32ClientRefCount++;
 
-       
+
 
        psClientInfo->ui32ProcessID = OSGetCurrentProcessIDKM();
 
-       
+
 
        OSMemCopy(&psClientInfo->asDevData, &psDevInfo->asSGXDevData, sizeof(psClientInfo->asDevData));
 
-       
+
        return PVRSRV_OK;
 }
 
@@ -1922,12 +1954,12 @@ PVRSRV_ERROR SGXDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
        IMG_UINT32                      ui32BuildOptions, ui32BuildOptionsMismatch;
 #if !defined(NO_HARDWARE)
        PPVRSRV_KERNEL_MEM_INFO                 psMemInfo;
-       PVRSRV_SGX_MISCINFO_INFO                *psSGXMiscInfoInt;      
+       PVRSRV_SGX_MISCINFO_INFO                *psSGXMiscInfoInt;
        PVRSRV_SGX_MISCINFO_FEATURES    *psSGXFeatures;
-       SGX_MISCINFO_STRUCT_SIZES               *psSGXStructSizes;      
+       SGX_MISCINFO_STRUCT_SIZES               *psSGXStructSizes;
        IMG_BOOL                                                bStructSizesFailed;
 
-       
+
        IMG_BOOL        bCheckCoreRev;
        const IMG_UINT32 aui32CoreRevExceptions[] =
        {
@@ -1937,7 +1969,7 @@ PVRSRV_ERROR SGXDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
        IMG_UINT        i;
 #endif
 
-       
+
        if(psDeviceNode->sDevId.eDeviceType != PVRSRV_DEVICE_TYPE_SGX)
        {
                PVR_LOG(("(FAIL) SGXInit: Device not of type SGX"));
@@ -1947,8 +1979,8 @@ PVRSRV_ERROR SGXDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
 
        psDevInfo = psDeviceNode->pvDevice;
 
-       
-       
+
+
        ui32BuildOptions = (SGX_BUILD_OPTIONS);
        if (ui32BuildOptions != psDevInfo->ui32ClientBuildOptions)
        {
@@ -1977,13 +2009,13 @@ PVRSRV_ERROR SGXDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
 #if !defined (NO_HARDWARE)
        psMemInfo = psDevInfo->psKernelSGXMiscMemInfo;
 
-       
+
        psSGXMiscInfoInt = psMemInfo->pvLinAddrKM;
        psSGXMiscInfoInt->ui32MiscInfoFlags = 0;
        psSGXMiscInfoInt->ui32MiscInfoFlags |= PVRSRV_USSE_MISCINFO_GET_STRUCT_SIZES;
        eError = SGXGetMiscInfoUkernel(psDevInfo, psDeviceNode, IMG_NULL);
 
-       
+
        if(eError != PVRSRV_OK)
        {
                PVR_LOG(("(FAIL) SGXInit: Unable to validate device DDK version"));
@@ -2007,17 +2039,17 @@ PVRSRV_ERROR SGXDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
                                PVRVERSION_BUILD, psSGXFeatures->ui32DDKBuild));
        }
 
-       
+
        if (psSGXFeatures->ui32CoreRevSW == 0)
        {
-               
+
 
                PVR_LOG(("SGXInit: HW core rev (%x) check skipped.",
                                psSGXFeatures->ui32CoreRev));
        }
        else
        {
-               
+
                bCheckCoreRev = IMG_TRUE;
                for(i=0; i<ui32NumCoreExceptions; i+=2)
                {
@@ -2048,7 +2080,7 @@ PVRSRV_ERROR SGXDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
                }
        }
 
-       
+
        psSGXStructSizes = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXStructSizes;
 
        bStructSizesFailed = IMG_FALSE;
@@ -2083,7 +2115,7 @@ PVRSRV_ERROR SGXDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
                PVR_DPF((PVR_DBG_MESSAGE, "SGXInit: SGXMKIF structure sizes match. [ OK ]"));
        }
 
-       
+
        ui32BuildOptions = psSGXFeatures->ui32BuildOptions;
        if (ui32BuildOptions != (SGX_BUILD_OPTIONS))
        {
@@ -2108,7 +2140,7 @@ PVRSRV_ERROR SGXDevInitCompatCheck(PVRSRV_DEVICE_NODE *psDeviceNode)
        {
                PVR_DPF((PVR_DBG_MESSAGE, "SGXInit: Driver and microkernel build options match. [ OK ]"));
        }
-#endif 
+#endif
 
        eError = PVRSRV_OK;
 chk_exit:
@@ -2125,10 +2157,10 @@ PVRSRV_ERROR SGXGetMiscInfoUkernel(PVRSRV_SGXDEV_INFO   *psDevInfo,
                                                                   IMG_HANDLE hDevMemContext)
 {
        PVRSRV_ERROR            eError;
-       SGXMKIF_COMMAND         sCommandData;  
-       PVRSRV_SGX_MISCINFO_INFO                        *psSGXMiscInfoInt;      
-       PVRSRV_SGX_MISCINFO_FEATURES            *psSGXFeatures;         
-       SGX_MISCINFO_STRUCT_SIZES                       *psSGXStructSizes;      
+       SGXMKIF_COMMAND         sCommandData;
+       PVRSRV_SGX_MISCINFO_INFO                        *psSGXMiscInfoInt;
+       PVRSRV_SGX_MISCINFO_FEATURES            *psSGXFeatures;
+       SGX_MISCINFO_STRUCT_SIZES                       *psSGXStructSizes;
 
        PPVRSRV_KERNEL_MEM_INFO psMemInfo = psDevInfo->psKernelSGXMiscMemInfo;
 
@@ -2143,12 +2175,12 @@ PVRSRV_ERROR SGXGetMiscInfoUkernel(PVRSRV_SGXDEV_INFO   *psDevInfo,
 
        psSGXMiscInfoInt->ui32MiscInfoFlags &= ~PVRSRV_USSE_MISCINFO_READY;
 
-       
+
        OSMemSet(psSGXFeatures, 0, sizeof(*psSGXFeatures));
        OSMemSet(psSGXStructSizes, 0, sizeof(*psSGXStructSizes));
 
-       
-       sCommandData.ui32Data[1] = psMemInfo->sDevVAddr.uiAddr; 
+
+       sCommandData.ui32Data[1] = psMemInfo->sDevVAddr.uiAddr;
 
        PDUMPCOMMENT("Microkernel kick for SGXGetMiscInfo");
        eError = SGXScheduleCCBCommandKM(psDeviceNode,
@@ -2165,7 +2197,7 @@ PVRSRV_ERROR SGXGetMiscInfoUkernel(PVRSRV_SGXDEV_INFO     *psDevInfo,
                return eError;
        }
 
-       
+
 #if !defined(NO_HARDWARE)
        {
                IMG_BOOL bExit;
@@ -2180,14 +2212,14 @@ PVRSRV_ERROR SGXGetMiscInfoUkernel(PVRSRV_SGXDEV_INFO   *psDevInfo,
                        }
                } END_LOOP_UNTIL_TIMEOUT();
 
-               
+
                if (!bExit)
                {
                        PVR_DPF((PVR_DBG_ERROR, "SGXGetMiscInfoUkernel: Timeout occurred waiting for misc info."));
                        return PVRSRV_ERROR_TIMEOUT;
                }
        }
-#endif 
+#endif
 
        return PVRSRV_OK;
 }
@@ -2204,7 +2236,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
        PPVRSRV_KERNEL_MEM_INFO psMemInfo = psDevInfo->psKernelSGXMiscMemInfo;
        IMG_UINT32      *pui32MiscInfoFlags = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->ui32MiscInfoFlags;
 
-       
+
        *pui32MiscInfoFlags = 0;
 
 #if !defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
@@ -2225,14 +2257,14 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                        IMG_UINT32              ui32EndRegVal;
                        SGXMKIF_COMMAND sCommandData;
 
-                       
+
                        if(psMiscInfo->uData.sSGXBreakpointInfo.bBPEnable)
                        {
-                               
+
                                IMG_DEV_VIRTADDR sBPDevVAddr = psMiscInfo->uData.sSGXBreakpointInfo.sBPDevVAddr;
                                IMG_DEV_VIRTADDR sBPDevVAddrEnd = psMiscInfo->uData.sSGXBreakpointInfo.sBPDevVAddrEnd;
 
-                               
+
                                ui32StartRegVal = sBPDevVAddr.uiAddr & EUR_CR_BREAKPOINT0_START_ADDRESS_MASK;
                                ui32EndRegVal = sBPDevVAddrEnd.uiAddr & EUR_CR_BREAKPOINT0_END_ADDRESS_MASK;
 
@@ -2241,7 +2273,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                                ui32CtrlREnable = psMiscInfo->uData.sSGXBreakpointInfo.bRead;
                                ui32CtrlTrapEnable = psMiscInfo->uData.sSGXBreakpointInfo.bTrapped;
 
-                               
+
                                ui32RegVal = ((ui32MaskDM<<EUR_CR_BREAKPOINT0_MASK_DM_SHIFT) & EUR_CR_BREAKPOINT0_MASK_DM_MASK) |
                                                         ((ui32CtrlWEnable<<EUR_CR_BREAKPOINT0_CTRL_WENABLE_SHIFT) & EUR_CR_BREAKPOINT0_CTRL_WENABLE_MASK) |
                                                         ((ui32CtrlREnable<<EUR_CR_BREAKPOINT0_CTRL_RENABLE_SHIFT) & EUR_CR_BREAKPOINT0_CTRL_RENABLE_MASK) |
@@ -2249,17 +2281,17 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                        }
                        else
                        {
-                               
+
                                ui32RegVal = ui32StartRegVal = ui32EndRegVal = 0;
                        }
 
-                       
+
                        sCommandData.ui32Data[0] = psMiscInfo->uData.sSGXBreakpointInfo.ui32BPIndex;
                        sCommandData.ui32Data[1] = ui32StartRegVal;
                        sCommandData.ui32Data[2] = ui32EndRegVal;
                        sCommandData.ui32Data[3] = ui32RegVal;
 
-                       
+
                        psDevInfo->psSGXHostCtl->ui32BPSetClearSignal = 0;
 
                        PDUMPCOMMENT("Microkernel kick for setting a data breakpoint");
@@ -2278,7 +2310,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                        }
 
 #if defined(NO_HARDWARE)
-                       
+
                        psDevInfo->psSGXHostCtl->ui32BPSetClearSignal = 0;
 #else
                        {
@@ -2290,32 +2322,32 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                        if (psDevInfo->psSGXHostCtl->ui32BPSetClearSignal != 0)
                                        {
                                                bExit = IMG_TRUE;
-                                               
+
                                                psDevInfo->psSGXHostCtl->ui32BPSetClearSignal = 0;
                                                break;
                                        }
                                } END_LOOP_UNTIL_TIMEOUT();
 
-                               
+
                                if (!bExit)
                                {
                                        PVR_DPF((PVR_DBG_ERROR, "SGXGetMiscInfoKM: Timeout occurred waiting BP set/clear"));
                                        return PVRSRV_ERROR_TIMEOUT;
                                }
                        }
-#endif 
+#endif
 
                        return PVRSRV_OK;
                }
 
                case SGX_MISC_INFO_REQUEST_POLL_BREAKPOINT:
                {
-                       
 
 
 
 
-                       
+
+
 
 #if !defined(NO_HARDWARE)
 #if defined(SGX_FEATURE_MP)
@@ -2326,7 +2358,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
 #define NUM_PIPES_PLUS_ONE (SGX_FEATURE_PERPIPE_BKPT_REGS_NUMPIPES+1)
 #endif
                        IMG_BOOL bTrappedBPAny;
-#endif 
+#endif
                        IMG_BOOL bFoundOne;
 
 #if defined(SGX_FEATURE_MP)
@@ -2334,12 +2366,12 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                        bTrappedBPMaster = !!(EUR_CR_MASTER_BREAKPOINT_TRAPPED_MASK & OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_BREAKPOINT));
                        bTrappedBPAny = bTrappedBPMaster;
 #if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
-                       ui32TrappedBPPipeNum = 0; 
+                       ui32TrappedBPPipeNum = 0;
 #endif
                        for (ui32CoreNum = 0; ui32CoreNum < SGX_FEATURE_MP_CORE_COUNT_3D; ui32CoreNum++)
                        {
 #if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
-                               
+
 
 
 #define SGX_MP_CORE_PIPE_SELECT(r,c,p) \
@@ -2347,8 +2379,8 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                                for (ui32PipeNum = 0; ui32PipeNum < NUM_PIPES_PLUS_ONE; ui32PipeNum++)
                                {
                                        bFoundOne =
-                                               0 != (EUR_CR_PARTITION_BREAKPOINT_TRAPPED_MASK & 
-                                                         OSReadHWReg(psDevInfo->pvRegsBaseKM, 
+                                               0 != (EUR_CR_PARTITION_BREAKPOINT_TRAPPED_MASK &
+                                                         OSReadHWReg(psDevInfo->pvRegsBaseKM,
                                                                                  SGX_MP_CORE_PIPE_SELECT(BREAKPOINT,
                                                                                                                                  ui32CoreNum,
                                                                                                                                  ui32PipeNum)));
@@ -2359,23 +2391,23 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                                ui32TrappedBPPipeNum = ui32PipeNum;
                                        }
                                }
-#else 
+#else
                                bFoundOne = !!(EUR_CR_BREAKPOINT_TRAPPED_MASK & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT, ui32CoreNum)));
                                if (bFoundOne)
                                {
                                        bTrappedBPAny = IMG_TRUE;
                                        ui32TrappedBPCoreNum = ui32CoreNum;
                                }
-#endif 
+#endif
                        }
 
                        psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBP = bTrappedBPAny;
-#else 
+#else
 #if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
                        #error Not yet considered the case for per-pipe regs in non-mp case
 #endif
                        psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBP = 0 != (EUR_CR_BREAKPOINT_TRAPPED_MASK & OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BREAKPOINT));
-#endif 
+#endif
 
                        if (psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBP)
                        {
@@ -2385,14 +2417,14 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
 #if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
                                ui32Info0 = OSReadHWReg(psDevInfo->pvRegsBaseKM, bTrappedBPMaster?EUR_CR_MASTER_BREAKPOINT_TRAP_INFO0:SGX_MP_CORE_PIPE_SELECT(BREAKPOINT_TRAP_INFO0, ui32TrappedBPCoreNum, ui32TrappedBPPipeNum));
                                ui32Info1 = OSReadHWReg(psDevInfo->pvRegsBaseKM, bTrappedBPMaster?EUR_CR_MASTER_BREAKPOINT_TRAP_INFO1:SGX_MP_CORE_PIPE_SELECT(BREAKPOINT_TRAP_INFO1, ui32TrappedBPCoreNum, ui32TrappedBPPipeNum));
-#else 
+#else
                                ui32Info0 = OSReadHWReg(psDevInfo->pvRegsBaseKM, bTrappedBPMaster?EUR_CR_MASTER_BREAKPOINT_TRAP_INFO0:SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT_TRAP_INFO0, ui32TrappedBPCoreNum));
                                ui32Info1 = OSReadHWReg(psDevInfo->pvRegsBaseKM, bTrappedBPMaster?EUR_CR_MASTER_BREAKPOINT_TRAP_INFO1:SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT_TRAP_INFO1, ui32TrappedBPCoreNum));
-#endif 
-#else 
+#endif
+#else
                                ui32Info0 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BREAKPOINT_TRAP_INFO0);
                                ui32Info1 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BREAKPOINT_TRAP_INFO1);
-#endif 
+#endif
 
 #ifdef SGX_FEATURE_PERPIPE_BKPT_REGS
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32BPIndex = (ui32Info1 & EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_NUMBER_MASK) >> EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_NUMBER_SHIFT;
@@ -2401,41 +2433,41 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBPRead = !!(ui32Info1 & EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_RNW_MASK);
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPDataMaster = (ui32Info1 & EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_DATA_MASTER_MASK) >> EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_DATA_MASTER_SHIFT;
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPTag = (ui32Info1 & EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_TAG_MASK) >> EUR_CR_PARTITION_BREAKPOINT_TRAP_INFO1_TAG_SHIFT;
-#else 
+#else
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32BPIndex = (ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_NUMBER_MASK) >> EUR_CR_BREAKPOINT_TRAP_INFO1_NUMBER_SHIFT;
                                psMiscInfo->uData.sSGXBreakpointInfo.sTrappedBPDevVAddr.uiAddr = ui32Info0 & EUR_CR_BREAKPOINT_TRAP_INFO0_ADDRESS_MASK;
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPBurstLength = (ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_SIZE_MASK) >> EUR_CR_BREAKPOINT_TRAP_INFO1_SIZE_SHIFT;
                                psMiscInfo->uData.sSGXBreakpointInfo.bTrappedBPRead = !!(ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_RNW_MASK);
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPDataMaster = (ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_DATA_MASTER_MASK) >> EUR_CR_BREAKPOINT_TRAP_INFO1_DATA_MASTER_SHIFT;
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32TrappedBPTag = (ui32Info1 & EUR_CR_BREAKPOINT_TRAP_INFO1_TAG_MASK) >> EUR_CR_BREAKPOINT_TRAP_INFO1_TAG_SHIFT;
-#endif 
+#endif
 #if defined(SGX_FEATURE_MP)
 #if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
-                               
+
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum = bTrappedBPMaster?65535:(ui32TrappedBPCoreNum + (ui32TrappedBPPipeNum<<10));
-#else 
-                               
+#else
+
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum = bTrappedBPMaster?65535:ui32TrappedBPCoreNum;
-#endif 
-#else 
+#endif
+#else
 #if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
-                               
+
 #error non-mp perpipe regs not yet supported
-#else 
-                               
+#else
+
                                psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum = 65534;
-#endif 
-#endif 
+#endif
+#endif
                        }
-#endif 
+#endif
                        return PVRSRV_OK;
                }
 
                case SGX_MISC_INFO_REQUEST_RESUME_BREAKPOINT:
                {
-                       
-                       
-                       
+
+
+
 #if !defined(NO_HARDWARE)
 #if defined(SGX_FEATURE_MP)
                        IMG_UINT32 ui32CoreNum;
@@ -2443,7 +2475,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
 #if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
                        IMG_UINT32 ui32PipeNum;
 #endif
-#endif 
+#endif
                        IMG_UINT32 ui32OldSeqNum, ui32NewSeqNum;
 
 #if defined(SGX_FEATURE_MP)
@@ -2451,14 +2483,14 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                        ui32PipeNum = psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum >> 10;
                        ui32CoreNum = psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum & 1023;
                        bMaster = psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum > 32767;
-#else 
+#else
                        ui32CoreNum = psMiscInfo->uData.sSGXBreakpointInfo.ui32CoreNum;
                        bMaster = ui32CoreNum > SGX_FEATURE_MP_CORE_COUNT_3D;
-#endif 
+#endif
                        if (bMaster)
                        {
-                               
-                               
+
+
                                ui32OldSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_BREAKPOINT);
                                OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_BREAKPOINT_TRAP, EUR_CR_MASTER_BREAKPOINT_TRAP_WRNOTIFY_MASK | EUR_CR_MASTER_BREAKPOINT_TRAP_CONTINUE_MASK);
                                do
@@ -2468,9 +2500,9 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                                while (ui32OldSeqNum == ui32NewSeqNum);
                        }
                        else
-#endif 
+#endif
                        {
-                               
+
 #if defined(SGX_FEATURE_PERPIPE_BKPT_REGS)
                                ui32OldSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_PIPE_SELECT(BREAKPOINT, ui32CoreNum, ui32PipeNum));
                                OSWriteHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_PIPE_SELECT(BREAKPOINT_TRAP, ui32CoreNum, ui32PipeNum), EUR_CR_PARTITION_BREAKPOINT_TRAP_WRNOTIFY_MASK | EUR_CR_PARTITION_BREAKPOINT_TRAP_CONTINUE_MASK);
@@ -2479,7 +2511,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                                        ui32NewSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_PIPE_SELECT(BREAKPOINT, ui32CoreNum, ui32PipeNum));
                                }
                                while (ui32OldSeqNum == ui32NewSeqNum);
-#else 
+#else
                                ui32OldSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT, ui32CoreNum));
                                OSWriteHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT_TRAP, ui32CoreNum), EUR_CR_BREAKPOINT_TRAP_WRNOTIFY_MASK | EUR_CR_BREAKPOINT_TRAP_CONTINUE_MASK);
                                do
@@ -2487,12 +2519,12 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                        ui32NewSeqNum = 0x1c & OSReadHWReg(psDevInfo->pvRegsBaseKM, SGX_MP_CORE_SELECT(EUR_CR_BREAKPOINT, ui32CoreNum));
                                }
                                while (ui32OldSeqNum == ui32NewSeqNum);
-#endif 
+#endif
                        }
-#endif 
+#endif
                        return PVRSRV_OK;
                }
-#endif 
+#endif
 
                case SGX_MISC_INFO_REQUEST_CLOCKSPEED:
                {
@@ -2520,7 +2552,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
 
                case SGX_MISC_INFO_REQUEST_SPM:
                {
-                       
+
                        return PVRSRV_OK;
                }
 
@@ -2536,10 +2568,10 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                        }
                        psSGXFeatures = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXFeatures;
 
-                       
+
                        psMiscInfo->uData.sSGXFeatures = *psSGXFeatures;
 
-                       
+
                        PVR_DPF((PVR_DBG_MESSAGE, "SGXGetMiscInfoKM: Core 0x%x, sw ID 0x%x, sw Rev 0x%x\n",
                                        psSGXFeatures->ui32CoreRev,
                                        psSGXFeatures->ui32CoreIdSW,
@@ -2548,7 +2580,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                                        psSGXFeatures->ui32DDKVersion,
                                        psSGXFeatures->ui32DDKBuild));
 
-                       
+
                        return PVRSRV_OK;
                }
 
@@ -2558,7 +2590,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
 
                        psSGXFeatures = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXFeatures;
 
-                       
+
                        OSMemSet(psMemInfo->pvLinAddrKM, 0,
                                        sizeof(PVRSRV_SGX_MISCINFO_INFO));
 
@@ -2568,16 +2600,16 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                PVRVERSION_BRANCH;
                        psSGXFeatures->ui32DDKBuild = PVRVERSION_BUILD;
 
-                       
+
                        psSGXFeatures->ui32BuildOptions = (SGX_BUILD_OPTIONS);
 
 #if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
-                       
+
                        psSGXFeatures->sDevVAEDMStatusBuffer = psDevInfo->psKernelEDMStatusBufferMemInfo->sDevVAddr;
                        psSGXFeatures->pvEDMStatusBuffer = psDevInfo->psKernelEDMStatusBufferMemInfo->pvLinAddrKM;
 #endif
 
-                       
+
                        psMiscInfo->uData.sSGXFeatures = *psSGXFeatures;
                        return PVRSRV_OK;
                }
@@ -2588,33 +2620,33 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                {
                        PVRSRV_ERROR eError;
                        PVRSRV_SGX_MISCINFO_FEATURES            *psSGXFeatures;
-                       PVRSRV_SGX_MISCINFO_MEMACCESS           *psSGXMemSrc;   
-                       PVRSRV_SGX_MISCINFO_MEMACCESS           *psSGXMemDest;  
+                       PVRSRV_SGX_MISCINFO_MEMACCESS           *psSGXMemSrc;
+                       PVRSRV_SGX_MISCINFO_MEMACCESS           *psSGXMemDest;
+
+                       {
 
-                       {                               
-                               
                                *pui32MiscInfoFlags |= PVRSRV_USSE_MISCINFO_MEMREAD;
                                psSGXMemSrc = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXMemAccessSrc;
 
                                if(psMiscInfo->sDevVAddrSrc.uiAddr != 0)
                                {
-                                       psSGXMemSrc->sDevVAddr = psMiscInfo->sDevVAddrSrc; 
+                                       psSGXMemSrc->sDevVAddr = psMiscInfo->sDevVAddrSrc;
                                }
                                else
                                {
                                        return PVRSRV_ERROR_INVALID_PARAMS;
-                               }                               
+                               }
                        }
 
                        if( psMiscInfo->eRequest == SGX_MISC_INFO_REQUEST_MEMCOPY)
-                       {                               
-                               
+                       {
+
                                *pui32MiscInfoFlags |= PVRSRV_USSE_MISCINFO_MEMWRITE;
                                psSGXMemDest = &((PVRSRV_SGX_MISCINFO_INFO*)(psMemInfo->pvLinAddrKM))->sSGXMemAccessDest;
-                               
+
                                if(psMiscInfo->sDevVAddrDest.uiAddr != 0)
                                {
-                                       psSGXMemDest->sDevVAddr = psMiscInfo->sDevVAddrDest; 
+                                       psSGXMemDest->sDevVAddr = psMiscInfo->sDevVAddrDest;
                                }
                                else
                                {
@@ -2622,12 +2654,12 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                }
                        }
 
-                       
+
                        if(psMiscInfo->hDevMemContext != IMG_NULL)
                        {
                                SGXGetMMUPDAddrKM( (IMG_HANDLE)psDeviceNode, hDevMemContext, &psSGXMemSrc->sPDDevPAddr);
-                               
-                               
+
+
                                psSGXMemDest->sPDDevPAddr = psSGXMemSrc->sPDDevPAddr;
                        }
                        else
@@ -2635,7 +2667,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                                return PVRSRV_ERROR_INVALID_PARAMS;
                        }
 
-                       
+
                        eError = SGXGetMiscInfoUkernel(psDevInfo, psDeviceNode);
                        if(eError != PVRSRV_OK)
                        {
@@ -2651,11 +2683,11 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                return PVRSRV_ERROR_INVALID_MISCINFO;
                        }
 #endif
-                       
+
                        psMiscInfo->uData.sSGXFeatures = *psSGXFeatures;
                        return PVRSRV_OK;
                }
-#endif 
+#endif
 
 #if defined(SUPPORT_SGX_HWPERF)
                case SGX_MISC_INFO_REQUEST_SET_HWPERF_STATUS:
@@ -2667,7 +2699,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                                                                                                 PVRSRV_SGX_HWPERF_STATUS_MK_EXECUTION_ON;
                        SGXMKIF_COMMAND         sCommandData = {0};
 
-                       
+
                        if ((psSetHWPerfStatus->ui32NewHWPerfStatus & ~ui32ValidFlags) != 0)
                        {
                                return PVRSRV_ERROR_INVALID_PARAMS;
@@ -2677,9 +2709,9 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS,
                                                                  "SGX ukernel HWPerf status %u\n",
                                                                  psSetHWPerfStatus->ui32NewHWPerfStatus);
-                       #endif 
+                       #endif
+
 
-                       
                        #if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS)
                        OSMemCopy(&psDevInfo->psSGXHostCtl->aui32PerfGroup[0],
                                          &psSetHWPerfStatus->aui32PerfGroup[0],
@@ -2698,7 +2730,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
                                         sizeof(psDevInfo->psSGXHostCtl->aui32PerfBit),
                                         PDUMP_FLAGS_CONTINUOUS,
                                         MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
-                       #endif 
+                       #endif
                        #else
                        psDevInfo->psSGXHostCtl->ui32PerfGroup = psSetHWPerfStatus->ui32PerfGroup;
                        #if defined(PDUMP)
@@ -2707,10 +2739,10 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                         sizeof(psDevInfo->psSGXHostCtl->ui32PerfGroup),
                                         PDUMP_FLAGS_CONTINUOUS,
                                         MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
-                       #endif 
-                       #endif 
+                       #endif
+                       #endif
+
 
-                       
                        sCommandData.ui32Data[0] = psSetHWPerfStatus->ui32NewHWPerfStatus;
                        eError = SGXScheduleCCBCommandKM(psDeviceNode,
                                                                                         SGXMKIF_CMD_SETHWPERFSTATUS,
@@ -2721,13 +2753,13 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                                                                         IMG_FALSE);
                        return eError;
                }
-#endif 
+#endif
 
                case SGX_MISC_INFO_DUMP_DEBUG_INFO:
                {
                        PVR_LOG(("User requested SGX debug info"));
 
-                       
+
                        SGXDumpDebugInfo(psDeviceNode->pvDevice, IMG_FALSE);
 
                        return PVRSRV_OK;
@@ -2747,7 +2779,7 @@ PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO  *psDevInfo,
 
                default:
                {
-                       
+
                        return PVRSRV_ERROR_INVALID_PARAMS;
                }
        }
old mode 100755 (executable)
new mode 100644 (file)
index 73ad5ce..10e12dc
@@ -1,30 +1,30 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
-#include <stddef.h> 
+#include <stddef.h>
 #include "services_headers.h"
 #include "sgxinfo.h"
 #include "sgxinfokm.h"
@@ -62,15 +62,15 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                PVR_TTRACE(PVRSRV_TRACE_GROUP_KICK, PVRSRV_TRACE_CLASS_FUNCTION_EXIT, KICK_TOKEN_DOKICK);
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
-       
-       
+
+
        psTACmd = CCB_DATA_FROM_OFFSET(SGXMKIF_CMDTA_SHARED, psCCBMemInfo, psCCBKick, ui32CCBOffset);
 
        PVR_TTRACE(PVRSRV_TRACE_GROUP_KICK, PVRSRV_TRACE_CLASS_CMD_START, KICK_TOKEN_DOKICK);
        PVR_TTRACE_UI32(PVRSRV_TRACE_GROUP_KICK, PVRSRV_TRACE_CLASS_CCB,
                        KICK_TOKEN_CCB_OFFSET, psCCBKick->ui32CCBOffset);
 
-       
+
        if (psCCBKick->hTA3DSyncInfo)
        {
                psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->hTA3DSyncInfo;
@@ -119,7 +119,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
        psTACmd->ui32NumTAStatusVals = psCCBKick->ui32NumTAStatusVals;
        if (psCCBKick->ui32NumTAStatusVals != 0)
        {
-               
+
                for (i = 0; i < psCCBKick->ui32NumTAStatusVals; i++)
                {
 #if defined(SUPPORT_SGX_NEW_STATUS_VALS)
@@ -135,7 +135,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
        psTACmd->ui32Num3DStatusVals = psCCBKick->ui32Num3DStatusVals;
        if (psCCBKick->ui32Num3DStatusVals != 0)
        {
-               
+
                for (i = 0; i < psCCBKick->ui32Num3DStatusVals; i++)
                {
 #if defined(SUPPORT_SGX_NEW_STATUS_VALS)
@@ -150,7 +150,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
 
 
 #if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-       
+
        psTACmd->ui32NumTASrcSyncs = psCCBKick->ui32NumTASrcSyncs;
        for (i=0; i<psCCBKick->ui32NumTASrcSyncs; i++)
        {
@@ -159,9 +159,9 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                psTACmd->asTASrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
                psTACmd->asTASrcSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
 
-               
+
                psTACmd->asTASrcSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending++;
-               
+
                psTACmd->asTASrcSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending;
        }
 
@@ -173,9 +173,9 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                psTACmd->asTADstSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
                psTACmd->asTADstSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
 
-               
+
                psTACmd->asTADstSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending;
-               
+
                psTACmd->asTADstSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending++;
        }
 
@@ -187,13 +187,13 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                psTACmd->as3DSrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
                psTACmd->as3DSrcSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
 
-               
+
                psTACmd->as3DSrcSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending++;
-               
+
                psTACmd->as3DSrcSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending;
        }
-#else 
-       
+#else
+
        psTACmd->ui32NumSrcSyncs = psCCBKick->ui32NumSrcSyncs;
        for (i=0; i<psCCBKick->ui32NumSrcSyncs; i++)
        {
@@ -205,9 +205,9 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                psTACmd->asSrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
                psTACmd->asSrcSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
 
-               
+
                psTACmd->asSrcSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending++;
-               
+
                psTACmd->asSrcSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending;
        }
 #endif
@@ -279,7 +279,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                                        if ((psSyncInfo->psSyncData->ui32LastOpDumpVal == 0) &&
                                                (psSyncInfo->psSyncData->ui32LastReadOpDumpVal == 0))
                                        {
-                                               
+
                                                PDUMPCOMMENT("Init RT ROpsComplete\r\n");
                                                PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
                                                        psSyncInfo->psSyncDataMemInfoKM,
@@ -287,7 +287,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                                                        sizeof(psSyncInfo->psSyncData->ui32ReadOpsComplete),
                                                        0,
                                                        MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
-                                               
+
                                                PDUMPCOMMENT("Init RT WOpsComplete\r\n");
                                                        PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
                                                                psSyncInfo->psSyncDataMemInfoKM,
@@ -329,7 +329,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                                                0,
                                                MAKEUNIQUETAG(psHWDstSyncListMemInfo));
                                }
-       #endif  
+       #endif
                        }
                        else
                        {
@@ -343,8 +343,8 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                        }
                }
        }
-       
-       
+
+
 
 
        psTACmd->ui32CtrlFlags |= SGXMKIF_CMDTA_CTRLFLAGS_READY;
@@ -370,7 +370,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                        if ((psSyncInfo->psSyncData->ui32LastOpDumpVal == 0) &&
                                (psSyncInfo->psSyncData->ui32LastReadOpDumpVal == 0))
                        {
-                               
+
                                PDUMPCOMMENT("Init RT TA-SRC ROpsComplete\r\n", i);
                                PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
                                        psSyncInfo->psSyncDataMemInfoKM,
@@ -378,7 +378,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                                        sizeof(psSyncInfo->psSyncData->ui32ReadOpsComplete),
                                        0,
                                        MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
-                               
+
                                PDUMPCOMMENT("Init RT TA-SRC WOpsComplete\r\n");
                                        PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
                                                psSyncInfo->psSyncDataMemInfoKM,
@@ -421,7 +421,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                        if ((psSyncInfo->psSyncData->ui32LastOpDumpVal == 0) &&
                                (psSyncInfo->psSyncData->ui32LastReadOpDumpVal == 0))
                        {
-                               
+
                                PDUMPCOMMENT("Init RT TA-DST ROpsComplete\r\n", i);
                                PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
                                        psSyncInfo->psSyncDataMemInfoKM,
@@ -429,7 +429,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                                        sizeof(psSyncInfo->psSyncData->ui32ReadOpsComplete),
                                        0,
                                        MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
-                               
+
                                PDUMPCOMMENT("Init RT TA-DST WOpsComplete\r\n");
                                        PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
                                                psSyncInfo->psSyncDataMemInfoKM,
@@ -472,7 +472,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                        if ((psSyncInfo->psSyncData->ui32LastOpDumpVal == 0) &&
                                (psSyncInfo->psSyncData->ui32LastReadOpDumpVal == 0))
                        {
-                               
+
                                PDUMPCOMMENT("Init RT 3D-SRC ROpsComplete\r\n", i);
                                PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
                                        psSyncInfo->psSyncDataMemInfoKM,
@@ -480,7 +480,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                                        sizeof(psSyncInfo->psSyncData->ui32ReadOpsComplete),
                                        0,
                                        MAKEUNIQUETAG(psSyncInfo->psSyncDataMemInfoKM));
-                               
+
                                PDUMPCOMMENT("Init RT 3D-SRC WOpsComplete\r\n");
                                        PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
                                                psSyncInfo->psSyncDataMemInfoKM,
@@ -634,7 +634,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
 #endif
                }
        }
-#endif 
+#endif
 
        PVR_TTRACE(PVRSRV_TRACE_GROUP_KICK, PVRSRV_TRACE_CLASS_CMD_END,
                        KICK_TOKEN_DOKICK);
@@ -646,7 +646,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                {
                        for (i=0; i < psCCBKick->ui32NumDstSyncObjects; i++)
                        {
-                               
+
                                psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->pahDstSyncHandles[i];
 
                                if (psSyncInfo)
@@ -702,7 +702,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
 #if defined(NO_HARDWARE)
 
 
-       
+
        if (psCCBKick->hTA3DSyncInfo)
        {
                psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->hTA3DSyncInfo;
@@ -727,12 +727,12 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                psSyncInfo->psSyncData->ui32ReadOpsComplete =  psSyncInfo->psSyncData->ui32ReadOpsPending;
        }
 
-       
+
        for (i = 0; i < psCCBKick->ui32NumTAStatusVals; i++)
        {
 #if defined(SUPPORT_SGX_NEW_STATUS_VALS)
                PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo = (PVRSRV_KERNEL_MEM_INFO*)psCCBKick->asTAStatusUpdate[i].hKernelMemInfo;
-               
+
                *(IMG_UINT32*)((IMG_UINTPTR_T)psKernelMemInfo->pvLinAddrKM
                                                + (psTACmd->sCtlTAStatusInfo[i].sStatusDevAddr.uiAddr
                                                - psKernelMemInfo->sDevVAddr.uiAddr)) = psTACmd->sCtlTAStatusInfo[i].ui32StatusValue;
@@ -743,7 +743,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
        }
 
 #if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
-       
+
        for (i=0; i<psCCBKick->ui32NumTASrcSyncs; i++)
        {
                psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->ahTASrcKernelSyncInfo[i];
@@ -760,7 +760,7 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                psSyncInfo->psSyncData->ui32ReadOpsComplete =  psSyncInfo->psSyncData->ui32ReadOpsPending;
        }
 #else
-       
+
        for (i=0; i<psCCBKick->ui32NumSrcSyncs; i++)
        {
                psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->ahSrcKernelSyncInfo[i];
@@ -784,12 +784,12 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                        }
                }
 
-               
+
                for (i = 0; i < psCCBKick->ui32Num3DStatusVals; i++)
                {
 #if defined(SUPPORT_SGX_NEW_STATUS_VALS)
                        PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo = (PVRSRV_KERNEL_MEM_INFO*)psCCBKick->as3DStatusUpdate[i].hKernelMemInfo;
-                       
+
                        *(IMG_UINT32*)((IMG_UINTPTR_T)psKernelMemInfo->pvLinAddrKM
                                                        + (psTACmd->sCtl3DStatusInfo[i].sStatusDevAddr.uiAddr
                                                        - psKernelMemInfo->sDevVAddr.uiAddr)) = psTACmd->sCtl3DStatusInfo[i].ui32StatusValue;
old mode 100755 (executable)
new mode 100644 (file)
index b647b68..e655873
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -39,7 +39,7 @@ static PVRSRV_ERROR SGXAddTimer(PVRSRV_DEVICE_NODE            *psDeviceNode,
                                                                SGX_TIMING_INFORMATION  *psSGXTimingInfo,
                                                                IMG_HANDLE                              *phTimer)
 {
-       
+
 
 
        *phTimer = OSAddTimer(SGXOSTimer, psDeviceNode,
@@ -52,7 +52,7 @@ static PVRSRV_ERROR SGXAddTimer(PVRSRV_DEVICE_NODE            *psDeviceNode,
 
        return PVRSRV_OK;
 }
-#endif 
+#endif
 
 
 static PVRSRV_ERROR SGXUpdateTimingInfo(PVRSRV_DEVICE_NODE     *psDeviceNode)
@@ -86,10 +86,10 @@ static PVRSRV_ERROR SGXUpdateTimingInfo(PVRSRV_DEVICE_NODE  *psDeviceNode)
                        ui32OlduKernelFreq = psDevInfo->ui32CoreClockSpeed / psDevInfo->ui32uKernelTimerClock;
                        if (ui32OlduKernelFreq != psSGXTimingInfo->ui32uKernelFreq)
                        {
-                               
+
 
                                IMG_HANDLE hNewTimer;
-                               
+
                                eError = SGXAddTimer(psDeviceNode, psSGXTimingInfo, &hNewTimer);
                                if (eError == PVRSRV_OK)
                                {
@@ -102,7 +102,7 @@ static PVRSRV_ERROR SGXUpdateTimingInfo(PVRSRV_DEVICE_NODE  *psDeviceNode)
                                }
                                else
                                {
-                                       
+
                                }
                        }
                }
@@ -118,13 +118,13 @@ static PVRSRV_ERROR SGXUpdateTimingInfo(PVRSRV_DEVICE_NODE        *psDeviceNode)
                psDevInfo->psSGXHostCtl->ui32HWRecoverySampleRate =
                        psSGXTimingInfo->ui32uKernelFreq / psSGXTimingInfo->ui32HWRecoveryFreq;
        }
-#endif 
+#endif
+
 
-       
        psDevInfo->ui32CoreClockSpeed = psSGXTimingInfo->ui32CoreClockSpeed;
        psDevInfo->ui32uKernelTimerClock = psSGXTimingInfo->ui32CoreClockSpeed / psSGXTimingInfo->ui32uKernelFreq;
 
-       
+
        psDevInfo->psSGXHostCtl->ui32uKernelTimerClock = psDevInfo->ui32uKernelTimerClock;
 #if defined(PDUMP)
        PDUMPCOMMENT("Host Control - Microkernel clock");
@@ -132,13 +132,13 @@ static PVRSRV_ERROR SGXUpdateTimingInfo(PVRSRV_DEVICE_NODE        *psDeviceNode)
                         offsetof(SGXMKIF_HOST_CTL, ui32uKernelTimerClock),
                         sizeof(IMG_UINT32), PDUMP_FLAGS_CONTINUOUS,
                         MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
-#endif 
+#endif
 
        if (psSGXTimingInfo->bEnableActivePM)
        {
                ui32ActivePowManSampleRate =
                        psSGXTimingInfo->ui32uKernelFreq * psSGXTimingInfo->ui32ActivePowManLatencyms / 1000;
-               
+
 
 
 
@@ -158,7 +158,7 @@ static PVRSRV_ERROR SGXUpdateTimingInfo(PVRSRV_DEVICE_NODE  *psDeviceNode)
                         offsetof(SGXMKIF_HOST_CTL, ui32ActivePowManSampleRate),
                         sizeof(IMG_UINT32), PDUMP_FLAGS_CONTINUOUS,
                         MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
-#endif 
+#endif
 
        return PVRSRV_OK;
 }
@@ -176,7 +176,7 @@ static IMG_VOID SGXStartTimer(PVRSRV_SGXDEV_INFO    *psDevInfo)
        }
        #else
        PVR_UNREFERENCED_PARAMETER(psDevInfo);
-       #endif 
+       #endif
 }
 
 
@@ -193,7 +193,7 @@ static IMG_VOID SGXPollForClockGating (PVRSRV_SGXDEV_INFO   *psDevInfo,
        #if !defined(NO_HARDWARE)
        PVR_ASSERT(psDevInfo != IMG_NULL);
 
-        
+
        if (PollForValueKM((IMG_UINT32 *)psDevInfo->pvRegsBaseKM + (ui32Register >> 2),
                                                0,
                                                ui32RegisterValue,
@@ -205,7 +205,7 @@ static IMG_VOID SGXPollForClockGating (PVRSRV_SGXDEV_INFO   *psDevInfo,
                SGXDumpDebugInfo(psDevInfo, IMG_FALSE);
                PVR_DBG_BREAK;
        }
-       #endif 
+       #endif
 
        PDUMPCOMMENT("%s", pszComment);
        PDUMPREGPOL(SGX_PDUMPREG_NAME, ui32Register, 0, ui32RegisterValue, PDUMP_POLL_OPERATOR_EQUAL);
@@ -228,25 +228,25 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE                         hDevHandle,
                IMG_UINT32                      ui32CoresEnabled;
 
                #if defined(SUPPORT_HW_RECOVERY)
-               
+
                eError = OSDisableTimer(psDevInfo->hTimer);
                if (eError != PVRSRV_OK)
                {
                        PVR_DPF((PVR_DBG_ERROR,"SGXPrePowerState: Failed to disable timer"));
                        return eError;
                }
-               #endif 
+               #endif
 
                if (eNewPowerState == PVRSRV_DEV_POWER_STATE_OFF)
                {
-                       
+
                        ui32PowerCmd = PVRSRV_POWERCMD_POWEROFF;
                        ui32CompleteStatus = PVRSRV_USSE_EDM_POWMAN_POWEROFF_COMPLETE;
                        PDUMPCOMMENT("SGX power off request");
                }
                else
                {
-                       
+
                        ui32PowerCmd = PVRSRV_POWERCMD_IDLE;
                        ui32CompleteStatus = PVRSRV_USSE_EDM_POWMAN_IDLE_COMPLETE;
                        PDUMPCOMMENT("SGX idle request");
@@ -261,7 +261,7 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE                           hDevHandle,
                        return eError;
                }
 
-               
+
                #if !defined(NO_HARDWARE)
                if (PollForValueKM(&psDevInfo->psSGXHostCtl->ui32PowerStatus,
                                                        ui32CompleteStatus,
@@ -274,7 +274,7 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE                           hDevHandle,
                        SGXDumpDebugInfo(psDevInfo, IMG_FALSE);
                        PVR_DBG_BREAK;
                }
-               #endif 
+               #endif
 
                #if defined(PDUMP)
                PDUMPCOMMENT("TA/3D CCB Control - Wait for power event on uKernel.");
@@ -285,7 +285,7 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE                           hDevHandle,
                                        PDUMP_POLL_OPERATOR_EQUAL,
                                        0,
                                        MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
-               #endif 
+               #endif
 
 #if defined(SGX_FEATURE_MP)
                ui32CoresEnabled = ((OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_CORE) & EUR_CR_MASTER_CORE_ENABLE_MASK) >> EUR_CR_MASTER_CORE_ENABLE_SHIFT) + 1;
@@ -295,7 +295,7 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE                           hDevHandle,
 
                for (ui32Core = 0; ui32Core < ui32CoresEnabled; ui32Core++)
                {
-                       
+
                        SGXPollForClockGating(psDevInfo,
                                                                  SGX_MP_CORE_SELECT(psDevInfo->ui32ClkGateStatusReg, ui32Core),
                                                                  psDevInfo->ui32ClkGateStatusMask,
@@ -303,7 +303,7 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE                           hDevHandle,
                }
 
                #if defined(SGX_FEATURE_MP)
-               
+
                SGXPollForClockGating(psDevInfo,
                                                          psDevInfo->ui32MasterClkGateStatusReg,
                                                          psDevInfo->ui32MasterClkGateStatusMask,
@@ -313,11 +313,11 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE                         hDevHandle,
                                                          psDevInfo->ui32MasterClkGateStatus2Reg,
                                                          psDevInfo->ui32MasterClkGateStatus2Mask,
                                                          "Wait for SGX master clock gating (2)");
-               #endif 
+               #endif
 
                if (eNewPowerState == PVRSRV_DEV_POWER_STATE_OFF)
                {
-                       
+
                        eError = SGXDeinitialise(psDevInfo);
                        if (eError != PVRSRV_OK)
                        {
@@ -343,7 +343,7 @@ PVRSRV_ERROR SGXPostPowerState (IMG_HANDLE                          hDevHandle,
                PVRSRV_SGXDEV_INFO      *psDevInfo = psDeviceNode->pvDevice;
                SGXMKIF_HOST_CTL *psSGXHostCtl = psDevInfo->psSGXHostCtl;
 
-               
+
                psSGXHostCtl->ui32PowerStatus = 0;
                #if defined(PDUMP)
                PDUMPCOMMENT("Host Control - Reset power status");
@@ -351,13 +351,13 @@ PVRSRV_ERROR SGXPostPowerState (IMG_HANDLE                                hDevHandle,
                                 offsetof(SGXMKIF_HOST_CTL, ui32PowerStatus),
                                 sizeof(IMG_UINT32), PDUMP_FLAGS_CONTINUOUS,
                                 MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
-               #endif 
+               #endif
 
                if (eCurrentPowerState == PVRSRV_DEV_POWER_STATE_OFF)
                {
-                       
 
-                       
+
+
 
                        eError = SGXUpdateTimingInfo(psDeviceNode);
                        if (eError != PVRSRV_OK)
@@ -366,7 +366,7 @@ PVRSRV_ERROR SGXPostPowerState (IMG_HANDLE                          hDevHandle,
                                return eError;
                        }
 
-                       
+
 
                        eError = SGXInitialise(psDevInfo, IMG_FALSE);
                        if (eError != PVRSRV_OK)
@@ -377,7 +377,7 @@ PVRSRV_ERROR SGXPostPowerState (IMG_HANDLE                          hDevHandle,
                }
                else
                {
-                       
+
 
                        SGXMKIF_COMMAND         sCommand = {0};
 
@@ -411,7 +411,7 @@ PVRSRV_ERROR SGXPreClockSpeedChange (IMG_HANDLE                             hDevHandle,
        {
                if (bIdleDevice)
                {
-                       
+
                        PDUMPSUSPEND();
 
                        eError = SGXPrePowerState(hDevHandle, PVRSRV_DEV_POWER_STATE_IDLE,
@@ -446,7 +446,7 @@ PVRSRV_ERROR SGXPostClockSpeedChange (IMG_HANDLE                            hDevHandle,
        {
                PVRSRV_ERROR eError;
 
-               
+
 
                eError = SGXUpdateTimingInfo(psDeviceNode);
                if (eError != PVRSRV_OK)
@@ -457,7 +457,7 @@ PVRSRV_ERROR SGXPostClockSpeedChange (IMG_HANDLE                            hDevHandle,
 
                if (bIdleDevice)
                {
-                       
+
                        eError = SGXPostPowerState(hDevHandle, PVRSRV_DEV_POWER_STATE_ON,
                                                                           PVRSRV_DEV_POWER_STATE_IDLE);
 
old mode 100755 (executable)
new mode 100644 (file)
index 5b2feb8..4ba86a5
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -29,6 +29,7 @@
 #include "services_headers.h"
 #include "sgxinfokm.h"
 #include "sgxconfig.h"
+#include "sgxutils.h"
 
 #include "pdump_km.h"
 
@@ -37,11 +38,11 @@ IMG_VOID SGXInitClocks(PVRSRV_SGXDEV_INFO   *psDevInfo,
                                           IMG_UINT32                   ui32PDUMPFlags)
 {
        IMG_UINT32      ui32RegVal;
-       
+
 #if !defined(PDUMP)
        PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif 
-       
+#endif
+
        ui32RegVal = psDevInfo->ui32ClkGateCtl;
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_CLKGATECTL, ui32RegVal);
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_CLKGATECTL, ui32RegVal, ui32PDUMPFlags);
@@ -61,7 +62,7 @@ static IMG_VOID SGXResetInitBIFContexts(PVRSRV_SGXDEV_INFO    *psDevInfo,
 
 #if !defined(PDUMP)
        PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif 
+#endif
 
        ui32RegVal = 0;
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32RegVal);
@@ -73,7 +74,7 @@ static IMG_VOID SGXResetInitBIFContexts(PVRSRV_SGXDEV_INFO    *psDevInfo,
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_BANK_SET, ui32RegVal, ui32PDUMPFlags);
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_BANK0, ui32RegVal);
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_BANK0, ui32RegVal, ui32PDUMPFlags);
-#endif 
+#endif
 
        PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Initialise the BIF directory list\r\n");
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_DIR_LIST_BASE0, ui32RegVal);
@@ -92,7 +93,7 @@ static IMG_VOID SGXResetInitBIFContexts(PVRSRV_SGXDEV_INFO    *psDevInfo,
                        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, ui32DirListReg, ui32RegVal, ui32PDUMPFlags);
                }
        }
-#endif 
+#endif
 }
 
 
@@ -103,40 +104,40 @@ static IMG_VOID SGXResetSetupBIFContexts(PVRSRV_SGXDEV_INFO       *psDevInfo,
 
 #if !defined(PDUMP)
        PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif 
-       
+#endif
+
        #if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-       
+
        ui32RegVal = (SGX_BIF_DIR_LIST_INDEX_EDM << EUR_CR_BIF_BANK0_INDEX_EDM_SHIFT);
 
        #if defined(SGX_FEATURE_2D_HARDWARE) && !defined(SGX_FEATURE_PTLA)
-       
+
        ui32RegVal |= (SGX_BIF_DIR_LIST_INDEX_EDM << EUR_CR_BIF_BANK0_INDEX_2D_SHIFT);
-       #endif 
+       #endif
 
        #if defined(FIX_HW_BRN_23410)
-       
+
        ui32RegVal |= (SGX_BIF_DIR_LIST_INDEX_EDM << EUR_CR_BIF_BANK0_INDEX_TA_SHIFT);
-       #endif 
+       #endif
 
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_BANK0, ui32RegVal);
        PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Set up EDM requestor page table in BIF\r\n");
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_BANK0, ui32RegVal, ui32PDUMPFlags);
-       #endif 
+       #endif
 
        {
                IMG_UINT32      ui32EDMDirListReg;
 
-               
+
                #if (SGX_BIF_DIR_LIST_INDEX_EDM == 0)
                ui32EDMDirListReg = EUR_CR_BIF_DIR_LIST_BASE0;
                #else
-               
+
                ui32EDMDirListReg = EUR_CR_BIF_DIR_LIST_BASE1 + 4 * (SGX_BIF_DIR_LIST_INDEX_EDM - 1);
-               #endif 
+               #endif
 
                ui32RegVal = psDevInfo->sKernelPDDevPAddr.uiAddr >> SGX_MMU_PDE_ADDR_ALIGNSHIFT;
-               
+
 #if defined(FIX_HW_BRN_28011)
                OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_DIR_LIST_BASE0, ui32RegVal);
                PDUMPPDREGWITHFLAGS(&psDevInfo->sMMUAttrib, EUR_CR_BIF_DIR_LIST_BASE0, ui32RegVal, ui32PDUMPFlags, PDUMP_PD_UNIQUETAG);
@@ -160,15 +161,15 @@ static IMG_VOID SGXResetSleep(PVRSRV_SGXDEV_INFO  *psDevInfo,
        ui32ReadRegister = EUR_CR_MASTER_SOFT_RESET;
        #else
        ui32ReadRegister = EUR_CR_SOFT_RESET;
-       #endif 
+       #endif
 #endif
 
 #if !defined(PDUMP)
        PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif 
+#endif
+
 
-       
-       OSWaitus(100 * 1000000 / psDevInfo->ui32CoreClockSpeed);
+       SGXWaitClocks(psDevInfo, 100);
        if (bPDump)
        {
                PDUMPIDLWITHFLAGS(30, ui32PDUMPFlags);
@@ -195,7 +196,7 @@ static IMG_VOID SGXResetSoftReset(PVRSRV_SGXDEV_INFO        *psDevInfo,
        IMG_UINT32 ui32SoftResetRegVal;
 
        ui32SoftResetRegVal =
-                                       
+
                                        EUR_CR_SOFT_RESET_DPM_RESET_MASK |
                                        EUR_CR_SOFT_RESET_TA_RESET_MASK  |
                                        EUR_CR_SOFT_RESET_USE_RESET_MASK |
@@ -253,7 +254,7 @@ static IMG_VOID SGXResetSoftReset(PVRSRV_SGXDEV_INFO        *psDevInfo,
 
 #if !defined(PDUMP)
        PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif 
+#endif
 
        if (bResetBIF)
        {
@@ -274,7 +275,7 @@ static IMG_VOID SGXResetInvalDC(PVRSRV_SGXDEV_INFO  *psDevInfo,
 {
        IMG_UINT32 ui32RegVal;
 
-       
+
 #if defined(EUR_CR_BIF_CTRL_INVAL)
        ui32RegVal = EUR_CR_BIF_CTRL_INVAL_ALL_MASK;
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL_INVAL, ui32RegVal);
@@ -301,7 +302,7 @@ static IMG_VOID SGXResetInvalDC(PVRSRV_SGXDEV_INFO  *psDevInfo,
 
 #if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
        {
-               
+
 
 
                if (PollForValueKM((IMG_UINT32 *)((IMG_UINT8*)psDevInfo->pvRegsBaseKM + EUR_CR_BIF_MEM_REQ_STAT),
@@ -320,9 +321,9 @@ static IMG_VOID SGXResetInvalDC(PVRSRV_SGXDEV_INFO  *psDevInfo,
                        PDUMPREGPOLWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_MEM_REQ_STAT, 0, EUR_CR_BIF_MEM_REQ_STAT_READS_MASK, ui32PDUMPFlags, PDUMP_POLL_OPERATOR_EQUAL);
                }
        }
-#endif 
+#endif
 }
-#endif 
+#endif
 
 
 IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO   *psDevInfo,
@@ -339,12 +340,12 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO      *psDevInfo,
 
 #if !defined(PDUMP)
        PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif 
+#endif
 
        PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Start of SGX reset sequence\r\n");
 
 #if defined(FIX_HW_BRN_23944)
-       
+
        ui32RegVal = EUR_CR_BIF_CTRL_PAUSE_MASK;
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32RegVal);
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, ui32RegVal, ui32PDUMPFlags);
@@ -354,7 +355,7 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO        *psDevInfo,
        ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_INT_STAT);
        if (ui32RegVal & ui32BifFaultMask)
        {
-               
+
                ui32RegVal = EUR_CR_BIF_CTRL_PAUSE_MASK | EUR_CR_BIF_CTRL_CLEAR_FAULT_MASK;
                OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_CTRL, ui32RegVal);
                PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_CTRL, ui32RegVal, ui32PDUMPFlags);
@@ -367,17 +368,17 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO      *psDevInfo,
 
                SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
        }
-#endif 
+#endif
+
 
-       
        SGXResetSoftReset(psDevInfo, IMG_TRUE, ui32PDUMPFlags, IMG_TRUE);
 
        SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
 
-       
+
 
 #if defined(SGX_FEATURE_36BIT_MMU)
-       
+
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_36BIT_ADDRESSING, EUR_CR_BIF_36BIT_ADDRESSING_ENABLE_MASK);
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_36BIT_ADDRESSING, EUR_CR_BIF_36BIT_ADDRESSING_ENABLE_MASK, ui32PDUMPFlags);
 #endif
@@ -385,38 +386,38 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO      *psDevInfo,
        SGXResetInitBIFContexts(psDevInfo, ui32PDUMPFlags);
 
 #if defined(EUR_CR_BIF_MEM_ARB_CONFIG)
-       
+
 
        ui32RegVal      = (12UL << EUR_CR_BIF_MEM_ARB_CONFIG_PAGE_SIZE_SHIFT) |
                                  (7UL << EUR_CR_BIF_MEM_ARB_CONFIG_BEST_CNT_SHIFT) |
                                  (12UL << EUR_CR_BIF_MEM_ARB_CONFIG_TTE_THRESH_SHIFT);
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_MEM_ARB_CONFIG, ui32RegVal);
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_MEM_ARB_CONFIG, ui32RegVal, ui32PDUMPFlags);
-#endif 
+#endif
 
 #if defined(SGX_FEATURE_SYSTEM_CACHE)
        #if defined(SGX_BYPASS_SYSTEM_CACHE)
-               
+
                ui32RegVal = MNE_CR_CTRL_BYPASS_ALL_MASK;
        #else
                #if defined(FIX_HW_BRN_26620)
                        ui32RegVal = 0;
                #else
-                       
+
                        ui32RegVal = MNE_CR_CTRL_BYP_CC_MASK;
                #endif
                #if defined(FIX_HW_BRN_34028)
 
                        ui32RegVal |= (8 << MNE_CR_CTRL_BYPASS_SHIFT);
                #endif
-       #endif 
+       #endif
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, MNE_CR_CTRL, ui32RegVal);
        PDUMPREG(SGX_PDUMPREG_NAME, MNE_CR_CTRL, ui32RegVal);
-#endif 
+#endif
 
        if (bHardwareRecovery)
        {
-               
+
 
 
 
@@ -428,13 +429,13 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO      *psDevInfo,
 
                SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
 
-               
+
                SGXResetSoftReset(psDevInfo, IMG_FALSE, ui32PDUMPFlags, IMG_TRUE);
                SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
 
                SGXResetInvalDC(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
 
-               
+
 
                for (;;)
                {
@@ -447,7 +448,7 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                break;
                        }
 
-                       
+
 
 
                        sBifFault.uiAddr = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_FAULT);
@@ -455,10 +456,10 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO      *psDevInfo,
                        ui32PDIndex = sBifFault.uiAddr >> (SGX_MMU_PAGE_SHIFT + SGX_MMU_PT_SHIFT);
                        ui32PTIndex = (sBifFault.uiAddr & SGX_MMU_PT_MASK) >> SGX_MMU_PAGE_SHIFT;
 
-                       
+
                        SGXResetSoftReset(psDevInfo, IMG_TRUE, ui32PDUMPFlags, IMG_FALSE);
 
-                       
+
                        psDevInfo->pui32BIFResetPD[ui32PDIndex] = (psDevInfo->sBIFResetPTDevPAddr.uiAddr
                                                                                                        >>SGX_MMU_PDE_ADDR_ALIGNSHIFT)
                                                                                                        | SGX_MMU_PDE_PAGE_SIZE_4K
@@ -467,7 +468,7 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO        *psDevInfo,
                                                                                                        >>SGX_MMU_PTE_ADDR_ALIGNSHIFT)
                                                                                                        | SGX_MMU_PTE_VALID;
 
-                       
+
                        ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS);
                        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR, ui32RegVal);
                        ui32RegVal = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS2);
@@ -475,50 +476,50 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO      *psDevInfo,
 
                        SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
 
-                       
+
                        SGXResetSoftReset(psDevInfo, IMG_FALSE, ui32PDUMPFlags, IMG_FALSE);
                        SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
 
-                       
+
                        SGXResetInvalDC(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
 
-                       
+
                        psDevInfo->pui32BIFResetPD[ui32PDIndex] = 0;
                        psDevInfo->pui32BIFResetPT[ui32PTIndex] = 0;
                }
        }
        else
        {
-               
+
                SGXResetSoftReset(psDevInfo, IMG_FALSE, ui32PDUMPFlags, IMG_TRUE);
                SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_FALSE);
-       }       
+       }
+
 
-       
 
        SGXResetSetupBIFContexts(psDevInfo, ui32PDUMPFlags);
 
 #if defined(SGX_FEATURE_2D_HARDWARE) && !defined(SGX_FEATURE_PTLA)
-       
+
        #if ((SGX_2D_HEAP_BASE & ~EUR_CR_BIF_TWOD_REQ_BASE_ADDR_MASK) != 0)
                #error "SGXReset: SGX_2D_HEAP_BASE doesn't match EUR_CR_BIF_TWOD_REQ_BASE_ADDR_MASK alignment"
        #endif
-       
+
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_TWOD_REQ_BASE, SGX_2D_HEAP_BASE);
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_BIF_TWOD_REQ_BASE, SGX_2D_HEAP_BASE, ui32PDUMPFlags);
 #endif
 
-       
+
        SGXResetInvalDC(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
 
        PVR_DPF((PVR_DBG_MESSAGE,"Soft Reset of SGX"));
 
-       
+
        ui32RegVal = 0;
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_SOFT_RESET, ui32RegVal);
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_SOFT_RESET, ui32RegVal, ui32PDUMPFlags);
 
-       
+
        SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
 
        PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "End of SGX reset sequence\r\n");
@@ -528,16 +529,16 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO      *psDevInfo,
 
 {
        IMG_UINT32 ui32RegVal;
-       
+
        PVR_UNREFERENCED_PARAMETER(bHardwareRecovery);
 
 #if !defined(PDUMP)
        PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
-#endif 
+#endif
 
        PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Start of SGX MP reset sequence\r\n");
 
-       
+
        ui32RegVal = EUR_CR_MASTER_SOFT_RESET_BIF_RESET_MASK  |
                                 EUR_CR_MASTER_SOFT_RESET_IPF_RESET_MASK  |
                                 EUR_CR_MASTER_SOFT_RESET_DPM_RESET_MASK  |
@@ -551,7 +552,7 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO        *psDevInfo,
        ui32RegVal |= EUR_CR_MASTER_SOFT_RESET_SLC_RESET_MASK;
 #endif
 
-       
+
        ui32RegVal |= EUR_CR_MASTER_SOFT_RESET_CORE_RESET_MASK(0)  |
                                  EUR_CR_MASTER_SOFT_RESET_CORE_RESET_MASK(1)  |
                                  EUR_CR_MASTER_SOFT_RESET_CORE_RESET_MASK(2)  |
@@ -570,7 +571,7 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO        *psDevInfo,
 
 #if defined(SGX_FEATURE_SYSTEM_CACHE)
        #if defined(SGX_BYPASS_SYSTEM_CACHE)
-               #error SGX_BYPASS_SYSTEM_CACHE not supported
+               ui32RegVal = EUR_CR_MASTER_SLC_CTRL_BYPASS_ALL_MASK;
        #else
                ui32RegVal = EUR_CR_MASTER_SLC_CTRL_USSE_INVAL_REQ0_MASK |
                #if defined(FIX_HW_BRN_30954)
@@ -598,20 +599,20 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO      *psDevInfo,
                                EUR_CR_MASTER_SLC_CTRL_BYPASS_REQ_USE3_MASK |
                                EUR_CR_MASTER_SLC_CTRL_BYPASS_REQ_TA_MASK;
        #endif
+       #endif
                OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_SLC_CTRL_BYPASS, ui32RegVal);
                PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Initialise the hydra SLC bypass control\r\n");
                PDUMPREG(SGX_PDUMPREG_NAME, EUR_CR_MASTER_SLC_CTRL_BYPASS, ui32RegVal);
-       #endif 
-#endif 
+#endif
 
        SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
 
-       
+
        ui32RegVal = 0;
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_SOFT_RESET, ui32RegVal);
        PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Remove the resets from all of SGX\r\n");
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_MASTER_SOFT_RESET, ui32RegVal, ui32PDUMPFlags);
-       
+
        SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
 
        PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "Turn on the slave cores' clock gating\r\n");
@@ -623,32 +624,32 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO      *psDevInfo,
 
 #if defined(FIX_HW_BRN_31278) || defined(FIX_HW_BRN_31620) || defined(FIX_HW_BRN_31671) || defined(FIX_HW_BRN_32085)
        #if defined(FIX_HW_BRN_31278) || defined(FIX_HW_BRN_32085)
-       
+
        ui32RegVal = (1<<EUR_CR_MASTER_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT);
        #else
-       ui32RegVal = (1<<EUR_CR_MASTER_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT) | EUR_CR_MASTER_BIF_MMU_CTRL_PREFETCHING_ON_MASK; 
+       ui32RegVal = (1<<EUR_CR_MASTER_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT) | EUR_CR_MASTER_BIF_MMU_CTRL_PREFETCHING_ON_MASK;
        #endif
        #if !defined(FIX_HW_BRN_31620) && !defined(FIX_HW_BRN_31671)
-       
+
        ui32RegVal |= EUR_CR_MASTER_BIF_MMU_CTRL_ENABLE_DC_TLB_MASK;
        #endif
 
-       
+
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MASTER_BIF_MMU_CTRL, ui32RegVal);
        PDUMPREGWITHFLAGS(SGX_PDUMPREG_NAME, EUR_CR_MASTER_BIF_MMU_CTRL, ui32RegVal, ui32PDUMPFlags);
 
        #if defined(FIX_HW_BRN_31278) || defined(FIX_HW_BRN_32085)
-       
+
        ui32RegVal = (1<<EUR_CR_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT);
        #else
-       ui32RegVal = (1<<EUR_CR_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT) | EUR_CR_BIF_MMU_CTRL_PREFETCHING_ON_MASK; 
+       ui32RegVal = (1<<EUR_CR_BIF_MMU_CTRL_ADDR_HASH_MODE_SHIFT) | EUR_CR_BIF_MMU_CTRL_PREFETCHING_ON_MASK;
        #endif
        #if !defined(FIX_HW_BRN_31620) && !defined(FIX_HW_BRN_31671)
-       
+
        ui32RegVal |= EUR_CR_BIF_MMU_CTRL_ENABLE_DC_TLB_MASK;
        #endif
 
-       
+
        {
                IMG_UINT32 ui32Core;
 
@@ -662,9 +663,9 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO        *psDevInfo,
 
        SGXResetInitBIFContexts(psDevInfo, ui32PDUMPFlags);
        SGXResetSetupBIFContexts(psDevInfo, ui32PDUMPFlags);
-       
+
        PDUMPCOMMENTWITHFLAGS(ui32PDUMPFlags, "End of SGX MP reset sequence\r\n");
-}      
-#endif 
+}
+#endif
 
 
old mode 100755 (executable)
new mode 100644 (file)
index b42bafc..04814b4
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -64,7 +64,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
 
 #if defined(PDUMP)
        IMG_BOOL bPersistentProcess = IMG_FALSE;
-       
+
        {
                PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
                if(psPerProc != IMG_NULL)
@@ -72,7 +72,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                        bPersistentProcess = psPerProc->bPDumpPersistent;
                }
        }
-#endif 
+#endif
 #if defined(FIX_HW_BRN_31620)
        hDevMemContext = psKick->hDevMemContext;
 #endif
@@ -91,8 +91,8 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                                TRANSFER_TOKEN_SUBMIT);
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
-       
-       
+
+
        psSharedTransferCmd =  CCB_DATA_FROM_OFFSET(SGXMKIF_TRANSFERCMD_SHARED, psCCBMemInfo, psKick, ui32SharedCmdCCBOffset);
 
        PVR_TTRACE(PVRSRV_TRACE_GROUP_TRANSFER, PVRSRV_TRACE_CLASS_CMD_START, TRANSFER_TOKEN_SUBMIT);
@@ -137,14 +137,14 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                psSharedTransferCmd->s3DSyncReadOpsCompleteDevVAddr.uiAddr = 0;
        }
 
-       
+
        for (loop = 0; loop < MIN(SGX_MAX_TRANSFER_SYNC_OPS, psKick->ui32NumSrcSync); loop++)
        {
                IMG_UINT32 i;
 
                PVRSRV_KERNEL_SYNC_INFO * psMySyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->ahSrcSyncInfo[loop];
-       
-               for (i = 0; i < loop; i++)      
+
+               for (i = 0; i < loop; i++)
                {
                        if (abSrcSyncEnable[i])
                        {
@@ -168,8 +168,8 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                IMG_UINT32 i;
 
                PVRSRV_KERNEL_SYNC_INFO * psMySyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->ahDstSyncInfo[loop];
-       
-               for (i = 0; i < loop; i++)      
+
+               for (i = 0; i < loop; i++)
                {
                        if (abDstSyncEnable[i])
                        {
@@ -189,8 +189,8 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                }
        }
 
-       psSharedTransferCmd->ui32NumSrcSyncs = ui32RealSrcSyncNum; 
-       psSharedTransferCmd->ui32NumDstSyncs = ui32RealDstSyncNum; 
+       psSharedTransferCmd->ui32NumSrcSyncs = ui32RealSrcSyncNum;
+       psSharedTransferCmd->ui32NumDstSyncs = ui32RealDstSyncNum;
 
        if ((psKick->ui32Flags & SGXMKIF_TQFLAGS_KEEPPENDING) == 0UL)
        {
@@ -208,7 +208,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                                psSharedTransferCmd->asSrcSyncs[i].ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending;
                                psSharedTransferCmd->asSrcSyncs[i].ui32ReadOpsPendingVal = psSyncInfo->psSyncData->ui32ReadOpsPending;
 
-                               psSharedTransferCmd->asSrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr; 
+                               psSharedTransferCmd->asSrcSyncs[i].sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr;
                                psSharedTransferCmd->asSrcSyncs[i].sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
                                i++;
                        }
@@ -237,7 +237,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                }
                PVR_ASSERT(i == ui32RealDstSyncNum);
 
-               
+
                for (loop = 0; loop < psKick->ui32NumSrcSync; loop++)
                {
                        if (abSrcSyncEnable[loop])
@@ -258,7 +258,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
 
 #if defined(PDUMP)
        if ((PDumpIsCaptureFrameKM()
-       || ((psKick->ui32PDumpFlags & PDUMP_FLAGS_CONTINUOUS) != 0)) 
+       || ((psKick->ui32PDumpFlags & PDUMP_FLAGS_CONTINUOUS) != 0))
        &&  (bPersistentProcess == IMG_FALSE) )
        {
                PDUMPCOMMENT("Shared part of transfer command\r\n");
@@ -333,11 +333,11 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                                }
                        }
 
-                       
+
                        for (loop = 0; loop < (psKick->ui32NumSrcSync); loop++)
                        {
                                if (abSrcSyncEnable[loop])
-                               {       
+                               {
                                        psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->ahSrcSyncInfo[loop];
                                        psSyncInfo->psSyncData->ui32LastReadOpDumpVal++;
                                }
@@ -382,11 +382,11 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
 
                        psSyncInfo->psSyncData->ui32LastOpDumpVal++;
                }
-       }               
+       }
 #endif
 
        sCommand.ui32Data[1] = psKick->sHWTransferContextDevVAddr.uiAddr;
-       
+
        PVR_TTRACE(PVRSRV_TRACE_GROUP_TRANSFER, PVRSRV_TRACE_CLASS_CMD_END,
                        TRANSFER_TOKEN_SUBMIT);
 
@@ -394,7 +394,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
 
        if (eError == PVRSRV_ERROR_RETRY)
        {
-               
+
                if ((psKick->ui32Flags & SGXMKIF_TQFLAGS_KEEPPENDING) == 0UL)
                {
                        for (loop = 0; loop < psKick->ui32NumSrcSync; loop++)
@@ -429,14 +429,14 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                        }
                }
 
-               
+
                if (psKick->hTASyncInfo != IMG_NULL)
                {
                        psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->hTASyncInfo;
                        psSyncInfo->psSyncData->ui32WriteOpsPending--;
                }
 
-               
+
                if (psKick->h3DSyncInfo != IMG_NULL)
                {
                        psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->h3DSyncInfo;
@@ -451,12 +451,12 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle, PVRSRV_TRANSF
                                TRANSFER_TOKEN_SUBMIT);
                return eError;
        }
-       
+
 
 #if defined(NO_HARDWARE)
        if ((psKick->ui32Flags & SGXMKIF_TQFLAGS_NOSYNCUPDATE) == 0)
        {
-               
+
                for (loop = 0; loop < psKick->ui32NumSrcSync; loop++)
                {
                        if (abSrcSyncEnable[loop])
@@ -501,7 +501,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK_
 #else
 IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK *psKick)
 #endif
-                                           
+
 {
        PVRSRV_KERNEL_MEM_INFO  *psCCBMemInfo = (PVRSRV_KERNEL_MEM_INFO *)psKick->hCCBMemInfo;
        SGXMKIF_COMMAND sCommand = {0};
@@ -512,7 +512,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
        IMG_HANDLE hDevMemContext = IMG_NULL;
 #if defined(PDUMP)
        IMG_BOOL bPersistentProcess = IMG_FALSE;
-       
+
        {
                PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
                if(psPerProc != IMG_NULL)
@@ -520,7 +520,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                        bPersistentProcess = psPerProc->bPDumpPersistent;
                }
        }
-#endif 
+#endif
 #if defined(FIX_HW_BRN_31620)
        hDevMemContext = psKick->hDevMemContext;
 #endif
@@ -530,13 +530,13 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                PVR_DPF((PVR_DBG_ERROR, "SGXSubmit2DKM: Invalid CCB offset"));
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
-       
-       
+
+
        ps2DCmd =  CCB_DATA_FROM_OFFSET(SGXMKIF_2DCMD_SHARED, psCCBMemInfo, psKick, ui32SharedCmdCCBOffset);
 
        OSMemSet(ps2DCmd, 0, sizeof(*ps2DCmd));
 
-       
+
        if (psKick->hTASyncInfo != IMG_NULL)
        {
                psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->hTASyncInfo;
@@ -548,7 +548,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                ps2DCmd->sTASyncData.sReadOpsCompleteDevVAddr   = psSyncInfo->sReadOpsCompleteDevVAddr;
        }
 
-       
+
        if (psKick->h3DSyncInfo != IMG_NULL)
        {
                psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->h3DSyncInfo;
@@ -560,7 +560,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                ps2DCmd->s3DSyncData.sReadOpsCompleteDevVAddr = psSyncInfo->sReadOpsCompleteDevVAddr;
        }
 
-       
+
        ps2DCmd->ui32NumSrcSync = psKick->ui32NumSrcSync;
        for (i = 0; i < psKick->ui32NumSrcSync; i++)
        {
@@ -586,7 +586,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                ps2DCmd->sDstSyncData.sReadOps2CompleteDevVAddr = psSyncInfo->sReadOps2CompleteDevVAddr;
        }
 
-       
+
        for (i = 0; i < psKick->ui32NumSrcSync; i++)
        {
                psSyncInfo = psKick->ahSrcSyncInfo[i];
@@ -604,7 +604,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
        || ((psKick->ui32PDumpFlags & PDUMP_FLAGS_CONTINUOUS) != 0))
        &&  (bPersistentProcess == IMG_FALSE) )
        {
-               
+
                PDUMPCOMMENT("Shared part of 2D command\r\n");
                PDUMPMEM(ps2DCmd,
                                psCCBMemInfo,
@@ -663,7 +663,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                                        MAKEUNIQUETAG(psCCBMemInfo));
                }
 
-               
+
                for (i = 0; i < psKick->ui32NumSrcSync; i++)
                {
                        psSyncInfo = psKick->ahSrcSyncInfo[i];
@@ -675,16 +675,16 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                        psSyncInfo = psKick->hDstSyncInfo;
                        psSyncInfo->psSyncData->ui32LastOpDumpVal++;
                }
-       }               
+       }
 #endif
 
        sCommand.ui32Data[1] = psKick->sHW2DContextDevVAddr.uiAddr;
-       
-       eError = SGXScheduleCCBCommandKM(hDevHandle, SGXMKIF_CMD_2D, &sCommand, KERNEL_ID, psKick->ui32PDumpFlags, hDevMemContext, IMG_FALSE);  
+
+       eError = SGXScheduleCCBCommandKM(hDevHandle, SGXMKIF_CMD_2D, &sCommand, KERNEL_ID, psKick->ui32PDumpFlags, hDevMemContext, IMG_FALSE);
 
        if (eError == PVRSRV_ERROR_RETRY)
        {
-               
+
 
 #if defined(PDUMP)
                if (PDumpIsCaptureFrameKM())
@@ -715,7 +715,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                        psSyncInfo->psSyncData->ui32WriteOpsPending--;
                }
 
-               
+
                if (psKick->hTASyncInfo != IMG_NULL)
                {
                        psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->hTASyncInfo;
@@ -723,7 +723,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                        psSyncInfo->psSyncData->ui32WriteOpsPending--;
                }
 
-               
+
                if (psKick->h3DSyncInfo != IMG_NULL)
                {
                        psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->h3DSyncInfo;
@@ -732,11 +732,11 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
                }
        }
 
-       
+
 
 
 #if defined(NO_HARDWARE)
-       
+
        for(i = 0; i < psKick->ui32NumSrcSync; i++)
        {
                psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psKick->ahSrcSyncInfo[i];
@@ -767,5 +767,5 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle, PVRSRV_2D_SGX_KICK
 
        return eError;
 }
-#endif 
-#endif 
+#endif
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 7747f4b..10bec35
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -43,8 +43,8 @@
 #include "ttrace.h"
 
 #ifdef __linux__
-#include <linux/kernel.h>      
-#include <linux/string.h>      
+#include <linux/kernel.h>
+#include <linux/string.h>
 #else
 #include <stdio.h>
 #endif
@@ -62,12 +62,12 @@ static IMG_VOID SGXPostActivePowerEvent(PVRSRV_DEVICE_NODE  * psDeviceNode,
        PVRSRV_SGXDEV_INFO      *psDevInfo = psDeviceNode->pvDevice;
        SGXMKIF_HOST_CTL        *psSGXHostCtl = psDevInfo->psSGXHostCtl;
 
-       
+
        psSGXHostCtl->ui32NumActivePowerEvents++;
 
        if ((psSGXHostCtl->ui32PowerStatus & PVRSRV_USSE_EDM_POWMAN_POWEROFF_RESTART_IMMEDIATE) != 0)
        {
-               
+
 
 
                if (ui32CallerID == ISR_ID)
@@ -107,14 +107,14 @@ IMG_VOID SGXTestActivePowerEvent (PVRSRV_DEVICE_NODE      *psDeviceNode,
        if (((psSGXHostCtl->ui32InterruptFlags & PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER) != 0) &&
                ((psSGXHostCtl->ui32InterruptClearFlags & PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER) == 0))
        {
-               
+
                psSGXHostCtl->ui32InterruptClearFlags |= PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER;
 
-               
+
                PDUMPSUSPEND();
 
 #if defined(SYS_CUSTOM_POWERDOWN)
-               
+
 
 
                eError = SysPowerDownMISR(psDeviceNode, ui32CallerID);
@@ -129,13 +129,13 @@ IMG_VOID SGXTestActivePowerEvent (PVRSRV_DEVICE_NODE      *psDeviceNode,
 #endif
                if (eError == PVRSRV_ERROR_RETRY)
                {
-                       
+
 
                        psSGXHostCtl->ui32InterruptClearFlags &= ~PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER;
                        eError = PVRSRV_OK;
                }
 
-               
+
                PDUMPRESUME();
        }
 
@@ -161,7 +161,7 @@ static INLINE SGXMKIF_COMMAND * SGXAcquireKernelCCBSlot(PVRSRV_SGX_CCB_INFO *psC
                OSSleepms(1);
        } END_LOOP_UNTIL_TIMEOUT();
 
-       
+
        return IMG_NULL;
 }
 
@@ -200,7 +200,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
        psMMUContext = psDevInfo->hKernelMMUContext;
        psDeviceNode->pfnMMUGetCacheFlushRange(psMMUContext, &ui32CacheMasks[0]);
 
-       
+
        if (hDevMemContext)
        {
                BM_CONTEXT *psBMContext = (BM_CONTEXT *) hDevMemContext;
@@ -209,7 +209,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
                psDeviceNode->pfnMMUGetCacheFlushRange(psMMUContext, &ui32CacheMasks[2]);
        }
 
-       
+
        if (ui32CacheMasks[0] || ui32CacheMasks[1] || ui32CacheMasks[2] || ui32CacheMasks[3])
        {
                psDevInfo->ui32CacheControl |= SGXMKIF_CC_INVAL_BIF_PD;
@@ -217,7 +217,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
 #endif
 
 #if defined(FIX_HW_BRN_28889)
-       
+
 
 
 
@@ -243,7 +243,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
                        goto Exit;
                }
 
-               
+
                #if !defined(NO_HARDWARE)
                if(PollForValueKM(&psSGXHostCtl->ui32InvalStatus,
                                                  PVRSRV_USSE_EDM_BIF_INVAL_COMPLETE,
@@ -258,7 +258,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
                #endif
 
                #if defined(PDUMP)
-               
+
                PDUMPCOMMENTWITHFLAGS(0, "Host Control - Poll for BIF cache invalidate request to complete");
                PDUMPMEMPOL(psSGXHostCtlMemInfo,
                                        offsetof(SGXMKIF_HOST_CTL, ui32InvalStatus),
@@ -267,7 +267,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
                                        PDUMP_POLL_OPERATOR_EQUAL,
                                        0,
                                        MAKEUNIQUETAG(psSGXHostCtlMemInfo));
-               #endif 
+               #endif
 
                psSGXHostCtl->ui32InvalStatus &= ~(PVRSRV_USSE_EDM_BIF_INVAL_COMPLETE);
                PDUMPMEM(IMG_NULL, psSGXHostCtlMemInfo, offsetof(SGXMKIF_HOST_CTL, ui32CleanupStatus), sizeof(IMG_UINT32), 0, MAKEUNIQUETAG(psSGXHostCtlMemInfo));
@@ -282,7 +282,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
                SGXMKIF_COMMAND         sPDECacheCommand = {0};
                IMG_DEV_PHYADDR         sDevPAddr;
 
-               
+
                psMMUContext = psDevInfo->hKernelMMUContext;
 
                psDeviceNode->pfnMMUGetPDPhysAddr(psMMUContext, &sDevPAddr);
@@ -290,7 +290,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
                sPDECacheCommand.ui32Data[1] = ui32CacheMasks[0];
                sPDECacheCommand.ui32Data[2] = ui32CacheMasks[1];
 
-               
+
                if (hDevMemContext)
                {
                        BM_CONTEXT *psBMContext = (BM_CONTEXT *) hDevMemContext;
@@ -298,13 +298,13 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE     *psDeviceNode,
                        psMMUContext = psBMContext->psMMUContext;
 
                        psDeviceNode->pfnMMUGetPDPhysAddr(psMMUContext, &sDevPAddr);
-                       
+
                        sPDECacheCommand.ui32Data[3] = sDevPAddr.uiAddr | 1;
                        sPDECacheCommand.ui32Data[4] = ui32CacheMasks[2];
                        sPDECacheCommand.ui32Data[5] = ui32CacheMasks[3];
                }
 
-               
+
                if (sPDECacheCommand.ui32Data[1] | sPDECacheCommand.ui32Data[2] | sPDECacheCommand.ui32Data[4] |
                        sPDECacheCommand.ui32Data[5])
                {
@@ -323,7 +323,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
        }
 #endif
 #if defined(PDUMP)
-       
+
        {
                PVRSRV_PER_PROCESS_DATA* psPerProc = PVRSRVFindPerProcessData();
                if(psPerProc != IMG_NULL)
@@ -331,12 +331,12 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE     *psDeviceNode,
                        bPersistentProcess = psPerProc->bPDumpPersistent;
                }
        }
-#endif 
+#endif
        psKernelCCB = psDevInfo->psKernelCCBInfo;
 
        psSGXCommand = SGXAcquireKernelCCBSlot(psKernelCCB);
 
-       
+
        if(!psSGXCommand)
        {
                PVR_DPF((PVR_DBG_ERROR, "SGXScheduleCCBCommand: Wait for CCB space timed out")) ;
@@ -344,18 +344,18 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE     *psDeviceNode,
                goto Exit;
        }
 
-       
+
        psCommandData->ui32CacheControl = psDevInfo->ui32CacheControl;
 
 #if defined(PDUMP)
-       
+
        psDevInfo->sPDContext.ui32CacheControl |= psDevInfo->ui32CacheControl;
 #endif
 
-       
+
        psDevInfo->ui32CacheControl = 0;
 
-       
+
        *psSGXCommand = *psCommandData;
 
        if (eCmdType >= SGXMKIF_CMD_MAX)
@@ -366,12 +366,12 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE     *psDeviceNode,
        }
 
        if (eCmdType == SGXMKIF_CMD_2D ||
-                       eCmdType == SGXMKIF_CMD_TRANSFER ||
-                       ((eCmdType == SGXMKIF_CMD_TA) && bLastInScene))
+               eCmdType == SGXMKIF_CMD_TRANSFER ||
+               ((eCmdType == SGXMKIF_CMD_TA) && bLastInScene))
        {
                SYS_DATA *psSysData;
 
-               
+
                SysAcquireData(&psSysData);
 
                if(psSysData->ePendingCacheOpType == PVRSRV_MISC_INFO_CPUCACHEOP_FLUSH)
@@ -383,18 +383,18 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE     *psDeviceNode,
                        OSCleanCPUCacheKM();
                }
 
-               
+
                psSysData->ePendingCacheOpType = PVRSRV_MISC_INFO_CPUCACHEOP_NONE;
        }
 
        PVR_ASSERT(eCmdType < SGXMKIF_CMD_MAX);
-       psSGXCommand->ui32ServiceAddress = psDevInfo->aui32HostKickAddr[eCmdType];       
+       psSGXCommand->ui32ServiceAddress = psDevInfo->aui32HostKickAddr[eCmdType];
 
 #if defined(PDUMP)
        if ((ui32CallerID != ISR_ID) && (bPDumpIsSuspended == IMG_FALSE) &&
                (bPersistentProcess == IMG_FALSE) )
        {
-               
+
                PDUMPCOMMENTWITHFLAGS(ui32PDumpFlags, "Poll for space in the Kernel CCB\r\n");
                PDUMPMEMPOL(psKernelCCB->psCCBCtlMemInfo,
                                        offsetof(PVRSRV_SGX_CCB_CTL, ui32ReadOffset),
@@ -414,7 +414,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
                                        ui32PDumpFlags,
                                        MAKEUNIQUETAG(psKernelCCB->psCCBMemInfo));
 
-               
+
                PDUMPMEM(&psDevInfo->sPDContext.ui32CacheControl,
                                        psKernelCCB->psCCBMemInfo,
                                        psKernelCCB->ui32CCBDumpWOff * sizeof(SGXMKIF_COMMAND) +
@@ -426,14 +426,14 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE     *psDeviceNode,
                if (PDumpIsCaptureFrameKM()
                || ((ui32PDumpFlags & PDUMP_FLAGS_CONTINUOUS) != 0))
                {
-                       
+
                        psDevInfo->sPDContext.ui32CacheControl = 0;
                }
        }
 #endif
 
 #if defined(FIX_HW_BRN_26620) && defined(SGX_FEATURE_SYSTEM_CACHE) && !defined(SGX_BYPASS_SYSTEM_CACHE)
-       
+
        eError = PollForValueKM (psKernelCCB->pui32ReadOffset,
                                                                *psKernelCCB->pui32WriteOffset,
                                                                0xFF,
@@ -448,7 +448,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
        }
 #endif
 
-       
+
 
        *psKernelCCB->pui32WriteOffset = (*psKernelCCB->pui32WriteOffset + 1) & 255;
 
@@ -501,7 +501,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
 
        OSWriteMemoryBarrier();
 
-       
+
        PVR_TTRACE_UI32(PVRSRV_TRACE_GROUP_MKSYNC, PVRSRV_TRACE_CLASS_NONE,
                        MKSYNC_TOKEN_KERNEL_CCB_OFFSET, *psKernelCCB->pui32WriteOffset);
        PVR_TTRACE_UI32(PVRSRV_TRACE_GROUP_MKSYNC, PVRSRV_TRACE_CLASS_NONE,
@@ -523,7 +523,7 @@ PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE       *psDeviceNode,
        OSMemoryBarrier();
 
 #if defined(NO_HARDWARE)
-       
+
        *psKernelCCB->pui32ReadOffset = (*psKernelCCB->pui32ReadOffset + 1) & 255;
 #endif
 
@@ -542,10 +542,10 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE           *psDeviceNode,
 {
        PVRSRV_ERROR            eError;
 
-       
+
        PDUMPSUSPEND();
 
-       
+
        eError = PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.ui32DeviceIndex,
                                                                                 PVRSRV_DEV_POWER_STATE_ON,
                                                                                 ui32CallerID,
@@ -575,7 +575,7 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE             *psDeviceNode,
                        }
                        else
                        {
-                               
+
 
                        }
                }
@@ -606,7 +606,7 @@ PVRSRV_ERROR SGXScheduleProcessQueuesKM(PVRSRV_DEVICE_NODE *psDeviceNode)
        ui32PowerStatus = psHostCtl->ui32PowerStatus;
        if ((ui32PowerStatus & PVRSRV_USSE_EDM_POWMAN_NO_WORK) != 0)
        {
-               
+
                return PVRSRV_OK;
        }
 
@@ -639,7 +639,7 @@ PVRSRV_ERROR SGXGetInternalDevInfoKM(IMG_HANDLE hDevCookie,
        psSGXInternalDevInfo->ui32Flags = psDevInfo->ui32Flags;
        psSGXInternalDevInfo->bForcePTOff = (IMG_BOOL)psDevInfo->bForcePTOff;
 
-       
+
        psSGXInternalDevInfo->hHostCtlKernelMemInfoHandle =
                (IMG_HANDLE)psDevInfo->psKernelSGXHostCtlMemInfo;
 
@@ -665,7 +665,7 @@ PVRSRV_ERROR SGXCleanupRequest(PVRSRV_DEVICE_NODE *psDeviceNode,
                sCommand.ui32Data[0] = ui32CleanupType;
                sCommand.ui32Data[1] = (psHWDataDevVAddr == IMG_NULL) ? 0 : psHWDataDevVAddr->uiAddr;
                PDUMPCOMMENTWITHFLAGS(0, "Request ukernel resource clean-up, Type %u, Data 0x%X", sCommand.ui32Data[0], sCommand.ui32Data[1]);
-       
+
                eError = SGXScheduleCCBCommandKM(psDeviceNode, SGXMKIF_CMD_CLEANUP, &sCommand, KERNEL_ID, 0, IMG_NULL, IMG_FALSE);
                if (eError != PVRSRV_OK)
                {
@@ -674,8 +674,8 @@ PVRSRV_ERROR SGXCleanupRequest(PVRSRV_DEVICE_NODE *psDeviceNode,
                                PVR_DBG_BREAK;
                                return eError;
                }
-               
-               
+
+
                #if !defined(NO_HARDWARE)
                if(PollForValueKM(&psHostCtl->ui32CleanupStatus,
                                                  PVRSRV_USSE_EDM_CLEANUPCMD_COMPLETE,
@@ -690,9 +690,9 @@ PVRSRV_ERROR SGXCleanupRequest(PVRSRV_DEVICE_NODE *psDeviceNode,
                        PVR_DBG_BREAK;
                }
                #endif
-       
+
                #if defined(PDUMP)
-               
+
                PDUMPCOMMENTWITHFLAGS(0, "Host Control - Poll for clean-up request to complete");
                PDUMPMEMPOL(psHostCtlMemInfo,
                                        offsetof(SGXMKIF_HOST_CTL, ui32CleanupStatus),
@@ -701,18 +701,18 @@ PVRSRV_ERROR SGXCleanupRequest(PVRSRV_DEVICE_NODE *psDeviceNode,
                                        PDUMP_POLL_OPERATOR_EQUAL,
                                        0,
                                        MAKEUNIQUETAG(psHostCtlMemInfo));
-               #endif 
-       
+               #endif
+
                if (eError != PVRSRV_OK)
                {
                        return eError;
                }
        }
-       
+
        psHostCtl->ui32CleanupStatus &= ~(PVRSRV_USSE_EDM_CLEANUPCMD_COMPLETE);
        PDUMPMEM(IMG_NULL, psHostCtlMemInfo, offsetof(SGXMKIF_HOST_CTL, ui32CleanupStatus), sizeof(IMG_UINT32), 0, MAKEUNIQUETAG(psHostCtlMemInfo));
 
-       
+
 #if defined(SGX_FEATURE_SYSTEM_CACHE)
        psDevInfo->ui32CacheControl |= (SGXMKIF_CC_INVAL_BIF_SL | SGXMKIF_CC_INVAL_DATA);
 #else
@@ -745,16 +745,16 @@ static PVRSRV_ERROR SGXCleanupHWRenderContextCallback(IMG_PVOID           pvParam,
                                          PVRSRV_CLEANUPCMD_RC,
                                          bForceCleanup);
 
-    
+
     PVRSRVFreeDeviceMemKM(psCleanup->psDeviceNode,
             psCleanup->psHWRenderContextMemInfo);
 
-    
+
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
                          sizeof(SGX_HW_RENDER_CONTEXT_CLEANUP),
                          psCleanup,
                          psCleanup->hBlockAlloc);
-       
+
 
        return eError;
 }
@@ -782,16 +782,16 @@ static PVRSRV_ERROR SGXCleanupHWTransferContextCallback(IMG_PVOID pvParam,
                                          PVRSRV_CLEANUPCMD_TC,
                                          bForceCleanup);
 
-    
+
     PVRSRVFreeDeviceMemKM(psCleanup->psDeviceNode,
             psCleanup->psHWTransferContextMemInfo);
 
-    
+
        OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
                          sizeof(SGX_HW_TRANSFER_CONTEXT_CLEANUP),
                          psCleanup,
                          psCleanup->hBlockAlloc);
-       
+
 
        return eError;
 }
@@ -837,8 +837,8 @@ IMG_HANDLE SGXRegisterHWRenderContextKM(IMG_HANDLE                          hDeviceNode,
     eError = PVRSRVAllocDeviceMemKM(hDeviceNode,
                                psPerProc,
                                psHeapInfo->hDevMemHeap,
-                               PVRSRV_MEM_READ | PVRSRV_MEM_WRITE 
-                                 | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT 
+                               PVRSRV_MEM_READ | PVRSRV_MEM_WRITE
+                                 | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT
                                  | PVRSRV_MEM_CACHE_CONSISTENT,
                                ui32HWRenderContextSize,
                                32,
@@ -864,11 +864,11 @@ IMG_HANDLE SGXRegisterHWRenderContextKM(IMG_HANDLE                                hDeviceNode,
                goto exit2;
        }
 
-    
+
     psHWRenderContextDevVAddr->uiAddr = psCleanup->psHWRenderContextMemInfo->sDevVAddr.uiAddr;
 
-    
-    eError = PVRSRVLookupHandle(psPerProc->psHandleBase, 
+
+    eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
                            &hDevMemContextInt,
                            hDevMemContext,
                            PVRSRV_HANDLE_TYPE_DEV_MEM_CONTEXT);
@@ -882,7 +882,7 @@ IMG_HANDLE SGXRegisterHWRenderContextKM(IMG_HANDLE                          hDeviceNode,
     psMMUContext = BM_GetMMUContextFromMemContext(hDevMemContextInt);
     sPDDevPAddr = psDeviceNode->pfnMMUGetPDDevPAddr(psMMUContext);
 
-    
+
 
 
 
@@ -897,18 +897,18 @@ IMG_HANDLE SGXRegisterHWRenderContextKM(IMG_HANDLE                                hDeviceNode,
     }
 
 #if defined(PDUMP)
-    
+
        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "HW Render context struct");
 
        PDUMPMEM(
-        IMG_NULL, 
+        IMG_NULL,
         psCleanup->psHWRenderContextMemInfo,
-        0, 
-        ui32HWRenderContextSize, 
-        PDUMP_FLAGS_CONTINUOUS, 
+        0,
+        ui32HWRenderContextSize,
+        PDUMP_FLAGS_CONTINUOUS,
         MAKEUNIQUETAG(psCleanup->psHWRenderContextMemInfo));
 
-    
+
        PDUMPCOMMENT("Page directory address in HW render context");
     PDUMPPDDEVPADDR(
             psCleanup->psHWRenderContextMemInfo,
@@ -945,7 +945,7 @@ exit1:
               sizeof(SGX_HW_RENDER_CONTEXT_CLEANUP),
               psCleanup,
               psCleanup->hBlockAlloc);
-    
+
 exit0:
     return IMG_NULL;
 }
@@ -1013,8 +1013,8 @@ IMG_HANDLE SGXRegisterHWTransferContextKM(IMG_HANDLE                              hDeviceNode,
     eError = PVRSRVAllocDeviceMemKM(hDeviceNode,
                                psPerProc,
                                psHeapInfo->hDevMemHeap,
-                               PVRSRV_MEM_READ | PVRSRV_MEM_WRITE 
-                                 | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT 
+                               PVRSRV_MEM_READ | PVRSRV_MEM_WRITE
+                                 | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT
                                  | PVRSRV_MEM_CACHE_CONSISTENT,
                                ui32HWTransferContextSize,
                                32,
@@ -1040,11 +1040,11 @@ IMG_HANDLE SGXRegisterHWTransferContextKM(IMG_HANDLE                            hDeviceNode,
                goto exit2;
        }
 
-    
+
     psHWTransferContextDevVAddr->uiAddr = psCleanup->psHWTransferContextMemInfo->sDevVAddr.uiAddr;
 
-    
-    eError = PVRSRVLookupHandle(psPerProc->psHandleBase, 
+
+    eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
                            &hDevMemContextInt,
                            hDevMemContext,
                            PVRSRV_HANDLE_TYPE_DEV_MEM_CONTEXT);
@@ -1058,7 +1058,7 @@ IMG_HANDLE SGXRegisterHWTransferContextKM(IMG_HANDLE                              hDeviceNode,
     psMMUContext = BM_GetMMUContextFromMemContext(hDevMemContextInt);
     sPDDevPAddr = psDeviceNode->pfnMMUGetPDDevPAddr(psMMUContext);
 
-    
+
 
 
 
@@ -1073,18 +1073,18 @@ IMG_HANDLE SGXRegisterHWTransferContextKM(IMG_HANDLE                            hDeviceNode,
     }
 
 #if defined(PDUMP)
-    
+
        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "HW Transfer context struct");
 
        PDUMPMEM(
-        IMG_NULL, 
+        IMG_NULL,
         psCleanup->psHWTransferContextMemInfo,
-        0, 
-        ui32HWTransferContextSize, 
-        PDUMP_FLAGS_CONTINUOUS, 
+        0,
+        ui32HWTransferContextSize,
+        PDUMP_FLAGS_CONTINUOUS,
         MAKEUNIQUETAG(psCleanup->psHWTransferContextMemInfo));
 
-    
+
        PDUMPCOMMENT("Page directory address in HW transfer context");
 
     PDUMPPDDEVPADDR(
@@ -1122,7 +1122,7 @@ exit1:
               sizeof(SGX_HW_TRANSFER_CONTEXT_CLEANUP),
               psCleanup,
               psCleanup->hBlockAlloc);
-    
+
 
 exit0:
     return IMG_NULL;
@@ -1166,17 +1166,17 @@ PVRSRV_ERROR SGXSetTransferContextPriorityKM(
     {
         psCleanup = (SGX_HW_TRANSFER_CONTEXT_CLEANUP *)hHWTransferContext;
 
-        if ((ui32OffsetOfPriorityField + sizeof(ui32Priority)) 
+        if ((ui32OffsetOfPriorityField + sizeof(ui32Priority))
             >= psCleanup->psHWTransferContextMemInfo->uAllocSize)
         {
             PVR_DPF((
-                PVR_DBG_ERROR, 
+                PVR_DBG_ERROR,
                 "SGXSetTransferContextPriorityKM: invalid context prioirty offset"));
 
             return PVRSRV_ERROR_INVALID_PARAMS;
         }
 
-        
+
 
 
         pDst = (IMG_UINT8 *)psCleanup->psHWTransferContextMemInfo->pvLinAddrKM;
@@ -1207,17 +1207,17 @@ PVRSRV_ERROR SGXSetRenderContextPriorityKM(
     if (hHWRenderContext != IMG_NULL)
     {
         psCleanup = (SGX_HW_RENDER_CONTEXT_CLEANUP *)hHWRenderContext;
-        if ((ui32OffsetOfPriorityField + sizeof(ui32Priority)) 
+        if ((ui32OffsetOfPriorityField + sizeof(ui32Priority))
             >= psCleanup->psHWRenderContextMemInfo->uAllocSize)
         {
             PVR_DPF((
-                PVR_DBG_ERROR, 
+                PVR_DBG_ERROR,
                 "SGXSetContextPriorityKM: invalid HWRenderContext prioirty offset"));
 
             return PVRSRV_ERROR_INVALID_PARAMS;
         }
 
-        
+
 
 
         pDst = (IMG_UINT8 *)psCleanup->psHWRenderContextMemInfo->pvLinAddrKM;
@@ -1251,22 +1251,22 @@ static PVRSRV_ERROR SGXCleanupHW2DContextCallback(IMG_PVOID  pvParam,
 
        PVR_UNREFERENCED_PARAMETER(ui32Param);
 
-    
+
     eError = SGXCleanupRequest(psCleanup->psDeviceNode,
                                          &psCleanup->psHW2DContextMemInfo->sDevVAddr,
                                          PVRSRV_CLEANUPCMD_2DC,
                                          bForceCleanup);
 
-    
+
     PVRSRVFreeDeviceMemKM(psCleanup->psDeviceNode,
             psCleanup->psHW2DContextMemInfo);
 
-    
+
     OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
                          sizeof(SGX_HW_2D_CONTEXT_CLEANUP),
                          psCleanup,
                          psCleanup->hBlockAlloc);
-                  
+
 
        return eError;
 }
@@ -1311,8 +1311,8 @@ IMG_HANDLE SGXRegisterHW2DContextKM(IMG_HANDLE                            hDeviceNode,
     eError = PVRSRVAllocDeviceMemKM(hDeviceNode,
                                psPerProc,
                                psHeapInfo->hDevMemHeap,
-                               PVRSRV_MEM_READ | PVRSRV_MEM_WRITE 
-                                 | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT 
+                               PVRSRV_MEM_READ | PVRSRV_MEM_WRITE
+                                 | PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_MEM_EDM_PROTECT
                                  | PVRSRV_MEM_CACHE_CONSISTENT,
                                ui32HW2DContextSize,
                                32,
@@ -1336,12 +1336,12 @@ IMG_HANDLE SGXRegisterHW2DContextKM(IMG_HANDLE                          hDeviceNode,
                PVR_DPF((PVR_DBG_ERROR, "SGXRegisterHW2DContextKM: Couldn't copy user-mode copy of HWContext into device memory"));
                goto exit2;
        }
-    
+
+
     psHW2DContextDevVAddr->uiAddr = psCleanup->psHW2DContextMemInfo->sDevVAddr.uiAddr;
 
-    
-    eError = PVRSRVLookupHandle(psPerProc->psHandleBase, 
+
+    eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
                            &hDevMemContextInt,
                            hDevMemContext,
                            PVRSRV_HANDLE_TYPE_DEV_MEM_CONTEXT);
@@ -1355,7 +1355,7 @@ IMG_HANDLE SGXRegisterHW2DContextKM(IMG_HANDLE                            hDeviceNode,
     psMMUContext = BM_GetMMUContextFromMemContext(hDevMemContextInt);
     sPDDevPAddr = psDeviceNode->pfnMMUGetPDDevPAddr(psMMUContext);
 
-    
+
 
 
 
@@ -1370,18 +1370,18 @@ IMG_HANDLE SGXRegisterHW2DContextKM(IMG_HANDLE                          hDeviceNode,
     }
 
 #if defined(PDUMP)
-    
+
        PDUMPCOMMENTWITHFLAGS(PDUMP_FLAGS_CONTINUOUS, "HW 2D context struct");
 
        PDUMPMEM(
-        IMG_NULL, 
+        IMG_NULL,
         psCleanup->psHW2DContextMemInfo,
-        0, 
-        ui32HW2DContextSize, 
-        PDUMP_FLAGS_CONTINUOUS, 
+        0,
+        ui32HW2DContextSize,
+        PDUMP_FLAGS_CONTINUOUS,
         MAKEUNIQUETAG(psCleanup->psHW2DContextMemInfo));
 
-    
+
        PDUMPCOMMENT("Page directory address in HW 2D transfer context");
     PDUMPPDDEVPADDR(
             psCleanup->psHW2DContextMemInfo,
@@ -1418,7 +1418,7 @@ exit1:
               sizeof(SGX_HW_2D_CONTEXT_CLEANUP),
               psCleanup,
               psCleanup->hBlockAlloc);
-    
+
 exit0:
     return IMG_NULL;
 }
@@ -1442,7 +1442,7 @@ PVRSRV_ERROR SGXUnregisterHW2DContextKM(IMG_HANDLE hHW2DContext, IMG_BOOL bForce
 
        return eError;
 }
-#endif 
+#endif
 
 #ifdef INLINE_IS_PRAGMA
 #pragma inline(SGX2DQuerySyncOpsComplete)
@@ -1476,20 +1476,20 @@ PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(PVRSRV_SGXDEV_INFO       *psDevInfo,
 
        if(SGX2DQuerySyncOpsComplete(psSyncInfo, ui32ReadOpsPending, ui32WriteOpsPending))
        {
-               
+
                PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DQueryBlitsCompleteKM: No wait. Blits complete."));
                return PVRSRV_OK;
        }
 
-       
+
        if (!bWaitForComplete)
        {
-               
+
                PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DQueryBlitsCompleteKM: No wait. Ops pending."));
                return PVRSRV_ERROR_CMD_NOT_PROCESSED;
        }
 
-       
+
        PVR_DPF((PVR_DBG_MESSAGE, "SGX2DQueryBlitsCompleteKM: Ops pending. Start polling."));
 
        LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
@@ -1498,7 +1498,7 @@ PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(PVRSRV_SGXDEV_INFO *psDevInfo,
 
                if(SGX2DQuerySyncOpsComplete(psSyncInfo, ui32ReadOpsPending, ui32WriteOpsPending))
                {
-                       
+
                        PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DQueryBlitsCompleteKM: Wait over.  Blits complete."));
                        return PVRSRV_OK;
                }
@@ -1506,7 +1506,7 @@ PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(PVRSRV_SGXDEV_INFO *psDevInfo,
                OSSleepms(1);
        } END_LOOP_UNTIL_TIMEOUT();
 
-       
+
        PVR_DPF((PVR_DBG_ERROR,"SGX2DQueryBlitsCompleteKM: Timed out. Ops pending."));
 
 #if defined(DEBUG)
@@ -1557,7 +1557,16 @@ IMG_UINT32 SGXConvertTimeStamp(PVRSRV_SGXDEV_INFO        *psDevInfo,
        ui32Clocksx16 = (IMG_UINT32)(ui64Clocks / 16);
 
        return ui32Clocksx16;
-#endif 
+#endif
+}
+
+
+IMG_VOID SGXWaitClocks(PVRSRV_SGXDEV_INFO      *psDevInfo,
+                                          IMG_UINT32                   ui32SGXClocks)
+{
+
+
+       OSWaitus(1 + (ui32SGXClocks * 1000000 / psDevInfo->ui32CoreClockSpeed));
 }
 
 
old mode 100755 (executable)
new mode 100644 (file)
index 98b2e45..fe5ca8c
@@ -1,33 +1,33 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #include "perproc.h"
 #include "sgxinfokm.h"
 
+
 #define CCB_OFFSET_IS_VALID(type, psCCBMemInfo, psCCBKick, offset) \
        ((sizeof(type) <= (psCCBMemInfo)->uAllocSize) && \
        ((psCCBKick)->offset <= (psCCBMemInfo)->uAllocSize - sizeof(type)))
@@ -123,6 +123,9 @@ IMG_UINT32 SGXConvertTimeStamp(PVRSRV_SGXDEV_INFO   *psDevInfo,
                                                           IMG_UINT32                   ui32TimeWraps,
                                                           IMG_UINT32                   ui32Time);
 
+IMG_VOID SGXWaitClocks(PVRSRV_SGXDEV_INFO      *psDevInfo,
+                                          IMG_UINT32                   ui32SGXClocks);
+
 PVRSRV_ERROR SGXCleanupRequest(PVRSRV_DEVICE_NODE      *psDeviceNode,
                                                        IMG_DEV_VIRTADDR        *psHWDataDevVAddr,
                                                        IMG_UINT32                      ui32CleanupType,
old mode 100755 (executable)
new mode 100644 (file)
index 36e3223..86b6031
@@ -1,26 +1,26 @@
 #
 # Copyright (C) Imagination Technologies Ltd. All rights reserved.
-# 
+#
 # This program is free software; you can redistribute it and/or modify it
 # under the terms and conditions of the GNU General Public License,
 # version 2, as published by the Free Software Foundation.
-# 
-# This program is distributed in the hope it will be useful but, except 
-# as otherwise stated in writing, without any warranty; without even the 
-# implied warranty of merchantability or fitness for a particular purpose. 
+#
+# This program is distributed in the hope it will be useful but, except
+# as otherwise stated in writing, without any warranty; without even the
+# implied warranty of merchantability or fitness for a particular purpose.
 # See the GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License along with
 # this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-# 
+#
 # The full GNU General Public License is included in this distribution in
 # the file called "COPYING".
 #
 # Contact Information:
 # Imagination Technologies Ltd. <gpl-support@imgtec.com>
-# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
-# 
+# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+#
 
 pvrsrvkm-y += \
        services4/srvkm/env/linux/osfunc.o \
@@ -61,6 +61,11 @@ pvrsrvkm-y += \
 pvrsrvkm-$(CONFIG_ION_OMAP) += \
        services4/srvkm/env/linux/ion.o
 
+ifeq ($(TTRACE),1)
+pvrsrvkm-y += \
+       services4/srvkm/common/ttrace.o
+endif
+
 ifneq ($(W),1)
 CFLAGS_osfunc.o := -Werror
 CFLAGS_mutils.o := -Werror
old mode 100755 (executable)
new mode 100644 (file)
index 7716529..91393ff
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -63,4 +63,4 @@ typedef struct _ENV_DATA_TAG
 #endif
 } ENV_DATA;
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index dabf1e3..27ffde3
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -47,10 +47,10 @@ IMG_VOID RemovePerProcessProcDir(PVRSRV_ENV_PER_PROCESS_DATA *psEnvPerProc);
 PVRSRV_ERROR LinuxMMapPerProcessConnect(PVRSRV_ENV_PER_PROCESS_DATA *psEnvPerProc);
 
 IMG_VOID LinuxMMapPerProcessDisconnect(PVRSRV_ENV_PER_PROCESS_DATA *psEnvPerProc);
+
 PVRSRV_ERROR LinuxMMapPerProcessHandleOptions(PVRSRV_HANDLE_BASE *psHandleBase);
 
 IMG_HANDLE LinuxTerminatingProcessPrivateData(IMG_VOID);
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 7e160c3..9ab80f5
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -68,7 +68,7 @@ typedef struct PVRSRV_LINUX_EVENT_OBJECT_LIST_TAG
 {
    rwlock_t            sLock;
    struct list_head    sList;
-   
+
 } PVRSRV_LINUX_EVENT_OBJECT_LIST;
 
 
@@ -79,9 +79,9 @@ typedef struct PVRSRV_LINUX_EVENT_OBJECT_TAG
 #if defined(DEBUG)
        IMG_UINT        ui32Stats;
 #endif
-    wait_queue_head_t sWait;   
+    wait_queue_head_t sWait;
        struct list_head        sList;
-       IMG_HANDLE              hResItem;                               
+       IMG_HANDLE              hResItem;
        PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList;
 } PVRSRV_LINUX_EVENT_OBJECT;
 
@@ -89,18 +89,18 @@ PVRSRV_ERROR LinuxEventObjectListCreate(IMG_HANDLE *phEventObjectList)
 {
        PVRSRV_LINUX_EVENT_OBJECT_LIST *psEventObjectList;
 
-       if(OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT_LIST), 
+       if(OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT_LIST),
                (IMG_VOID **)&psEventObjectList, IMG_NULL,
                "Linux Event Object List") != PVRSRV_OK)
        {
-               PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectCreate: failed to allocate memory for event list"));           
-               return PVRSRV_ERROR_OUT_OF_MEMORY;      
+               PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectCreate: failed to allocate memory for event list"));
+               return PVRSRV_ERROR_OUT_OF_MEMORY;
        }
 
        INIT_LIST_HEAD(&psEventObjectList->sList);
 
        rwlock_init(&psEventObjectList->sLock);
-       
+
        *phEventObjectList = (IMG_HANDLE *) psEventObjectList;
 
        return PVRSRV_OK;
@@ -111,7 +111,7 @@ PVRSRV_ERROR LinuxEventObjectListDestroy(IMG_HANDLE hEventObjectList)
 
        PVRSRV_LINUX_EVENT_OBJECT_LIST *psEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST *) hEventObjectList ;
 
-       if(psEventObjectList)   
+       if(psEventObjectList)
        {
                IMG_BOOL bListEmpty;
 
@@ -119,14 +119,14 @@ PVRSRV_ERROR LinuxEventObjectListDestroy(IMG_HANDLE hEventObjectList)
                bListEmpty = list_empty(&psEventObjectList->sList);
                read_unlock(&psEventObjectList->sLock);
 
-               if (!bListEmpty) 
+               if (!bListEmpty)
                {
                         PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectListDestroy: Event List is not empty"));
                         return PVRSRV_ERROR_UNABLE_TO_DESTROY_EVENT;
                }
 
                OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT_LIST), psEventObjectList, IMG_NULL);
-               
+
        }
 
        return PVRSRV_OK;
@@ -139,7 +139,7 @@ PVRSRV_ERROR LinuxEventObjectDelete(IMG_HANDLE hOSEventObjectList, IMG_HANDLE hO
        {
                if(hOSEventObject)
                {
-                       PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *)hOSEventObject; 
+                       PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *)hOSEventObject;
 #if defined(DEBUG)
                        PVR_DPF((PVR_DBG_MESSAGE, "LinuxEventObjectListDelete: Event object waits: %u", psLinuxEventObject->ui32Stats));
 #endif
@@ -147,7 +147,7 @@ PVRSRV_ERROR LinuxEventObjectDelete(IMG_HANDLE hOSEventObjectList, IMG_HANDLE hO
                        {
                                return PVRSRV_ERROR_UNABLE_TO_DESTROY_EVENT;
                        }
-                       
+
                        return PVRSRV_OK;
                }
        }
@@ -170,17 +170,17 @@ static PVRSRV_ERROR LinuxEventObjectDeleteCallback(IMG_PVOID pvParam, IMG_UINT32
 
 #if defined(DEBUG)
        PVR_DPF((PVR_DBG_MESSAGE, "LinuxEventObjectDeleteCallback: Event object waits: %u", psLinuxEventObject->ui32Stats));
-#endif 
+#endif
 
        OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT), psLinuxEventObject, IMG_NULL);
-       
+
 
        return PVRSRV_OK;
 }
 PVRSRV_ERROR LinuxEventObjectAdd(IMG_HANDLE hOSEventObjectList, IMG_HANDLE *phOSEventObject)
  {
-       PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject; 
-       PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST*)hOSEventObjectList; 
+       PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject;
+       PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST*)hOSEventObjectList;
        IMG_UINT32 ui32PID = OSGetCurrentProcessIDKM();
        PVRSRV_PER_PROCESS_DATA *psPerProc;
        unsigned long ulLockFlags;
@@ -192,15 +192,15 @@ PVRSRV_ERROR LinuxEventObjectAdd(IMG_HANDLE hOSEventObjectList, IMG_HANDLE *phOS
                return PVRSRV_ERROR_OUT_OF_MEMORY;
        }
 
-       
-       if(OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT), 
+
+       if(OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP, sizeof(PVRSRV_LINUX_EVENT_OBJECT),
                (IMG_VOID **)&psLinuxEventObject, IMG_NULL,
                "Linux Event Object") != PVRSRV_OK)
        {
-               PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectAdd: failed to allocate memory "));            
-               return PVRSRV_ERROR_OUT_OF_MEMORY;      
+               PVR_DPF((PVR_DBG_ERROR, "LinuxEventObjectAdd: failed to allocate memory "));
+               return PVRSRV_ERROR_OUT_OF_MEMORY;
        }
-       
+
        INIT_LIST_HEAD(&psLinuxEventObject->sList);
 
        atomic_set(&psLinuxEventObject->sTimeStamp, 0);
@@ -217,39 +217,39 @@ PVRSRV_ERROR LinuxEventObjectAdd(IMG_HANDLE hOSEventObjectList, IMG_HANDLE *phOS
                                                                                                         RESMAN_TYPE_EVENT_OBJECT,
                                                                                                         psLinuxEventObject,
                                                                                                         0,
-                                                                                                        &LinuxEventObjectDeleteCallback);      
+                                                                                                        &LinuxEventObjectDeleteCallback);
 
        write_lock_irqsave(&psLinuxEventObjectList->sLock, ulLockFlags);
        list_add(&psLinuxEventObject->sList, &psLinuxEventObjectList->sList);
        write_unlock_irqrestore(&psLinuxEventObjectList->sLock, ulLockFlags);
-       
+
        *phOSEventObject = psLinuxEventObject;
 
-       return PVRSRV_OK;        
+       return PVRSRV_OK;
 }
 
 PVRSRV_ERROR LinuxEventObjectSignal(IMG_HANDLE hOSEventObjectList)
 {
        PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject;
-       PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST*)hOSEventObjectList; 
+       PVRSRV_LINUX_EVENT_OBJECT_LIST *psLinuxEventObjectList = (PVRSRV_LINUX_EVENT_OBJECT_LIST*)hOSEventObjectList;
        struct list_head *psListEntry, *psList;
 
        psList = &psLinuxEventObjectList->sList;
 
-       
+
        read_lock(&psLinuxEventObjectList->sLock);
-       list_for_each(psListEntry, psList) 
-       {               
+       list_for_each(psListEntry, psList)
+       {
+
+               psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *)list_entry(psListEntry, PVRSRV_LINUX_EVENT_OBJECT, sList);
 
-               psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *)list_entry(psListEntry, PVRSRV_LINUX_EVENT_OBJECT, sList);    
-               
-               atomic_inc(&psLinuxEventObject->sTimeStamp);    
+               atomic_inc(&psLinuxEventObject->sTimeStamp);
                wake_up_interruptible(&psLinuxEventObject->sWait);
        }
        read_unlock(&psLinuxEventObjectList->sLock);
 
        return  PVRSRV_OK;
-       
+
 }
 
 PVRSRV_ERROR LinuxEventObjectWait(IMG_HANDLE hOSEventObject, IMG_UINT32 ui32MSTimeout)
@@ -260,30 +260,30 @@ PVRSRV_ERROR LinuxEventObjectWait(IMG_HANDLE hOSEventObject, IMG_UINT32 ui32MSTi
        PVRSRV_LINUX_EVENT_OBJECT *psLinuxEventObject = (PVRSRV_LINUX_EVENT_OBJECT *) hOSEventObject;
 
        IMG_UINT32 ui32TimeOutJiffies = msecs_to_jiffies(ui32MSTimeout);
-       
-       do      
+
+       do
        {
                prepare_to_wait(&psLinuxEventObject->sWait, &sWait, TASK_INTERRUPTIBLE);
                ui32TimeStamp = (IMG_UINT32)atomic_read(&psLinuxEventObject->sTimeStamp);
-       
+
                if(psLinuxEventObject->ui32TimeStampPrevious != ui32TimeStamp)
                {
                        break;
                }
 
-               LinuxUnLockMutex(&gPVRSRVLock);         
+               LinuxUnLockMutex(&gPVRSRVLock);
 
                ui32TimeOutJiffies = (IMG_UINT32)schedule_timeout((IMG_INT32)ui32TimeOutJiffies);
-               
+
                LinuxLockMutex(&gPVRSRVLock);
 #if defined(DEBUG)
                psLinuxEventObject->ui32Stats++;
-#endif                 
+#endif
+
 
-               
        } while (ui32TimeOutJiffies);
 
-       finish_wait(&psLinuxEventObject->sWait, &sWait);        
+       finish_wait(&psLinuxEventObject->sWait, &sWait);
 
        psLinuxEventObject->ui32TimeStampPrevious = ui32TimeStamp;
 
old mode 100755 (executable)
new mode 100644 (file)
index 3035283..af7efa5
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
index 586ed9e..7919595 100644 (file)
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  *****************************************************************************/
 
index a3845f7..6b00935 100644 (file)
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  *****************************************************************************/
 
old mode 100755 (executable)
new mode 100644 (file)
index e64012c..d536a41
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -45,8 +45,8 @@ IMG_INT PVRProcSetPowerLevel(struct file *file, const IMG_CHAR *buffer, IMG_UINT
 
 void ProcSeqShowPowerLevel(struct seq_file *sfile,void* el);
 
-#endif 
+#endif
 
-#endif 
+#endif
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index a0854c3..f1329b5
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -29,4 +29,4 @@
 
 extern PVRSRV_LINUX_MUTEX gPVRSRVLock;
 
-#endif 
+#endif
index 3987552..7f12ff5 100644 (file)
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -75,7 +75,7 @@ typedef enum {
 typedef struct _DEBUG_MEM_ALLOC_REC
 {
     DEBUG_MEM_ALLOC_TYPE    eAllocType;
-       IMG_VOID                                *pvKey; 
+       IMG_VOID                                *pvKey;
     IMG_VOID                *pvCpuVAddr;
     IMG_UINT32              ulCpuPAddr;
     IMG_VOID                *pvPrivateData;
@@ -83,7 +83,7 @@ typedef struct _DEBUG_MEM_ALLOC_REC
        pid_t                                   pid;
     IMG_CHAR                *pszFileName;
     IMG_UINT32              ui32Line;
-    
+
     struct _DEBUG_MEM_ALLOC_REC   *psNext;
        struct _DEBUG_MEM_ALLOC_REC   **ppsThis;
 }DEBUG_MEM_ALLOC_REC;
@@ -196,8 +196,8 @@ LinuxMMInit(IMG_VOID)
 #if defined(DEBUG_LINUX_MEM_AREAS)
     {
                g_SeqFileMemArea = CreateProcReadEntrySeq(
-                                                                       "mem_areas", 
-                                                                       NULL, 
+                                                                       "mem_areas",
+                                                                       NULL,
                                                                        ProcSeqNextMemArea,
                                                                        ProcSeqShowMemArea,
                                                                        ProcSeqOff2ElementMemArea,
@@ -214,10 +214,10 @@ LinuxMMInit(IMG_VOID)
 #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
     {
                g_SeqFileMemoryRecords =CreateProcReadEntrySeq(
-                                                                       "meminfo", 
-                                                                       NULL, 
+                                                                       "meminfo",
+                                                                       NULL,
                                                                        ProcSeqNextMemoryRecords,
-                                                                       ProcSeqShowMemoryRecords, 
+                                                                       ProcSeqShowMemoryRecords,
                                                                        ProcSeqOff2ElementMemoryRecords,
                                                                        ProcSeqStartstopDebugMutex
                                                                   );
@@ -249,7 +249,7 @@ static IMG_VOID LinuxMMCleanup_MemAreas_ForEachCb(DEBUG_LINUX_MEM_AREA_REC *psCu
                                psCurrentRecord->psLinuxMemArea,
                                LinuxMemAreaTypeToString(psCurrentRecord->psLinuxMemArea->eAreaType),
                                psCurrentRecord->psLinuxMemArea->ui32ByteSize));
-       
+
        LinuxMemAreaDeepFree(psLinuxMemArea);
 }
 #endif
@@ -258,7 +258,7 @@ static IMG_VOID LinuxMMCleanup_MemAreas_ForEachCb(DEBUG_LINUX_MEM_AREA_REC *psCu
 static IMG_VOID LinuxMMCleanup_MemRecords_ForEachVa(DEBUG_MEM_ALLOC_REC *psCurrentRecord)
 
 {
-       
+
        PVR_DPF((PVR_DBG_ERROR, "%s: BUG!: Cleaning up memory: "
                                                        "type=%s "
                                                        "CpuVAddr=%p "
@@ -279,14 +279,14 @@ static IMG_VOID LinuxMMCleanup_MemRecords_ForEachVa(DEBUG_MEM_ALLOC_REC *psCurre
                        IOUnmapWrapper(psCurrentRecord->pvCpuVAddr);
                        break;
                case DEBUG_MEM_ALLOC_TYPE_IO:
-                       
+
                        DebugMemAllocRecordRemove(DEBUG_MEM_ALLOC_TYPE_IO, psCurrentRecord->pvKey, __FILE__, __LINE__);
                        break;
                case DEBUG_MEM_ALLOC_TYPE_VMALLOC:
                        VFreeWrapper(psCurrentRecord->pvCpuVAddr);
                        break;
                case DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES:
-                       
+
                        DebugMemAllocRecordRemove(DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES, psCurrentRecord->pvKey, __FILE__, __LINE__);
                        break;
                case DEBUG_MEM_ALLOC_TYPE_KMEM_CACHE:
@@ -310,7 +310,7 @@ LinuxMMCleanup(IMG_VOID)
             PVR_DPF((PVR_DBG_ERROR, "%s: BUG!: There are %d LinuxMemArea allocation unfreed (%d bytes)",
                     __FUNCTION__, g_LinuxMemAreaCount, g_LinuxMemAreaWaterMark));
         }
-               
+
                List_DEBUG_LINUX_MEM_AREA_REC_ForEach(g_LinuxMemAreaRecords,
                                                                                        LinuxMMCleanup_MemAreas_ForEachCb);
 
@@ -321,8 +321,8 @@ LinuxMMCleanup(IMG_VOID)
 
 #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
     {
-        
-        
+
+
                List_DEBUG_MEM_ALLOC_REC_ForEach(g_MemoryRecords,
                                                                                LinuxMMCleanup_MemRecords_ForEachVa);
 
@@ -332,7 +332,7 @@ LinuxMMCleanup(IMG_VOID)
 
     if(psLinuxMemAreaCache)
     {
-        KMemCacheDestroyWrapper(psLinuxMemAreaCache); 
+        KMemCacheDestroyWrapper(psLinuxMemAreaCache);
         psLinuxMemAreaCache=NULL;
     }
 }
@@ -403,9 +403,9 @@ DebugMemAllocRecordAdd(DEBUG_MEM_ALLOC_TYPE eAllocType,
     psRecord->ui32Bytes = ui32Bytes;
     psRecord->pszFileName = pszFileName;
     psRecord->ui32Line = ui32Line;
-    
+
        List_DEBUG_MEM_ALLOC_REC_Insert(&g_MemoryRecords, psRecord);
-    
+
     g_WaterMarkData[eAllocType] += ui32Bytes;
     if(g_WaterMarkData[eAllocType] > g_HighWaterMarkData[eAllocType])
     {
@@ -441,7 +441,7 @@ static IMG_BOOL DebugMemAllocRecordRemove_AnyVaCb(DEBUG_MEM_ALLOC_REC *psCurrent
 {
        DEBUG_MEM_ALLOC_TYPE eAllocType;
        IMG_VOID *pvKey;
-       
+
        eAllocType = va_arg(va, DEBUG_MEM_ALLOC_TYPE);
        pvKey = va_arg(va, IMG_VOID*);
 
@@ -450,7 +450,7 @@ static IMG_BOOL DebugMemAllocRecordRemove_AnyVaCb(DEBUG_MEM_ALLOC_REC *psCurrent
        {
                eAllocType = psCurrentRecord->eAllocType;
                g_WaterMarkData[eAllocType] -= psCurrentRecord->ui32Bytes;
-               
+
                if(eAllocType == DEBUG_MEM_ALLOC_TYPE_KMALLOC
                   || eAllocType == DEBUG_MEM_ALLOC_TYPE_VMALLOC
                   || eAllocType == DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES
@@ -463,7 +463,7 @@ static IMG_BOOL DebugMemAllocRecordRemove_AnyVaCb(DEBUG_MEM_ALLOC_REC *psCurrent
                {
                        g_IOMemWaterMark -= psCurrentRecord->ui32Bytes;
                }
-               
+
                List_DEBUG_MEM_ALLOC_REC_Remove(psCurrentRecord);
                kfree(psCurrentRecord);
 
@@ -481,7 +481,7 @@ DebugMemAllocRecordRemove(DEBUG_MEM_ALLOC_TYPE eAllocType, IMG_VOID *pvKey, IMG_
 {
     LinuxLockMutex(&g_sDebugMutex);
 
-    
+
        if(!List_DEBUG_MEM_ALLOC_REC_IMG_BOOL_Any_va(g_MemoryRecords,
                                                                                                DebugMemAllocRecordRemove_AnyVaCb,
                                                                                                eAllocType,
@@ -521,7 +521,7 @@ _VMallocWrapper(IMG_UINT32 ui32Bytes,
 {
     pgprot_t PGProtFlags;
     IMG_VOID *pvRet;
-    
+
     switch(ui32AllocFlags & PVRSRV_HAP_CACHETYPE_MASK)
     {
         case PVRSRV_HAP_CACHED:
@@ -541,9 +541,9 @@ _VMallocWrapper(IMG_UINT32 ui32Bytes,
             return NULL;
     }
 
-       
+
     pvRet = __vmalloc(ui32Bytes, GFP_KERNEL | __GFP_HIGHMEM, PGProtFlags);
-    
+
 #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
     if(pvRet)
     {
@@ -596,9 +596,9 @@ NewVMallocLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags)
     {
         goto failed;
     }
-    
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-    
+
     ReservePages(pvCpuVAddr, ui32Bytes);
 #endif
 
@@ -612,7 +612,7 @@ NewVMallocLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags)
     DebugLinuxMemAreaRecordAdd(psLinuxMemArea, ui32AreaFlags);
 #endif
 
-    
+
     if(ui32AreaFlags & (PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_UNCACHED))
         OSInvalidateCPUCacheRangeKM(psLinuxMemArea, pvCpuVAddr, ui32Bytes);
 
@@ -683,7 +683,7 @@ UnreservePages(IMG_VOID *pvAddress, IMG_UINT32 ui32Length)
 #endif
        }
 }
-#endif 
+#endif
 
 
 IMG_VOID *
@@ -694,7 +694,7 @@ _IORemapWrapper(IMG_CPU_PHYADDR BasePAddr,
                IMG_UINT32 ui32Line)
 {
     IMG_VOID *pvIORemapCookie;
-    
+
     switch(ui32MappingFlags & PVRSRV_HAP_CACHETYPE_MASK)
     {
         case PVRSRV_HAP_CACHED:
@@ -710,7 +710,7 @@ _IORemapWrapper(IMG_CPU_PHYADDR BasePAddr,
             PVR_DPF((PVR_DBG_ERROR, "IORemapWrapper: unknown mapping flags"));
             return NULL;
     }
-    
+
 #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
     if(pvIORemapCookie)
     {
@@ -790,7 +790,7 @@ FreeIORemapLinuxMemArea(LinuxMemArea *psLinuxMemArea)
 #if defined(DEBUG_LINUX_MEM_AREAS)
     DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
 #endif
-    
+
     IOUnmapWrapper(psLinuxMemArea->uData.sIORemap.pvIORemapCookie);
 
     LinuxMemAreaStructFree(psLinuxMemArea);
@@ -805,7 +805,7 @@ TreatExternalPagesAsContiguous(IMG_SYS_PHYADDR *psSysPhysAddr, IMG_UINT32 ui32By
        IMG_UINT32 ui32AddrChk;
        IMG_UINT32 ui32NumPages = RANGE_TO_PAGES(ui32Bytes);
 
-       
+
        for (ui32 = 0, ui32AddrChk = psSysPhysAddr[0].uiAddr;
                ui32 < ui32NumPages;
                ui32++, ui32AddrChk = (bPhysContig) ? (ui32AddrChk + PAGE_SIZE) : psSysPhysAddr[ui32].uiAddr)
@@ -884,7 +884,7 @@ FreeExternalKVLinuxMemArea(LinuxMemArea *psLinuxMemArea)
 #if defined(DEBUG_LINUX_MEM_AREAS)
     DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
 #endif
-    
+
     LinuxMemAreaStructFree(psLinuxMemArea);
 }
 
@@ -900,7 +900,7 @@ NewIOLinuxMemArea(IMG_CPU_PHYADDR BasePAddr,
         return NULL;
     }
 
-    
+
     psLinuxMemArea->eAreaType = LINUX_MEM_AREA_IO;
     psLinuxMemArea->uData.sIO.CPUPhysAddr.uiAddr = BasePAddr.uiAddr;
     psLinuxMemArea->ui32ByteSize = ui32Bytes;
@@ -918,7 +918,7 @@ NewIOLinuxMemArea(IMG_CPU_PHYADDR BasePAddr,
                            0
                            );
 #endif
-   
+
 #if defined(DEBUG_LINUX_MEM_AREAS)
     DebugLinuxMemAreaRecordAdd(psLinuxMemArea, ui32AreaFlags);
 #endif
@@ -931,7 +931,7 @@ IMG_VOID
 FreeIOLinuxMemArea(LinuxMemArea *psLinuxMemArea)
 {
     PVR_ASSERT(psLinuxMemArea->eAreaType == LINUX_MEM_AREA_IO);
-    
+
 #if defined(DEBUG_LINUX_MEM_AREAS)
     DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
 #endif
@@ -941,7 +941,7 @@ FreeIOLinuxMemArea(LinuxMemArea *psLinuxMemArea)
                               (IMG_VOID *)psLinuxMemArea->uData.sIO.CPUPhysAddr.uiAddr, __FILE__, __LINE__);
 #endif
 
-    
+
 
     LinuxMemAreaStructFree(psLinuxMemArea);
 }
@@ -954,15 +954,15 @@ NewAllocPagesLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags)
     IMG_UINT32 ui32PageCount;
     struct page **pvPageList;
     IMG_HANDLE hBlockPageList;
-    IMG_INT32 i;               
+    IMG_INT32 i;
     PVRSRV_ERROR eError;
-    
+
     psLinuxMemArea = LinuxMemAreaStructAlloc();
     if(!psLinuxMemArea)
     {
         goto failed_area_alloc;
     }
-    
+
     ui32PageCount = RANGE_TO_PAGES(ui32Bytes);
     eError = OSAllocMem(0, sizeof(*pvPageList) * ui32PageCount, (IMG_VOID **)&pvPageList, &hBlockPageList,
                                                        "Array of pages");
@@ -970,7 +970,7 @@ NewAllocPagesLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags)
     {
         goto failed_page_list_alloc;
     }
-    
+
     for(i=0; i<(IMG_INT32)ui32PageCount; i++)
     {
         pvPageList[i] = alloc_pages(GFP_KERNEL | __GFP_HIGHMEM, 0);
@@ -979,8 +979,8 @@ NewAllocPagesLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags)
             goto failed_alloc_pages;
         }
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-       
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))               
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
        SetPageReserved(pvPageList[i]);
 #else
         mem_map_reserve(pvPageList[i]);
@@ -1008,7 +1008,7 @@ NewAllocPagesLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags)
     psLinuxMemArea->ui32AreaFlags = ui32AreaFlags;
     INIT_LIST_HEAD(&psLinuxMemArea->sMMapOffsetStructList);
 
-    
+
     if(ui32AreaFlags & (PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_UNCACHED))
     {
         psLinuxMemArea->bNeedsCacheInvalidate = IMG_TRUE;
@@ -1019,19 +1019,19 @@ NewAllocPagesLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags)
 #endif
 
     return psLinuxMemArea;
-    
+
 failed_alloc_pages:
     for(i--; i >= 0; i--)
     {
         __free_pages(pvPageList[i], 0);
     }
     (IMG_VOID) OSFreeMem(0, sizeof(*pvPageList) * ui32PageCount, pvPageList, hBlockPageList);
-       psLinuxMemArea->uData.sPageList.pvPageList = IMG_NULL; 
+       psLinuxMemArea->uData.sPageList.pvPageList = IMG_NULL;
 failed_page_list_alloc:
     LinuxMemAreaStructFree(psLinuxMemArea);
 failed_area_alloc:
     PVR_DPF((PVR_DBG_ERROR, "%s: failed", __FUNCTION__));
-    
+
     return NULL;
 }
 
@@ -1050,29 +1050,29 @@ FreeAllocPagesLinuxMemArea(LinuxMemArea *psLinuxMemArea)
 #if defined(DEBUG_LINUX_MEM_AREAS)
     DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
 #endif
-    
+
     ui32PageCount = RANGE_TO_PAGES(psLinuxMemArea->ui32ByteSize);
     pvPageList = psLinuxMemArea->uData.sPageList.pvPageList;
     hBlockPageList = psLinuxMemArea->uData.sPageList.hBlockPageList;
-    
+
 #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
     DebugMemAllocRecordRemove(DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES, pvPageList, __FILE__, __LINE__);
 #endif
 
     for(i=0;i<(IMG_INT32)ui32PageCount;i++)
     {
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))              
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))               
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
         ClearPageReserved(pvPageList[i]);
 #else
         mem_map_reserve(pvPageList[i]);
-#endif         
-#endif 
+#endif
+#endif
         __free_pages(pvPageList[i], 0);
     }
 
     (IMG_VOID) OSFreeMem(0, sizeof(*pvPageList) * ui32PageCount, pvPageList, hBlockPageList);
-       psLinuxMemArea->uData.sPageList.pvPageList = IMG_NULL; 
+       psLinuxMemArea->uData.sPageList.pvPageList = IMG_NULL;
 
     LinuxMemAreaStructFree(psLinuxMemArea);
 }
@@ -1107,12 +1107,12 @@ NewIONLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags,
         goto err_out;
     }
 
-    
+
     BUG_ON(ui32PrivDataLength != ui32AllocDataLen &&
            ui32PrivDataLength != ui32AllocDataLen * 2);
     ui32NumHandlesPerFd = ui32PrivDataLength / ui32AllocDataLen;
 
-    
+
     for(i = 0; i < ui32NumHandlesPerFd; i++)
     {
            memcpy(&asAllocData[i], &pbPrivData[i * ui32AllocDataLen], ui32AllocDataLen);
@@ -1131,11 +1131,11 @@ NewIONLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags,
         }
     }
 
-    
+
     BUG_ON(ui32Bytes != (iNumPages[0] + iNumPages[1]) * PAGE_SIZE);
     BUG_ON(sizeof(IMG_CPU_PHYADDR) != sizeof(int));
 
-    
+
     pCPUPhysAddrs = vmalloc(sizeof(IMG_CPU_PHYADDR) * (iNumPages[0] + iNumPages[1]));
     if(!pCPUPhysAddrs)
     {
@@ -1168,7 +1168,7 @@ NewIONLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags,
     psLinuxMemArea->ui32AreaFlags = ui32AreaFlags;
     INIT_LIST_HEAD(&psLinuxMemArea->sMMapOffsetStructList);
 
-    
+
     if(ui32AreaFlags & (PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_UNCACHED))
     {
         psLinuxMemArea->bNeedsCacheInvalidate = IMG_TRUE;
@@ -1211,7 +1211,7 @@ FreeIONLinuxMemArea(LinuxMemArea *psLinuxMemArea)
         psLinuxMemArea->uData.sIONTilerAlloc.psIONHandle[i] = IMG_NULL;
     }
 
-    
+
     vfree(psLinuxMemArea->uData.sIONTilerAlloc.pCPUPhysAddrs);
     psLinuxMemArea->uData.sIONTilerAlloc.pCPUPhysAddrs = IMG_NULL;
 
@@ -1232,14 +1232,14 @@ LinuxMemAreaOffsetToPage(LinuxMemArea *psLinuxMemArea,
         case LINUX_MEM_AREA_ALLOC_PAGES:
             ui32PageIndex = PHYS_TO_PFN(ui32ByteOffset);
             return psLinuxMemArea->uData.sPageList.pvPageList[ui32PageIndex];
+
         case LINUX_MEM_AREA_VMALLOC:
             pui8Addr = psLinuxMemArea->uData.sVmalloc.pvVmallocAddress;
             pui8Addr += ui32ByteOffset;
             return vmalloc_to_page(pui8Addr);
+
         case LINUX_MEM_AREA_SUB_ALLOC:
-             
+
             return LinuxMemAreaOffsetToPage(psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea,
                                             psLinuxMemArea->uData.sSubAlloc.ui32ByteOffset
                                              + ui32ByteOffset);
@@ -1264,7 +1264,7 @@ KMemCacheCreateWrapper(IMG_CHAR *pszName,
     return kmem_cache_create(pszName, Size, Align, ui32Flags, NULL
 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22))
                                , NULL
-#endif 
+#endif
                            );
 }
 
@@ -1287,7 +1287,7 @@ _KMemCacheAllocWrapper(LinuxKMemCache *psCache,
                       IMG_UINT32 ui32Line)
 {
     IMG_VOID *pvRet;
-    
+
     pvRet = kmem_cache_zalloc(psCache, Flags);
 
 #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
@@ -1304,7 +1304,7 @@ _KMemCacheAllocWrapper(LinuxKMemCache *psCache,
     PVR_UNREFERENCED_PARAMETER(pszFileName);
     PVR_UNREFERENCED_PARAMETER(ui32Line);
 #endif
-    
+
     return pvRet;
 }
 
@@ -1328,7 +1328,7 @@ KMemCacheNameWrapper(LinuxKMemCache *psCache)
 {
     PVR_UNREFERENCED_PARAMETER(psCache);
 
-    
+
     return "";
 }
 
@@ -1339,15 +1339,15 @@ NewSubLinuxMemArea(LinuxMemArea *psParentLinuxMemArea,
                    IMG_UINT32 ui32Bytes)
 {
     LinuxMemArea *psLinuxMemArea;
-    
+
     PVR_ASSERT((ui32ByteOffset+ui32Bytes) <= psParentLinuxMemArea->ui32ByteSize);
-    
+
     psLinuxMemArea = LinuxMemAreaStructAlloc();
     if(!psLinuxMemArea)
     {
         return NULL;
     }
-    
+
     psLinuxMemArea->eAreaType = LINUX_MEM_AREA_SUB_ALLOC;
     psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea = psParentLinuxMemArea;
     psLinuxMemArea->uData.sSubAlloc.ui32ByteOffset = ui32ByteOffset;
@@ -1355,7 +1355,7 @@ NewSubLinuxMemArea(LinuxMemArea *psParentLinuxMemArea,
     psLinuxMemArea->ui32AreaFlags = psParentLinuxMemArea->ui32AreaFlags;
     psLinuxMemArea->bNeedsCacheInvalidate = psParentLinuxMemArea->bNeedsCacheInvalidate;
     INIT_LIST_HEAD(&psLinuxMemArea->sMMapOffsetStructList);
-    
+
 #if defined(DEBUG_LINUX_MEM_AREAS)
     {
         DEBUG_LINUX_MEM_AREA_REC *psParentRecord;
@@ -1363,7 +1363,7 @@ NewSubLinuxMemArea(LinuxMemArea *psParentLinuxMemArea,
         DebugLinuxMemAreaRecordAdd(psLinuxMemArea, psParentRecord->ui32Flags);
     }
 #endif
-    
+
     return psLinuxMemArea;
 }
 
@@ -1376,8 +1376,8 @@ FreeSubLinuxMemArea(LinuxMemArea *psLinuxMemArea)
 #if defined(DEBUG_LINUX_MEM_AREAS)
     DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
 #endif
-    
-    
+
+
 
     LinuxMemAreaStructFree(psLinuxMemArea);
 }
@@ -1402,8 +1402,8 @@ static IMG_VOID
 LinuxMemAreaStructFree(LinuxMemArea *psLinuxMemArea)
 {
     KMemCacheFreeWrapper(psLinuxMemAreaCache, psLinuxMemArea);
-    
-    
+
+
 }
 
 
@@ -1447,7 +1447,7 @@ DebugLinuxMemAreaRecordAdd(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32Flags)
 {
     DEBUG_LINUX_MEM_AREA_REC *psNewRecord;
     const IMG_CHAR *pi8FlagsString;
-    
+
     LinuxLockMutex(&g_sDebugMutex);
 
     if(psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC)
@@ -1459,16 +1459,16 @@ DebugLinuxMemAreaRecordAdd(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32Flags)
         }
     }
     g_LinuxMemAreaCount++;
-    
-    
+
+
     psNewRecord = kmalloc(sizeof(DEBUG_LINUX_MEM_AREA_REC), GFP_KERNEL);
     if(psNewRecord)
     {
-        
+
         psNewRecord->psLinuxMemArea = psLinuxMemArea;
         psNewRecord->ui32Flags = ui32Flags;
         psNewRecord->pid = OSGetCurrentProcessIDKM();
-               
+
                List_DEBUG_LINUX_MEM_AREA_REC_Insert(&g_LinuxMemAreaRecords, psNewRecord);
     }
     else
@@ -1477,8 +1477,8 @@ DebugLinuxMemAreaRecordAdd(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32Flags)
                  "%s: failed to allocate linux memory area record.",
                  __FUNCTION__));
     }
-    
-    
+
+
     pi8FlagsString = HAPFlagsToString(ui32Flags);
     if(strstr(pi8FlagsString, "UNKNOWN"))
     {
@@ -1487,7 +1487,7 @@ DebugLinuxMemAreaRecordAdd(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32Flags)
                  __FUNCTION__,
                  ui32Flags,
                  psLinuxMemArea));
-        
+
     }
 
     LinuxUnLockMutex(&g_sDebugMutex);
@@ -1499,7 +1499,7 @@ static IMG_VOID* MatchLinuxMemArea_AnyVaCb(DEBUG_LINUX_MEM_AREA_REC *psCurrentRe
                                                                                   va_list va)
 {
        LinuxMemArea *psLinuxMemArea;
-       
+
        psLinuxMemArea = va_arg(va, LinuxMemArea*);
        if(psCurrentRecord->psLinuxMemArea == psLinuxMemArea)
        {
@@ -1521,7 +1521,7 @@ DebugLinuxMemAreaRecordFind(LinuxMemArea *psLinuxMemArea)
        psCurrentRecord = List_DEBUG_LINUX_MEM_AREA_REC_Any_va(g_LinuxMemAreaRecords,
                                                                                                                MatchLinuxMemArea_AnyVaCb,
                                                                                                                psLinuxMemArea);
-       
+
     LinuxUnLockMutex(&g_sDebugMutex);
 
     return psCurrentRecord;
@@ -1541,13 +1541,13 @@ DebugLinuxMemAreaRecordRemove(LinuxMemArea *psLinuxMemArea)
     }
     g_LinuxMemAreaCount--;
 
-    
+
        psCurrentRecord = List_DEBUG_LINUX_MEM_AREA_REC_Any_va(g_LinuxMemAreaRecords,
                                                                                                                MatchLinuxMemArea_AnyVaCb,
                                                                                                                psLinuxMemArea);
        if(psCurrentRecord)
        {
-               
+
                List_DEBUG_LINUX_MEM_AREA_REC_Remove(psCurrentRecord);
                kfree(psCurrentRecord);
        }
@@ -1576,7 +1576,7 @@ LinuxMemAreaToCpuVAddr(LinuxMemArea *psLinuxMemArea)
         case LINUX_MEM_AREA_SUB_ALLOC:
         {
             IMG_CHAR *pAddr =
-                LinuxMemAreaToCpuVAddr(psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea);  
+                LinuxMemAreaToCpuVAddr(psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea);
             if(!pAddr)
             {
                 return NULL;
@@ -1593,7 +1593,7 @@ IMG_CPU_PHYADDR
 LinuxMemAreaToCpuPAddr(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32ByteOffset)
 {
     IMG_CPU_PHYADDR CpuPAddr;
-    
+
     CpuPAddr.uiAddr = 0;
 
     switch(psLinuxMemArea->eAreaType)
@@ -1669,7 +1669,7 @@ LinuxMemAreaToCpuPAddr(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32ByteOffset)
            break;
         }
    }
-    
+
     return CpuPAddr;
 }
 
@@ -1692,7 +1692,7 @@ LinuxMemAreaPhysIsContig(LinuxMemArea *psLinuxMemArea)
             return IMG_FALSE;
 
         case LINUX_MEM_AREA_SUB_ALLOC:
-             
+
             return LinuxMemAreaPhysIsContig(psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea);
 
         default:
@@ -1707,7 +1707,7 @@ LinuxMemAreaPhysIsContig(LinuxMemArea *psLinuxMemArea)
 const IMG_CHAR *
 LinuxMemAreaTypeToString(LINUX_MEM_AREA_TYPE eMemAreaType)
 {
-    
+
     switch(eMemAreaType)
     {
         case LINUX_MEM_AREA_IOREMAP:
@@ -1733,18 +1733,18 @@ LinuxMemAreaTypeToString(LINUX_MEM_AREA_TYPE eMemAreaType)
 
 
 #if defined(DEBUG_LINUX_MEM_AREAS) || defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
-static void ProcSeqStartstopDebugMutex(struct seq_file *sfile, IMG_BOOL start) 
+static void ProcSeqStartstopDebugMutex(struct seq_file *sfile, IMG_BOOL start)
 {
-       if(start) 
+       if(start)
        {
-           LinuxLockMutex(&g_sDebugMutex);             
+           LinuxLockMutex(&g_sDebugMutex);
        }
        else
        {
            LinuxUnLockMutex(&g_sDebugMutex);
        }
 }
-#endif 
+#endif
 
 #if defined(DEBUG_LINUX_MEM_AREAS)
 
@@ -1761,8 +1761,8 @@ static IMG_VOID* DecOffMemAreaRec_AnyVaCb(DEBUG_LINUX_MEM_AREA_REC *psNode, va_l
        }
 }
 
-static void* ProcSeqNextMemArea(struct seq_file *sfile,void* el,loff_t off) 
+
+static void* ProcSeqNextMemArea(struct seq_file *sfile,void* el,loff_t off)
 {
     DEBUG_LINUX_MEM_AREA_REC *psRecord;
        psRecord = (DEBUG_LINUX_MEM_AREA_REC*)
@@ -1775,7 +1775,7 @@ static void* ProcSeqNextMemArea(struct seq_file *sfile,void* el,loff_t off)
 static void* ProcSeqOff2ElementMemArea(struct seq_file * sfile, loff_t off)
 {
     DEBUG_LINUX_MEM_AREA_REC *psRecord;
-       if(!off) 
+       if(!off)
        {
                return PVR_PROC_SEQ_START_TOKEN;
        }
@@ -1790,8 +1790,8 @@ static void* ProcSeqOff2ElementMemArea(struct seq_file * sfile, loff_t off)
 
 static void ProcSeqShowMemArea(struct seq_file *sfile,void* el)
 {
-    DEBUG_LINUX_MEM_AREA_REC *psRecord = (DEBUG_LINUX_MEM_AREA_REC*)el; 
-       if(el == PVR_PROC_SEQ_START_TOKEN) 
+    DEBUG_LINUX_MEM_AREA_REC *psRecord = (DEBUG_LINUX_MEM_AREA_REC*)el;
+       if(el == PVR_PROC_SEQ_START_TOKEN)
        {
 
 #if !defined(DEBUG_LINUX_XML_PROC_FILES)
@@ -1816,8 +1816,8 @@ static void ProcSeqShowMemArea(struct seq_file *sfile,void* el)
         seq_printf( sfile,
                           "<mem_areas_header>\n"
                           "\t<count>%u</count>\n"
-                          "\t<watermark key=\"mar0\" description=\"current\" bytes=\"%u\"/>\n" 
-                          "\t<watermark key=\"mar1\" description=\"high\" bytes=\"%u\"/>\n" 
+                          "\t<watermark key=\"mar0\" description=\"current\" bytes=\"%u\"/>\n"
+                          "\t<watermark key=\"mar1\" description=\"high\" bytes=\"%u\"/>\n"
                           "</mem_areas_header>\n",
                           g_LinuxMemAreaCount,
                           g_LinuxMemAreaWaterMark,
@@ -1854,7 +1854,7 @@ static void ProcSeqShowMemArea(struct seq_file *sfile,void* el)
 
 }
 
-#endif 
+#endif
 
 
 #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
@@ -1873,8 +1873,8 @@ static IMG_VOID* DecOffMemAllocRec_AnyVaCb(DEBUG_MEM_ALLOC_REC *psNode, va_list
 }
 
 
-static void* ProcSeqNextMemoryRecords(struct seq_file *sfile,void* el,loff_t off) 
+
+static void* ProcSeqNextMemoryRecords(struct seq_file *sfile,void* el,loff_t off)
 {
     DEBUG_MEM_ALLOC_REC *psRecord;
        psRecord = (DEBUG_MEM_ALLOC_REC*)
@@ -1882,7 +1882,7 @@ static void* ProcSeqNextMemoryRecords(struct seq_file *sfile,void* el,loff_t off
                                                                                DecOffMemAllocRec_AnyVaCb,
                                                                                &off);
 #if defined(DEBUG_LINUX_XML_PROC_FILES)
-       if(!psRecord) 
+       if(!psRecord)
        {
                seq_printf( sfile, "</meminfo>\n");
        }
@@ -1894,7 +1894,7 @@ static void* ProcSeqNextMemoryRecords(struct seq_file *sfile,void* el,loff_t off
 static void* ProcSeqOff2ElementMemoryRecords(struct seq_file *sfile, loff_t off)
 {
     DEBUG_MEM_ALLOC_REC *psRecord;
-       if(!off) 
+       if(!off)
        {
                return PVR_PROC_SEQ_START_TOKEN;
        }
@@ -1905,7 +1905,7 @@ static void* ProcSeqOff2ElementMemoryRecords(struct seq_file *sfile, loff_t off)
                                                                                &off);
 
 #if defined(DEBUG_LINUX_XML_PROC_FILES)
-       if(!psRecord) 
+       if(!psRecord)
        {
                seq_printf( sfile, "</meminfo>\n");
        }
@@ -1917,10 +1917,10 @@ static void* ProcSeqOff2ElementMemoryRecords(struct seq_file *sfile, loff_t off)
 static void ProcSeqShowMemoryRecords(struct seq_file *sfile,void* el)
 {
     DEBUG_MEM_ALLOC_REC *psRecord = (DEBUG_MEM_ALLOC_REC*)el;
-       if(el == PVR_PROC_SEQ_START_TOKEN) 
+       if(el == PVR_PROC_SEQ_START_TOKEN)
        {
 #if !defined(DEBUG_LINUX_XML_PROC_FILES)
-        
+
         seq_printf( sfile, "%-60s: %d bytes\n",
                            "Current Water Mark of bytes allocated via kmalloc",
                            g_WaterMarkData[DEBUG_MEM_ALLOC_TYPE_KMALLOC]);
@@ -1984,9 +1984,9 @@ static void ProcSeqShowMemoryRecords(struct seq_file *sfile,void* el)
                            "PrivateData",
                            "Filename:Line");
 
-#else 
-               
-               
+#else
+
+
                seq_printf( sfile, "<meminfo>\n<meminfo_header>\n");
                seq_printf( sfile,
                            "<watermark key=\"mr0\" description=\"kmalloc_current\" bytes=\"%d\"/>\n",
@@ -2041,7 +2041,7 @@ static void ProcSeqShowMemoryRecords(struct seq_file *sfile,void* el)
 
                seq_printf( sfile, "</meminfo_header>\n");
 
-#endif 
+#endif
                return;
        }
 
@@ -2099,7 +2099,7 @@ static void ProcSeqShowMemoryRecords(struct seq_file *sfile,void* el)
     }
 }
 
-#endif 
+#endif
 
 
 #if defined(DEBUG_LINUX_MEM_AREAS) || defined(DEBUG_LINUX_MMAP_AREAS)
@@ -2123,8 +2123,8 @@ HAPFlagsToString(IMG_UINT32 ui32Flags)
         "NO_CPU_VIRTUAL",
         "UNKNOWN"
     };
-    
-    
+
+
     if(ui32Flags & PVRSRV_HAP_UNCACHED){
         ui32CacheTypeIndex=0;
     }else if(ui32Flags & PVRSRV_HAP_CACHED){
@@ -2137,7 +2137,7 @@ HAPFlagsToString(IMG_UINT32 ui32Flags)
                  __FUNCTION__, (ui32Flags & PVRSRV_HAP_CACHETYPE_MASK)));
     }
 
-    
+
     if(ui32Flags & PVRSRV_HAP_KERNEL_ONLY){
         ui32MapTypeIndex = 0;
     }else if(ui32Flags & PVRSRV_HAP_SINGLE_PROCESS){
old mode 100755 (executable)
new mode 100644 (file)
index f7d4c0e..0fb0917
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -73,7 +73,7 @@
 static inline IMG_UINT32 VMallocToPhys(IMG_VOID *pCpuVAddr)
 {
        return (page_to_phys(vmalloc_to_page(pCpuVAddr)) + ADDR_TO_PAGE_OFFSET(pCpuVAddr));
-               
+
 }
 
 typedef enum {
@@ -96,16 +96,16 @@ struct _LinuxMemArea {
     {
         struct _sIORemap
         {
-            
+
             IMG_CPU_PHYADDR CPUPhysAddr;
             IMG_VOID *pvIORemapCookie;
         }sIORemap;
         struct _sExternalKV
         {
-            
+
            IMG_BOOL bPhysContig;
            union {
-                   
+
                    IMG_SYS_PHYADDR SysPhysAddr;
                    IMG_SYS_PHYADDR *pSysPhysAddr;
            } uPhysAddr;
@@ -113,17 +113,17 @@ struct _LinuxMemArea {
         }sExternalKV;
         struct _sIO
         {
-            
+
             IMG_CPU_PHYADDR CPUPhysAddr;
         }sIO;
         struct _sVmalloc
         {
-            
+
             IMG_VOID *pvVmallocAddress;
         }sVmalloc;
         struct _sPageList
         {
-            
+
             struct page **pvPageList;
            IMG_HANDLE hBlockPageList;
         }sPageList;
@@ -135,24 +135,24 @@ struct _LinuxMemArea {
         }sIONTilerAlloc;
         struct _sSubAlloc
         {
-            
+
             LinuxMemArea *psParentLinuxMemArea;
             IMG_UINT32 ui32ByteOffset;
         }sSubAlloc;
     }uData;
 
-    IMG_UINT32 ui32ByteSize;           
+    IMG_UINT32 ui32ByteSize;
 
-    IMG_UINT32 ui32AreaFlags;          
+    IMG_UINT32 ui32AreaFlags;
 
-    IMG_BOOL bMMapRegistered;          
+    IMG_BOOL bMMapRegistered;
+
+    IMG_BOOL bNeedsCacheInvalidate;
 
-    IMG_BOOL bNeedsCacheInvalidate;    
 
-    
     struct list_head   sMMapItem;
 
-    
+
     struct list_head   sMMapOffsetStructList;
 };
 
@@ -371,5 +371,5 @@ const IMG_CHAR *LinuxMemAreaTypeToString(LINUX_MEM_AREA_TYPE eMemAreaType);
 const IMG_CHAR *HAPFlagsToString(IMG_UINT32 ui32Flags);
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index e7a43c1..cad1476
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -86,7 +86,7 @@ static IMG_UINT32 g_ui32TotalByteSize = 0;
 
 #if defined(DEBUG_LINUX_MMAP_AREAS)
 static struct proc_dir_entry *g_ProcMMap;
-#endif 
+#endif
 
 #if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
 #define MMAP2_PGOFF_RESOLUTION (32-PAGE_SHIFT+12)
@@ -98,7 +98,7 @@ static struct proc_dir_entry *g_ProcMMap;
 #define        FIRST_SPECIAL_PFN       (LAST_PHYSICAL_PFN + 1)
 #define        LAST_SPECIAL_PFN        (FIRST_SPECIAL_PFN + MAX_MMAP_HANDLE)
 
-#else  
+#else
 
 #if PAGE_SHIFT != 12
 #error This build variant has not yet been made non-4KB page-size aware
@@ -116,20 +116,20 @@ static struct proc_dir_entry *g_ProcMMap;
 #define        MAX_MMAP_HANDLE         0x7fffffffUL
 #endif
 
-#endif 
+#endif
 
 #if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
 static inline IMG_BOOL
 PFNIsPhysical(IMG_UINT32 pfn)
 {
-       
+
        return ( (pfn <= LAST_PHYSICAL_PFN)) ? IMG_TRUE : IMG_FALSE;
 }
 
 static inline IMG_BOOL
 PFNIsSpecial(IMG_UINT32 pfn)
 {
-       
+
        return ((pfn >= FIRST_SPECIAL_PFN) ) ? IMG_TRUE : IMG_FALSE;
 }
 #endif
@@ -178,7 +178,7 @@ LinuxMemAreaUsesPhysicalMap(LinuxMemArea *psLinuxMemArea)
 static inline IMG_UINT32
 GetCurrentThreadID(IMG_VOID)
 {
-       
+
        return (IMG_UINT32)current->pid;
 }
 #endif
@@ -207,21 +207,21 @@ CreateOffsetStruct(LinuxMemArea *psLinuxMemArea, IMG_UINT32 ui32Offset, IMG_UINT
         PVR_DPF((PVR_DBG_ERROR,"PVRMMapRegisterArea: Couldn't alloc another mapping record from cache"));
         return IMG_NULL;
     }
-    
+
     psOffsetStruct->ui32MMapOffset = ui32Offset;
 
     psOffsetStruct->psLinuxMemArea = psLinuxMemArea;
 
     psOffsetStruct->ui32RealByteSize = ui32RealByteSize;
 
-    
+
 #if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
     psOffsetStruct->ui32TID = GetCurrentThreadID();
 #endif
     psOffsetStruct->ui32PID = OSGetCurrentProcessIDKM();
 
 #if defined(DEBUG_LINUX_MMAP_AREAS)
-    
+
     psOffsetStruct->pszName = pszName;
 #endif
 
@@ -252,7 +252,7 @@ DestroyOffsetStruct(PKV_OFFSET_STRUCT psOffsetStruct)
              psOffsetStruct->psLinuxMemArea,
              CpuPAddr.uiAddr));
 #endif
-    
+
     KMemCacheFreeWrapper(g_psMemmapCache, psOffsetStruct);
 }
 
@@ -264,10 +264,10 @@ DetermineUsersSizeAndByteOffset(LinuxMemArea *psLinuxMemArea,
 {
     IMG_UINT32 ui32PageAlignmentOffset;
     IMG_CPU_PHYADDR CpuPAddr;
-    
+
     CpuPAddr = LinuxMemAreaToCpuPAddr(psLinuxMemArea, 0);
     ui32PageAlignmentOffset = ADDR_TO_PAGE_OFFSET(CpuPAddr.uiAddr);
-    
+
     *pui32ByteOffset = ui32PageAlignmentOffset;
 
     *pui32RealByteSize = PAGE_ALIGN(psLinuxMemArea->ui32ByteSize + ui32PageAlignmentOffset);
@@ -313,14 +313,14 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
                                    pui32RealByteSize,
                                    pui32ByteOffset);
 
-    
+
     list_for_each_entry(psOffsetStruct, &psLinuxMemArea->sMMapOffsetStructList, sAreaItem)
     {
         if (psPerProc->ui32PID == psOffsetStruct->ui32PID)
         {
 
           PVR_ASSERT(*pui32RealByteSize == psOffsetStruct->ui32RealByteSize);
-          
+
           *pui32MMapOffset = psOffsetStruct->ui32MMapOffset;
           *pui32UserVAddr = psOffsetStruct->ui32UserVAddr;
           PVRSRVOffsetStructIncRef(psOffsetStruct);
@@ -330,7 +330,7 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
         }
     }
 
-    
+
     *pui32UserVAddr = 0;
 
 #if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
@@ -355,7 +355,7 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
        goto exit_unlock;
     }
 
-    
+
     list_add_tail(&psOffsetStruct->sMMapItem, &g_sMMapOffsetStructList);
 
     psOffsetStruct->bOnMMapList = IMG_TRUE;
@@ -364,7 +364,7 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
 
     eError = PVRSRV_OK;
 
-       
+
 
 
        *pui32MMapOffset = *pui32MMapOffset << (PAGE_SHIFT - 12);
@@ -411,7 +411,7 @@ PVRMMapReleaseMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
 
     psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
 
-    
+
     list_for_each_entry(psOffsetStruct, &psLinuxMemArea->sMMapOffsetStructList, sAreaItem)
     {
         if (psOffsetStruct->ui32PID == ui32PID)
@@ -435,7 +435,7 @@ PVRMMapReleaseMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
         }
     }
 
-    
+
 #if defined (SUPPORT_SID_INTERFACE)
     PVR_DPF((PVR_DBG_ERROR, "%s: Mapping data not found for handle %x (memory area %p)", __FUNCTION__, hMHandle, psLinuxMemArea));
 #else
@@ -464,7 +464,7 @@ FindOffsetStructByOffset(IMG_UINT32 ui32Offset, IMG_UINT32 ui32RealByteSize)
         if (ui32Offset == psOffsetStruct->ui32MMapOffset && ui32RealByteSize == psOffsetStruct->ui32RealByteSize && psOffsetStruct->ui32PID == ui32PID)
         {
 #if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
-           
+
            if (!PFNIsPhysical(ui32Offset) || psOffsetStruct->ui32TID == ui32TID)
 #endif
            {
@@ -486,17 +486,17 @@ DoMapToUser(LinuxMemArea *psLinuxMemArea,
 
     if (psLinuxMemArea->eAreaType == LINUX_MEM_AREA_SUB_ALLOC)
     {
-        return DoMapToUser(LinuxMemAreaRoot(psLinuxMemArea),            
+        return DoMapToUser(LinuxMemAreaRoot(psLinuxMemArea),
                     ps_vma,
                     psLinuxMemArea->uData.sSubAlloc.ui32ByteOffset + ui32ByteOffset);
     }
 
-    
+
     ui32ByteSize = ps_vma->vm_end - ps_vma->vm_start;
     PVR_ASSERT(ADDR_TO_PAGE_OFFSET(ui32ByteSize) == 0);
 
 #if defined (__sparc__)
-    
+
 #error "SPARC not supported"
 #endif
 
@@ -507,7 +507,7 @@ DoMapToUser(LinuxMemArea *psLinuxMemArea,
 
        PVR_ASSERT(LinuxMemAreaPhysIsContig(psLinuxMemArea));
        PVR_ASSERT(LinuxMemAreaToCpuPFN(psLinuxMemArea, ui32ByteOffset) == ps_vma->vm_pgoff);
-        
+
        result = IO_REMAP_PFN_RANGE(ps_vma, ps_vma->vm_start, ps_vma->vm_pgoff, ui32ByteSize, ps_vma->vm_page_prot);
 
         if(result == 0)
@@ -520,14 +520,14 @@ DoMapToUser(LinuxMemArea *psLinuxMemArea,
 #endif
 
     {
-        
+
         IMG_UINT32 ulVMAPos;
        IMG_UINT32 ui32ByteEnd = ui32ByteOffset + ui32ByteSize;
        IMG_UINT32 ui32PA;
 #if defined(PVR_MAKE_ALL_PFNS_SPECIAL)
        IMG_BOOL bMixedMap = IMG_FALSE;
 #endif
-       
+
        for(ui32PA = ui32ByteOffset; ui32PA < ui32ByteEnd; ui32PA += PAGE_SIZE)
        {
            IMG_UINT32 pfn =  LinuxMemAreaToCpuPFN(psLinuxMemArea, ui32PA);
@@ -549,7 +549,7 @@ DoMapToUser(LinuxMemArea *psLinuxMemArea,
             ps_vma->vm_flags |= VM_MIXEDMAP;
        }
 #endif
-       
+
         ulVMAPos = ps_vma->vm_start;
        for(ui32PA = ui32ByteOffset; ui32PA < ui32ByteEnd; ui32PA += PAGE_SIZE)
        {
@@ -752,15 +752,15 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
     PVR_UNREFERENCED_PARAMETER(pFile);
 
     LinuxLockMutex(&g_sMMapMutex);
-    
+
     ui32ByteSize = ps_vma->vm_end - ps_vma->vm_start;
-    
+
     PVR_DPF((PVR_DBG_MESSAGE, "%s: Received mmap(2) request with ui32MMapOffset 0x%08lx,"
                               " and ui32ByteSize %d(0x%08x)",
             __FUNCTION__,
             ps_vma->vm_pgoff,
             ui32ByteSize, ui32ByteSize));
-   
+
     psOffsetStruct = FindOffsetStructByOffset(ps_vma->vm_pgoff, ui32ByteSize);
     if (psOffsetStruct == IMG_NULL)
     {
@@ -788,7 +788,7 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
     list_del(&psOffsetStruct->sMMapItem);
     psOffsetStruct->bOnMMapList = IMG_FALSE;
 
-    
+
     if (((ps_vma->vm_flags & VM_WRITE) != 0) &&
         ((ps_vma->vm_flags & VM_SHARED) == 0))
     {
@@ -796,25 +796,25 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
         iRetVal = -EINVAL;
         goto unlock_and_return;
     }
-   
+
     PVR_DPF((PVR_DBG_MESSAGE, "%s: Mapped psLinuxMemArea 0x%p\n",
          __FUNCTION__, psOffsetStruct->psLinuxMemArea));
 
     ps_vma->vm_flags |= VM_RESERVED;
     ps_vma->vm_flags |= VM_IO;
 
-    
+
     ps_vma->vm_flags |= VM_DONTEXPAND;
-    
-    
+
+
     ps_vma->vm_flags |= VM_DONTCOPY;
 
     ps_vma->vm_private_data = (void *)psOffsetStruct;
-    
+
     switch(psOffsetStruct->psLinuxMemArea->ui32AreaFlags & PVRSRV_HAP_CACHETYPE_MASK)
     {
         case PVRSRV_HAP_CACHED:
-            
+
             break;
         case PVRSRV_HAP_WRITECOMBINE:
             ps_vma->vm_page_prot = PGPROT_WC(ps_vma->vm_page_prot);
@@ -827,21 +827,21 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
             iRetVal = -EINVAL;
            goto unlock_and_return;
     }
-    
-    
+
+
     ps_vma->vm_ops = &MMapIOOps;
-    
+
     if(!DoMapToUser(psOffsetStruct->psLinuxMemArea, ps_vma, 0))
     {
         iRetVal = -EAGAIN;
         goto unlock_and_return;
     }
-    
+
     PVR_ASSERT(psOffsetStruct->ui32UserVAddr == 0)
 
     psOffsetStruct->ui32UserVAddr = ps_vma->vm_start;
 
-    
+
     if(psOffsetStruct->psLinuxMemArea->bNeedsCacheInvalidate)
     {
         IMG_UINT32 ui32ByteOffset, ui32DummyByteSize;
@@ -856,7 +856,7 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
         psOffsetStruct->psLinuxMemArea->bNeedsCacheInvalidate = IMG_FALSE;
     }
 
-    
+
     MMapVOpenNoLock(ps_vma);
 
     PVR_DPF((PVR_DBG_MESSAGE, "%s: Mapped area at offset 0x%08lx\n",
@@ -882,11 +882,11 @@ unlock_and_return:
 
 #if defined(DEBUG_LINUX_MMAP_AREAS)
 
-static void ProcSeqStartstopMMapRegistations(struct seq_file *sfile,IMG_BOOL start) 
+static void ProcSeqStartstopMMapRegistations(struct seq_file *sfile,IMG_BOOL start)
 {
-       if(start) 
+       if(start)
        {
-           LinuxLockMutex(&g_sMMapMutex);              
+           LinuxLockMutex(&g_sMMapMutex);
        }
        else
        {
@@ -898,7 +898,7 @@ static void ProcSeqStartstopMMapRegistations(struct seq_file *sfile,IMG_BOOL sta
 static void* ProcSeqOff2ElementMMapRegistrations(struct seq_file *sfile, loff_t off)
 {
     LinuxMemArea *psLinuxMemArea;
-       if(!off) 
+       if(!off)
        {
                return PVR_PROC_SEQ_START_TOKEN;
        }
@@ -911,7 +911,7 @@ static void* ProcSeqOff2ElementMMapRegistrations(struct seq_file *sfile, loff_t
         {
                off--;
                if (off == 0)
-               {                               
+               {
                                PVR_ASSERT(psOffsetStruct->psLinuxMemArea == psLinuxMemArea);
                                return (void*)psOffsetStruct;
                    }
@@ -933,7 +933,7 @@ static void ProcSeqShowMMapRegistrations(struct seq_file *sfile, void *el)
        IMG_UINT32 ui32RealByteSize;
        IMG_UINT32 ui32ByteOffset;
 
-       if(el == PVR_PROC_SEQ_START_TOKEN) 
+       if(el == PVR_PROC_SEQ_START_TOKEN)
        {
         seq_printf( sfile,
 #if !defined(DEBUG_LINUX_XML_PROC_FILES)
@@ -1017,7 +1017,7 @@ PVRMMapRegisterArea(LinuxMemArea *psLinuxMemArea)
 
     PVR_ASSERT(psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC || LinuxMemAreaRoot(psLinuxMemArea)->eAreaType != LINUX_MEM_AREA_SUB_ALLOC);
 
-    
+
     if(psLinuxMemArea->bMMapRegistered)
     {
         PVR_DPF((PVR_DBG_ERROR, "%s: psLinuxMemArea 0x%p is already registered",
@@ -1032,7 +1032,7 @@ PVRMMapRegisterArea(LinuxMemArea *psLinuxMemArea)
 
 #if defined(DEBUG_LINUX_MMAP_AREAS)
     g_ui32RegisteredAreas++;
-    
+
     if (psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC)
     {
         g_ui32TotalByteSize += psLinuxMemArea->ui32ByteSize;
@@ -1071,7 +1071,7 @@ PVRMMapRemoveRegisteredArea(LinuxMemArea *psLinuxMemArea)
        }
        else
        {
-             
+
             PVR_DPF((PVR_DBG_WARNING, "%s: psOffsetStruct 0x%p was never mapped",  __FUNCTION__, psOffsetStruct));
        }
 
@@ -1167,13 +1167,13 @@ PVRMMapInit(IMG_VOID)
     }
 
 #if defined(DEBUG_LINUX_MMAP_AREAS)
-       g_ProcMMap = CreateProcReadEntrySeq("mmap", NULL, 
+       g_ProcMMap = CreateProcReadEntrySeq("mmap", NULL,
                                                  ProcSeqNextMMapRegistrations,
                                                  ProcSeqShowMMapRegistrations,
                                                  ProcSeqOff2ElementMMapRegistrations,
                                                  ProcSeqStartstopMMapRegistations
                                                 );
-#endif  
+#endif
     return;
 
 error:
@@ -1192,7 +1192,7 @@ PVRMMapCleanup(IMG_VOID)
        LinuxMemArea *psLinuxMemArea, *psTmpMemArea;
 
        PVR_DPF((PVR_DBG_ERROR, "%s: Memory areas are still registered with MMap", __FUNCTION__));
-       
+
        PVR_TRACE(("%s: Unregistering memory areas", __FUNCTION__));
        list_for_each_entry_safe(psLinuxMemArea, psTmpMemArea, &g_sMMapAreaList, sMMapItem)
        {
@@ -1210,7 +1210,7 @@ PVRMMapCleanup(IMG_VOID)
 
 #if defined(DEBUG_LINUX_MMAP_AREAS)
     RemoveProcEntrySeq(g_ProcMMap);
-#endif 
+#endif
 
     if(g_psMemmapCache)
     {
old mode 100755 (executable)
new mode 100644 (file)
index 224e652..8604671
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 
 typedef struct KV_OFFSET_STRUCT_TAG
 {
-    
+
     IMG_UINT32                 ui32Mapped;
 
-    
+
     IMG_UINT32                  ui32MMapOffset;
-    
+
     IMG_UINT32                 ui32RealByteSize;
 
-    
+
     LinuxMemArea                *psLinuxMemArea;
-    
+
 #if !defined(PVR_MAKE_ALL_PFNS_SPECIAL)
-    
+
     IMG_UINT32                 ui32TID;
 #endif
 
-    
+
     IMG_UINT32                 ui32PID;
 
-    
+
     IMG_BOOL                   bOnMMapList;
 
-    
+
     IMG_UINT32                 ui32RefCount;
 
-    
+
     IMG_UINT32                 ui32UserVAddr;
 
-    
+
 #if defined(DEBUG_LINUX_MMAP_AREAS)
     const IMG_CHAR             *pszName;
 #endif
-    
-   
+
+
    struct list_head            sMMapItem;
 
-   
+
    struct list_head            sAreaItem;
 }KV_OFFSET_STRUCT, *PKV_OFFSET_STRUCT;
 
@@ -118,5 +118,5 @@ PVRMMapReleaseMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
 int PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma);
 
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 0385e17..9297ae8
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -35,7 +35,7 @@
 #if defined(SUPPORT_DRI_DRM) && !defined(SUPPORT_DRI_DRM_PLUGIN)
 #define        PVR_MOD_STATIC
 #else
-       
+
        #if defined(LDM_PLATFORM)
                #define PVR_LDM_PLATFORM_MODULE
                #define PVR_LDM_MODULE
 
 #if defined(PVR_LDM_PLATFORM_MODULE)
 #include <linux/platform_device.h>
-#endif 
+#endif
 
 #if defined(PVR_LDM_PCI_MODULE)
 #include <linux/pci.h>
-#endif 
+#endif
 
 #if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
 #include <asm/uaccess.h>
 #endif
 
+#if defined(PVR_LDM_MODULE) || defined(PVR_DRI_DRM_PLATFORM_DEV)
+#include <asm/atomic.h>
+#endif
+
 #include "img_defs.h"
 #include "services.h"
 #include "kerneldisplay.h"
@@ -121,7 +125,7 @@ MODULE_SUPPORTED_DEVICE(DEVNAME);
 extern IMG_UINT32 gPVRDebugLevel;
 module_param(gPVRDebugLevel, uint, 0644);
 MODULE_PARM_DESC(gPVRDebugLevel, "Sets the level of debug output (default 0x7)");
-#endif 
+#endif
 
 #if defined(CONFIG_ION_OMAP)
 #include <linux/ion.h>
@@ -131,7 +135,7 @@ struct ion_client *gpsIONClient;
 EXPORT_SYMBOL(gpsIONClient);
 #endif
 
+
 EXPORT_SYMBOL(PVRGetDisplayClassJTable);
 EXPORT_SYMBOL(PVRGetBufferClassJTable);
 
@@ -168,12 +172,12 @@ static IMG_UINT32 gPVRPowerLevel;
 #if defined(PVR_LDM_PLATFORM_MODULE)
 #define        LDM_DEV struct platform_device
 #define        LDM_DRV struct platform_driver
-#endif 
+#endif
 
 #if defined(PVR_LDM_PCI_MODULE)
 #define        LDM_DEV struct pci_dev
 #define        LDM_DRV struct pci_driver
-#endif 
+#endif
 #if defined(PVR_LDM_PLATFORM_MODULE)
 static int PVRSRVDriverRemove(LDM_DEV *device);
 static int PVRSRVDriverProbe(LDM_DEV *device);
@@ -258,13 +262,13 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device
        PVR_TRACE(("PVRSRVDriverProbe(pDevice=%p)", pDevice));
 
 #if 0
-       
+
        if (PerDeviceSysInitialise((IMG_PVOID)pDevice) != PVRSRV_OK)
        {
                return -EINVAL;
        }
-#endif 
-       
+#endif
+
        psSysData = SysAcquireDataNoCheck();
        if (psSysData == IMG_NULL)
        {
@@ -308,7 +312,7 @@ static void __devexit PVRSRVDriverRemove(LDM_DEV *pDevice)
 #endif
 
        SysAcquireData(&psSysData);
-       
+
 #if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
        if (gPVRPowerLevel != 0)
        {
@@ -336,7 +340,7 @@ static void __devexit PVRSRVDriverRemove(LDM_DEV *pDevice)
        return;
 #endif
 }
-#endif 
+#endif
 
 
 #if defined(PVR_LDM_MODULE) || defined(PVR_DRI_DRM_PLATFORM_DEV)
@@ -347,12 +351,20 @@ void PVRSRVDriverShutdown(struct drm_device *pDevice)
 PVR_MOD_STATIC void PVRSRVDriverShutdown(LDM_DEV *pDevice)
 #endif
 {
+       static atomic_t sDriverIsShutdown = ATOMIC_INIT(1);
+
        PVR_TRACE(("PVRSRVDriverShutdown(pDevice=%p)", pDevice));
 
-       (void) PVRSRVSetPowerStateKM(PVRSRV_SYS_POWER_STATE_D3);
+       if (atomic_dec_and_test(&sDriverIsShutdown))
+       {
+
+               LinuxLockMutex(&gPVRSRVLock);
+
+               (void) PVRSRVSetPowerStateKM(PVRSRV_SYS_POWER_STATE_D3);
+       }
 }
 
-#endif 
+#endif
 
 
 #if defined(PVR_LDM_MODULE) || defined(SUPPORT_DRI_DRM)
@@ -392,7 +404,7 @@ PVR_MOD_STATIC int PVRSRVDriverResume(LDM_DEV *pDevice)
 #endif
        return 0;
 }
-#endif 
+#endif
 
 
 #if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL) && !defined(SUPPORT_DRI_DRM)
@@ -435,7 +447,7 @@ IMG_INT PVRProcSetPowerLevel(struct file *file, const IMG_CHAR *buffer, IMG_UINT
        return (count);
 }
 
-void ProcSeqShowPowerLevel(struct seq_file *sfile,void* el)    
+void ProcSeqShowPowerLevel(struct seq_file *sfile,void* el)
 {
        seq_printf(sfile, "%lu\n", gPVRPowerLevel);
 }
@@ -496,7 +508,7 @@ static int PVRSRVOpen(struct inode unref__ * pInode, struct file *pFile)
        psPrivateData->hBlockAlloc = hBlockAlloc;
        PRIVATE_DATA(pFile) = psPrivateData;
        iRet = 0;
-err_unlock:    
+err_unlock:
        LinuxUnLockMutex(&gPVRSRVLock);
        return iRet;
 }
@@ -549,7 +561,7 @@ static int PVRSRVRelease(struct inode unref__ * pInode, struct file *pFile)
                        }
                }
 
-               
+
                gui32ReleasePID = psPrivateData->ui32OpenPID;
                PVRSRVProcessDisconnect(psPrivateData->ui32OpenPID);
                gui32ReleasePID = 0;
@@ -559,7 +571,7 @@ static int PVRSRVRelease(struct inode unref__ * pInode, struct file *pFile)
                                  psPrivateData, psPrivateData->hBlockAlloc);
 
 #if !defined(SUPPORT_DRI_DRM)
-               PRIVATE_DATA(pFile) = IMG_NULL; 
+               PRIVATE_DATA(pFile) = IMG_NULL;
 #endif
        }
 
@@ -589,7 +601,7 @@ static int __init PVRCore_Init(void)
 #endif
 
 #if !defined(SUPPORT_DRI_DRM)
-       
+
        PVRDPFInit();
 #endif
        PVR_TRACE(("PVRCore_Init"));
@@ -653,7 +665,7 @@ static int __init PVRCore_Init(void)
 #endif
 
 #if !defined(PVR_LDM_MODULE)
-       
+
        if ((eError = SysInitialise()) != PVRSRV_OK)
        {
                error = -ENODEV;
@@ -666,7 +678,7 @@ static int __init PVRCore_Init(void)
 #endif
                goto init_failed;
        }
-#endif 
+#endif
 
 #if !defined(SUPPORT_DRI_DRM)
        AssignedMajorNumber = register_chrdev(0, DEVNAME, &pvrsrv_fops);
@@ -682,7 +694,7 @@ static int __init PVRCore_Init(void)
        PVR_TRACE(("PVRCore_Init: major device %d", AssignedMajorNumber));
 
 #if defined(PVR_LDM_MODULE)
-       
+
        psPvrClass = class_create(THIS_MODULE, "pvr");
 
        if (IS_ERR(psPvrClass))
@@ -695,7 +707,7 @@ static int __init PVRCore_Init(void)
        psDev = device_create(psPvrClass, NULL, MKDEV(AssignedMajorNumber, 0),
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
                                  NULL,
-#endif 
+#endif
                                  DEVNAME);
        if (IS_ERR(psDev))
        {
@@ -729,8 +741,8 @@ sys_deinit:
        platform_driver_unregister(&powervr_driver);
 #endif
 
-#else  
-       
+#else
+
        {
                SYS_DATA *psSysData;
 
@@ -740,7 +752,7 @@ sys_deinit:
                        (void) SysDeinitialise(psSysData);
                }
        }
-#endif 
+#endif
 init_failed:
        PVRMMapCleanup();
        LinuxMMCleanup();
@@ -750,7 +762,7 @@ init_failed:
 
        return error;
 
-} 
+}
 
 
 #if defined(SUPPORT_DRI_DRM)
@@ -777,17 +789,17 @@ static void __exit PVRCore_Cleanup(void)
 
 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22))
        if (
-#endif 
+#endif
                unregister_chrdev((IMG_UINT)AssignedMajorNumber, DEVNAME)
 #if !(LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22))
                                                                ;
-#else  
+#else
                                                                )
        {
                PVR_DPF((PVR_DBG_ERROR," can't unregister device major %d", AssignedMajorNumber));
        }
-#endif 
-#endif 
+#endif
+#endif
 
 #if defined(PVR_LDM_MODULE)
 
@@ -802,7 +814,7 @@ static void __exit PVRCore_Cleanup(void)
        platform_driver_unregister(&powervr_driver);
 #endif
 
-#else 
+#else
 #if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
        if (gPVRPowerLevel != 0)
        {
@@ -812,9 +824,9 @@ static void __exit PVRCore_Cleanup(void)
                }
        }
 #endif
-       
+
        (void) SysDeinitialise(psSysData);
-#endif 
+#endif
 
        PVRMMapCleanup();
 
old mode 100755 (executable)
new mode 100644 (file)
index 742fa03..0f29e33
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -79,7 +79,7 @@ IMG_BOOL LinuxIsLockedMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex)
 }
 
 
-#else 
+#else
 
 
 IMG_VOID LinuxInitMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex)
@@ -98,7 +98,7 @@ PVRSRV_ERROR LinuxLockMutexInterruptible(PVRSRV_LINUX_MUTEX *psPVRSRVMutex)
 {
     if(down_interruptible(&psPVRSRVMutex->sSemaphore) == -EINTR)
     {
-        
+
         return PVRSRV_ERROR_MUTEX_INTERRUPTIBLE_ERROR;
     }else{
         atomic_dec(&psPVRSRVMutex->Count);
@@ -126,11 +126,11 @@ IMG_VOID LinuxUnLockMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex)
 IMG_BOOL LinuxIsLockedMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex)
 {
     IMG_INT32 iCount;
-    
+
     iCount = atomic_read(&psPVRSRVMutex->Count);
 
     return (IMG_BOOL)iCount;
 }
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 5e787b7..ed2ec29
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 
 typedef struct mutex PVRSRV_LINUX_MUTEX;
 
-#else 
+#else
 
 
 typedef struct {
     struct semaphore sSemaphore;
-    
+
     atomic_t Count;
 }PVRSRV_LINUX_MUTEX;
 
@@ -66,5 +66,5 @@ extern IMG_VOID LinuxUnLockMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
 extern IMG_BOOL LinuxIsLockedMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
 
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index a012cf5..5701c19
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -77,15 +77,15 @@ pvr_pat_entry(u64 pat, IMG_UINT index)
 static IMG_VOID
 PVRLinuxX86PATProbe(IMG_VOID)
 {
-       
-       if (cpu_has_pat)         
+
+       if (cpu_has_pat)
        {
                u64 pat;
                IMG_UINT pat_index;
                IMG_UINT pat_entry;
 
                PVR_TRACE(("%s: PAT available", __FUNCTION__));
-               
+
                rdmsrl(MSR_IA32_CR_PAT, pat);
                PVR_TRACE(("%s: Top 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat >> 32)));
                PVR_TRACE(("%s: Bottom 32 bits of PAT: 0x%.8x", __FUNCTION__, (IMG_UINT)(pat)));
@@ -110,21 +110,21 @@ PVRLinuxX86PATProbe(IMG_VOID)
        {
                PVR_TRACE(("%s: Write combining not available", __FUNCTION__));
        }
-#else  
+#else
        PVR_TRACE(("%s: Write combining disabled in driver build", __FUNCTION__));
-#endif 
-#endif 
+#endif
+#endif
 }
 
 pgprot_t
 pvr_pgprot_writecombine(pgprot_t prot)
 {
-    
-     
+
+
     return (g_write_combining_available) ?
                __pgprot((pgprot_val(prot) & ~_PAGE_CACHE_MASK) | _PAGE_CACHE_WC) : pgprot_noncached(prot);
 }
-#endif 
+#endif
 
 IMG_VOID
 PVRLinuxMUtilsInit(IMG_VOID)
old mode 100755 (executable)
new mode 100644 (file)
index b2a8ba0..063e34e
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -61,7 +61,7 @@
 
 #if defined(__i386__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
        #define IOREMAP(pa, bytes)      ioremap_cache(pa, bytes)
-#else  
+#else
        #if defined(__arm__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
                #define IOREMAP(pa, bytes)      ioremap_cached(pa, bytes)
        #else
@@ -99,5 +99,5 @@
 
 IMG_VOID PVRLinuxMUtilsInit(IMG_VOID);
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 18a3df6..b243de0
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -40,7 +40,7 @@
 #include <asm/cacheflush.h>
 #include <linux/mm.h>
 #include <linux/pagemap.h>
-#include <linux/hugetlb.h> 
+#include <linux/hugetlb.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
@@ -100,7 +100,7 @@ PVRSRV_ERROR OSAllocMem_Impl(IMG_UINT32 ui32Flags, IMG_UINT32 ui32Size, IMG_PVOI
 
     if (ui32Size > PAGE_SIZE)
     {
-        
+
 #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
         *ppvCpuVAddr = _VMallocWrapper(ui32Size, PVRSRV_HAP_CACHED, pszFilename, ui32Line);
 #else
@@ -133,14 +133,14 @@ static inline int is_vmalloc_addr(const void *pvCpuVAddr)
        return lAddr >= VMALLOC_START && lAddr < VMALLOC_END;
 }
 
-#endif 
+#endif
 
 #if !defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
 PVRSRV_ERROR OSFreeMem_Impl(IMG_UINT32 ui32Flags, IMG_UINT32 ui32Size, IMG_PVOID pvCpuVAddr, IMG_HANDLE hBlockAlloc)
 #else
 PVRSRV_ERROR OSFreeMem_Impl(IMG_UINT32 ui32Flags, IMG_UINT32 ui32Size, IMG_PVOID pvCpuVAddr, IMG_HANDLE hBlockAlloc, IMG_CHAR *pszFilename, IMG_UINT32 ui32Line)
 #endif
-{      
+{
     PVR_UNREFERENCED_PARAMETER(ui32Flags);
     PVR_UNREFERENCED_PARAMETER(ui32Size);
     PVR_UNREFERENCED_PARAMETER(hBlockAlloc);
@@ -180,7 +180,7 @@ OSAllocPages_Impl(IMG_UINT32 ui32AllocFlags,
     PVR_UNREFERENCED_PARAMETER(ui32PageSize);
 
 #if 0
-    
+
     if(ui32AllocFlags & PVRSRV_HAP_SINGLE_PROCESS)
     {
         ui32AllocFlags &= ~PVRSRV_HAP_SINGLE_PROCESS;
@@ -217,7 +217,7 @@ OSAllocPages_Impl(IMG_UINT32 ui32AllocFlags,
         }
         case PVRSRV_HAP_SINGLE_PROCESS:
         {
-            
+
             psLinuxMemArea = NewAllocPagesLinuxMemArea(ui32Size, ui32AllocFlags);
             if(!psLinuxMemArea)
             {
@@ -229,9 +229,9 @@ OSAllocPages_Impl(IMG_UINT32 ui32AllocFlags,
 
         case PVRSRV_HAP_MULTI_PROCESS:
         {
-            
+
 #if defined(VIVT_CACHE) || defined(__sh__)
-            
+
             ui32AllocFlags &= ~PVRSRV_HAP_CACHED;
 #endif
             psLinuxMemArea = NewVMallocLinuxMemArea(ui32Size, ui32AllocFlags);
@@ -252,7 +252,7 @@ OSAllocPages_Impl(IMG_UINT32 ui32AllocFlags,
 ExitSkipSwitch:
     *ppvCpuVAddr = LinuxMemAreaToCpuVAddr(psLinuxMemArea);
     *phOSMemHandle = psLinuxMemArea;
-    
+
     LinuxMemAreaRegister(psLinuxMemArea);
 
     return PVRSRV_OK;
@@ -261,13 +261,13 @@ ExitSkipSwitch:
 
 PVRSRV_ERROR
 OSFreePages(IMG_UINT32 ui32AllocFlags, IMG_UINT32 ui32Bytes, IMG_VOID *pvCpuVAddr, IMG_HANDLE hOSMemHandle)
-{   
+{
     LinuxMemArea *psLinuxMemArea;
     PVRSRV_ERROR eError;
-    
+
     PVR_UNREFERENCED_PARAMETER(ui32Bytes);
     PVR_UNREFERENCED_PARAMETER(pvCpuVAddr);
-    
+
     psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
 
     switch(ui32AllocFlags & PVRSRV_HAP_MAPTYPE_MASK)
@@ -309,7 +309,7 @@ OSGetSubMemHandle(IMG_HANDLE hOSMemHandle,
     PVRSRV_ERROR eError;
 
     psParentLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
-    
+
     psLinuxMemArea = NewSubLinuxMemArea(psParentLinuxMemArea, ui32ByteOffset, ui32Bytes);
     if(!psLinuxMemArea)
     {
@@ -318,7 +318,7 @@ OSGetSubMemHandle(IMG_HANDLE hOSMemHandle,
     }
     *phOSMemHandleRet = psLinuxMemArea;
 
-    
+
     if(ui32Flags & PVRSRV_HAP_KERNEL_ONLY)
     {
         return PVRSRV_OK;
@@ -343,10 +343,10 @@ OSReleaseSubMemHandle(IMG_VOID *hOSMemHandle, IMG_UINT32 ui32Flags)
 {
     LinuxMemArea *psLinuxMemArea;
     PVRSRV_ERROR eError;
-    
+
     psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
     PVR_ASSERT(psLinuxMemArea->eAreaType == LINUX_MEM_AREA_SUB_ALLOC);
-    
+
     if((ui32Flags & PVRSRV_HAP_KERNEL_ONLY) == 0)
     {
         eError = PVRMMapRemoveRegisteredArea(psLinuxMemArea);
@@ -448,7 +448,7 @@ IMG_VOID OSBreakResourceLock (PVRSRV_RESOURCE *psResource, IMG_UINT32 ui32ID)
         }
         else
         {
-            PVR_DPF((PVR_DBG_MESSAGE,"OSBreakResourceLock: Resource is not locked for this process.")); 
+            PVR_DPF((PVR_DBG_MESSAGE,"OSBreakResourceLock: Resource is not locked for this process."));
         }
     }
     else
@@ -479,8 +479,8 @@ PVRSRV_ERROR OSInitEnvData(IMG_PVOID *ppvEnvSpecificData)
 {
     ENV_DATA           *psEnvData;
     PVRSRV_ERROR       eError;
-    
-    
+
+
     eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(ENV_DATA), (IMG_VOID **)&psEnvData, IMG_NULL,
         "Environment Data");
     if (eError != PVRSRV_OK)
@@ -488,22 +488,22 @@ PVRSRV_ERROR OSInitEnvData(IMG_PVOID *ppvEnvSpecificData)
         return eError;
     }
 
-    eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, PVRSRV_MAX_BRIDGE_IN_SIZE + PVRSRV_MAX_BRIDGE_OUT_SIZE, 
+    eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, PVRSRV_MAX_BRIDGE_IN_SIZE + PVRSRV_MAX_BRIDGE_OUT_SIZE,
                     &psEnvData->pvBridgeData, IMG_NULL,
                     "Bridge Data");
     if (eError != PVRSRV_OK)
     {
         OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(ENV_DATA), psEnvData, IMG_NULL);
-               
+
         return eError;
     }
 
 
-    
+
     psEnvData->bMISRInstalled = IMG_FALSE;
     psEnvData->bLISRInstalled = IMG_FALSE;
 
-    
+
     *ppvEnvSpecificData = psEnvData;
 
     return PVRSRV_OK;
@@ -521,20 +521,20 @@ PVRSRV_ERROR OSDeInitEnvData(IMG_PVOID pvEnvSpecificData)
     psEnvData->pvBridgeData = IMG_NULL;
 
     OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(ENV_DATA), pvEnvSpecificData, IMG_NULL);
-       
+
 
     return PVRSRV_OK;
 }
 
 
+
 IMG_VOID OSReleaseThreadQuanta(IMG_VOID)
 {
     schedule();
 }
 
 
+
 IMG_UINT32 OSClockus(IMG_VOID)
 {
     IMG_UINT32 time, j = jiffies;
@@ -557,20 +557,20 @@ IMG_VOID OSSleepms(IMG_UINT32 ui32Timems)
 }
 
 
+
 IMG_HANDLE OSFuncHighResTimerCreate(IMG_VOID)
 {
-       
+
        return (IMG_HANDLE) 1;
 }
 
+
 IMG_UINT32 OSFuncHighResTimerGetus(IMG_HANDLE hTimer)
 {
        return (IMG_UINT32) jiffies_to_usecs(jiffies);
 }
 
+
 IMG_VOID OSFuncHighResTimerDestroy(IMG_HANDLE hTimer)
 {
        PVR_UNREFERENCED_PARAMETER(hTimer);
@@ -620,7 +620,7 @@ static irqreturn_t DeviceISRWrapper(int irq, void *dev_id
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
     PVR_UNREFERENCED_PARAMETER(regs);
-#endif 
+#endif
     psDeviceNode = (PVRSRV_DEVICE_NODE*)dev_id;
     if(!psDeviceNode)
     {
@@ -709,7 +709,7 @@ PVRSRV_ERROR OSInstallDeviceLISR(IMG_VOID *pvSysData,
     psEnvData->pvISRCookie = pvDeviceNode;
     psEnvData->bLISRInstalled = IMG_TRUE;
 
-    return PVRSRV_OK;  
+    return PVRSRV_OK;
 }
 
 PVRSRV_ERROR OSUninstallDeviceLISR(IMG_VOID *pvSysData)
@@ -722,7 +722,7 @@ PVRSRV_ERROR OSUninstallDeviceLISR(IMG_VOID *pvSysData)
         PVR_DPF((PVR_DBG_ERROR, "OSUninstallDeviceLISR: No LISR has been installed"));
         return PVRSRV_ERROR_ISR_NOT_INSTALLED;
     }
-        
+
     PVR_TRACE(("Uninstalling device LISR on IRQ %d with cookie %p", psEnvData->ui32IRQ,  psEnvData->pvISRCookie));
 
     free_irq(psEnvData->ui32IRQ, psEnvData->pvISRCookie);
@@ -763,7 +763,7 @@ PVRSRV_ERROR OSInstallSystemLISR(IMG_VOID *pvSysData, IMG_UINT32 ui32Irq)
     psEnvData->pvISRCookie = pvSysData;
     psEnvData->bLISRInstalled = IMG_TRUE;
 
-    return PVRSRV_OK;  
+    return PVRSRV_OK;
 }
 
 
@@ -868,9 +868,9 @@ PVRSRV_ERROR OSScheduleMISR(IMG_VOID *pvSysData)
                queue_work(psEnvData->psWorkQueue, &psEnvData->sMISRWork);
        }
 
-       return PVRSRV_OK;       
+       return PVRSRV_OK;
 }
-#else  
+#else
 #if defined(PVR_LINUX_MISR_USING_WORKQUEUE)
 static void MISRWrapper(
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
@@ -944,10 +944,10 @@ PVRSRV_ERROR OSScheduleMISR(IMG_VOID *pvSysData)
                schedule_work(&psEnvData->sMISRWork);
        }
 
-       return PVRSRV_OK;       
+       return PVRSRV_OK;
 }
 
-#else  
+#else
 
 
 static void MISRWrapper(unsigned long data)
@@ -955,7 +955,7 @@ static void MISRWrapper(unsigned long data)
     SYS_DATA *psSysData;
 
     psSysData = (SYS_DATA *)data;
-    
+
     PVRSRVMISR(psSysData);
 }
 
@@ -1011,13 +1011,13 @@ PVRSRV_ERROR OSScheduleMISR(IMG_VOID *pvSysData)
         tasklet_schedule(&psEnvData->sMISRTasklet);
     }
 
-    return PVRSRV_OK;  
+    return PVRSRV_OK;
 }
 
-#endif 
-#endif 
+#endif
+#endif
 
-#endif 
+#endif
 
 IMG_VOID OSPanic(IMG_VOID)
 {
@@ -1059,7 +1059,7 @@ PVRSRV_ERROR OSUnlockResource (PVRSRV_RESOURCE *psResource, IMG_UINT32 ui32ID)
         }
         else
         {
-            PVR_DPF((PVR_DBG_ERROR,"OSUnlockResource: Resource %p is not locked with expected value.", psResource)); 
+            PVR_DPF((PVR_DBG_ERROR,"OSUnlockResource: Resource %p is not locked with expected value.", psResource));
             PVR_DPF((PVR_DBG_MESSAGE,"Should be %x is actually %x", ui32ID, psResource->ui32ID));
             eError = PVRSRV_ERROR_INVALID_LOCK_ID;
         }
@@ -1069,7 +1069,7 @@ PVRSRV_ERROR OSUnlockResource (PVRSRV_RESOURCE *psResource, IMG_UINT32 ui32ID)
         PVR_DPF((PVR_DBG_ERROR,"OSUnlockResource: Resource %p is not locked", psResource));
         eError = PVRSRV_ERROR_RESOURCE_NOT_LOCKED;
     }
-    
+
     return eError;
 }
 
@@ -1095,7 +1095,7 @@ PVRSRV_ERROR OSPowerLockWrap(IMG_BOOL bTryLock)
 IMG_VOID OSPowerLockUnwrap (IMG_VOID)
 {
 }
-#endif 
+#endif
 
 
 IMG_CPU_PHYADDR OSMapLinToCPUPhys(IMG_HANDLE hOSMemHandle,
@@ -1108,7 +1108,7 @@ IMG_CPU_PHYADDR OSMapLinToCPUPhys(IMG_HANDLE hOSMemHandle,
 
        PVR_ASSERT(hOSMemHandle != IMG_NULL);
 
-       
+
 
        psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
 
@@ -1129,7 +1129,7 @@ OSMapPhysToLin(IMG_CPU_PHYADDR BasePAddr,
 {
     if(ui32MappingFlags & PVRSRV_HAP_KERNEL_ONLY)
     {
-       
+
        if(phOSMemHandle == IMG_NULL)
        {
                IMG_VOID *pvIORemapCookie;
@@ -1166,7 +1166,7 @@ OSUnMapPhysToLin(IMG_VOID *pvLinAddr, IMG_UINT32 ui32Bytes, IMG_UINT32 ui32Mappi
 {
     PVR_TRACE(("%s: unmapping %d bytes from %p", __FUNCTION__, ui32Bytes, pvLinAddr));
 
-    PVR_UNREFERENCED_PARAMETER(ui32Bytes);     
+    PVR_UNREFERENCED_PARAMETER(ui32Bytes);
 
     if(ui32MappingFlags & PVRSRV_HAP_KERNEL_ONLY)
     {
@@ -1179,7 +1179,7 @@ OSUnMapPhysToLin(IMG_VOID *pvLinAddr, IMG_UINT32 ui32Bytes, IMG_UINT32 ui32Mappi
                LinuxMemArea *psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
 
                PVR_ASSERT(LinuxMemAreaToCpuVAddr(psLinuxMemArea) == pvLinAddr);
-               
+
                FreeIORemapLinuxMemArea(psLinuxMemArea);
        }
 
@@ -1207,7 +1207,7 @@ RegisterExternalMem(IMG_SYS_PHYADDR *pBasePAddr,
         case PVRSRV_HAP_KERNEL_ONLY:
         {
         psLinuxMemArea = NewExternalKVLinuxMemArea(pBasePAddr, pvCPUVAddr, ui32Bytes, bPhysContig, ui32MappingFlags);
-        
+
             if(!psLinuxMemArea)
             {
                 return PVRSRV_ERROR_BAD_MAPPING;
@@ -1227,9 +1227,9 @@ RegisterExternalMem(IMG_SYS_PHYADDR *pBasePAddr,
         }
         case PVRSRV_HAP_MULTI_PROCESS:
         {
-            
+
 #if defined(VIVT_CACHE) || defined(__sh__)
-            
+
             ui32MappingFlags &= ~PVRSRV_HAP_CACHED;
 #endif
         psLinuxMemArea = NewExternalKVLinuxMemArea(pBasePAddr, pvCPUVAddr, ui32Bytes, bPhysContig, ui32MappingFlags);
@@ -1246,7 +1246,7 @@ RegisterExternalMem(IMG_SYS_PHYADDR *pBasePAddr,
             *phOSMemHandle = (IMG_HANDLE)0;
             return PVRSRV_ERROR_INVALID_FLAGS;
     }
-    
+
     *phOSMemHandle = (IMG_HANDLE)psLinuxMemArea;
 
     LinuxMemAreaRegister(psLinuxMemArea);
@@ -1330,7 +1330,7 @@ OSReservePhys(IMG_CPU_PHYADDR BasePAddr,
     LinuxMemArea *psLinuxMemArea;
 
 #if 0
-    
+
     if(ui32MappingFlags & PVRSRV_HAP_SINGLE_PROCESS)
     {
         ui32MappingFlags &= ~PVRSRV_HAP_SINGLE_PROCESS;
@@ -1342,7 +1342,7 @@ OSReservePhys(IMG_CPU_PHYADDR BasePAddr,
     {
         case PVRSRV_HAP_KERNEL_ONLY:
         {
-            
+
             psLinuxMemArea = NewIORemapLinuxMemArea(BasePAddr, ui32Bytes, ui32MappingFlags);
             if(!psLinuxMemArea)
             {
@@ -1352,7 +1352,7 @@ OSReservePhys(IMG_CPU_PHYADDR BasePAddr,
         }
         case PVRSRV_HAP_SINGLE_PROCESS:
         {
-            
+
             psLinuxMemArea = NewIOLinuxMemArea(BasePAddr, ui32Bytes, ui32MappingFlags);
             if(!psLinuxMemArea)
             {
@@ -1363,9 +1363,9 @@ OSReservePhys(IMG_CPU_PHYADDR BasePAddr,
         }
         case PVRSRV_HAP_MULTI_PROCESS:
         {
-            
+
 #if defined(VIVT_CACHE) || defined(__sh__)
-            
+
             ui32MappingFlags &= ~PVRSRV_HAP_CACHED;
 #endif
             psLinuxMemArea = NewIORemapLinuxMemArea(BasePAddr, ui32Bytes, ui32MappingFlags);
@@ -1404,7 +1404,7 @@ OSUnReservePhys(IMG_VOID *pvCpuVAddr,
     PVR_UNREFERENCED_PARAMETER(ui32Bytes);
 
     psLinuxMemArea = (LinuxMemArea *)hOSMemHandle;
-    
+
     switch(ui32MappingFlags & PVRSRV_HAP_MAPTYPE_MASK)
     {
         case PVRSRV_HAP_KERNEL_ONLY:
@@ -1428,7 +1428,7 @@ OSUnReservePhys(IMG_VOID *pvCpuVAddr,
             return PVRSRV_ERROR_INVALID_PARAMS;
         }
     }
-    
+
     LinuxMemAreaDeepFree(psLinuxMemArea);
 
     return PVRSRV_OK;
@@ -1462,7 +1462,7 @@ PVRSRV_ERROR OSBaseAllocContigMemory(IMG_UINT32 ui32Size, IMG_CPU_VIRTADDR *pvLi
     psPhysAddr->uiAddr = virt_to_phys(pvKernLinAddr);
 
     return PVRSRV_OK;
-#endif 
+#endif
 }
 
 
@@ -1528,26 +1528,26 @@ PVRSRV_PCI_DEV_HANDLE OSPCISetDev(IMG_VOID *pvPCICookie, HOST_PCI_INIT_FLAGS eFl
         return IMG_NULL;
     }
 
-    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)    
+    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
     {
         pci_set_master(psPVRPCI->psPCIDev);
     }
 
-    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI)           
+    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI)
     {
 #if defined(CONFIG_PCI_MSI)
         err = pci_enable_msi(psPVRPCI->psPCIDev);
         if (err != 0)
         {
             PVR_DPF((PVR_DBG_WARNING, "OSPCISetDev: Couldn't enable MSI (%d)", err));
-            psPVRPCI->ePCIFlags &= ~HOST_PCI_INIT_FLAG_MSI;     
+            psPVRPCI->ePCIFlags &= ~HOST_PCI_INIT_FLAG_MSI;
         }
 #else
         PVR_DPF((PVR_DBG_WARNING, "OSPCISetDev: MSI support not enabled in the kernel"));
 #endif
     }
 
-    
+
     for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
     {
         psPVRPCI->abPCIResourceInUse[i] = IMG_FALSE;
@@ -1639,17 +1639,17 @@ static IMG_UINT32 OSPCIAddrRangeFunc(enum HOST_PCI_ADDR_RANGE_FUNC eFunc,
 
 IMG_UINT32 OSPCIAddrRangeLen(PVRSRV_PCI_DEV_HANDLE hPVRPCI, IMG_UINT32 ui32Index)
 {
-    return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_LEN, hPVRPCI, ui32Index); 
+    return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_LEN, hPVRPCI, ui32Index);
 }
 
 IMG_UINT32 OSPCIAddrRangeStart(PVRSRV_PCI_DEV_HANDLE hPVRPCI, IMG_UINT32 ui32Index)
 {
-    return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_START, hPVRPCI, ui32Index); 
+    return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_START, hPVRPCI, ui32Index);
 }
 
 IMG_UINT32 OSPCIAddrRangeEnd(PVRSRV_PCI_DEV_HANDLE hPVRPCI, IMG_UINT32 ui32Index)
 {
-    return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_END, hPVRPCI, ui32Index); 
+    return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_END, hPVRPCI, ui32Index);
 }
 
 PVRSRV_ERROR OSPCIRequestAddrRange(PVRSRV_PCI_DEV_HANDLE hPVRPCI,
@@ -1670,7 +1670,7 @@ PVRSRV_ERROR OSPCIReleaseDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
 
     PVR_TRACE(("OSPCIReleaseDev"));
 
-    
+
     for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
     {
         if (psPVRPCI->abPCIResourceInUse[i])
@@ -1682,14 +1682,14 @@ PVRSRV_ERROR OSPCIReleaseDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
     }
 
 #if defined(CONFIG_PCI_MSI)
-    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI)           
+    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI)
     {
         pci_disable_msi(psPVRPCI->psPCIDev);
     }
 #endif
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
-    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)    
+    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
     {
         pci_clear_master(psPVRPCI->psPCIDev);
     }
@@ -1697,7 +1697,7 @@ PVRSRV_ERROR OSPCIReleaseDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
     pci_disable_device(psPVRPCI->psPCIDev);
 
     OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(*psPVRPCI), (IMG_VOID *)psPVRPCI, IMG_NULL);
-       
+
 
     return PVRSRV_OK;
 }
@@ -1710,7 +1710,7 @@ PVRSRV_ERROR OSPCISuspendDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
 
     PVR_TRACE(("OSPCISuspendDev"));
 
-    
+
     for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
     {
         if (psPVRPCI->abPCIResourceInUse[i])
@@ -1789,10 +1789,10 @@ PVRSRV_ERROR OSPCIResumeDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
         return PVRSRV_ERROR_PCI_CALL_FAILED;
     }
 
-    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)    
+    if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
         pci_set_master(psPVRPCI->psPCIDev);
 
-    
+
     for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
     {
         if (psPVRPCI->abPCIResourceInUse[i])
@@ -1809,7 +1809,7 @@ PVRSRV_ERROR OSPCIResumeDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
     return PVRSRV_OK;
 }
 
-#endif 
+#endif
 
 #define        OS_MAX_TIMERS   8
 
@@ -1817,7 +1817,7 @@ typedef struct TIMER_CALLBACK_DATA_TAG
 {
     IMG_BOOL                   bInUse;
     PFN_TIMER_FUNC             pfnTimerFunc;
-    IMG_VOID                   *pvData;        
+    IMG_VOID                   *pvData;
     struct timer_list          sTimer;
     IMG_UINT32                 ui32Delay;
     IMG_BOOL                   bActive;
@@ -1836,7 +1836,7 @@ static TIMER_CALLBACK_DATA sTimers[OS_MAX_TIMERS];
 DEFINE_MUTEX(sTimerStructLock);
 #else
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
+
 static spinlock_t sTimerStructLock = __SPIN_LOCK_UNLOCKED();
 #else
 static DEFINE_SPINLOCK(sTimerStructLock);
@@ -1848,10 +1848,10 @@ static void OSTimerCallbackBody(TIMER_CALLBACK_DATA *psTimerCBData)
     if (!psTimerCBData->bActive)
         return;
 
-    
+
     psTimerCBData->pfnTimerFunc(psTimerCBData->pvData);
-    
-    
+
+
     mod_timer(&psTimerCBData->sTimer, psTimerCBData->ui32Delay + jiffies);
 }
 
@@ -1859,7 +1859,7 @@ static void OSTimerCallbackBody(TIMER_CALLBACK_DATA *psTimerCBData)
 static IMG_VOID OSTimerCallbackWrapper(IMG_UINT32 ui32Data)
 {
     TIMER_CALLBACK_DATA        *psTimerCBData = (TIMER_CALLBACK_DATA*)ui32Data;
-    
+
 #if defined(PVR_LINUX_TIMERS_USING_WORKQUEUES) || defined(PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE)
     int res;
 
@@ -1870,7 +1870,7 @@ static IMG_VOID OSTimerCallbackWrapper(IMG_UINT32 ui32Data)
 #endif
     if (res == 0)
     {
-        PVR_DPF((PVR_DBG_WARNING, "OSTimerCallbackWrapper: work already queued"));             
+        PVR_DPF((PVR_DBG_WARNING, "OSTimerCallbackWrapper: work already queued"));
     }
 #else
     OSTimerCallbackBody(psTimerCBData);
@@ -1895,14 +1895,14 @@ IMG_HANDLE OSAddTimer(PFN_TIMER_FUNC pfnTimerFunc, IMG_VOID *pvData, IMG_UINT32
     unsigned long              ulLockFlags;
 #endif
 
-    
+
     if(!pfnTimerFunc)
     {
-        PVR_DPF((PVR_DBG_ERROR, "OSAddTimer: passed invalid callback"));               
-        return IMG_NULL;               
+        PVR_DPF((PVR_DBG_ERROR, "OSAddTimer: passed invalid callback"));
+        return IMG_NULL;
     }
-    
-    
+
+
 #if defined(PVR_LINUX_TIMERS_USING_WORKQUEUES) || defined(PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE)
     mutex_lock(&sTimerStructLock);
 #else
@@ -1924,28 +1924,28 @@ IMG_HANDLE OSAddTimer(PFN_TIMER_FUNC pfnTimerFunc, IMG_VOID *pvData, IMG_UINT32
 #endif
     if (ui32i >= OS_MAX_TIMERS)
     {
-        PVR_DPF((PVR_DBG_ERROR, "OSAddTimer: all timers are in use"));         
-        return IMG_NULL;       
+        PVR_DPF((PVR_DBG_ERROR, "OSAddTimer: all timers are in use"));
+        return IMG_NULL;
     }
 
     psTimerCBData->pfnTimerFunc = pfnTimerFunc;
     psTimerCBData->pvData = pvData;
     psTimerCBData->bActive = IMG_FALSE;
-    
-    
+
+
 
 
     psTimerCBData->ui32Delay = ((HZ * ui32MsTimeout) < 1000)
                                 ?      1
                                 :      ((HZ * ui32MsTimeout) / 1000);
-    
+
     init_timer(&psTimerCBData->sTimer);
-    
-    
-     
+
+
+
     psTimerCBData->sTimer.function = (IMG_VOID *)OSTimerCallbackWrapper;
     psTimerCBData->sTimer.data = (IMG_UINT32)psTimerCBData;
-    
+
     return (IMG_HANDLE)(ui32i + 1);
 }
 
@@ -1966,9 +1966,9 @@ PVRSRV_ERROR OSRemoveTimer (IMG_HANDLE hTimer)
     PVR_ASSERT(psTimerCBData->bInUse);
     PVR_ASSERT(!psTimerCBData->bActive);
 
-    
+
     psTimerCBData->bInUse = IMG_FALSE;
-    
+
     return PVRSRV_OK;
 }
 
@@ -1980,15 +1980,15 @@ PVRSRV_ERROR OSEnableTimer (IMG_HANDLE hTimer)
     PVR_ASSERT(psTimerCBData->bInUse);
     PVR_ASSERT(!psTimerCBData->bActive);
 
-    
+
     psTimerCBData->bActive = IMG_TRUE;
 
-    
+
     psTimerCBData->sTimer.expires = psTimerCBData->ui32Delay + jiffies;
 
-    
+
     add_timer(&psTimerCBData->sTimer);
-    
+
     return PVRSRV_OK;
 }
 
@@ -2000,7 +2000,7 @@ PVRSRV_ERROR OSDisableTimer (IMG_HANDLE hTimer)
     PVR_ASSERT(psTimerCBData->bInUse);
     PVR_ASSERT(psTimerCBData->bActive);
 
-    
+
     psTimerCBData->bActive = IMG_FALSE;
     smp_mb();
 
@@ -2011,11 +2011,11 @@ PVRSRV_ERROR OSDisableTimer (IMG_HANDLE hTimer)
     flush_scheduled_work();
 #endif
 
-    
-    del_timer_sync(&psTimerCBData->sTimer);    
-    
+
+    del_timer_sync(&psTimerCBData->sTimer);
+
 #if defined(PVR_LINUX_TIMERS_USING_WORKQUEUES)
-    
+
     flush_workqueue(psTimerWorkQueue);
 #endif
 #if defined(PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE)
@@ -2034,7 +2034,7 @@ PVRSRV_ERROR OSEventObjectCreateKM(const IMG_CHAR *pszName, PVRSRV_EVENTOBJECT *
 {
 
     PVRSRV_ERROR eError = PVRSRV_OK;
-    
+
     if(psEventObject)
     {
        if (pszName && strlen(pszName) < EVENTOBJNAME_MAXLENGTH)
@@ -2043,27 +2043,27 @@ PVRSRV_ERROR OSEventObjectCreateKM(const IMG_CHAR *pszName, PVRSRV_EVENTOBJECT *
         }
         else
         {
-               
-            static IMG_UINT16 ui16NameIndex = 0;                       
+
+            static IMG_UINT16 ui16NameIndex = 0;
 #if defined (SUPPORT_SID_INTERFACE)
             snprintf(psEventObject->szName, EVENTOBJNAME_MAXLENGTH, "PVRSRV_EVENTOBJECT_KM_%d", ui16NameIndex++);
 #else
             snprintf(psEventObject->szName, EVENTOBJNAME_MAXLENGTH, "PVRSRV_EVENTOBJECT_%d", ui16NameIndex++);
 #endif
         }
-        
+
         if(LinuxEventObjectListCreate(&psEventObject->hOSEventKM) != PVRSRV_OK)
         {
-             eError = PVRSRV_ERROR_OUT_OF_MEMORY;      
+             eError = PVRSRV_ERROR_OUT_OF_MEMORY;
         }
 
     }
     else
     {
         PVR_DPF((PVR_DBG_ERROR, "OSEventObjectCreateKM: psEventObject is not a valid pointer"));
-        eError = PVRSRV_ERROR_UNABLE_TO_CREATE_EVENT;  
+        eError = PVRSRV_ERROR_UNABLE_TO_CREATE_EVENT;
     }
-    
+
     return eError;
 
 }
@@ -2094,14 +2094,14 @@ PVRSRV_ERROR OSEventObjectDestroyKM(PVRSRV_EVENTOBJECT *psEventObject)
         PVR_DPF((PVR_DBG_ERROR, "OSEventObjectDestroyKM: psEventObject is not a valid pointer"));
         eError = PVRSRV_ERROR_INVALID_PARAMS;
     }
-    
+
     return eError;
 }
 
 PVRSRV_ERROR OSEventObjectWaitKM(IMG_HANDLE hOSEventKM)
 {
     PVRSRV_ERROR eError;
-    
+
     if(hOSEventKM)
     {
         eError = LinuxEventObjectWait(hOSEventKM, EVENT_OBJECT_TIMEOUT_MS);
@@ -2111,7 +2111,7 @@ PVRSRV_ERROR OSEventObjectWaitKM(IMG_HANDLE hOSEventKM)
         PVR_DPF((PVR_DBG_ERROR, "OSEventObjectWaitKM: hOSEventKM is not a valid handle"));
         eError = PVRSRV_ERROR_INVALID_PARAMS;
     }
-    
+
     return eError;
 }
 
@@ -2123,7 +2123,7 @@ PVRSRV_ERROR OSEventObjectOpenKM(PVRSRV_EVENTOBJECT *psEventObject,
                                             IMG_HANDLE *phOSEvent)
 {
     PVRSRV_ERROR eError = PVRSRV_OK;
-    
+
     if(psEventObject)
     {
         if(LinuxEventObjectAdd(psEventObject->hOSEventKM, phOSEvent) != PVRSRV_OK)
@@ -2138,7 +2138,7 @@ PVRSRV_ERROR OSEventObjectOpenKM(PVRSRV_EVENTOBJECT *psEventObject,
         PVR_DPF((PVR_DBG_ERROR, "OSEventObjectCreateKM: psEventObject is not a valid pointer"));
         eError = PVRSRV_ERROR_INVALID_PARAMS;
     }
-    
+
     return eError;
 }
 
@@ -2165,15 +2165,15 @@ PVRSRV_ERROR OSEventObjectCloseKM(PVRSRV_EVENTOBJECT *psEventObject,
         PVR_DPF((PVR_DBG_ERROR, "OSEventObjectDestroyKM: psEventObject is not a valid pointer"));
         eError = PVRSRV_ERROR_INVALID_PARAMS;
     }
-    
+
     return eError;
-    
+
 }
 
 PVRSRV_ERROR OSEventObjectSignalKM(IMG_HANDLE hOSEventKM)
 {
     PVRSRV_ERROR eError;
-    
+
     if(hOSEventKM)
     {
         eError = LinuxEventObjectSignal(hOSEventKM);
@@ -2183,7 +2183,7 @@ PVRSRV_ERROR OSEventObjectSignalKM(IMG_HANDLE hOSEventKM)
         PVR_DPF((PVR_DBG_ERROR, "OSEventObjectSignalKM: hOSEventKM is not a valid handle"));
         eError = PVRSRV_ERROR_INVALID_PARAMS;
     }
-    
+
     return eError;
 }
 
@@ -2192,9 +2192,9 @@ IMG_BOOL OSProcHasPrivSrvInit(IMG_VOID)
     return (capable(CAP_SYS_MODULE) != 0) ? IMG_TRUE : IMG_FALSE;
 }
 
-PVRSRV_ERROR OSCopyToUser(IMG_PVOID pvProcess, 
-                          IMG_VOID *pvDest, 
-                          IMG_VOID *pvSrc, 
+PVRSRV_ERROR OSCopyToUser(IMG_PVOID pvProcess,
+                          IMG_VOID *pvDest,
+                          IMG_VOID *pvSrc,
                           IMG_UINT32 ui32Bytes)
 {
     PVR_UNREFERENCED_PARAMETER(pvProcess);
@@ -2205,9 +2205,9 @@ PVRSRV_ERROR OSCopyToUser(IMG_PVOID pvProcess,
         return PVRSRV_ERROR_FAILED_TO_COPY_VIRT_MEMORY;
 }
 
-PVRSRV_ERROR OSCopyFromUser( IMG_PVOID pvProcess, 
-                             IMG_VOID *pvDest, 
-                             IMG_VOID *pvSrc, 
+PVRSRV_ERROR OSCopyFromUser( IMG_PVOID pvProcess,
+                             IMG_VOID *pvDest,
+                             IMG_VOID *pvSrc,
                              IMG_UINT32 ui32Bytes)
 {
     PVR_UNREFERENCED_PARAMETER(pvProcess);
@@ -2335,7 +2335,7 @@ PVRSRV_ERROR OSReleasePhysPageAddr(IMG_HANDLE hOSWrapMem)
 
                PVR_ASSERT(psPage != NULL);
 
-                
+
                if (psInfo->iNumPagesMapped == psInfo->iNumPages)
                {
                     if (!PageReserved(psPage))
@@ -2422,8 +2422,8 @@ err_out:
 
 #endif
 
-PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr, 
-                                    IMG_UINT32 ui32Bytes, 
+PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
+                                    IMG_UINT32 ui32Bytes,
                                     IMG_SYS_PHYADDR *psSysPAddr,
                                     IMG_HANDLE *phOSWrapMem)
 {
@@ -2442,12 +2442,12 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
     IMG_BOOL bMMapSemHeld = IMG_FALSE;
     PVRSRV_ERROR eError = PVRSRV_ERROR_OUT_OF_MEMORY;
 
-    
+
     ulStartAddr = ulStartAddrOrig & PAGE_MASK;
     ulBeyondEndAddr = PAGE_ALIGN(ulBeyondEndAddrOrig);
     ulAddrRange = ulBeyondEndAddr - ulStartAddr;
 
-    
+
     if (ulBeyondEndAddr <= ulStartAddr)
     {
         PVR_DPF((PVR_DBG_ERROR,
@@ -2456,7 +2456,7 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
         goto error;
     }
 
-    
+
     psInfo = kmalloc(sizeof(*psInfo), GFP_KERNEL);
     if (psInfo == NULL)
     {
@@ -2474,42 +2474,42 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
     psInfo->iNumPages = (IMG_INT)(ulAddrRange >> PAGE_SHIFT);
     psInfo->iPageOffset = (IMG_INT)(ulStartAddrOrig & ~PAGE_MASK);
 
-    
+
     psInfo->psPhysAddr = kmalloc((size_t)psInfo->iNumPages * sizeof(*psInfo->psPhysAddr), GFP_KERNEL);
     if (psInfo->psPhysAddr == NULL)
     {
         PVR_DPF((PVR_DBG_ERROR,
-            "OSAcquirePhysPageAddr: Couldn't allocate page array"));           
+            "OSAcquirePhysPageAddr: Couldn't allocate page array"));
         goto error;
     }
     memset(psInfo->psPhysAddr, 0, (size_t)psInfo->iNumPages * sizeof(*psInfo->psPhysAddr));
 
-    
+
     psInfo->ppsPages = kmalloc((size_t)psInfo->iNumPages * sizeof(*psInfo->ppsPages),  GFP_KERNEL);
     if (psInfo->ppsPages == NULL)
     {
         PVR_DPF((PVR_DBG_ERROR,
-            "OSAcquirePhysPageAddr: Couldn't allocate page array"));           
+            "OSAcquirePhysPageAddr: Couldn't allocate page array"));
         goto error;
     }
     memset(psInfo->ppsPages, 0, (size_t)psInfo->iNumPages * sizeof(*psInfo->ppsPages));
 
-    
+
     eError = PVRSRV_ERROR_BAD_MAPPING;
 
-    
+
     psInfo->eType = WRAP_TYPE_GET_USER_PAGES;
 
-    
+
     down_read(&current->mm->mmap_sem);
     bMMapSemHeld = IMG_TRUE;
 
-    
+
     psInfo->iNumPagesMapped = get_user_pages(current, current->mm, ulStartAddr, psInfo->iNumPages, 1, 0, psInfo->ppsPages, NULL);
 
     if (psInfo->iNumPagesMapped >= 0)
     {
-        
+
         if (psInfo->iNumPagesMapped != psInfo->iNumPages)
         {
             PVR_TRACE(("OSAcquirePhysPageAddr: Couldn't map all the pages needed (wanted: %d, got %d)", psInfo->iNumPages, psInfo->iNumPagesMapped));
@@ -2517,7 +2517,7 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
             goto error;
         }
 
-        
+
         for (i = 0; i < psInfo->iNumPages; i++)
         {
             IMG_CPU_PHYADDR CPUPhysAddr;
@@ -2534,21 +2534,21 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
            }
             psInfo->psPhysAddr[i] = SysCpuPAddrToSysPAddr(CPUPhysAddr);
             psSysPAddr[i] = psInfo->psPhysAddr[i];
-            
+
         }
 
         goto exit;
     }
 
     PVR_DPF((PVR_DBG_MESSAGE, "OSAcquirePhysPageAddr: get_user_pages failed (%d), using CPU page table", psInfo->iNumPagesMapped));
-    
-    
+
+
     psInfo->eType = WRAP_TYPE_NULL;
     psInfo->iNumPagesMapped = 0;
     memset(psInfo->ppsPages, 0, (size_t)psInfo->iNumPages * sizeof(*psInfo->ppsPages));
 
-    
-    
+
+
     psInfo->eType = WRAP_TYPE_FIND_VMA;
 
     psVMArea = find_vma(current->mm, ulStartAddrOrig);
@@ -2556,14 +2556,14 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
     {
         PVR_DPF((PVR_DBG_ERROR,
             "OSAcquirePhysPageAddr: Couldn't find memory region containing start address %x", ulStartAddrOrig));
-        
+
         goto error;
     }
 #if defined(DEBUG)
     psInfo->psVMArea = psVMArea;
 #endif
 
-    
+
     if (ulStartAddrOrig < psVMArea->vm_start)
     {
         PVR_DPF((PVR_DBG_ERROR,
@@ -2571,7 +2571,7 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
         goto error;
     }
 
-    
+
     if (ulBeyondEndAddrOrig > psVMArea->vm_end)
     {
         PVR_DPF((PVR_DBG_ERROR,
@@ -2579,7 +2579,7 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
         goto error;
     }
 
-    
+
     if ((psVMArea->vm_flags & (VM_IO | VM_RESERVED)) != (VM_IO | VM_RESERVED))
     {
         PVR_DPF((PVR_DBG_ERROR,
@@ -2587,7 +2587,7 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
         goto error;
     }
 
-    
+
     if ((psVMArea->vm_flags & (VM_READ | VM_WRITE)) != (VM_READ | VM_WRITE))
     {
         PVR_DPF((PVR_DBG_ERROR,
@@ -2665,7 +2665,7 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
 
     if (!bHaveNoPageStructs)
     {
-       
+
        goto exit;
     }
 
@@ -2682,7 +2682,7 @@ exit:
     PVR_ASSERT(bMMapSemHeld);
     up_read(&current->mm->mmap_sem);
 
-    
+
     *phOSWrapMem = (IMG_HANDLE)psInfo;
 
     if (bHaveNoPageStructs)
@@ -2694,8 +2694,8 @@ exit:
     PVR_ASSERT(psInfo->eType != 0);
 
 #if 0
-    
-    
+
+
     OSCleanCPUCacheRangeKM(pvCPUVAddr, (IMG_VOID *)((IMG_CHAR *)pvCPUVAddr + ui32Bytes));
 #endif
 
@@ -2768,7 +2768,7 @@ static unsigned long IONAreaToPhys(LinuxMemArea *psLinuxMemArea,
        return CpuPAddr.uiAddr;
 }
 
-#endif 
+#endif
 
 static
 IMG_VOID *FindMMapBaseVAddr(struct list_head *psMMapOffsetStructList,
@@ -2777,7 +2777,7 @@ IMG_VOID *FindMMapBaseVAddr(struct list_head *psMMapOffsetStructList,
        PKV_OFFSET_STRUCT psOffsetStruct;
        IMG_VOID *pvMinVAddr;
 
-       
+
        list_for_each_entry(psOffsetStruct, psMMapOffsetStructList, sAreaItem)
        {
                if(OSGetCurrentProcessIDKM() != psOffsetStruct->ui32PID)
@@ -2785,7 +2785,7 @@ IMG_VOID *FindMMapBaseVAddr(struct list_head *psMMapOffsetStructList,
 
                pvMinVAddr = (IMG_VOID *)psOffsetStruct->ui32UserVAddr;
 
-               
+
                if(pvRangeAddrStart >= pvMinVAddr &&
                   ui32Length <= psOffsetStruct->ui32RealByteSize)
                        return pvMinVAddr;
@@ -2828,7 +2828,7 @@ IMG_BOOL CheckExecuteCacheOp(IMG_HANDLE hOSMemHandle,
                psLinuxMemArea = psLinuxMemArea->uData.sSubAlloc.psParentLinuxMemArea;
        }
 
-       
+
        PVR_ASSERT(psLinuxMemArea->eAreaType != LINUX_MEM_AREA_SUB_ALLOC);
 
        switch(psLinuxMemArea->eAreaType)
@@ -2839,7 +2839,7 @@ IMG_BOOL CheckExecuteCacheOp(IMG_HANDLE hOSMemHandle,
                        {
                                pvMinVAddr = psLinuxMemArea->uData.sVmalloc.pvVmallocAddress + ui32AreaOffset;
 
-                               
+
                                if(pvRangeAddrStart < pvMinVAddr)
                                        goto err_blocked;
 
@@ -2847,7 +2847,7 @@ IMG_BOOL CheckExecuteCacheOp(IMG_HANDLE hOSMemHandle,
                        }
                        else
                        {
-                               
+
                                pvMinVAddr = FindMMapBaseVAddr(psMMapOffsetStructList,
                                                                                           pvRangeAddrStart, ui32Length);
                                if(!pvMinVAddr)
@@ -2856,28 +2856,28 @@ IMG_BOOL CheckExecuteCacheOp(IMG_HANDLE hOSMemHandle,
                                pfnInnerCacheOp(pvRangeAddrStart, pvRangeAddrStart + ui32Length);
 
 #if defined(CONFIG_OUTER_CACHE)
-                               
+
                                pvRangeAddrStart = psLinuxMemArea->uData.sVmalloc.pvVmallocAddress +
                                                                   (ui32AreaOffset & PAGE_MASK) + (pvRangeAddrStart - pvMinVAddr);
                        }
 
                        pfnMemAreaToPhys = VMallocAreaToPhys;
-#else 
+#else
                        }
-#endif 
+#endif
                        break;
                }
 
                case LINUX_MEM_AREA_EXTERNAL_KV:
                {
-                       
+
                        if (psLinuxMemArea->uData.sExternalKV.bPhysContig == IMG_TRUE)
                        {
                                PVR_DPF((PVR_DBG_WARNING, "%s: Attempt to flush contiguous external memory", __func__));
                                goto err_blocked;
                        }
 
-                       
+
                        if (psLinuxMemArea->uData.sExternalKV.pvExternalKV != IMG_NULL)
                        {
                                PVR_DPF((PVR_DBG_WARNING, "%s: Attempt to flush external memory with a kernel virtual address", __func__));
@@ -2939,17 +2939,17 @@ IMG_BOOL CheckExecuteCacheOp(IMG_HANDLE hOSMemHandle,
 #if defined(CONFIG_OUTER_CACHE)
        PVR_ASSERT(pfnMemAreaToPhys != IMG_NULL);
 
-       
+
        {
                unsigned long ulStart, ulEnd, ulLength, ulStartOffset, ulEndOffset;
                IMG_UINT32 i, ui32NumPages;
 
-               
+
                ulLength = (unsigned long)ui32Length;
                ulStartOffset = ((unsigned long)pvRangeAddrStart) & (PAGE_SIZE - 1);
                ulEndOffset = ((unsigned long)pvRangeAddrStart + ulLength) & (PAGE_SIZE - 1);
 
-               
+
                ui32NumPages = (ulStartOffset + ulLength + PAGE_SIZE - 1) >> PAGE_SHIFT;
 
                for(i = 0; i < ui32NumPages; i++)
@@ -3007,7 +3007,7 @@ static void x86_flush_cache_range(const void *pvStart, const void *pvEnd)
 
 IMG_VOID OSCleanCPUCacheKM(IMG_VOID)
 {
-       
+
        ON_EACH_CPU(per_cpu_cache_flush, NULL, 1);
 }
 
@@ -3020,7 +3020,7 @@ IMG_BOOL OSFlushCPUCacheRangeKM(IMG_HANDLE hOSMemHandle,
                                                                IMG_VOID *pvRangeAddrStart,
                                                                IMG_UINT32 ui32Length)
 {
-       
+
        return CheckExecuteCacheOp(hOSMemHandle, pvRangeAddrStart, ui32Length,
                                                           x86_flush_cache_range, IMG_NULL);
 }
@@ -3029,7 +3029,7 @@ IMG_BOOL OSCleanCPUCacheRangeKM(IMG_HANDLE hOSMemHandle,
                                                                IMG_VOID *pvRangeAddrStart,
                                                                IMG_UINT32 ui32Length)
 {
-       
+
        return CheckExecuteCacheOp(hOSMemHandle, pvRangeAddrStart, ui32Length,
                                                           x86_flush_cache_range, IMG_NULL);
 }
@@ -3038,12 +3038,12 @@ IMG_BOOL OSInvalidateCPUCacheRangeKM(IMG_HANDLE hOSMemHandle,
                                                                         IMG_VOID *pvRangeAddrStart,
                                                                         IMG_UINT32 ui32Length)
 {
-       
+
        return CheckExecuteCacheOp(hOSMemHandle, pvRangeAddrStart, ui32Length,
                                                           x86_flush_cache_range, IMG_NULL);
 }
 
-#else 
+#else
 
 #if defined(__arm__)
 
@@ -3055,7 +3055,7 @@ static void per_cpu_cache_flush(void *arg)
 
 IMG_VOID OSCleanCPUCacheKM(IMG_VOID)
 {
-       
+
        ON_EACH_CPU(per_cpu_cache_flush, NULL, 1);
 #if defined(CONFIG_OUTER_CACHE) && !defined(PVR_NO_FULL_CACHE_OPS)
        outer_clean_range(0, ULONG_MAX);
@@ -3119,18 +3119,18 @@ IMG_BOOL OSInvalidateCPUCacheRangeKM(IMG_HANDLE hOSMemHandle,
                                                           pvr_dmac_inv_range, outer_inv_range);
 }
 
-#else 
+#else
 
 #if defined(__mips__)
 IMG_VOID OSCleanCPUCacheKM(IMG_VOID)
 {
-       
+
        dma_cache_wback(0, 0x100000);
 }
 
 IMG_VOID OSFlushCPUCacheKM(IMG_VOID)
 {
-       
+
        dma_cache_wback_inv(0, 0x100000);
 }
 
@@ -3139,7 +3139,7 @@ IMG_BOOL OSFlushCPUCacheRangeKM(IMG_HANDLE hOSMemHandle,
                                                                IMG_UINT32 ui32Length)
 {
        if (ui32Length)
-               dma_cache_wback_inv((IMG_UINTPTR_T)pvRangeAddrStart, ui32Length);       
+               dma_cache_wback_inv((IMG_UINTPTR_T)pvRangeAddrStart, ui32Length);
        return IMG_TRUE;
 }
 
@@ -3161,15 +3161,15 @@ IMG_BOOL OSInvalidateCPUCacheRangeKM(IMG_HANDLE hOSMemHandle,
        return IMG_TRUE;
 }
 
-#else 
+#else
 
 #error "Implement CPU cache flush/clean/invalidate primitives for this CPU!"
 
-#endif 
+#endif
 
-#endif 
+#endif
 
-#endif 
+#endif
 
 PVRSRV_ERROR PVROSFuncInit(IMG_VOID)
 {
@@ -3178,7 +3178,7 @@ PVRSRV_ERROR PVROSFuncInit(IMG_VOID)
         psTimerWorkQueue = create_workqueue("pvr_timer");
         if (psTimerWorkQueue == NULL)
         {
-           PVR_DPF((PVR_DBG_ERROR, "%s: couldn't create timer workqueue", __FUNCTION__));              
+           PVR_DPF((PVR_DBG_ERROR, "%s: couldn't create timer workqueue", __FUNCTION__));
            return PVRSRV_ERROR_UNABLE_TO_CREATE_THREAD;
 
         }
old mode 100755 (executable)
new mode 100644 (file)
index 6b57dfc..0e3cc0e
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -57,11 +57,11 @@ PVRSRV_ERROR OSPerProcessPrivateDataInit(IMG_HANDLE *phOsPrivateData)
 
        psEnvPerProc->hBlockAlloc = hBlockAlloc;
 
-       
+
        LinuxMMapPerProcessConnect(psEnvPerProc);
 
 #if defined(SUPPORT_DRI_DRM) && defined(PVR_SECURE_DRM_AUTH_EXPORT)
-       
+
        INIT_LIST_HEAD(&psEnvPerProc->sDRMAuthListHead);
 #endif
 
@@ -80,17 +80,17 @@ PVRSRV_ERROR OSPerProcessPrivateDataDeInit(IMG_HANDLE hOsPrivateData)
 
        psEnvPerProc = (PVRSRV_ENV_PER_PROCESS_DATA *)hOsPrivateData;
 
-       
+
        LinuxMMapPerProcessDisconnect(psEnvPerProc);
 
-       
+
        RemovePerProcessProcDir(psEnvPerProc);
 
        eError = OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
                                sizeof(PVRSRV_ENV_PER_PROCESS_DATA),
                                hOsPrivateData,
                                psEnvPerProc->hBlockAlloc);
-       
+
 
        if (eError != PVRSRV_OK)
        {
old mode 100755 (executable)
new mode 100644 (file)
index 13d9b0d..66433d5
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -30,7 +30,7 @@
 #include <asm/atomic.h>
 #include <stdarg.h>
 #if defined (SUPPORT_SGX)
-#include "sgxdefs.h" 
+#include "sgxdefs.h"
 #endif
 #include "services_headers.h"
 
@@ -45,8 +45,8 @@
 #include "pdump_km.h"
 #include "pdump_int.h"
 
-#include <linux/kernel.h> 
-#include <linux/string.h> 
+#include <linux/kernel.h>
+#include <linux/string.h>
 
 static IMG_BOOL PDumpWriteString2              (IMG_CHAR * pszString, IMG_UINT32 ui32Flags);
 static IMG_BOOL PDumpWriteILock                        (PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_UINT32 ui32Count, IMG_UINT32 ui32Flags);
@@ -147,7 +147,7 @@ PVRSRV_ERROR PDumpOSBufprintf(IMG_HANDLE hBuf, IMG_UINT32 ui32ScriptSizeMax, IMG
 
        va_end(vaArgs);
 
-       if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)   
+       if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)
        {
                PVR_DPF((PVR_DBG_ERROR, "Buffer overflow detected, pdump output may be incomplete."));
 
@@ -166,7 +166,7 @@ PVRSRV_ERROR PDumpOSVSprintf(IMG_CHAR *pszComment, IMG_UINT32 ui32ScriptSizeMax,
 
        n = vsnprintf(pszComment, ui32ScriptSizeMax, pszFormat, vaArgs);
 
-       if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)   
+       if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)
        {
                PVR_DPF((PVR_DBG_ERROR, "Buffer overflow detected, pdump output may be incomplete."));
 
@@ -180,7 +180,7 @@ IMG_VOID PDumpOSDebugPrintf(IMG_CHAR* pszFormat, ...)
 {
        PVR_UNREFERENCED_PARAMETER(pszFormat);
 
-       
+
 }
 
 PVRSRV_ERROR PDumpOSSprintf(IMG_CHAR *pszComment, IMG_UINT32 ui32ScriptSizeMax, IMG_CHAR *pszFormat, ...)
@@ -194,7 +194,7 @@ PVRSRV_ERROR PDumpOSSprintf(IMG_CHAR *pszComment, IMG_UINT32 ui32ScriptSizeMax,
 
        va_end(vaArgs);
 
-       if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)   
+       if (n>=(IMG_INT32)ui32ScriptSizeMax || n==-1)
        {
                PVR_DPF((PVR_DBG_ERROR, "Buffer overflow detected, pdump output may be incomplete."));
 
@@ -221,10 +221,10 @@ IMG_VOID PDumpOSVerifyLineEnding(IMG_HANDLE hBuffer, IMG_UINT32 ui32BufferSizeMa
        IMG_UINT32 ui32Count;
        IMG_CHAR* pszBuf = hBuffer;
 
-       
+
        ui32Count = PDumpOSBuflen(hBuffer, ui32BufferSizeMax);
 
-       
+
        if ((ui32Count >= 1) && (pszBuf[ui32Count-1] != '\n') && (ui32Count<ui32BufferSizeMax))
        {
                pszBuf[ui32Count] = '\n';
@@ -270,7 +270,7 @@ IMG_BOOL PDumpOSWriteString(IMG_HANDLE hStream,
 
 IMG_VOID PDumpOSCheckForSplitting(IMG_HANDLE hStream, IMG_UINT32 ui32Size, IMG_UINT32 ui32Flags)
 {
-       
+
        PVR_UNREFERENCED_PARAMETER(hStream);
        PVR_UNREFERENCED_PARAMETER(ui32Size);
        PVR_UNREFERENCED_PARAMETER(ui32Flags);
@@ -300,16 +300,16 @@ IMG_VOID PDumpOSCPUVAddrToDevPAddr(PVRSRV_DEVICE_TYPE eDeviceType,
        IMG_CPU_PHYADDR sCpuPAddr;
 
        PVR_UNREFERENCED_PARAMETER(pui8LinAddr);
-       PVR_UNREFERENCED_PARAMETER(ui32PageSize);   
+       PVR_UNREFERENCED_PARAMETER(ui32PageSize);
+
+
 
-       
-          
        PVR_ASSERT (hOSMemHandle != IMG_NULL);
-       
+
        sCpuPAddr = OSMemHandleToCpuPAddr(hOSMemHandle, ui32Offset);
        PVR_ASSERT((sCpuPAddr.uiAddr & (ui32PageSize - 1)) == 0);
 
-       
+
        *psDevPAddr = SysCpuPAddrToDevPAddr(eDeviceType, sCpuPAddr);
 }
 
@@ -321,7 +321,7 @@ IMG_VOID PDumpOSCPUVAddrToPhysPages(IMG_HANDLE hOSMemHandle,
 {
        if(hOSMemHandle)
        {
-               
+
                IMG_CPU_PHYADDR     sCpuPAddr;
 
                PVR_UNREFERENCED_PARAMETER(pui8LinAddr);
@@ -375,19 +375,19 @@ IMG_VOID PDumpInit(IMG_VOID)
        IMG_UINT32 i;
        DBGKM_CONNECT_NOTIFIER sConnectNotifier;
 
-       
+
        if (!gpfnDbgDrv)
        {
                DBGDrvGetServiceTable((IMG_VOID **)&gpfnDbgDrv);
 
 
-               
+
                if (gpfnDbgDrv == IMG_NULL)
                {
                        return;
                }
-               
-               
+
+
                sConnectNotifier.pfnConnectNotifier = &PDumpConnectionNotify;
                gpfnDbgDrv->pfnSetConnectNotifier(sConnectNotifier);
 
@@ -457,7 +457,7 @@ init_failed:
                gsDBGPdumpState.pszMsg = IMG_NULL;
        }
 
-       
+
        sConnectNotifier.pfnConnectNotifier = 0;
        gpfnDbgDrv->pfnSetConnectNotifier(sConnectNotifier);
 
@@ -493,7 +493,7 @@ IMG_VOID PDumpDeInit(IMG_VOID)
                gsDBGPdumpState.pszMsg = IMG_NULL;
        }
 
-       
+
        sConnectNotifier.pfnConnectNotifier = 0;
        gpfnDbgDrv->pfnSetConnectNotifier(sConnectNotifier);
 
@@ -578,7 +578,7 @@ static IMG_BOOL PDumpWriteILock(PDBG_STREAM psStream, IMG_UINT8 *pui8Data, IMG_U
        }
 
 
-       
+
 
        if (psStream == gsDBGPdumpState.psStream[PDUMP_STREAM_PARAM2])
        {
@@ -624,5 +624,5 @@ IMG_VOID PDumpResumeKM(IMG_VOID)
        atomic_dec(&gsPDumpSuspended);
 }
 
-#endif 
-#endif 
+#endif
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index b8751d3..54a709f
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 
 typedef struct
 {
-       
+
        IMG_UINT32 ui32OpenPID;
 
-       
+
 #if defined (SUPPORT_SID_INTERFACE)
        IMG_SID hKernelMemInfo;
 #else
@@ -45,25 +45,25 @@ typedef struct
 #endif
 
 #if defined(SUPPORT_DRI_DRM) && defined(PVR_SECURE_DRM_AUTH_EXPORT)
-       
+
        struct list_head sDRMAuthListItem;
 
        struct drm_file *psDRMFile;
 #endif
 
 #if defined(SUPPORT_MEMINFO_IDS)
-       
+
        IMG_UINT64 ui64Stamp;
-#endif 
+#endif
+
 
-       
        IMG_HANDLE hBlockAlloc;
 
 #if defined(SUPPORT_DRI_DRM_EXT)
-       IMG_PVOID pPriv;        
+       IMG_PVOID pPriv;
 #endif
 }
 PVRSRV_FILE_PRIVATE_DATA;
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 1df8aff..aaad188
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -109,10 +109,10 @@ off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * fo
     n = vsnprintf (buffer+off, space, format, ap);
 
     va_end (ap);
-    
+
     if (n >= (IMG_INT)space || n < 0)
     {
-       
+
         buffer[size - 1] = 0;
         return (off_t)(size - 1);
     }
@@ -126,7 +126,7 @@ off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * fo
 void* ProcSeq1ElementOff2Element(struct seq_file *sfile, loff_t off)
 {
        PVR_UNREFERENCED_PARAMETER(sfile);
-       
+
        if(!off)
                return (void*)2;
        return NULL;
@@ -142,7 +142,7 @@ void* ProcSeq1ElementHeaderOff2Element(struct seq_file *sfile, loff_t off)
                return PVR_PROC_SEQ_START_TOKEN;
        }
 
-       
+
        if(off == 1)
                return (void*)2;
 
@@ -157,7 +157,7 @@ static IMG_INT pvr_proc_open(struct inode *inode,struct file *file)
        struct seq_file *seq = (struct seq_file*)file->private_data;
        struct proc_dir_entry* pvr_proc_entry = PDE(inode);
 
-       
+
        seq->private = pvr_proc_entry->data;
        return ret;
 }
@@ -259,7 +259,7 @@ static struct proc_dir_entry* CreateProcEntryInDirSeq(
                file->proc_fops = &pvr_proc_operations;
                file->write_proc = whandler;
 
-               
+
                file->data =  kmalloc(sizeof(PVR_PROC_SEQ_HANDLERS), GFP_KERNEL);
                if(file->data)
                {
@@ -423,7 +423,7 @@ IMG_VOID RemovePerProcessProcEntrySeq(struct proc_dir_entry* proc_entry)
 static IMG_INT pvr_read_proc(IMG_CHAR *page, IMG_CHAR **start, off_t off,
                          IMG_INT count, IMG_INT *eof, IMG_VOID *data)
 {
-        
+
     pvr_read_proc_t *pprn = (pvr_read_proc_t *)data;
 
     off_t len = pprn (page, (size_t)count, off);
@@ -433,9 +433,9 @@ static IMG_INT pvr_read_proc(IMG_CHAR *page, IMG_CHAR **start, off_t off,
         len  = 0;
         *eof = 1;
     }
-    else if (!len)             
+    else if (!len)
     {
-        *start = (IMG_CHAR *) 0;   
+        *start = (IMG_CHAR *) 0;
     }
     else
     {
@@ -560,7 +560,7 @@ IMG_INT CreateProcReadEntry(const IMG_CHAR * name, pvr_read_proc_t handler)
         return -ENOMEM;
     }
 
-        
+
     file = create_proc_read_entry (name, S_IFREG | S_IRUGO, dir, pvr_read_proc, (IMG_VOID *)handler);
 
     if (file)
@@ -686,7 +686,7 @@ IMG_VOID RemoveProcEntries(IMG_VOID)
        RemoveProcEntrySeq( g_pProcDebugLevel );
 #ifdef PVR_MANUAL_POWER_CONTROL
        RemoveProcEntrySeq( g_pProcPowerLevel );
-#endif 
+#endif
 #endif
 
        RemoveProcEntrySeq(g_pProcQueue);
@@ -811,9 +811,9 @@ static void* ProcSeqOff2ElementSysNodes(struct seq_file * sfile, loff_t off)
 {
     SYS_DATA *psSysData;
     PVRSRV_DEVICE_NODE*psDevNode = IMG_NULL;
-    
+
     PVR_UNREFERENCED_PARAMETER(sfile);
-    
+
     if(!off)
     {
        return PVR_PROC_SEQ_START_TOKEN;
@@ -822,14 +822,14 @@ static void* ProcSeqOff2ElementSysNodes(struct seq_file * sfile, loff_t off)
     psSysData = SysAcquireDataNoCheck();
     if (psSysData != IMG_NULL)
     {
-       
+
        psDevNode = (PVRSRV_DEVICE_NODE*)
                        List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
                                                                                                        DecOffPsDev_AnyVaCb,
                                                                                                        &off);
     }
 
-    
+
     return (void*)psDevNode;
 }
 
old mode 100755 (executable)
new mode 100644 (file)
index 2066d71..fa98ec5
@@ -1,35 +1,35 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #ifndef __SERVICES_PROC_H__
 #define __SERVICES_PROC_H__
 
-#include <asm/system.h>                
-#include <linux/proc_fs.h>     
-#include <linux/seq_file.h> 
+#include <asm/system.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 
 #define END_OF_FILE (off_t) -1
 
@@ -43,8 +43,8 @@ typedef void (pvr_show_proc_seq_t)(struct seq_file *,void*);
 typedef void (pvr_startstop_proc_seq_t)(struct seq_file *, IMG_BOOL start);
 
 typedef struct _PVR_PROC_SEQ_HANDLERS_ {
-       pvr_next_proc_seq_t *next;      
-       pvr_show_proc_seq_t *show;      
+       pvr_next_proc_seq_t *next;
+       pvr_show_proc_seq_t *show;
        pvr_off2element_proc_seq_t *off2element;
        pvr_startstop_proc_seq_t *startstop;
        IMG_VOID *data;
@@ -73,18 +73,18 @@ IMG_VOID RemovePerProcessProcEntry(const IMG_CHAR * name);
 IMG_VOID RemoveProcEntries(IMG_VOID);
 
 struct proc_dir_entry* CreateProcReadEntrySeq (
-                                                               const IMG_CHAR* name, 
+                                                               const IMG_CHAR* name,
                                                                IMG_VOID* data,
-                                                               pvr_next_proc_seq_t next_handler, 
+                                                               pvr_next_proc_seq_t next_handler,
                                                                pvr_show_proc_seq_t show_handler,
                                                                pvr_off2element_proc_seq_t off2element_handler,
                                                                pvr_startstop_proc_seq_t startstop_handler
                                                           );
 
 struct proc_dir_entry* CreateProcEntrySeq (
-                                                               const IMG_CHAR* name, 
+                                                               const IMG_CHAR* name,
                                                                IMG_VOID* data,
-                                                               pvr_next_proc_seq_t next_handler, 
+                                                               pvr_next_proc_seq_t next_handler,
                                                                pvr_show_proc_seq_t show_handler,
                                                                pvr_off2element_proc_seq_t off2element_handler,
                                                                pvr_startstop_proc_seq_t startstop_handler,
@@ -92,9 +92,9 @@ struct proc_dir_entry* CreateProcEntrySeq (
                                                           );
 
 struct proc_dir_entry* CreatePerProcessProcEntrySeq (
-                                                               const IMG_CHAR* name, 
+                                                               const IMG_CHAR* name,
                                                                IMG_VOID* data,
-                                                               pvr_next_proc_seq_t next_handler, 
+                                                               pvr_next_proc_seq_t next_handler,
                                                                pvr_show_proc_seq_t show_handler,
                                                                pvr_off2element_proc_seq_t off2element_handler,
                                                                pvr_startstop_proc_seq_t startstop_handler,
old mode 100755 (executable)
new mode 100644 (file)
index 026023c..4732e3b
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -75,7 +75,7 @@ extern PVRSRV_LINUX_MUTEX gPVRSRVLock;
 
 #if defined(SUPPORT_MEMINFO_IDS)
 static IMG_UINT64 ui64Stamp;
-#endif 
+#endif
 
 PVRSRV_ERROR
 LinuxBridgeInit(IMG_VOID)
@@ -83,7 +83,7 @@ LinuxBridgeInit(IMG_VOID)
 #if defined(DEBUG_BRIDGE_KM)
        {
                g_ProcBridgeStats = CreateProcReadEntrySeq(
-                                                                                                 "bridge_stats", 
+                                                                                                 "bridge_stats",
                                                                                                  NULL,
                                                                                                  ProcSeqNextBridgeStats,
                                                                                                  ProcSeqShowBridgeStats,
@@ -109,9 +109,9 @@ LinuxBridgeDeInit(IMG_VOID)
 
 #if defined(DEBUG_BRIDGE_KM)
 
-static void ProcSeqStartstopBridgeStats(struct seq_file *sfile,IMG_BOOL start) 
+static void ProcSeqStartstopBridgeStats(struct seq_file *sfile,IMG_BOOL start)
 {
-       if(start) 
+       if(start)
        {
                LinuxLockMutex(&gPVRSRVLock);
        }
@@ -124,7 +124,7 @@ static void ProcSeqStartstopBridgeStats(struct seq_file *sfile,IMG_BOOL start)
 
 static void* ProcSeqOff2ElementBridgeStats(struct seq_file *sfile, loff_t off)
 {
-       if(!off) 
+       if(!off)
        {
                return PVR_PROC_SEQ_START_TOKEN;
        }
@@ -148,7 +148,7 @@ static void ProcSeqShowBridgeStats(struct seq_file *sfile,void* el)
 {
        PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY *psEntry = ( PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY*)el;
 
-       if(el == PVR_PROC_SEQ_START_TOKEN) 
+       if(el == PVR_PROC_SEQ_START_TOKEN)
        {
                seq_printf(sfile,
                                                  "Total ioctl call count = %u\n"
@@ -178,7 +178,7 @@ static void ProcSeqShowBridgeStats(struct seq_file *sfile,void* el)
                                   psEntry->ui32CopyToUserTotalBytes);
 }
 
-#endif 
+#endif
 
 
 #if defined(SUPPORT_DRI_DRM)
@@ -216,8 +216,8 @@ PVRSRV_BridgeDispatchKM(struct file *pFile, unsigned int unref__ ioctlCmd, unsig
 
                goto unlock_and_return;
        }
-       
-       
+
+
        if(OSCopyFromUser(IMG_NULL,
                                          psBridgePackageKM,
                                          psBridgePackageUM,
@@ -229,7 +229,7 @@ PVRSRV_BridgeDispatchKM(struct file *pFile, unsigned int unref__ ioctlCmd, unsig
 #endif
 
        cmd = psBridgePackageKM->ui32BridgeID;
-       
+
        if(cmd != PVRSRV_BRIDGE_CONNECT_SERVICES)
        {
                PVRSRV_ERROR eError;
@@ -255,7 +255,7 @@ PVRSRV_BridgeDispatchKM(struct file *pFile, unsigned int unref__ ioctlCmd, unsig
        }
        else
        {
-               
+
                psPerProc = PVRSRVPerProcessData(ui32PID);
                if(psPerProc == IMG_NULL)
                {
@@ -334,7 +334,7 @@ PVRSRV_BridgeDispatchKM(struct file *pFile, unsigned int unref__ ioctlCmd, unsig
                                break;
                        }
 
-                       
+
                        psEnvPerProc = (PVRSRV_ENV_PER_PROCESS_DATA *)PVRSRVProcessPrivateData(psPerProc);
                        if (psEnvPerProc == IMG_NULL)
                        {
@@ -368,7 +368,7 @@ PVRSRV_BridgeDispatchKM(struct file *pFile, unsigned int unref__ ioctlCmd, unsig
                default:
                        break;
        }
-#endif 
+#endif
 
        err = BridgedDispatchKM(psPerProc, psBridgePackageKM);
        if(err != PVRSRV_OK)
@@ -381,12 +381,19 @@ PVRSRV_BridgeDispatchKM(struct file *pFile, unsigned int unref__ ioctlCmd, unsig
                        PVRSRV_BRIDGE_OUT_EXPORTDEVICEMEM *psExportDeviceMemOUT =
                                (PVRSRV_BRIDGE_OUT_EXPORTDEVICEMEM *)psBridgePackageKM->pvParamOut;
                        PVRSRV_FILE_PRIVATE_DATA *psPrivateData = PRIVATE_DATA(pFile);
+                       IMG_HANDLE hMemInfo;
                        PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
 
+                       if (get_user(hMemInfo, &psExportDeviceMemOUT->hMemInfo) != 0)
+                       {
+                               err = -EFAULT;
+                               goto unlock_and_return;
+                       }
+
 
                        if(PVRSRVLookupHandle(KERNEL_HANDLE_BASE,
                                                                  (IMG_PVOID *)&psKernelMemInfo,
-                                                                 psExportDeviceMemOUT->hMemInfo,
+                                                                 hMemInfo,
                                                                  PVRSRV_HANDLE_TYPE_MEM_INFO) != PVRSRV_OK)
                        {
                                PVR_DPF((PVR_DBG_ERROR, "%s: Failed to look up export handle", __FUNCTION__));
@@ -397,7 +404,7 @@ PVRSRV_BridgeDispatchKM(struct file *pFile, unsigned int unref__ ioctlCmd, unsig
 
                        PVRSRVKernelMemInfoIncRef(psKernelMemInfo);
 
-                       psPrivateData->hKernelMemInfo = psExportDeviceMemOUT->hMemInfo;
+                       psPrivateData->hKernelMemInfo = hMemInfo;
 #if defined(SUPPORT_MEMINFO_IDS)
                        psPrivateData->ui64Stamp = ++ui64Stamp;
 
@@ -437,7 +444,7 @@ PVRSRV_BridgeDispatchKM(struct file *pFile, unsigned int unref__ ioctlCmd, unsig
                        }
                        break;
                }
-#endif 
+#endif
 
                default:
                        break;
old mode 100755 (executable)
new mode 100644 (file)
index 3a280fc..03c3ba0
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -38,7 +38,7 @@
 #include <linux/hardirq.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
-#include <linux/string.h>                      
+#include <linux/string.h>
 #include <stdarg.h>
 #include "img_types.h"
 #include "servicesext.h"
@@ -68,7 +68,7 @@ static IMG_BOOL BAppend(IMG_CHAR *pszBuf, IMG_UINT32 ui32BufSiz,
 IMG_UINT32 gPVRDebugLevel =
        (DBGPRIV_FATAL | DBGPRIV_ERROR | DBGPRIV_WARNING);
 
-#endif 
+#endif
 
 #define        PVR_MAX_MSG_LEN PVR_MAX_DEBUG_MESSAGE_LEN
 
@@ -83,14 +83,14 @@ static PVRSRV_LINUX_MUTEX gsDebugMutexNonIRQ;
 #endif
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
+
 static spinlock_t gsDebugLockIRQ = __SPIN_LOCK_UNLOCKED();
 #else
 static DEFINE_SPINLOCK(gsDebugLockIRQ);
 #endif
 
 #if !defined(PVR_DEBUG_ALWAYS_USE_SPINLOCK)
-#if !defined (USE_SPIN_LOCK)  
+#if !defined (USE_SPIN_LOCK)
 #define        USE_SPIN_LOCK (in_interrupt() || !preemptible())
 #endif
 #endif
@@ -158,7 +158,7 @@ static IMG_BOOL VBAppend(IMG_CHAR *pszBuf, IMG_UINT32 ui32BufSiz, const IMG_CHAR
        i32Len = vsnprintf(&pszBuf[ui32Used], ui32Space, pszFormat, VArgs);
        pszBuf[ui32BufSiz - 1] = 0;
 
-       
+
        return (i32Len < 0 || i32Len >= (IMG_INT32)ui32Space) ? IMG_TRUE : IMG_FALSE;
 }
 
@@ -206,7 +206,7 @@ IMG_VOID PVRSRVDebugAssertFail(const IMG_CHAR* pszFile, IMG_UINT32 uLine)
        BUG();
 }
 
-#endif 
+#endif
 
 #if defined(PVRSRV_NEED_PVR_TRACE)
 
@@ -239,7 +239,7 @@ IMG_VOID PVRSRVTrace(const IMG_CHAR* pszFormat, ...)
        va_end(VArgs);
 }
 
-#endif 
+#endif
 
 #if defined(PVRSRV_NEED_PVR_DPF)
 
@@ -285,7 +285,7 @@ IMG_VOID PVRSRVDebugPrintf  (
 
                GetBufferLock(&ulLockFlags);
 
-               
+
                if (bTrace == IMG_FALSE)
                {
                        switch(ui32DebugLevel)
@@ -333,21 +333,21 @@ IMG_VOID PVRSRVDebugPrintf        (
                }
                else
                {
-                       
+
                        if (bTrace == IMG_FALSE)
                        {
 #ifdef DEBUG_LOG_PATH_TRUNCATE
-                               
+
                                static IMG_CHAR szFileNameRewrite[PVR_MAX_FILEPATH_LEN];
 
                                IMG_CHAR* pszTruncIter;
                                IMG_CHAR* pszTruncBackInter;
 
-                               
+
                                if (strlen(pszFullFileName) > strlen(DEBUG_LOG_PATH_TRUNCATE)+1)
                                        pszFileName = pszFullFileName + strlen(DEBUG_LOG_PATH_TRUNCATE)+1;
 
-                               
+
                                strncpy(szFileNameRewrite, pszFileName,PVR_MAX_FILEPATH_LEN);
 
                                if(strlen(szFileNameRewrite) == PVR_MAX_FILEPATH_LEN-1) {
@@ -359,7 +359,7 @@ IMG_VOID PVRSRVDebugPrintf  (
                                while(*pszTruncIter++ != 0)
                                {
                                        IMG_CHAR* pszNextStartPoint;
-                                       
+
                                        if(
                                           !( ( *pszTruncIter == '/' && (pszTruncIter-4 >= szFileNameRewrite) ) &&
                                                 ( *(pszTruncIter-1) == '.') &&
@@ -367,7 +367,7 @@ IMG_VOID PVRSRVDebugPrintf  (
                                                 ( *(pszTruncIter-3) == '/') )
                                           ) continue;
 
-                                       
+
                                        pszTruncBackInter = pszTruncIter - 3;
                                        while(*(--pszTruncBackInter) != '/')
                                        {
@@ -375,19 +375,19 @@ IMG_VOID PVRSRVDebugPrintf        (
                                        }
                                        pszNextStartPoint = pszTruncBackInter;
 
-                                       
+
                                        while(*pszTruncIter != 0)
                                        {
                                                *pszTruncBackInter++ = *pszTruncIter++;
                                        }
                                        *pszTruncBackInter = 0;
 
-                                       
+
                                        pszTruncIter = pszNextStartPoint;
                                }
 
                                pszFileName = szFileNameRewrite;
-                               
+
                                if(*pszFileName == '/') pszFileName++;
 #endif
 
@@ -398,7 +398,7 @@ IMG_VOID PVRSRVDebugPrintf  (
                                {
                                        pszFileName = pszLeafName;
                        }
-#endif 
+#endif
 
                                if (BAppend(pszBuf, ui32BufSiz, " [%u, %s]", ui32Line, pszFileName))
                                {
@@ -421,7 +421,7 @@ IMG_VOID PVRSRVDebugPrintf  (
        }
 }
 
-#endif 
+#endif
 
 #if defined(DEBUG)
 
@@ -450,4 +450,4 @@ void ProcSeqShowDebugLevel(struct seq_file *sfile,void* el)
        seq_printf(sfile, "%u\n", gPVRDebugLevel);
 }
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 4291bd1..c06636c
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -102,20 +102,20 @@ static struct platform_device_id asPlatIdList[] = {
        {}
 };
 #endif
-#else  
+#else
 static struct pci_device_id asPciIdList[] = {
 #if defined(PVR_DRI_DRM_NOT_PCI)
        {1, 1, 1, 1, 0, 0, 0},
-#else  
+#else
        {SYS_SGX_DEV_VENDOR_ID, SYS_SGX_DEV_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 #if defined(SYS_SGX_DEV1_DEVICE_ID)
        {SYS_SGX_DEV_VENDOR_ID, SYS_SGX_DEV1_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-#endif 
-#endif 
+#endif
+#endif
        {0}
 };
-#endif 
-#endif 
+#endif
+#endif
 
 DRI_DRM_STATIC int
 PVRSRVDrmLoad(struct drm_device *dev, unsigned long flags)
@@ -140,7 +140,7 @@ PVRSRVDrmLoad(struct drm_device *dev, unsigned long flags)
                goto exit;
        }
 #endif
-       
+
        iRes = PVRCore_Init();
        if (iRes != 0)
        {
@@ -247,7 +247,7 @@ PVRSRVDrmRelease(struct inode *inode, struct file *filp)
 
        if (ret != 0)
        {
-               
+
                PVR_DPF((PVR_DBG_ERROR, "%s : drm_release failed: %d",
                        __FUNCTION__, ret));
        }
@@ -355,9 +355,9 @@ static int pvr_max_ioctl = DRM_ARRAY_SIZE(sPVRDrmIoctls);
 #if defined(PVR_DRI_DRM_PLATFORM_DEV) && !defined(SUPPORT_DRI_DRM_EXT)
 static int PVRSRVDrmProbe(struct platform_device *pDevice);
 static int PVRSRVDrmRemove(struct platform_device *pDevice);
-#endif 
+#endif
 
-static struct drm_driver sPVRDrmDriver = 
+static struct drm_driver sPVRDrmDriver =
 {
 #if defined(PVR_DRI_DRM_PLATFORM_DEV)
        .driver_features = DRIVER_USE_PLATFORM_DEVICE,
@@ -377,7 +377,7 @@ static struct drm_driver sPVRDrmDriver =
        .get_reg_ofs = drm_core_get_reg_ofs,
 #endif
        .ioctls = sPVRDrmIoctls,
-       .fops = 
+       .fops =
        {
                .owner = THIS_MODULE,
                .open = drm_open,
@@ -402,7 +402,7 @@ static struct drm_driver sPVRDrmDriver =
                .shutdown = PVRSRVDriverShutdown,
        },
 #else
-       .pci_driver = 
+       .pci_driver =
        {
                .name = PVR_DRM_NAME,
                .id_table = asPciIdList,
@@ -435,13 +435,13 @@ PVRSRVDrmRemove(struct platform_device *pDevice)
        return 0;
 }
 
-#endif 
+#endif
 static int __init PVRSRVDrmInit(void)
 {
        int iRes;
        sPVRDrmDriver.num_ioctls = pvr_max_ioctl;
 
-       
+
        PVRDPFInit();
 
 #if defined(PVR_DRI_DRM_NOT_PCI)
@@ -461,7 +461,7 @@ static int __init PVRSRVDrmInit(void)
 #endif
        return iRes;
 }
-       
+
 static void __exit PVRSRVDrmExit(void)
 {
        drm_exit(&sPVRDrmDriver);
@@ -473,7 +473,7 @@ static void __exit PVRSRVDrmExit(void)
 
 module_init(PVRSRVDrmInit);
 module_exit(PVRSRVDrmExit);
-#endif 
-#endif 
+#endif
+#endif
 
 
old mode 100755 (executable)
new mode 100644 (file)
index 9bd5540..78f616d
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -68,7 +68,7 @@ int PVRDRMUnprivCmd(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFil
 int PVRDRM_Dummy_ioctl(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFile);
 #else
 #define        DRI_DRM_STATIC  static
-#endif 
+#endif
 
 #if defined(DISPLAY_CONTROLLER)
 extern int PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Init)(struct drm_device *);
@@ -98,10 +98,10 @@ IMG_INT dbgdrv_ioctl(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFi
 #define        DRM_IOCTL_PVR_UNPRIV            _IO(0, DRM_PVR_UNPRIV)
 #define        DRM_IOCTL_PVR_DBGDRV            _IO(0, DRM_PVR_DBGDRV)
 #define        DRM_IOCTL_PVR_DISP              _IO(0, DRM_PVR_DISP)
-#endif 
+#endif
 
-#endif 
+#endif
 
-#endif 
+#endif
 
 
old mode 100755 (executable)
new mode 100644 (file)
index 3bbab7b..9122bf8
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #define EUR_CR_OCP_DEBUG_STATUS_CMD_DEBUG_STATE_SIGNED 0
 
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 810cb81..6becfbc
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #define EUR_CR_MNE_CR_EVENT_CLEAR_INVAL_SHIFT  0
 #define EUR_CR_MNE_CR_CTRL_INVAL                               0x0D20
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index c09aa26..f971d30
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #define EUR_CR_USE_CODE_BASE_SIZE_UINT32 16
 #define EUR_CR_USE_CODE_BASE_NUM_ENTRIES 16
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 23bd4d4..646e415
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #define EUR_CR_USE_CODE_BASE_SIZE_UINT32 16
 #define EUR_CR_USE_CODE_BASE_NUM_ENTRIES 16
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index c18b8ad..88dc2bd
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #define EUR_CR_USE_CODE_BASE_SIZE_UINT32 16
 #define EUR_CR_USE_CODE_BASE_NUM_ENTRIES 16
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 4dc7f3c..17968f2
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #define EUR_CR_USE_CODE_BASE_SIZE_UINT32 16
 #define EUR_CR_USE_CODE_BASE_NUM_ENTRIES 16
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index b3a2583..4bd2916
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #include "sgxmpplusdefs.h"
 #else
 #include "sgxmpdefs.h"
-#endif 
-#else 
+#endif
+#else
 #if defined(SGX_FEATURE_SYSTEM_CACHE)
 #include "mnemedefs.h"
 #endif
-#endif 
+#endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 50ad94f..1e23aad
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #define _SGXERRATA_KM_H_
 
 #if defined(SGX520) && !defined(SGX_CORE_DEFINED)
-       
+
        #define SGX_CORE_REV_HEAD       0
        #if defined(USE_SGX_CORE_REV_HEAD)
-               
+
                #define SGX_CORE_REV    SGX_CORE_REV_HEAD
        #endif
 
                #define FIX_HW_BRN_28889
        #else
        #if SGX_CORE_REV == SGX_CORE_REV_HEAD
-               
+
        #else
                #error "sgxerrata.h: SGX520 Core Revision unspecified"
        #endif
        #endif
        #endif
-       
+
        #define SGX_CORE_DEFINED
 #endif
 
 #if defined(SGX530) && !defined(SGX_CORE_DEFINED)
-       
+
        #define SGX_CORE_REV_HEAD       0
        #if defined(USE_SGX_CORE_REV_HEAD)
-               
+
                #define SGX_CORE_REV    SGX_CORE_REV_HEAD
        #endif
 
                #define FIX_HW_BRN_28889
        #else
        #if SGX_CORE_REV == 111
-               #define FIX_HW_BRN_22934        
+               #define FIX_HW_BRN_22934
                #define FIX_HW_BRN_28889
        #else
        #if SGX_CORE_REV == 1111
-               #define FIX_HW_BRN_22934        
+               #define FIX_HW_BRN_22934
                #define FIX_HW_BRN_28889
        #else
        #if SGX_CORE_REV == 120
-               #define FIX_HW_BRN_22934        
+               #define FIX_HW_BRN_22934
                #define FIX_HW_BRN_28889
        #else
        #if SGX_CORE_REV == 121
-               #define FIX_HW_BRN_22934        
+               #define FIX_HW_BRN_22934
                #define FIX_HW_BRN_28889
        #else
        #if SGX_CORE_REV == 125
-               #define FIX_HW_BRN_22934        
+               #define FIX_HW_BRN_22934
                #define FIX_HW_BRN_28889
        #else
        #if SGX_CORE_REV == 130
-               #define FIX_HW_BRN_22934        
+               #define FIX_HW_BRN_22934
                #define FIX_HW_BRN_28889
        #else
        #if SGX_CORE_REV == SGX_CORE_REV_HEAD
-               
+
        #else
                #error "sgxerrata.h: SGX530 Core Revision unspecified"
        #endif
        #endif
 #endif
         #endif
-       
+
        #define SGX_CORE_DEFINED
 #endif
 
 #if defined(SGX531) && !defined(SGX_CORE_DEFINED)
-       
+
        #define SGX_CORE_REV_HEAD       0
        #if defined(USE_SGX_CORE_REV_HEAD)
-               
+
                #define SGX_CORE_REV    SGX_CORE_REV_HEAD
        #endif
 
                #define FIX_HW_BRN_34028
        #else
        #if SGX_CORE_REV == SGX_CORE_REV_HEAD
-               
+
        #else
                #error "sgxerrata.h: SGX531 Core Revision unspecified"
        #endif
        #endif
        #endif
-       
+
        #define SGX_CORE_DEFINED
 #endif
 
 #if (defined(SGX535) || defined(SGX535_V1_1)) && !defined(SGX_CORE_DEFINED)
-       
+
        #define SGX_CORE_REV_HEAD       0
        #if defined(USE_SGX_CORE_REV_HEAD)
-               
+
                #define SGX_CORE_REV    SGX_CORE_REV_HEAD
        #endif
 
                #define FIX_HW_BRN_23281
                #define FIX_HW_BRN_23410
                #define FIX_HW_BRN_22693
-               #define FIX_HW_BRN_22934        
+               #define FIX_HW_BRN_22934
                #define FIX_HW_BRN_22997
                #define FIX_HW_BRN_23030
        #else
        #if SGX_CORE_REV == 113
-               #define FIX_HW_BRN_22934        
+               #define FIX_HW_BRN_22934
                #define FIX_HW_BRN_23281
                #define FIX_HW_BRN_23944
                #define FIX_HW_BRN_23410
        #else
        #if SGX_CORE_REV == 121
-               #define FIX_HW_BRN_22934        
+               #define FIX_HW_BRN_22934
                #define FIX_HW_BRN_23944
                #define FIX_HW_BRN_23410
        #else
        #if SGX_CORE_REV == 126
-               #define FIX_HW_BRN_22934        
-       #else   
+               #define FIX_HW_BRN_22934
+       #else
        #if SGX_CORE_REV == SGX_CORE_REV_HEAD
-               
+
        #else
                #error "sgxerrata.h: SGX535 Core Revision unspecified"
 
        #endif
        #endif
        #endif
-       
+
        #define SGX_CORE_DEFINED
 #endif
 
 #if defined(SGX540) && !defined(SGX_CORE_DEFINED)
-       
+
        #define SGX_CORE_REV_HEAD       0
        #if defined(USE_SGX_CORE_REV_HEAD)
-               
+
                #define SGX_CORE_REV    SGX_CORE_REV_HEAD
        #endif
 
                #define FIX_HW_BRN_34028
        #else
        #if SGX_CORE_REV == SGX_CORE_REV_HEAD
-               
+
        #else
                #error "sgxerrata.h: SGX540 Core Revision unspecified"
        #endif
        #endif
        #endif
        #endif
-       
+
        #define SGX_CORE_DEFINED
 #endif
 
 #if defined(SGX541) && !defined(SGX_CORE_DEFINED)
        #if defined(SGX_FEATURE_MP)
-               
+
                #define SGX_CORE_REV_HEAD       0
                #if defined(USE_SGX_CORE_REV_HEAD)
-                       
+
                        #define SGX_CORE_REV    SGX_CORE_REV_HEAD
                #endif
 
                        #define FIX_HW_BRN_27270
                        #define FIX_HW_BRN_28011
                        #define FIX_HW_BRN_27510
-                       
+
                #else
                #if SGX_CORE_REV == SGX_CORE_REV_HEAD
-                       
+
                #else
                        #error "sgxerrata.h: SGX541 Core Revision unspecified"
                #endif
                #endif
-               
+
                #define SGX_CORE_DEFINED
-       #else 
+       #else
                #error "sgxerrata.h: SGX541 only supports MP configs (SGX_FEATURE_MP)"
-       #endif 
+       #endif
 #endif
 
 #if defined(SGX543) && !defined(SGX_CORE_DEFINED)
-       
+
        #define SGX_CORE_REV_HEAD       0
        #if defined(USE_SGX_CORE_REV_HEAD)
-               
+
                #define SGX_CORE_REV    SGX_CORE_REV_HEAD
        #endif
 
                #define FIX_HW_BRN_31620
                #define FIX_HW_BRN_31780
                #define FIX_HW_BRN_31542
-               #define FIX_HW_BRN_32044 
+               #define FIX_HW_BRN_32044
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
                #define FIX_HW_BRN_31620
                #define FIX_HW_BRN_31780
                #define FIX_HW_BRN_31542
-               #define FIX_HW_BRN_32044 
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32044
+               #define FIX_HW_BRN_32085
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
                #define FIX_HW_BRN_33920
-                       
+
        #else
        #if SGX_CORE_REV == 1221
                #define FIX_HW_BRN_29954
                        #define FIX_HW_BRN_31425
                #endif
                #define FIX_HW_BRN_31542
-               #define FIX_HW_BRN_31671                
+               #define FIX_HW_BRN_31671
                #define FIX_HW_BRN_31780
                #define FIX_HW_BRN_32044
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32085
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
                #define FIX_HW_BRN_33920
-                       
+
        #else
        #if SGX_CORE_REV == 140
                #define FIX_HW_BRN_29954
                #define FIX_HW_BRN_31620
                #define FIX_HW_BRN_31780
                #define FIX_HW_BRN_31542
-               #define FIX_HW_BRN_32044 
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32044
+               #define FIX_HW_BRN_32085
                #define FIX_HW_BRN_33920
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
-                       
+
        #else
        #if SGX_CORE_REV == 1401
                #define FIX_HW_BRN_29954
                #define FIX_HW_BRN_31620
                #define FIX_HW_BRN_31542
                #define FIX_HW_BRN_31780
-               #define FIX_HW_BRN_32044 
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32044
+               #define FIX_HW_BRN_32085
                #define FIX_HW_BRN_33920
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
-                       
+
        #else
        #if SGX_CORE_REV == 141
                #define FIX_HW_BRN_29954
                #if defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_31425
                #endif
-               #define FIX_HW_BRN_31671 
+               #define FIX_HW_BRN_31671
                #define FIX_HW_BRN_31780
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
-                       
+
        #else
        #if SGX_CORE_REV == 142
                #define FIX_HW_BRN_29954
                #if defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_31425
                #endif
-               #define FIX_HW_BRN_31671 
+               #define FIX_HW_BRN_31671
                #define FIX_HW_BRN_31780
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
-                       
+
        #else
        #if SGX_CORE_REV == 211
                #define FIX_HW_BRN_31093
                #define FIX_HW_BRN_31620
                #define FIX_HW_BRN_31780
                #define FIX_HW_BRN_31542
-               #define FIX_HW_BRN_32044 
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32044
+               #define FIX_HW_BRN_32085
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
                #define FIX_HW_BRN_33920
-                       
+
        #else
        #if SGX_CORE_REV == 2111
-               #define FIX_HW_BRN_30982 
+               #define FIX_HW_BRN_30982
                #define FIX_HW_BRN_31093
                #define FIX_HW_BRN_31195
                #define FIX_HW_BRN_31272
                #define FIX_HW_BRN_31620
                #define FIX_HW_BRN_31780
                #define FIX_HW_BRN_31542
-               #define FIX_HW_BRN_32044 
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32044
+               #define FIX_HW_BRN_32085
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
                #define FIX_HW_BRN_33920
-                       
+
        #else
        #if SGX_CORE_REV == 213
                #define FIX_HW_BRN_31272
                #if defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_31425
                #endif
-               #define FIX_HW_BRN_31671 
+               #define FIX_HW_BRN_31671
                #define FIX_HW_BRN_31780
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32085
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
                #define FIX_HW_BRN_33920
-                       
+
        #else
        #if SGX_CORE_REV == 216
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
        #endif
        #endif
        #endif
-       
+
        #define SGX_CORE_DEFINED
 #endif
 
 #if defined(SGX544) && !defined(SGX_CORE_DEFINED)
-       
+
        #define SGX_CORE_REV_HEAD       0
        #if defined(USE_SGX_CORE_REV_HEAD)
-               
+
                #define SGX_CORE_REV    SGX_CORE_REV_HEAD
        #endif
 
                        #define FIX_HW_BRN_31425
                #endif
                #define FIX_HW_BRN_31780
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32085
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
                        #define FIX_HW_BRN_31425
                #endif
                #define FIX_HW_BRN_31780
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32085
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
                #if defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_31425
                #endif
-               #define FIX_HW_BRN_31542 
+               #define FIX_HW_BRN_31542
                #define FIX_HW_BRN_31620
-               #define FIX_HW_BRN_31671 
+               #define FIX_HW_BRN_31671
                #define FIX_HW_BRN_31780
-               #define FIX_HW_BRN_32044 
-               #define FIX_HW_BRN_32085 
+               #define FIX_HW_BRN_32044
+               #define FIX_HW_BRN_32085
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
                #define FIX_HW_BRN_33920
-       #else   
+       #else
        #if SGX_CORE_REV == 105
                #if defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_31425
        #endif
        #endif
        #endif
-       
+
        #define SGX_CORE_DEFINED
 #endif
 
 #if defined(SGX545) && !defined(SGX_CORE_DEFINED)
-       
+
        #define SGX_CORE_REV_HEAD       0
        #if defined(USE_SGX_CORE_REV_HEAD)
-               
+
                #define SGX_CORE_REV    SGX_CORE_REV_HEAD
        #endif
 
        #if SGX_CORE_REV == 10141
        #else
        #if SGX_CORE_REV == SGX_CORE_REV_HEAD
-               
+
        #else
                #error "sgxerrata.h: SGX545 Core Revision unspecified"
        #endif
        #endif
        #endif
        #endif
-       
+
        #define SGX_CORE_DEFINED
 #endif
 
 #if defined(SGX554) && !defined(SGX_CORE_DEFINED)
-       
+
        #define SGX_CORE_REV_HEAD       0
        #if defined(USE_SGX_CORE_REV_HEAD)
-               
+
                #define SGX_CORE_REV    SGX_CORE_REV_HEAD
        #endif
 
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #endif
-               
-       #else   
+
+       #else
        #if SGX_CORE_REV == SGX_CORE_REV_HEAD
                #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && defined(SGX_FEATURE_MP)
                        #define FIX_HW_BRN_33657
                #error "sgxerrata.h: SGX554 Core Revision unspecified"
        #endif
        #endif
-       
+
        #define SGX_CORE_DEFINED
 #endif
 
 #endif
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 054845e..de508b5
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
        #define SGX_CORE_FRIENDLY_NAME                                                  "SGX520"
        #define SGX_CORE_ID                                                                             SGX_CORE_ID_520
        #define SGX_FEATURE_ADDRESS_SPACE_SIZE                                  (28)
+       #define SGX_FEATURE_NUM_USE_PIPES                                               (1)
        #define SGX_FEATURE_AUTOCLOCKGATING
 #else
 #if defined(SGX530)
        #define SGX_CORE_FRIENDLY_NAME                                                  "SGX530"
        #define SGX_CORE_ID                                                                             SGX_CORE_ID_530
        #define SGX_FEATURE_ADDRESS_SPACE_SIZE                                  (28)
+       #define SGX_FEATURE_NUM_USE_PIPES                                               (2)
        #define SGX_FEATURE_AUTOCLOCKGATING
 #else
 #if defined(SGX531)
        #define SGX_CORE_FRIENDLY_NAME                                                  "SGX531"
        #define SGX_CORE_ID                                                                             SGX_CORE_ID_531
        #define SGX_FEATURE_ADDRESS_SPACE_SIZE                                  (28)
+       #define SGX_FEATURE_NUM_USE_PIPES                                               (2)
        #define SGX_FEATURE_AUTOCLOCKGATING
        #define SGX_FEATURE_MULTI_EVENT_KICK
 #else
@@ -50,6 +53,7 @@
        #define SGX_FEATURE_MULTIPLE_MEM_CONTEXTS
        #define SGX_FEATURE_BIF_NUM_DIRLISTS                                    (16)
        #define SGX_FEATURE_2D_HARDWARE
+       #define SGX_FEATURE_NUM_USE_PIPES                                               (2)
        #define SGX_FEATURE_AUTOCLOCKGATING
        #define SUPPORT_SGX_GENERAL_MAPPING_HEAP
        #define SGX_FEATURE_EDM_VERTEX_PDSADDR_FULL_RANGE
@@ -58,6 +62,7 @@
        #define SGX_CORE_FRIENDLY_NAME                                                  "SGX540"
        #define SGX_CORE_ID                                                                             SGX_CORE_ID_540
        #define SGX_FEATURE_ADDRESS_SPACE_SIZE                                  (28)
+       #define SGX_FEATURE_NUM_USE_PIPES                                               (4)
        #define SGX_FEATURE_AUTOCLOCKGATING
        #define SGX_FEATURE_MULTI_EVENT_KICK
 #else
@@ -69,6 +74,7 @@
        #define SGX_FEATURE_ADDRESS_SPACE_SIZE                                  (32)
        #define SGX_FEATURE_MULTIPLE_MEM_CONTEXTS
        #define SGX_FEATURE_BIF_NUM_DIRLISTS                                    (8)
+       #define SGX_FEATURE_NUM_USE_PIPES                                               (4)
        #define SGX_FEATURE_AUTOCLOCKGATING
        #define SGX_FEATURE_MONOLITHIC_UKERNEL
        #define SGX_FEATURE_MULTI_EVENT_KICK
        #define SGX_FEATURE_ADDRESS_SPACE_SIZE                                  (32)
        #define SGX_FEATURE_MULTIPLE_MEM_CONTEXTS
        #define SGX_FEATURE_BIF_NUM_DIRLISTS                                    (8)
+       #define SGX_FEATURE_NUM_USE_PIPES                                               (4)
        #define SGX_FEATURE_AUTOCLOCKGATING
        #define SGX_FEATURE_MONOLITHIC_UKERNEL
        #define SGX_FEATURE_MULTI_EVENT_KICK
        #define SGX_FEATURE_MAX_TA_RENDER_TARGETS                               (512)
        #define SGX_FEATURE_SECONDARY_REQUIRES_USE_KICK
        #define SGX_FEATURE_WRITEBACK_DCU
-       
-       
+
+
        #define SGX_FEATURE_BIF_WIDE_TILING_AND_4K_ADDRESS
        #define SGX_FEATURE_MULTI_EVENT_KICK
        #define SGX_FEATURE_EDM_VERTEX_PDSADDR_FULL_RANGE
        #define SGX_FEATURE_ADDRESS_SPACE_SIZE                                  (32)
        #define SGX_FEATURE_MULTIPLE_MEM_CONTEXTS
        #define SGX_FEATURE_BIF_NUM_DIRLISTS                                    (8)
+       #define SGX_FEATURE_NUM_USE_PIPES                                               (8)
        #define SGX_FEATURE_AUTOCLOCKGATING
        #define SGX_FEATURE_MONOLITHIC_UKERNEL
        #define SGX_FEATURE_MULTI_EVENT_KICK
 #if defined(SGX_FEATURE_MP_CORE_COUNT_TA) && defined(SGX_FEATURE_MP_CORE_COUNT_3D)
 #if (SGX_FEATURE_MP_CORE_COUNT_TA > SGX_FEATURE_MP_CORE_COUNT_3D)
 #error Number of TA cores larger than number of 3D cores not supported in current driver
-#endif 
+#endif
 #else
 #if defined(SGX_FEATURE_MP_CORE_COUNT)
 #define SGX_FEATURE_MP_CORE_COUNT_TA           (SGX_FEATURE_MP_CORE_COUNT)
 #error Either SGX_FEATURE_MP_CORE_COUNT or \
 both SGX_FEATURE_MP_CORE_COUNT_TA and SGX_FEATURE_MP_CORE_COUNT_3D \
 must be defined when SGX_FEATURE_MP is defined
-#endif 
-#endif 
+#endif
+#endif
 #else
 #define SGX_FEATURE_MP_CORE_COUNT              (1)
 #define SGX_FEATURE_MP_CORE_COUNT_TA   (1)
 #define SGX_FEATURE_MP_CORE_COUNT_3D   (1)
-#endif 
+#endif
 
 #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) && !defined(SUPPORT_SGX_PRIORITY_SCHEDULING)
 #define SUPPORT_SGX_PRIORITY_SCHEDULING
old mode 100755 (executable)
new mode 100644 (file)
index 1b265f1..683f485
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -68,5 +68,5 @@
 #define SGX_MMU_PTE_CACHECONSISTENT            (0x00000008U)
 #define SGX_MMU_PTE_EDMPROTECT                 (0x00000010U)
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index e34561a..fb045ad
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #define EUR_CR_MASTER_SOFT_RESET_PTLA_RESET_SHIFT 10
 #define EUR_CR_MASTER_SOFT_RESET_PTLA_RESET_SIGNED 0
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 34bc7e9..8b15dd2
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -41,16 +41,16 @@ struct _BM_MAPPING_
 {
        enum
        {
-               hm_wrapped = 1,         
-               hm_wrapped_scatter,     
-               hm_wrapped_virtaddr, 
-               hm_wrapped_scatter_virtaddr, 
-               hm_env,                         
-               hm_contiguous           
+               hm_wrapped = 1,
+               hm_wrapped_scatter,
+               hm_wrapped_virtaddr,
+               hm_wrapped_scatter_virtaddr,
+               hm_env,
+               hm_contiguous
        } eCpuMemoryOrigin;
 
-       BM_HEAP                         *pBMHeap;       
-       RA_ARENA                        *pArena;        
+       BM_HEAP                         *pBMHeap;
+       RA_ARENA                        *pArena;
 
        IMG_CPU_VIRTADDR        CpuVAddr;
        IMG_CPU_PHYADDR         CpuPAddr;
@@ -83,7 +83,7 @@ struct _BM_HEAP_
        DEV_ARENA_DESCRIPTOR    sDevArena;
        MMU_HEAP                                *pMMUHeap;
        PDUMP_MMU_ATTRIB                *psMMUAttrib;
-       
+
        struct _BM_HEAP_                *psNext;
        struct _BM_HEAP_                **ppsThis;
 
@@ -94,23 +94,23 @@ struct _BM_CONTEXT_
 {
        MMU_CONTEXT     *psMMUContext;
 
-       
+
         BM_HEAP *psBMHeap;
 
-       
+
         BM_HEAP *psBMSharedHeap;
 
        PVRSRV_DEVICE_NODE *psDeviceNode;
 
-       
+
        HASH_TABLE *pBufferHash;
 
-       
+
        IMG_HANDLE hResItem;
 
        IMG_UINT32 ui32RefCount;
 
-       
+
 
        struct _BM_CONTEXT_ *psNext;
        struct _BM_CONTEXT_ **ppsThis;
old mode 100755 (executable)
new mode 100644 (file)
index 9df2c73..448ef58
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -30,9 +30,9 @@
 #if defined(__cplusplus)
 extern "C" {
 #endif
-       
-#include "ra.h"                
-#include "resman.h"            
+
+#include "ra.h"
+#include "resman.h"
 
 typedef struct _BM_CONTEXT_ BM_CONTEXT;
 
@@ -51,38 +51,38 @@ typedef IMG_UINT32 DEVICE_MEMORY_HEAP_TYPE;
 #define DEVICE_MEMORY_HEAP_SHARED_EXPORTED     3
 
 #define PVRSRV_DEVICE_NODE_FLAGS_PORT80DISPLAY 1
-#define PVRSRV_DEVICE_NODE_FLAGS_MMU_OPT_INV   2       
+#define PVRSRV_DEVICE_NODE_FLAGS_MMU_OPT_INV   2
 
 typedef struct _DEVICE_MEMORY_HEAP_INFO_
 {
-       
+
        IMG_UINT32                              ui32HeapID;
 
-       
+
        IMG_CHAR                                *pszName;
 
-       
+
        IMG_CHAR                                *pszBSName;
-       
-       
+
+
        IMG_DEV_VIRTADDR                sDevVAddrBase;
 
-       
+
        IMG_UINT32                              ui32HeapSize;
 
-       
+
        IMG_UINT32                              ui32Attribs;
 
-       
+
        DEVICE_MEMORY_HEAP_TYPE DevMemHeapType;
-       
-       
+
+
        IMG_HANDLE                              hDevMemHeap;
-       
-       
+
+
        RA_ARENA                                *psLocalDevMemArena;
 
-       
+
        IMG_UINT32                              ui32DataPageSize;
 
        IMG_UINT32                              ui32XTileStride;
@@ -91,30 +91,30 @@ typedef struct _DEVICE_MEMORY_HEAP_INFO_
 
 typedef struct _DEVICE_MEMORY_INFO_
 {
-       
+
        IMG_UINT32                              ui32AddressSpaceSizeLog2;
 
-       
+
 
 
        IMG_UINT32                              ui32Flags;
 
-       
+
        IMG_UINT32                              ui32HeapCount;
-       
-       
+
+
        IMG_UINT32                              ui32SyncHeapID;
-       
-       
+
+
        IMG_UINT32                              ui32MappingHeapID;
 
-       
+
        DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeap;
 
-       
+
     BM_CONTEXT                         *pBMKernelContext;
 
-       
+
     BM_CONTEXT                         *pBMContext;
 
 } DEVICE_MEMORY_INFO;
@@ -122,17 +122,17 @@ typedef struct _DEVICE_MEMORY_INFO_
 
 typedef struct DEV_ARENA_DESCRIPTOR_TAG
 {
-       IMG_UINT32                              ui32HeapID;             
+       IMG_UINT32                              ui32HeapID;
 
-       IMG_CHAR                                *pszName;               
+       IMG_CHAR                                *pszName;
 
-       IMG_DEV_VIRTADDR                BaseDevVAddr;   
+       IMG_DEV_VIRTADDR                BaseDevVAddr;
 
-       IMG_UINT32                              ui32Size;               
+       IMG_UINT32                              ui32Size;
 
        DEVICE_MEMORY_HEAP_TYPE DevMemHeapType;
 
-       
+
        IMG_UINT32                              ui32DataPageSize;
 
        DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeapInfo;
@@ -143,18 +143,18 @@ typedef struct DEV_ARENA_DESCRIPTOR_TAG
 typedef struct _PDUMP_MMU_ATTRIB_
 {
        PVRSRV_DEVICE_IDENTIFIER        sDevId;
-       
+
        IMG_CHAR        *pszPDRegRegion;
-       
-       
+
+
        IMG_UINT32 ui32DataPageMask;
 
-       
+
        IMG_UINT32 ui32PTEValid;
        IMG_UINT32 ui32PTSize;
        IMG_UINT32 ui32PTEAlignShift;
 
-       
+
        IMG_UINT32 ui32PDEMask;
        IMG_UINT32 ui32PDEAlignShift;
 
@@ -167,17 +167,17 @@ typedef struct _PVRSRV_DEVICE_NODE_
        PVRSRV_DEVICE_IDENTIFIER        sDevId;
        IMG_UINT32                                      ui32RefCount;
 
-       
 
-       
+
+
        PVRSRV_ERROR                    (*pfnInitDevice) (IMG_VOID*);
-       
+
        PVRSRV_ERROR                    (*pfnDeInitDevice) (IMG_VOID*);
 
-       
+
        PVRSRV_ERROR                    (*pfnInitDeviceCompatCheck) (struct _PVRSRV_DEVICE_NODE_*);
 
-       
+
        PVRSRV_ERROR                    (*pfnMMUInitialise)(struct _PVRSRV_DEVICE_NODE_*, MMU_CONTEXT**, IMG_DEV_PHYADDR*);
        IMG_VOID                                (*pfnMMUFinalise)(MMU_CONTEXT*);
        IMG_VOID                                (*pfnMMUInsertHeap)(MMU_CONTEXT*, MMU_HEAP*);
@@ -200,7 +200,7 @@ typedef struct _PVRSRV_DEVICE_NODE_
                                                                                          IMG_HANDLE hUniqueTag);
        IMG_VOID                                (*pfnMMUMapShadow)(MMU_HEAP            *pMMU,
                                                                                           IMG_DEV_VIRTADDR    MapBaseDevVAddr,
-                                                                                          IMG_SIZE_T          uSize, 
+                                                                                          IMG_SIZE_T          uSize,
                                                                                           IMG_CPU_VIRTADDR    CpuVAddr,
                                                                                           IMG_HANDLE          hOSMemHandle,
                                                                                           IMG_DEV_VIRTADDR    *pDevVAddr,
@@ -225,7 +225,7 @@ typedef struct _PVRSRV_DEVICE_NODE_
        IMG_VOID                                (*pfnMMUGetCacheFlushRange)(MMU_CONTEXT *pMMUContext, IMG_UINT32 *pui32RangeMask);
        IMG_VOID                                (*pfnMMUGetPDPhysAddr)(MMU_CONTEXT *pMMUContext, IMG_DEV_PHYADDR *psDevPAddr);
 
-       
+
        PVRSRV_ERROR                    (*pfnAllocMemTilingRange)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
                                                                                                                PVRSRV_KERNEL_MEM_INFO *psMemInfo,
                                                                                                                IMG_UINT32 ui32TilingStride,
@@ -233,47 +233,47 @@ typedef struct _PVRSRV_DEVICE_NODE_
        PVRSRV_ERROR                    (*pfnFreeMemTilingRange)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
                                                                                                                IMG_UINT32 ui32RangeIndex);
 
-       
+
        IMG_BOOL                                (*pfnDeviceISR)(IMG_VOID*);
-       
+
        IMG_VOID                                *pvISRData;
-       
+
        IMG_UINT32                              ui32SOCInterruptBit;
-       
+
        IMG_VOID                                (*pfnDeviceMISR)(IMG_VOID*);
 
-       
+
        IMG_VOID                                (*pfnDeviceCommandComplete)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode);
-       
+
        IMG_BOOL                                bReProcessDeviceCommandComplete;
 
        IMG_VOID                                (*pfnCacheInvalidate)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode);
 
-       
+
        DEVICE_MEMORY_INFO              sDevMemoryInfo;
 
-       
+
        IMG_VOID                                *pvDevice;
-       IMG_UINT32                              ui32pvDeviceSize; 
-               
-       
+       IMG_UINT32                              ui32pvDeviceSize;
+
+
        PRESMAN_CONTEXT                 hResManContext;
-       
-       
+
+
        PSYS_DATA                               psSysData;
-       
-       
+
+
        RA_ARENA                                *psLocalDevMemArena;
-       
+
        IMG_UINT32                              ui32Flags;
-       
+
        struct _PVRSRV_DEVICE_NODE_     *psNext;
        struct _PVRSRV_DEVICE_NODE_     **ppsThis;
-       
+
 #if defined(PDUMP)
-       
+
        PVRSRV_ERROR                    (*pfnPDumpInitDevice)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode);
-       
+
        IMG_UINT32                              (*pfnMMUGetContextID)(IMG_HANDLE hDevMemContext);
 #endif
 } PVRSRV_DEVICE_NODE;
@@ -299,7 +299,7 @@ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PollForValueKM(volatile IMG_UINT32*    pui32Li
                                                                                                        IMG_UINT32                              ui32PollPeriodus,
                                                                                                        IMG_BOOL                                bAllowPreemption);
 
-#endif 
+#endif
 
 
 #if defined (USING_ISR_INTERRUPTS)
@@ -307,7 +307,7 @@ PVRSRV_ERROR IMG_CALLCONV PollForInterruptKM(IMG_UINT32 ui32Value,
                                                                IMG_UINT32 ui32Mask,
                                                                IMG_UINT32 ui32Waitus,
                                                                IMG_UINT32 ui32Tries);
-#endif 
+#endif
 
 PVRSRV_ERROR IMG_CALLCONV PVRSRVInit(PSYS_DATA psSysData);
 IMG_VOID IMG_CALLCONV PVRSRVDeInit(PSYS_DATA psSysData);
@@ -318,6 +318,6 @@ IMG_VOID IMG_CALLCONV PVRSRVMISR(IMG_VOID *pvSysData);
 #if defined(__cplusplus)
 }
 #endif
-       
-#endif 
+
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 536fa56..7ff9360
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -65,13 +65,13 @@ typedef enum
 
 typedef enum
 {
-       
+
        PVRSRV_HANDLE_ALLOC_FLAG_NONE =                 0,
-       
+
        PVRSRV_HANDLE_ALLOC_FLAG_SHARED =               0x01,
-       
+
        PVRSRV_HANDLE_ALLOC_FLAG_MULTI =                0x02,
-       
+
        PVRSRV_HANDLE_ALLOC_FLAG_PRIVATE =              0x04
 } PVRSRV_HANDLE_ALLOC_FLAG;
 
@@ -119,7 +119,7 @@ PVRSRV_ERROR PVRSRVGetParentHandle(PVRSRV_HANDLE_BASE *psBase, IMG_PVOID *phPare
 PVRSRV_ERROR PVRSRVLookupAndReleaseHandle(PVRSRV_HANDLE_BASE *psBase, IMG_PVOID *ppvData, IMG_HANDLE hHandle, PVRSRV_HANDLE_TYPE eType);
 
 PVRSRV_ERROR PVRSRVReleaseHandle(PVRSRV_HANDLE_BASE *psBase, IMG_HANDLE hHandle, PVRSRV_HANDLE_TYPE eType);
-#endif 
+#endif
 
 PVRSRV_ERROR PVRSRVNewHandleBatch(PVRSRV_HANDLE_BASE *psBase, IMG_UINT32 ui32BatchSize);
 
@@ -143,7 +143,7 @@ PVRSRV_ERROR PVRSRVHandleInit(IMG_VOID);
 
 PVRSRV_ERROR PVRSRVHandleDeInit(IMG_VOID);
 
-#else  
+#else
 
 #define KERNEL_HANDLE_BASE IMG_NULL
 
@@ -196,7 +196,7 @@ static INLINE
 PVRSRV_ERROR PVRSRVLookupHandleAnyType(PVRSRV_HANDLE_BASE *psBase, IMG_PVOID *ppvData, PVRSRV_HANDLE_TYPE *peType, IMG_HANDLE hHandle)
 {
        PVR_UNREFERENCED_PARAMETER(psBase);
-       
+
        *peType = PVRSRV_HANDLE_TYPE_NONE;
 
        *ppvData = hHandle;
@@ -388,7 +388,7 @@ PVRSRV_ERROR PVRSRVHandleDeInit(IMG_VOID)
        return PVRSRV_OK;
 }
 
-#endif 
+#endif
 
 #define PVRSRVAllocHandleNR(psBase, phHandle, pvData, eType, eFlag) \
        (IMG_VOID)PVRSRVAllocHandle(psBase, phHandle, pvData, eType, eFlag)
@@ -400,5 +400,5 @@ PVRSRV_ERROR PVRSRVHandleDeInit(IMG_VOID)
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 3662089..47536af
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -76,5 +76,5 @@ IMG_VOID HASH_Dump (HASH_TABLE *pHash);
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index a02307a..5004b69
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
old mode 100755 (executable)
new mode 100644 (file)
index 69e1b3d..b1c74bd
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -36,7 +36,7 @@ extern "C" {
 #if defined(DEBUG) || defined(TIMING)
 
 
-typedef struct 
+typedef struct
 {
        IMG_UINT32 ui32Start;
        IMG_UINT32 ui32Stop;
@@ -44,7 +44,7 @@ typedef struct
        IMG_UINT32 ui32Count;
 } Temporal_Data;
 
-extern Temporal_Data asTimers[]; 
+extern Temporal_Data asTimers[];
 
 extern IMG_UINT32 PVRSRVTimeNow(IMG_VOID);
 extern IMG_VOID   PVRSRVSetupMetricTimers(IMG_VOID *pvDevInfo);
@@ -90,21 +90,21 @@ extern IMG_VOID   PVRSRVOutputMetricTotals(IMG_VOID);
 
 #if defined(__sh__)
 
-#define TST_REG   ((volatile IMG_UINT8 *) (psDevInfo->pvSOCRegsBaseKM))        
+#define TST_REG   ((volatile IMG_UINT8 *) (psDevInfo->pvSOCRegsBaseKM))
 
-#define TCOR_2    ((volatile IMG_UINT *)  (psDevInfo->pvSOCRegsBaseKM+28))     
-#define TCNT_2    ((volatile IMG_UINT *)  (psDevInfo->pvSOCRegsBaseKM+32))     
-#define TCR_2     ((volatile IMG_UINT16 *)(psDevInfo->pvSOCRegsBaseKM+36))     
+#define TCOR_2    ((volatile IMG_UINT *)  (psDevInfo->pvSOCRegsBaseKM+28))
+#define TCNT_2    ((volatile IMG_UINT *)  (psDevInfo->pvSOCRegsBaseKM+32))
+#define TCR_2     ((volatile IMG_UINT16 *)(psDevInfo->pvSOCRegsBaseKM+36))
 
 #define TIMER_DIVISOR  4
 
-#endif 
+#endif
 
 
 
 
 
-#else 
+#else
 
 
 
@@ -119,12 +119,12 @@ extern IMG_VOID   PVRSRVOutputMetricTotals(IMG_VOID);
 
 
 
-#endif 
+#endif
 
 #if defined(__cplusplus)
 }
 #endif
 
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 6e5cbd1..111a8c3
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -46,7 +46,7 @@ extern "C" {
 #endif
 
 
-       
+
        #define PVRSRV_PAGEABLE_SELECT          PVRSRV_OS_PAGEABLE_HEAP
 
 #define KERNEL_ID                      0xffffffffL
@@ -59,9 +59,9 @@ extern "C" {
 #define HOST_PAGEMASK                  (HOST_PAGESIZE()-1)
 #define HOST_PAGEALIGN(addr)   (((addr) + HOST_PAGEMASK) & ~HOST_PAGEMASK)
 
-#define PVRSRV_OS_HEAP_MASK                    0xf 
-#define PVRSRV_OS_PAGEABLE_HEAP                0x1 
-#define PVRSRV_OS_NON_PAGEABLE_HEAP    0x2 
+#define PVRSRV_OS_HEAP_MASK                    0xf
+#define PVRSRV_OS_PAGEABLE_HEAP                0x1
+#define PVRSRV_OS_NON_PAGEABLE_HEAP    0x2
 
 
 IMG_UINT32 OSClockus(IMG_VOID);
@@ -99,7 +99,7 @@ IMG_BOOL OSInvalidateCPUCacheRangeKM(IMG_HANDLE hOSMemHandle,
                                                                         IMG_VOID *pvRangeAddrStart,
                                                                         IMG_UINT32 ui32Length);
 
-#else 
+#else
 
 #ifdef INLINE_IS_PRAGMA
 #pragma inline(OSFlushCPUCacheKM)
@@ -150,19 +150,19 @@ static INLINE IMG_BOOL OSInvalidateCPUCacheRangeKM(IMG_HANDLE hOSMemHandle,
        return IMG_FALSE;
 }
 
-#endif 
+#endif
 
 #if defined(__linux__)
 PVRSRV_ERROR OSRegisterDiscontigMem(IMG_SYS_PHYADDR *pBasePAddr,
-                                                                       IMG_VOID *pvCpuVAddr, 
+                                                                       IMG_VOID *pvCpuVAddr,
                                                                        IMG_SIZE_T ui32Bytes,
-                                                                       IMG_UINT32 ui32Flags, 
+                                                                       IMG_UINT32 ui32Flags,
                                                                        IMG_HANDLE *phOSMemHandle);
 PVRSRV_ERROR OSUnRegisterDiscontigMem(IMG_VOID *pvCpuVAddr,
                                                                        IMG_SIZE_T ui32Bytes,
                                                                        IMG_UINT32 ui32Flags,
                                                                        IMG_HANDLE hOSMemHandle);
-#else  
+#else
 #ifdef INLINE_IS_PRAGMA
 #pragma inline(OSRegisterDiscontigMem)
 #endif
@@ -196,7 +196,7 @@ static INLINE PVRSRV_ERROR OSUnRegisterDiscontigMem(IMG_VOID *pvCpuVAddr,
 
        return PVRSRV_ERROR_NOT_SUPPORTED;
 }
-#endif 
+#endif
 
 
 #if defined(__linux__)
@@ -205,15 +205,15 @@ static INLINE PVRSRV_ERROR OSUnRegisterDiscontigMem(IMG_VOID *pvCpuVAddr,
 #endif
 static INLINE PVRSRV_ERROR OSReserveDiscontigPhys(IMG_SYS_PHYADDR *pBasePAddr, IMG_SIZE_T ui32Bytes, IMG_UINT32 ui32Flags, IMG_VOID **ppvCpuVAddr, IMG_HANDLE *phOSMemHandle)
 {
-#if defined(__linux__) 
+#if defined(__linux__)
        *ppvCpuVAddr = IMG_NULL;
-       return OSRegisterDiscontigMem(pBasePAddr, *ppvCpuVAddr, ui32Bytes, ui32Flags, phOSMemHandle);   
+       return OSRegisterDiscontigMem(pBasePAddr, *ppvCpuVAddr, ui32Bytes, ui32Flags, phOSMemHandle);
 #else
        extern IMG_CPU_PHYADDR SysSysPAddrToCpuPAddr(IMG_SYS_PHYADDR SysPAddr);
 
-       
+
        return OSReservePhys(SysSysPAddrToCpuPAddr(pBasePAddr[0]), ui32Bytes, ui32Flags, ppvCpuVAddr, phOSMemHandle);
-#endif 
+#endif
 }
 
 static INLINE PVRSRV_ERROR OSUnReserveDiscontigPhys(IMG_VOID *pvCpuVAddr, IMG_SIZE_T ui32Bytes, IMG_UINT32 ui32Flags, IMG_HANDLE hOSMemHandle)
@@ -221,10 +221,10 @@ static INLINE PVRSRV_ERROR OSUnReserveDiscontigPhys(IMG_VOID *pvCpuVAddr, IMG_SI
 #if defined(__linux__)
        OSUnRegisterDiscontigMem(pvCpuVAddr, ui32Bytes, ui32Flags, hOSMemHandle);
 #endif
-       
+
        return PVRSRV_OK;
 }
-#else  
+#else
 
 
 #ifdef INLINE_IS_PRAGMA
@@ -253,7 +253,7 @@ static INLINE PVRSRV_ERROR OSUnReserveDiscontigPhys(IMG_VOID *pvCpuVAddr, IMG_SI
 
        return PVRSRV_ERROR_NOT_SUPPORTED;
 }
-#endif 
+#endif
 
 PVRSRV_ERROR OSRegisterMem(IMG_CPU_PHYADDR BasePAddr,
                                                        IMG_VOID *pvCpuVAddr,
@@ -317,20 +317,20 @@ PVRSRV_ERROR OSFreePages(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID pv
        #define OSAllocPages(flags, size, pageSize, privdata, privdatalength, linAddr, pageAlloc) \
                (PVR_TRACE(("OSAllocPages(" #flags ", " #size ", " #pageSize ", " #linAddr ", " #pageAlloc "): (size = 0x%lx)", size)), \
                        OSAllocPages_Impl(flags, size, pageSize, linAddr, privdata, privdatalength, pageAlloc))
-               
+
        #define OSFreeMem(flags, size, linAddr, blockAlloc) \
                (PVR_TRACE(("OSFreeMem(" #flags ", " #size ", " #linAddr ", " #blockAlloc "): (pointer = 0x%X)", linAddr)), \
                        OSFreeMem_Debug_Wrapper(flags, size, linAddr, blockAlloc, __FILE__, __LINE__))
 #else
        #define OSAllocMem(flags, size, linAddr, blockAlloc, logString) \
                OSAllocMem_Debug_Wrapper(flags, size, linAddr, blockAlloc, __FILE__, __LINE__)
-       
+
        #define OSAllocPages OSAllocPages_Impl
-       
+
        #define OSFreeMem(flags, size, linAddr, blockAlloc) \
                        OSFreeMem_Debug_Wrapper(flags, size, linAddr, blockAlloc, __FILE__, __LINE__)
 #endif
+
 #ifdef PVRSRV_DEBUG_OS_MEMORY
 
        PVRSRV_ERROR OSAllocMem_Debug_Wrapper(IMG_UINT32 ui32Flags,
@@ -339,7 +339,7 @@ PVRSRV_ERROR OSFreePages(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID pv
                                                                                IMG_HANDLE *phBlockAlloc,
                                                                                IMG_CHAR *pszFilename,
                                                                                IMG_UINT32 ui32Line);
-       
+
        PVRSRV_ERROR OSFreeMem_Debug_Wrapper(IMG_UINT32 ui32Flags,
                                                                         IMG_UINT32 ui32Size,
                                                                         IMG_PVOID pvCpuVAddr,
@@ -349,7 +349,7 @@ PVRSRV_ERROR OSFreePages(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID pv
 
 
        typedef struct
-       {       
+       {
                IMG_UINT8 sGuardRegionBefore[8];
                IMG_CHAR sFileName[128];
                IMG_UINT32 uLineNo;
@@ -360,25 +360,25 @@ PVRSRV_ERROR OSFreePages(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID pv
                        isAllocated = 0x260511AA
                } eValid;
        } OSMEM_DEBUG_INFO;
-       
-       #define TEST_BUFFER_PADDING_STATUS (sizeof(OSMEM_DEBUG_INFO)) 
-       #define TEST_BUFFER_PADDING_AFTER  (8) 
+
+       #define TEST_BUFFER_PADDING_STATUS (sizeof(OSMEM_DEBUG_INFO))
+       #define TEST_BUFFER_PADDING_AFTER  (8)
        #define TEST_BUFFER_PADDING (TEST_BUFFER_PADDING_STATUS + TEST_BUFFER_PADDING_AFTER)
 #else
        #define OSAllocMem_Debug_Wrapper OSAllocMem_Debug_Linux_Memory_Allocations
        #define OSFreeMem_Debug_Wrapper OSFreeMem_Debug_Linux_Memory_Allocations
 #endif
+
 #if defined(__linux__) && defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
        PVRSRV_ERROR OSAllocMem_Impl(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID *ppvLinAddr, IMG_HANDLE *phBlockAlloc, IMG_CHAR *pszFilename, IMG_UINT32 ui32Line);
        PVRSRV_ERROR OSFreeMem_Impl(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID pvLinAddr, IMG_HANDLE hBlockAlloc, IMG_CHAR *pszFilename, IMG_UINT32 ui32Line);
-       
+
        #define OSAllocMem_Debug_Linux_Memory_Allocations OSAllocMem_Impl
        #define OSFreeMem_Debug_Linux_Memory_Allocations OSFreeMem_Impl
 #else
        PVRSRV_ERROR OSAllocMem_Impl(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID *ppvLinAddr, IMG_HANDLE *phBlockAlloc);
        PVRSRV_ERROR OSFreeMem_Impl(IMG_UINT32 ui32Flags, IMG_SIZE_T ui32Size, IMG_PVOID pvLinAddr, IMG_HANDLE hBlockAlloc);
-       
+
        #define OSAllocMem_Debug_Linux_Memory_Allocations(flags, size, addr, blockAlloc, file, line) \
                OSAllocMem_Impl(flags, size, addr, blockAlloc)
        #define OSFreeMem_Debug_Linux_Memory_Allocations(flags, size, addr, blockAlloc, file, line) \
@@ -441,7 +441,7 @@ PVRSRV_ERROR OSEventObjectOpenKM(PVRSRV_EVENTOBJECT *psEventObject,
                                                                                        IMG_HANDLE *phOSEvent);
 PVRSRV_ERROR OSEventObjectCloseKM(PVRSRV_EVENTOBJECT *psEventObject,
                                                                                        IMG_HANDLE hOSEventKM);
-#endif 
+#endif
 
 
 PVRSRV_ERROR OSBaseAllocContigMemory(IMG_SIZE_T ui32Size, IMG_CPU_VIRTADDR *pLinAddr, IMG_CPU_PHYADDR *pPhysAddr);
@@ -479,12 +479,12 @@ IMG_VOID OSBreakResourceLock(PVRSRV_RESOURCE *psResource, IMG_UINT32 ui32ID);
 PVRSRV_ERROR OSPowerLockWrap(IMG_BOOL bTryLock);
 
 IMG_VOID OSPowerLockUnwrap(IMG_VOID);
-#endif 
+#endif
+
 
 IMG_VOID OSWaitus(IMG_UINT32 ui32Timeus);
 
+
 IMG_VOID OSSleepms(IMG_UINT32 ui32Timems);
 
 IMG_HANDLE OSFuncHighResTimerCreate(IMG_VOID);
@@ -549,8 +549,8 @@ PVRSRV_ERROR OSCopyToUser(IMG_PVOID pvProcess, IMG_VOID *pvDest, IMG_VOID *pvSrc
 PVRSRV_ERROR OSCopyFromUser(IMG_PVOID pvProcess, IMG_VOID *pvDest, IMG_VOID *pvSrc, IMG_SIZE_T ui32Bytes);
 
 #if defined(__linux__)
-PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr, 
-                                                                       IMG_SIZE_T ui32Bytes, 
+PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr,
+                                                                       IMG_SIZE_T ui32Bytes,
                                                                        IMG_SYS_PHYADDR *psSysPAddr,
                                                                        IMG_HANDLE *phOSWrapMem);
 PVRSRV_ERROR OSReleasePhysPageAddr(IMG_HANDLE hOSWrapMem);
@@ -558,8 +558,8 @@ PVRSRV_ERROR OSReleasePhysPageAddr(IMG_HANDLE hOSWrapMem);
 #ifdef INLINE_IS_PRAGMA
 #pragma inline(OSAcquirePhysPageAddr)
 #endif
-static INLINE PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr, 
-                                                                                               IMG_SIZE_T ui32Bytes, 
+static INLINE PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr,
+                                                                                               IMG_SIZE_T ui32Bytes,
                                                                                                IMG_SYS_PHYADDR *psSysPAddr,
                                                                                                IMG_HANDLE *phOSWrapMem)
 {
@@ -567,7 +567,7 @@ static INLINE PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr,
        PVR_UNREFERENCED_PARAMETER(ui32Bytes);
        PVR_UNREFERENCED_PARAMETER(psSysPAddr);
        PVR_UNREFERENCED_PARAMETER(phOSWrapMem);
-       return PVRSRV_OK;       
+       return PVRSRV_OK;
 }
 #ifdef INLINE_IS_PRAGMA
 #pragma inline(OSReleasePhysPageAddr)
@@ -575,10 +575,10 @@ static INLINE PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID* pvCPUVAddr,
 static INLINE PVRSRV_ERROR OSReleasePhysPageAddr(IMG_HANDLE hOSWrapMem)
 {
        PVR_UNREFERENCED_PARAMETER(hOSWrapMem);
-       return PVRSRV_OK;       
+       return PVRSRV_OK;
 }
 #endif
-                                                                       
+
 #if defined(__linux__) && defined(__KERNEL__)
 
 #define        OS_SUPPORTS_IN_LISR
@@ -599,7 +599,7 @@ static inline IMG_VOID OSMemoryBarrier(IMG_VOID)
        mb();
 }
 
-#else 
+#else
 
 #ifdef INLINE_IS_PRAGMA
 #pragma inline(OSWriteMemoryBarrier)
@@ -611,11 +611,11 @@ static INLINE IMG_VOID OSWriteMemoryBarrier(IMG_VOID) { }
 #endif
 static INLINE IMG_VOID OSMemoryBarrier(IMG_VOID) { }
 
-#endif 
+#endif
 
 #if defined (__cplusplus)
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 02aa230..d4851e4
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -36,7 +36,7 @@ PVRSRV_ERROR OSPerProcessPrivateDataInit(IMG_HANDLE *phOsPrivateData);
 PVRSRV_ERROR OSPerProcessPrivateDataDeInit(IMG_HANDLE hOsPrivateData);
 
 PVRSRV_ERROR OSPerProcessSetHandleOptions(PVRSRV_HANDLE_BASE *psHandleBase);
-#else  
+#else
 #ifdef INLINE_IS_PRAGMA
 #pragma inline(OSPerProcessPrivateDataInit)
 #endif
@@ -66,11 +66,11 @@ static INLINE PVRSRV_ERROR OSPerProcessSetHandleOptions(PVRSRV_HANDLE_BASE *psHa
 
        return PVRSRV_OK;
 }
-#endif 
+#endif
 
 #if defined (__cplusplus)
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 9f68549..15e27a0
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -36,17 +36,17 @@ extern "C" {
 
 IMG_EXPORT IMG_VOID PDumpConnectionNotify(IMG_VOID);
 
-#endif 
+#endif
 
 typedef enum
 {
-       
+
        PDUMP_WRITE_MODE_CONTINUOUS = 0,
-       
+
        PDUMP_WRITE_MODE_LASTFRAME,
-       
+
        PDUMP_WRITE_MODE_BINCM,
-       
+
        PDUMP_WRITE_MODE_PERSISTENT
 } PDUMP_DDWMODE;
 
@@ -63,5 +63,5 @@ IMG_UINT32 PDumpOSDebugDriverWrite(   PDBG_STREAM psStream,
 #if defined (__cplusplus)
 }
 #endif
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 6c516e0..f3ddf4a
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -96,7 +96,7 @@ extern IMG_UINT32 g_ui32EveryLineCounter;
                                                                         IMG_BOOL bInitialisePages,
                                                                         IMG_HANDLE hUniqueTag1,
                                                                         IMG_HANDLE hUniqueTag2);
-                                                        
+
        PVRSRV_ERROR PDumpMemPTEntriesKM(PDUMP_MMU_ATTRIB *psMMUAttrib,
                                                                         IMG_HANDLE         hOSMemHandle,
                                                                         IMG_CPU_VIRTADDR       pvLinAddr,
@@ -297,9 +297,9 @@ extern IMG_UINT32 g_ui32EveryLineCounter;
                                                                  IMG_UINT32    ui32Flags);
 
        IMG_VOID PDumpVGXMemToFile(IMG_CHAR *pszFileName,
-                                                          IMG_UINT32 ui32FileOffset, 
+                                                          IMG_UINT32 ui32FileOffset,
                                                           PVRSRV_KERNEL_MEM_INFO *psMemInfo,
-                                                          IMG_UINT32 uiAddr, 
+                                                          IMG_UINT32 uiAddr,
                                                           IMG_UINT32 ui32Size,
                                                           IMG_UINT32 ui32PDumpFlags,
                                                           IMG_HANDLE hUniqueTag);
@@ -307,12 +307,12 @@ extern IMG_UINT32 g_ui32EveryLineCounter;
        IMG_VOID PDumpSuspendKM(IMG_VOID);
        IMG_VOID PDumpResumeKM(IMG_VOID);
 
-       
+
        PVRSRV_ERROR PDumpStoreMemToFile(PDUMP_MMU_ATTRIB *psMMUAttrib,
                                                                 IMG_CHAR *pszFileName,
-                                                                        IMG_UINT32 ui32FileOffset, 
+                                                                        IMG_UINT32 ui32FileOffset,
                                                                         PVRSRV_KERNEL_MEM_INFO *psMemInfo,
-                                                                        IMG_UINT32 uiAddr, 
+                                                                        IMG_UINT32 uiAddr,
                                                                         IMG_UINT32 ui32Size,
                                                                         IMG_UINT32 ui32PDumpFlags,
                                                                         IMG_HANDLE hUniqueTag);
@@ -408,5 +408,5 @@ extern IMG_UINT32 g_ui32EveryLineCounter;
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 4daacf4..d1b252f
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -34,7 +34,7 @@ extern "C" {
 #define MAX_PDUMP_STRING_LENGTH (256)
 
 
-       
+
 #define PDUMP_GET_SCRIPT_STRING()                              \
        IMG_HANDLE hScript;                                                     \
        IMG_UINT32      ui32MaxLen;                                             \
@@ -67,13 +67,13 @@ extern "C" {
        eError = PDumpOSGetFilenameString(&pszFileName, &ui32MaxLenFileName);\
        if(eError != PVRSRV_OK) return eError;
 
-       
+
        PVRSRV_ERROR PDumpOSGetScriptString(IMG_HANDLE *phScript, IMG_UINT32 *pui32MaxLen);
 
-       
+
        PVRSRV_ERROR PDumpOSGetMessageString(IMG_CHAR **ppszMsg, IMG_UINT32 *pui32MaxLen);
 
-       
+
        PVRSRV_ERROR PDumpOSGetFilenameString(IMG_CHAR **ppszFile, IMG_UINT32 *pui32MaxLen);
 
 
index e12bc2e..1fcbe47 100644 (file)
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -32,5 +32,5 @@
 #define PERFINIT()
 #define PERFDEINIT()
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 842680c..839e7da
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -48,27 +48,27 @@ typedef struct _PVRSRV_PER_PROCESS_DATA_
 #endif
        PVRSRV_HANDLE_BASE      *psHandleBase;
 #if defined (SUPPORT_SID_INTERFACE)
-       
+
        IMG_BOOL                bHandlesBatched;
 #else
 #if defined (PVR_SECURE_HANDLES)
-       
+
        IMG_BOOL                bHandlesBatched;
-#endif  
-#endif 
+#endif
+#endif
        IMG_UINT32              ui32RefCount;
 
-       
+
        IMG_BOOL                bInitProcess;
 #if defined(PDUMP)
-       
+
        IMG_BOOL                bPDumpPersistent;
 #if defined(SUPPORT_PDUMP_MULTI_PROCESS)
-       
+
        IMG_BOOL                bPDumpActive;
-#endif 
 #endif
-       
+#endif
+
        IMG_HANDLE              hOsPrivateData;
 } PVRSRV_PER_PROCESS_DATA;
 
@@ -122,5 +122,5 @@ IMG_HANDLE PVRSRVFindPerProcessPrivateData(IMG_VOID)
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 9e3dcc4..fcc1be0
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -32,7 +32,7 @@ extern "C" {
 #endif
 
 
+
 typedef struct _PVRSRV_POWER_DEV_TAG_
 {
        PFN_PRE_POWER                                   pfnPrePower;
@@ -50,11 +50,11 @@ typedef struct _PVRSRV_POWER_DEV_TAG_
 
 typedef enum _PVRSRV_INIT_SERVER_STATE_
 {
-       PVRSRV_INIT_SERVER_Unspecified          = -1,   
-       PVRSRV_INIT_SERVER_RUNNING                      = 0,    
-       PVRSRV_INIT_SERVER_RAN                          = 1,    
-       PVRSRV_INIT_SERVER_SUCCESSFUL           = 2,    
-       PVRSRV_INIT_SERVER_NUM                          = 3,    
+       PVRSRV_INIT_SERVER_Unspecified          = -1,
+       PVRSRV_INIT_SERVER_RUNNING                      = 0,
+       PVRSRV_INIT_SERVER_RAN                          = 1,
+       PVRSRV_INIT_SERVER_SUCCESSFUL           = 2,
+       PVRSRV_INIT_SERVER_NUM                          = 3,
        PVRSRV_INIT_SERVER_FORCE_I32 = 0x7fffffff
 
 } PVRSRV_INIT_SERVER_STATE, *PPVRSRV_INIT_SERVER_STATE;
@@ -116,5 +116,5 @@ IMG_VOID PVRSRVDevicePostClockSpeedChange(IMG_UINT32        ui32DeviceIndex,
 #if defined (__cplusplus)
 }
 #endif
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 974f6da..b6f2baf
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -55,7 +55,7 @@ IMG_VOID QueueDumpDebugInfo(IMG_VOID);
 IMG_IMPORT
 PVRSRV_ERROR PVRSRVProcessQueues (IMG_BOOL             bFlush);
 
-#if defined(__linux__) && defined(__KERNEL__) 
+#if defined(__linux__) && defined(__KERNEL__)
 #include <linux/types.h>
 #include <linux/seq_file.h>
 void* ProcSeqOff2ElementQueue(struct seq_file * sfile, loff_t off);
@@ -103,12 +103,12 @@ IMG_IMPORT
 PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32      ui32DevIndex,
                                                                           IMG_UINT32   ui32CmdCount);
 
-#endif 
+#endif
 
 
 #if defined (__cplusplus)
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 7476302..b26323f
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #include "hash.h"
 #include "osfunc.h"
 
-typedef struct _RA_ARENA_ RA_ARENA;                    
+typedef struct _RA_ARENA_ RA_ARENA;
 typedef struct _BM_MAPPING_ BM_MAPPING;
 
 
 
-#define RA_STATS 
+#define RA_STATS
 
 
 struct _RA_STATISTICS_
 {
-    
+
     IMG_SIZE_T uSpanCount;
 
-    
+
     IMG_SIZE_T uLiveSegmentCount;
 
-    
+
     IMG_SIZE_T uFreeSegmentCount;
 
-    
+
     IMG_SIZE_T uTotalResourceCount;
-    
-    
+
+
     IMG_SIZE_T uFreeResourceCount;
 
-    
+
     IMG_SIZE_T uCumulativeAllocs;
 
-    
+
     IMG_SIZE_T uCumulativeFrees;
 
-    
+
     IMG_SIZE_T uImportCount;
 
-    
+
     IMG_SIZE_T uExportCount;
 };
 typedef struct _RA_STATISTICS_ RA_STATISTICS;
@@ -83,7 +83,7 @@ RA_Create (IMG_CHAR *name,
            IMG_UINTPTR_T base,
            IMG_SIZE_T uSize,
            BM_MAPPING *psMapping,
-           IMG_SIZE_T uQuantum, 
+           IMG_SIZE_T uQuantum,
            IMG_BOOL (*imp_alloc)(IMG_VOID *_h,
                                 IMG_SIZE_T uSize,
                                 IMG_SIZE_T *pActualSize,
@@ -111,10 +111,10 @@ IMG_BOOL
 RA_Add (RA_ARENA *pArena, IMG_UINTPTR_T base, IMG_SIZE_T uSize);
 
 IMG_BOOL
-RA_Alloc (RA_ARENA *pArena, 
+RA_Alloc (RA_ARENA *pArena,
           IMG_SIZE_T uSize,
           IMG_SIZE_T *pActualSize,
-          BM_MAPPING **ppsMapping, 
+          BM_MAPPING **ppsMapping,
           IMG_UINT32 uFlags,
           IMG_UINT32 uAlignment,
           IMG_UINT32 uAlignmentOffset,
@@ -122,7 +122,7 @@ RA_Alloc (RA_ARENA *pArena,
           IMG_UINT32 ui32PrivDataLength,
           IMG_UINTPTR_T *pBase);
 
-IMG_VOID 
+IMG_VOID
 RA_Free (RA_ARENA *pArena, IMG_UINTPTR_T base, IMG_BOOL bFreeBackingStore);
 
 
@@ -150,14 +150,14 @@ IMG_BOOL RA_GetNextLiveSegment(IMG_HANDLE hArena, RA_SEGMENT_DETAILS *psSegDetai
 
 
 PVRSRV_ERROR RA_GetStats(RA_ARENA *pArena,
-                                                       IMG_CHAR **ppszStr, 
+                                                       IMG_CHAR **ppszStr,
                                                        IMG_UINT32 *pui32StrLen);
 
 PVRSRV_ERROR RA_GetStatsFreeMem(RA_ARENA *pArena,
-                                                               IMG_CHAR **ppszStr, 
+                                                               IMG_CHAR **ppszStr,
                                                                IMG_UINT32 *pui32StrLen);
 
-#endif 
+#endif
 
 #endif
 
index 1090aa4..5def933 100644 (file)
@@ -1,7 +1,27 @@
-/*************************************************************************/ /*!
-@Title          Services reference count debugging
-@Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
-@License        Strictly Confidential.
+/**********************************************************************
+ *
+ * Copyright (C) Imagination Technologies Ltd. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * The full GNU General Public License is included in this distribution in
+ * the file called "COPYING".
+ *
+ * Contact Information:
+ * Imagination Technologies Ltd. <gpl-support@imgtec.com>
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
+ *
 */ /**************************************************************************/
 
 #ifndef __REFCOUNT_H__
old mode 100755 (executable)
new mode 100644 (file)
index 648e490..a2f52e6
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -32,51 +32,51 @@ extern "C" {
 #endif
 
 enum {
-       
-       RESMAN_TYPE_SHARED_PB_DESC = 1,                                 
-       RESMAN_TYPE_SHARED_PB_DESC_CREATE_LOCK,                         
-       RESMAN_TYPE_HW_RENDER_CONTEXT,                                  
-       RESMAN_TYPE_HW_TRANSFER_CONTEXT,                                
-       RESMAN_TYPE_HW_2D_CONTEXT,                                              
-       RESMAN_TYPE_TRANSFER_CONTEXT,                                   
-
-       
-       RESMAN_TYPE_DMA_CLIENT_FIFO_DATA,                               
-
-       
-       
-       
-       
-       RESMAN_TYPE_DISPLAYCLASS_SWAPCHAIN_REF,                 
-       RESMAN_TYPE_DISPLAYCLASS_DEVICE,                                
-
-       
-       RESMAN_TYPE_BUFFERCLASS_DEVICE,                                 
-       
-       
-       RESMAN_TYPE_OS_USERMODE_MAPPING,                                
-       
-       
-       RESMAN_TYPE_DEVICEMEM_CONTEXT,                                  
-       RESMAN_TYPE_DEVICECLASSMEM_MAPPING,                             
-       RESMAN_TYPE_DEVICEMEM_MAPPING,                                  
-       RESMAN_TYPE_DEVICEMEM_WRAP,                                             
-       RESMAN_TYPE_DEVICEMEM_ALLOCATION,                               
-       RESMAN_TYPE_EVENT_OBJECT,                                               
-    RESMAN_TYPE_SHARED_MEM_INFO,                    
-    RESMAN_TYPE_MODIFY_SYNC_OPS,                                       
-    RESMAN_TYPE_SYNC_INFO,                                             
-       
-       
-       RESMAN_TYPE_KERNEL_DEVICEMEM_ALLOCATION                 
+
+       RESMAN_TYPE_SHARED_PB_DESC = 1,
+       RESMAN_TYPE_SHARED_PB_DESC_CREATE_LOCK,
+       RESMAN_TYPE_HW_RENDER_CONTEXT,
+       RESMAN_TYPE_HW_TRANSFER_CONTEXT,
+       RESMAN_TYPE_HW_2D_CONTEXT,
+       RESMAN_TYPE_TRANSFER_CONTEXT,
+
+
+       RESMAN_TYPE_DMA_CLIENT_FIFO_DATA,
+
+
+
+
+
+       RESMAN_TYPE_DISPLAYCLASS_SWAPCHAIN_REF,
+       RESMAN_TYPE_DISPLAYCLASS_DEVICE,
+
+
+       RESMAN_TYPE_BUFFERCLASS_DEVICE,
+
+
+       RESMAN_TYPE_OS_USERMODE_MAPPING,
+
+
+       RESMAN_TYPE_DEVICEMEM_CONTEXT,
+       RESMAN_TYPE_DEVICECLASSMEM_MAPPING,
+       RESMAN_TYPE_DEVICEMEM_MAPPING,
+       RESMAN_TYPE_DEVICEMEM_WRAP,
+       RESMAN_TYPE_DEVICEMEM_ALLOCATION,
+       RESMAN_TYPE_EVENT_OBJECT,
+    RESMAN_TYPE_SHARED_MEM_INFO,
+    RESMAN_TYPE_MODIFY_SYNC_OPS,
+    RESMAN_TYPE_SYNC_INFO,
+
+
+       RESMAN_TYPE_KERNEL_DEVICEMEM_ALLOCATION
 };
 
-#define RESMAN_CRITERIA_ALL                            0x00000000      
-#define RESMAN_CRITERIA_RESTYPE                        0x00000001      
-#define RESMAN_CRITERIA_PVOID_PARAM            0x00000002      
-#define RESMAN_CRITERIA_UI32_PARAM             0x00000004      
+#define RESMAN_CRITERIA_ALL                            0x00000000
+#define RESMAN_CRITERIA_RESTYPE                        0x00000001
+#define RESMAN_CRITERIA_PVOID_PARAM            0x00000002
+#define RESMAN_CRITERIA_UI32_PARAM             0x00000004
 
-typedef PVRSRV_ERROR (*RESMAN_FREE_FN)(IMG_PVOID pvParam, IMG_UINT32 ui32Param, IMG_BOOL bForceCleanup); 
+typedef PVRSRV_ERROR (*RESMAN_FREE_FN)(IMG_PVOID pvParam, IMG_UINT32 ui32Param, IMG_BOOL bForceCleanup);
 
 typedef struct _RESMAN_ITEM_ *PRESMAN_ITEM;
 typedef struct _RESMAN_CONTEXT_ *PRESMAN_CONTEXT;
@@ -85,18 +85,18 @@ PVRSRV_ERROR ResManInit(IMG_VOID);
 IMG_VOID ResManDeInit(IMG_VOID);
 
 PRESMAN_ITEM ResManRegisterRes(PRESMAN_CONTEXT hResManContext,
-                                                          IMG_UINT32           ui32ResType, 
-                                                          IMG_PVOID            pvParam, 
-                                                          IMG_UINT32           ui32Param, 
+                                                          IMG_UINT32           ui32ResType,
+                                                          IMG_PVOID            pvParam,
+                                                          IMG_UINT32           ui32Param,
                                                           RESMAN_FREE_FN       pfnFreeResource);
 
 PVRSRV_ERROR ResManFreeResByPtr(PRESMAN_ITEM   psResItem,
                                                                IMG_BOOL                bForceCleanup);
 
 PVRSRV_ERROR ResManFreeResByCriteria(PRESMAN_CONTEXT   hResManContext,
-                                                                        IMG_UINT32                     ui32SearchCriteria, 
-                                                                        IMG_UINT32                     ui32ResType, 
-                                                                        IMG_PVOID                      pvParam, 
+                                                                        IMG_UINT32                     ui32SearchCriteria,
+                                                                        IMG_UINT32                     ui32ResType,
+                                                                        IMG_PVOID                      pvParam,
                                                                         IMG_UINT32                     ui32Param);
 
 PVRSRV_ERROR ResManDissociateRes(PRESMAN_ITEM          psResItem,
@@ -114,5 +114,5 @@ IMG_VOID PVRSRVResManDisconnect(PRESMAN_CONTEXT hResManContext,
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 09ed87e..c8130d4
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -46,5 +46,5 @@
 #include "osfunc.h"
 #include "refcount.h"
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 474a1ee..f857238
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 extern "C" {
 #endif
 
-       
+
        #ifdef PVR_DISABLE_LOGGING
        #define PVR_LOG(X)
        #else
-        
+
        #define PVR_LOG(X)                      PVRSRVReleasePrintf X;
        #endif
 
@@ -58,7 +58,7 @@ extern "C" {
 }
 #endif
 
+
 #define LOOP_UNTIL_TIMEOUT(TIMEOUT) \
 {\
        IMG_UINT32 uiOffset, uiStart, uiCurrent; \
@@ -75,4 +75,4 @@ extern "C" {
 IMG_IMPORT
 const IMG_CHAR *PVRSRVGetErrorStringKM(PVRSRV_ERROR eError);
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 9e04b88..65d7bae
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -147,7 +147,7 @@ static INLINE IMG_VOID PVRSRVTimeTraceSysPhysAddr(IMG_UINT32 ui32Group, IMG_UINT
                                1, (IMG_UINT8 *) &psPAddr.uiAddr);
 }
 
-#else 
+#else
 
        #define PVR_TTRACE(group, class, token) \
                        ((void) 0)
@@ -170,7 +170,7 @@ static INLINE IMG_VOID PVRSRVTimeTraceSysPhysAddr(IMG_UINT32 ui32Group, IMG_UINT
        #define PVR_TTRACE_SYNC_OBJECT(group, token, syncobj, op) \
                        ((void) 0)
 
-#endif 
+#endif
 
 IMG_IMPORT PVRSRV_ERROR PVRSRVTimeTraceInit(IMG_VOID);
 IMG_IMPORT IMG_VOID PVRSRVTimeTraceDeinit(IMG_VOID);
@@ -181,4 +181,4 @@ IMG_IMPORT PVRSRV_ERROR PVRSRVTimeTraceBufferCreate(IMG_UINT32 ui32PID);
 IMG_IMPORT PVRSRV_ERROR PVRSRVTimeTraceBufferDestroy(IMG_UINT32 ui32PID);
 
 IMG_IMPORT IMG_VOID PVRSRVDumpTimeTraceBuffers(IMG_VOID);
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 5895b6c..dafcbee
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -76,6 +76,9 @@
  #define PVRSRV_TRACE_SYNC_WO_DEV_VADDR        5
  #define PVRSRV_TRACE_SYNC_RO_DEV_VADDR        6
  #define PVRSRV_TRACE_SYNC_OP          7
-#define PVRSRV_TRACE_TYPE_SYNC_SIZE    ((PVRSRV_TRACE_SYNC_OP + 1) * sizeof(IMG_UINT32))
+ #define PVRSRV_TRACE_SYNC_RO2P                8
+ #define PVRSRV_TRACE_SYNC_RO2C                9
+ #define PVRSRV_TRACE_SYNC_RO2_DEV_VADDR 10
+#define PVRSRV_TRACE_TYPE_SYNC_SIZE    ((PVRSRV_TRACE_SYNC_RO2_DEV_VADDR + 1) * sizeof(IMG_UINT32))
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 21ea5fb..0755016
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -81,4 +81,4 @@
 #define MKSYNC_TOKEN_CORE_CLK          1
 #define MKSYNC_TOKEN_UKERNEL_CLK       2
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 6bb1037..409b66e
@@ -1,34 +1,34 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #ifndef _SYSCOMMON_H
 #define _SYSCOMMON_H
 
-#include "sysconfig.h"      
-#include "sysinfo.h"           
+#include "sysconfig.h"
+#include "sysinfo.h"
 #include "servicesint.h"
 #include "queue.h"
 #include "power.h"
@@ -62,38 +62,38 @@ typedef IMG_UINT32 (*PFN_HTIMER_GETUS) (IMG_HANDLE);
 typedef IMG_VOID (*PFN_HTIMER_DESTROY) (IMG_HANDLE);
 typedef struct _SYS_DATA_TAG_
 {
-    IMG_UINT32                  ui32NumDevices;                
+    IMG_UINT32                  ui32NumDevices;
        SYS_DEVICE_ID                           sDeviceID[SYS_DEVICE_COUNT];
-    PVRSRV_DEVICE_NODE                 *psDeviceNodeList;                      
-    PVRSRV_POWER_DEV                   *psPowerDeviceList;                     
-       PVRSRV_RESOURCE                         sPowerStateChangeResource;      
-       PVRSRV_SYS_POWER_STATE          eCurrentPowerState;                     
-       PVRSRV_SYS_POWER_STATE          eFailedPowerState;                      
-       IMG_UINT32                                      ui32CurrentOSPowerState;        
-    PVRSRV_QUEUE_INFO           *psQueueList;                  
-       PVRSRV_KERNEL_SYNC_INFO         *psSharedSyncInfoList;          
-    IMG_PVOID                   pvEnvSpecificData;             
-    IMG_PVOID                   pvSysSpecificData;             
-       PVRSRV_RESOURCE                         sQProcessResource;                      
-       IMG_VOID                                        *pvSOCRegsBase;                         
-    IMG_HANDLE                  hSOCTimerRegisterOSMemHandle; 
-       IMG_UINT32                                      *pvSOCTimerRegisterKM;          
-       IMG_VOID                                        *pvSOCClockGateRegsBase;        
+    PVRSRV_DEVICE_NODE                 *psDeviceNodeList;
+    PVRSRV_POWER_DEV                   *psPowerDeviceList;
+       PVRSRV_RESOURCE                         sPowerStateChangeResource;
+       PVRSRV_SYS_POWER_STATE          eCurrentPowerState;
+       PVRSRV_SYS_POWER_STATE          eFailedPowerState;
+       IMG_UINT32                                      ui32CurrentOSPowerState;
+    PVRSRV_QUEUE_INFO           *psQueueList;
+       PVRSRV_KERNEL_SYNC_INFO         *psSharedSyncInfoList;
+    IMG_PVOID                   pvEnvSpecificData;
+    IMG_PVOID                   pvSysSpecificData;
+       PVRSRV_RESOURCE                         sQProcessResource;
+       IMG_VOID                                        *pvSOCRegsBase;
+    IMG_HANDLE                  hSOCTimerRegisterOSMemHandle;
+       IMG_UINT32                                      *pvSOCTimerRegisterKM;
+       IMG_VOID                                        *pvSOCClockGateRegsBase;
        IMG_UINT32                                      ui32SOCClockGateRegsSize;
-                                                                                                                       
+
        struct _DEVICE_COMMAND_DATA_ *apsDeviceCommandData[SYS_DEVICE_COUNT];
-                                                                                                                       
 
-       RA_ARENA                                        *apsLocalDevMemArena[SYS_MAX_LOCAL_DEVMEM_ARENAS]; 
 
-    IMG_CHAR                    *pszVersionString;          
+       RA_ARENA                                        *apsLocalDevMemArena[SYS_MAX_LOCAL_DEVMEM_ARENAS];
+
+    IMG_CHAR                    *pszVersionString;
 #if defined (SUPPORT_SID_INTERFACE)
-       PVRSRV_EVENTOBJECT_KM           *psGlobalEventObject;           
+       PVRSRV_EVENTOBJECT_KM           *psGlobalEventObject;
 #else
-       PVRSRV_EVENTOBJECT                      *psGlobalEventObject;           
+       PVRSRV_EVENTOBJECT                      *psGlobalEventObject;
 #endif
 
-       PVRSRV_MISC_INFO_CPUCACHEOP_TYPE ePendingCacheOpType;   
+       PVRSRV_MISC_INFO_CPUCACHEOP_TYPE ePendingCacheOpType;
 
        PFN_HTIMER_CREATE       pfnHighResTimerCreate;
        PFN_HTIMER_GETUS        pfnHighResTimerGetus;
@@ -168,10 +168,10 @@ extern SYS_DATA* gpsSysData;
 #endif
 static INLINE IMG_VOID SysAcquireData(SYS_DATA **ppsSysData)
 {
-       
+
        *ppsSysData = gpsSysData;
 
-       
+
 
 
 
@@ -184,7 +184,7 @@ static INLINE IMG_VOID SysAcquireData(SYS_DATA **ppsSysData)
 #endif
 static INLINE SYS_DATA * SysAcquireDataNoCheck(IMG_VOID)
 {
-       
+
        return gpsSysData;
 }
 
@@ -196,7 +196,7 @@ static INLINE PVRSRV_ERROR SysInitialiseCommon(SYS_DATA *psSysData)
 {
        PVRSRV_ERROR    eError;
 
-       
+
        eError = PVRSRVInit(psSysData);
 
        return eError;
@@ -207,18 +207,18 @@ static INLINE PVRSRV_ERROR SysInitialiseCommon(SYS_DATA *psSysData)
 #endif
 static INLINE IMG_VOID SysDeinitialiseCommon(SYS_DATA *psSysData)
 {
-       
+
        PVRSRVDeInit(psSysData);
 
        OSDestroyResource(&psSysData->sPowerStateChangeResource);
 }
-#endif 
+#endif
 
 
 #if !(defined(NO_HARDWARE) && defined(__linux__) && defined(__KERNEL__))
 #define        SysReadHWReg(p, o) OSReadHWReg(p, o)
 #define SysWriteHWReg(p, o, v) OSWriteHWReg(p, o, v)
-#else  
+#else
 static inline IMG_UINT32 SysReadHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset)
 {
        return (IMG_UINT32) readl(pvLinRegBaseAddr + ui32Offset);
@@ -228,7 +228,7 @@ static inline IMG_VOID SysWriteHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32
 {
        writel(ui32Value, pvLinRegBaseAddr + ui32Offset);
 }
-#endif 
+#endif
 
 #if defined(__cplusplus)
 }
old mode 100755 (executable)
new mode 100644 (file)
index 8564f97..c0b00ae
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -40,15 +40,15 @@ typedef struct OEM_ACCESS_INFO_TAG
 {
        IMG_UINT32              ui32Size;
        IMG_UINT32      ui32FBPhysBaseAddress;
-       IMG_UINT32              ui32FBMemAvailable;             
+       IMG_UINT32              ui32FBMemAvailable;
        IMG_UINT32      ui32SysPhysBaseAddress;
        IMG_UINT32              ui32SysSize;
        IMG_UINT32              ui32DevIRQ;
-} OEM_ACCESS_INFO, *POEM_ACCESS_INFO; 
+} OEM_ACCESS_INFO, *POEM_ACCESS_INFO;
+
 typedef IMG_UINT32   (*PFN_SRV_BRIDGEDISPATCH)( IMG_UINT32  Ioctl,
                                                                                                IMG_BYTE   *pInBuf,
-                                                                                               IMG_UINT32  InBufLen, 
+                                                                                               IMG_UINT32  InBufLen,
                                                                                            IMG_BYTE   *pOutBuf,
                                                                                                IMG_UINT32  OutBufLen,
                                                                                                IMG_UINT32 *pdwBytesTransferred);
@@ -68,5 +68,5 @@ typedef struct PVRSRV_DC_OEM_JTABLE_TAG
 }
 #endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index dfe8648..82fb651
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
old mode 100755 (executable)
new mode 100644 (file)
index 3a87972..e12845d
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -91,7 +91,7 @@ int BC_Video_ModInit(void);
 int BC_Video_ModCleanup(void);
 int BC_Video_Bridge(struct drm_device *dev, IMG_VOID *arg, struct drm_file *file_priv);
 
-#endif 
+#endif
 
-#endif 
+#endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 400f14c..920d397
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 
 #else
 
-#define DRM_PSB_STOLEN_MEMORY  0x0B
-#define DRM_PSB_PLACEMENT_OFFSET   0x13
-
-#define DRM_PVR_RESERVED1      0x0D
-#define DRM_PVR_RESERVED2      0x0E
-#define DRM_PVR_RESERVED3      0x0F
-#define DRM_PVR_RESERVED4      0x10
-#define DRM_PVR_RESERVED5      0x11
-#define DRM_PVR_RESERVED6      0x12
+#define        pvr_put_user    put_user
+#define        pvr_get_user    get_user
 
 #endif
 
 #define DRM_PSB_VT_LEAVE       0x02
 #define DRM_PSB_VT_ENTER       0x03
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index f170e31..b4fdc31
@@ -2,26 +2,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -67,8 +67,8 @@ extern struct drm_device *gpDrmDevice;
 #endif
 
 #define SYS_SGX_CLOCK_SPEED                    (400000000)
-#define SYS_SGX_HWRECOVERY_TIMEOUT_FREQ                (100) 
-#define SYS_SGX_PDS_TIMER_FREQ                 (1000) 
+#define SYS_SGX_HWRECOVERY_TIMEOUT_FREQ                (100)
+#define SYS_SGX_PDS_TIMER_FREQ                 (1000)
 #define SYS_SGX_ACTIVE_POWER_LATENCY_MS                (5)
 
 #if defined(SUPPORT_DRI_DRM_EXT)
@@ -84,7 +84,7 @@ static SYS_SPECIFIC_DATA gsSysSpecificData;
 
 #if defined(DRM_PVR_USE_INTEL_FB)
 IMG_UINT32 gui32SGXDeviceID;
-#else 
+#else
 static IMG_UINT32 gui32SGXDeviceID;
 #endif
 #if defined(PVR_MDFLD_SYS_MSVDX_AND_TOPAZ)
@@ -137,14 +137,14 @@ static PVRSRV_ERROR PCIInitDev(SYS_DATA *psSysData)
 
        psSysSpecData->hSGXPCI = OSPCISetDev((IMG_VOID *)psSysSpecData->psPCIDev, 0);
        ui32MaxOffset = (IS_MRST(psSysSpecData->psDRMDev) || IS_MDFLD(psSysSpecData->psDRMDev)) ? MRST_MAX_OFFSET : POULSBO_MAX_OFFSET;
-       
-#else  
+
+#else
 #if defined(LDM_PCI) || defined(SUPPORT_DRI_DRM)
        psSysSpecData->hSGXPCI = OSPCISetDev((IMG_VOID *)psSysSpecData->psPCIDev, HOST_PCI_INIT_FLAG_BUS_MASTER | HOST_PCI_INIT_FLAG_MSI);
 #else
        psSysSpecData->hSGXPCI = OSPCIAcquireDev(SYS_SGX_DEV_VENDOR_ID, SYS_SGX_DEV_DEVICE_ID, HOST_PCI_INIT_FLAG_BUS_MASTER | HOST_PCI_INIT_FLAG_MSI);
 #endif
-#endif 
+#endif
        if (!psSysSpecData->hSGXPCI)
        {
                PVR_DPF((PVR_DBG_ERROR,"PCIInitDev: Failed to acquire PCI device"));
@@ -157,14 +157,14 @@ static PVRSRV_ERROR PCIInitDev(SYS_DATA *psSysData)
 #if defined(SGX_FEATURE_HOST_PORT)
        PVR_TRACE(("Host Port region: %x to %x", OSPCIAddrRangeStart(psSysSpecData->hSGXPCI, POULSBO_HP_ADDR_RANGE_INDEX), OSPCIAddrRangeEnd(psSysSpecData->hSGXPCI, POULSBO_HP_ADDR_RANGE_INDEX)));
 #endif
-       
+
        if (OSPCIAddrRangeLen(psSysSpecData->hSGXPCI, POULSBO_ADDR_RANGE_INDEX) < ui32MaxOffset)
        {
                PVR_DPF((PVR_DBG_ERROR,"PCIInitDev: Device memory region isn't big enough"));
                return PVRSRV_ERROR_PCI_REGION_TOO_SMALL;
        }
 
-       
+
        if (OSPCIRequestAddrRange(psSysSpecData->hSGXPCI, POULSBO_ADDR_RANGE_INDEX) != PVRSRV_OK)
        {
                PVR_DPF((PVR_DBG_ERROR,"PCIInitDev: Device memory region not available"));
@@ -172,16 +172,16 @@ static PVRSRV_ERROR PCIInitDev(SYS_DATA *psSysData)
 
        }
         SYS_SPECIFIC_DATA_SET(psSysSpecData, SYS_SPECIFIC_DATA_PCI_REQUEST_SGX_ADDR_RANGE);
-       
+
 #if defined(SGX_FEATURE_HOST_PORT)
-       
+
        if (OSPCIRequestAddrRange(psSysSpecData->hSGXPCI, POULSBO_HP_ADDR_RANGE_INDEX) != PVRSRV_OK)
        {
                PVR_DPF((PVR_DBG_ERROR,"PCIInitDev: Host Port region not available"));
                return PVRSRV_ERROR_PCI_REGION_UNAVAILABLE;
        }
         SYS_SPECIFIC_DATA_SET(psSysSpecData, SYS_SPECIFIC_DATA_PCI_REQUEST_HOST_PORT_RANGE);
-#endif 
+#endif
        return PVRSRV_OK;
 }
 
@@ -233,11 +233,11 @@ static PVRSRV_ERROR SysLocateDevices(SYS_DATA *psSysData)
 #endif
        PVR_TRACE(("IRQ: %d", ui32IRQ));
 
-       
+
        gsSGXDeviceMap.ui32Flags = 0x0;
        gsSGXDeviceMap.ui32IRQ = ui32IRQ;
 
-       
+
 #if defined(SUPPORT_DRI_DRM_EXT)
        gsSGXDeviceMap.sRegsSysPBase.uiAddr = ui32BaseAddr + ((IS_MRST(psSysSpecData->psDRMDev) || IS_MDFLD(psSysSpecData->psDRMDev)) ? MRST_SGX_REGS_OFFSET : POULSBO_SGX_REGS_OFFSET);
 #else
@@ -245,22 +245,22 @@ static PVRSRV_ERROR SysLocateDevices(SYS_DATA *psSysData)
 #endif
        gsSGXDeviceMap.sRegsCpuPBase = SysSysPAddrToCpuPAddr(gsSGXDeviceMap.sRegsSysPBase);
        gsSGXDeviceMap.ui32RegsSize = SGX_REG_SIZE;
-       
+
 #if defined(SGX_FEATURE_HOST_PORT)
-       
+
        gsSGXDeviceMap.ui32Flags = SGX_HOSTPORT_PRESENT;
        gsSGXDeviceMap.sHPSysPBase.uiAddr = ui32HostPortAddr;
        gsSGXDeviceMap.sHPCpuPBase = SysSysPAddrToCpuPAddr(gsSGXDeviceMap.sHPSysPBase);
        gsSGXDeviceMap.ui32HPSize = SYS_SGX_HP_SIZE;
-#endif         
+#endif
 
 #if defined(MRST_SLAVEPORT)
-       
+
        gsSGXDeviceMap.sSPSysPBase.uiAddr = ui32BaseAddr + MRST_SGX_SP_OFFSET;
        gsSGXDeviceMap.sSPCpuPBase = SysSysPAddrToCpuPAddr(gsSGXDeviceMap.sSPSysPBase);
        gsSGXDeviceMap.ui32SPSize = SGX_SP_SIZE;
 #endif
-       
+
 
 
 
@@ -278,7 +278,7 @@ static PVRSRV_ERROR SysLocateDevices(SYS_DATA *psSysData)
 
 
 #if !defined(NO_HARDWARE)
-       
+
        {
                IMG_SYS_PHYADDR sPoulsboRegsCpuPBase;
                sPoulsboRegsCpuPBase.uiAddr = ui32BaseAddr + POULSBO_REGS_OFFSET;
@@ -296,7 +296,7 @@ static PVRSRV_ERROR SysLocateDevices(SYS_DATA *psSysData)
 #endif
 #if defined(PDUMP)
        {
-               
+
                static IMG_CHAR pszPDumpDevName[] = "SGXMEM";
                gsSGXDeviceMap.pszPDumpDevName = pszPDumpDevName;
        }
@@ -361,7 +361,7 @@ static PVRSRV_ERROR SysCreateVersionString(SYS_DATA *psSysData)
                     ui32MaxStrLen + 1,
                     pszVersionString,
                     IMG_NULL);
-               
+
                return PVRSRV_ERROR_INVALID_PARAMS;
     }
 
@@ -371,7 +371,7 @@ static PVRSRV_ERROR SysCreateVersionString(SYS_DATA *psSysData)
 }
 
 static IMG_VOID SysFreeVersionString(SYS_DATA *psSysData)
-{ 
+{
     if(psSysData->pszVersionString)
     {
         IMG_UINT32 ui32MaxStrLen;
@@ -401,12 +401,12 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
        gpsSysData->pvSysSpecificData = &gsSysSpecificData;
        gsSysSpecificData.ui32SysSpecificData = 0;
 #if defined(LDM_PCI) || defined(SUPPORT_DRI_DRM)
-       
+
        PVR_ASSERT(gpsPVRLDMDev != IMG_NULL);
        gsSysSpecificData.psPCIDev = gpsPVRLDMDev;
 #endif
 #if defined(SUPPORT_DRI_DRM)
-       
+
        PVR_ASSERT(gpsPVRDRMDev != IMG_NULL);
        gsSysSpecificData.psDRMDev = gpsPVRDRMDev;
 #endif
@@ -420,17 +420,17 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
                return eError;
        }
 
-       
+
        psTimingInfo = &gsSGXDeviceMap.sTimingInfo;
        psTimingInfo->ui32CoreClockSpeed = SYS_SGX_CLOCK_SPEED;
-       psTimingInfo->ui32HWRecoveryFreq = SYS_SGX_HWRECOVERY_TIMEOUT_FREQ; 
+       psTimingInfo->ui32HWRecoveryFreq = SYS_SGX_HWRECOVERY_TIMEOUT_FREQ;
 #if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
        psTimingInfo->bEnableActivePM = IMG_TRUE;
-#else  
+#else
        psTimingInfo->bEnableActivePM = IMG_FALSE;
-#endif 
-       psTimingInfo->ui32ActivePowManLatencyms = SYS_SGX_ACTIVE_POWER_LATENCY_MS; 
-       psTimingInfo->ui32uKernelFreq = SYS_SGX_PDS_TIMER_FREQ; 
+#endif
+       psTimingInfo->ui32ActivePowManLatencyms = SYS_SGX_ACTIVE_POWER_LATENCY_MS;
+       psTimingInfo->ui32uKernelFreq = SYS_SGX_PDS_TIMER_FREQ;
 
        eError = PCIInitDev(gpsSysData);
        if (eError != PVRSRV_OK)
@@ -442,7 +442,7 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
 
        gpsSysData->ui32NumDevices = SYS_DEVICE_COUNT;
 
-       
+
        for(i=0; i<SYS_DEVICE_COUNT; i++)
        {
                gpsSysData->sDeviceID[i].uiID = i;
@@ -460,8 +460,8 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
                gpsSysData = IMG_NULL;
                return eError;
        }
-       
-       
+
+
 
 
 
@@ -487,7 +487,7 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
 
 #ifdef CONFIG_MDFD_VIDEO_DECODE
 #if defined(PVR_MDFLD_SYS_MSVDX_AND_TOPAZ)
-       
+
        eError = PVRSRVRegisterDevice(gpsSysData, MSVDXRegisterDevice,
                                      DEVICE_MSVDX_INTERRUPT, &gui32MRSTMSVDXDeviceID);
        if (eError != PVRSRV_OK)
@@ -500,7 +500,7 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
 
        if (IS_MDFLD(gpDrmDevice) && !dev_priv->topaz_disabled)
        {
-               
+
                eError = PVRSRVRegisterDevice(gpsSysData, TOPAZRegisterDevice,
                                              DEVICE_TOPAZ_INTERRUPT, &gui32MRSTTOPAZDeviceID);
                if (eError != PVRSRV_OK)
@@ -513,34 +513,34 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
        }
 #endif
 #endif
-       
+
 
 
        psDeviceNode = gpsSysData->psDeviceNodeList;
 
        while(psDeviceNode)
        {
-               
+
                switch(psDeviceNode->sDevId.eDeviceType)
                {
                        case PVRSRV_DEVICE_TYPE_SGX:
                        {
                                DEVICE_MEMORY_INFO *psDevMemoryInfo;
                                DEVICE_MEMORY_HEAP_INFO *psDeviceMemoryHeap;
-                               
-                               
+
+
                                psDeviceNode->psLocalDevMemArena = IMG_NULL;
-                               
-                               
+
+
                                psDevMemoryInfo = &psDeviceNode->sDevMemoryInfo;
                                psDeviceMemoryHeap = psDevMemoryInfo->psDeviceMemoryHeap;
-                               
-                               
+
+
                                for(i=0; i<psDevMemoryInfo->ui32HeapCount; i++)
                                {
                                        psDeviceMemoryHeap[i].ui32Attribs |= PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG;
 #ifdef OEM_CUSTOMISE
-                                       
+
 #endif
                                }
 #if defined(SUPPORT_DRI_DRM_EXT)
@@ -550,7 +550,7 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
                        }
 #if defined(PVR_MDFLD_SYS_MSVDX_AND_TOPAZ)
                        case PVRSRV_DEVICE_TYPE_MSVDX:
-                       
+
                        break;
                        case PVRSRV_DEVICE_TYPE_TOPAZ:
                        break;
@@ -562,14 +562,14 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
                        }
                }
 
-               
+
                psDeviceNode = psDeviceNode->psNext;
        }
 
        PDUMPINIT();
        SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_PDUMP_INIT);
 
-       
+
        eError = PVRSRVInitialiseDevice (gui32SGXDeviceID);
        if (eError != PVRSRV_OK)
        {
@@ -615,15 +615,15 @@ static IMG_VOID SysEnableInterrupts(SYS_DATA *psSysData)
 
        ui32Mask = POULSBO_THALIA_MASK;
 
-       
+
        ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_IDENTITY_REG);
        OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_IDENTITY_REG, ui32RegData | ui32Mask);
 
-       
+
        ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_MASK_REG);
        OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_MASK_REG, ui32RegData & (~ui32Mask));
 
-       
+
        ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG);
        OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG, ui32RegData | ui32Mask);
 
@@ -631,7 +631,7 @@ static IMG_VOID SysEnableInterrupts(SYS_DATA *psSysData)
 #endif
        PVR_UNREFERENCED_PARAMETER(psSysData);
 }
-#endif 
+#endif
 
 #if !defined(SUPPORT_DRI_DRM_EXT)
 static IMG_VOID SysDisableInterrupts(SYS_DATA *psSysData)
@@ -641,11 +641,11 @@ static IMG_VOID SysDisableInterrupts(SYS_DATA *psSysData)
        IMG_UINT32 ui32Mask;
        ui32Mask = POULSBO_THALIA_MASK;
 
-       
+
        ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG);
        OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG, ui32RegData & (~ui32Mask));
 
-       
+
        ui32RegData = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_MASK_REG);
        OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_MASK_REG, ui32RegData | ui32Mask);
 
@@ -653,13 +653,13 @@ static IMG_VOID SysDisableInterrupts(SYS_DATA *psSysData)
 #endif
        PVR_UNREFERENCED_PARAMETER(psSysData);
 }
-#endif 
+#endif
 
 PVRSRV_ERROR SysFinalise(IMG_VOID)
 {
        PVRSRV_ERROR eError = PVRSRV_OK;
 
-       
+
        eError = OSInstallMISR(gpsSysData);
        if (eError != PVRSRV_OK)
        {
@@ -676,7 +676,7 @@ PVRSRV_ERROR SysFinalise(IMG_VOID)
                return eError;
        }
        SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_LISR_INSTALLED);
-#endif 
+#endif
 
 #if (defined(SYS_USING_INTERRUPTS) && !defined(SUPPORT_DRI_DRM_EXT))
        SysEnableInterrupts(gpsSysData);
@@ -684,7 +684,7 @@ PVRSRV_ERROR SysFinalise(IMG_VOID)
 #endif
 
 #if defined(__linux__)
-       
+
        eError = SysCreateVersionString(gpsSysData);
        if (eError != PVRSRV_OK)
        {
@@ -724,7 +724,7 @@ PVRSRV_ERROR SysDeinitialise (SYS_DATA *psSysData)
                        return eError;
                }
        }
-#endif 
+#endif
 
        if (SYS_SPECIFIC_DATA_TEST(psSysSpecData, SYS_SPECIFIC_DATA_MISR_INSTALLED))
        {
@@ -738,7 +738,7 @@ PVRSRV_ERROR SysDeinitialise (SYS_DATA *psSysData)
 
        if (SYS_SPECIFIC_DATA_TEST(psSysSpecData, SYS_SPECIFIC_DATA_SGX_INITIALISED))
        {
-               
+
                eError = PVRSRVDeinitialiseDevice(gui32SGXDeviceID);
                if (eError != PVRSRV_OK)
                {
@@ -762,7 +762,7 @@ PVRSRV_ERROR SysDeinitialise (SYS_DATA *psSysData)
 
 
 #if !defined(NO_HARDWARE)
-       
+
        OSUnMapPhysToLin(gsPoulsboRegsCPUVaddr,
                                                                                         POULSBO_REG_SIZE,
                                                                                         PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
@@ -794,7 +794,7 @@ IMG_UINT32 SysGetInterruptSource(SYS_DATA* psSysData,
        PVR_UNREFERENCED_PARAMETER(psSysData);
        PVR_UNREFERENCED_PARAMETER(psDeviceNode);
 
-       
+
        ui32Data = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_IDENTITY_REG);
 
        if (ui32Data & POULSBO_THALIA_MASK)
@@ -807,23 +807,23 @@ IMG_UINT32 SysGetInterruptSource(SYS_DATA* psSysData,
                ui32Devices |= DEVICE_MSVDX_INTERRUPT;
        }
 
-       
+
        ui32DIMMask = OSReadHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_ENABLE_REG);
        ui32DIMMask &= ~(POULSBO_THALIA_MASK | POULSBO_MSVDX_MASK);
 
-       
+
        if (ui32Data & ui32DIMMask)
        {
                ui32Devices |= DEVICE_DISP_INTERRUPT;
        }
 
        return (ui32Devices);
-#else  
+#else
        PVR_UNREFERENCED_PARAMETER(psSysData);
        PVR_UNREFERENCED_PARAMETER(psDeviceNode);
 
        return 0;
-#endif 
+#endif
 }
 
 IMG_VOID SysClearInterrupts(SYS_DATA* psSysData, IMG_UINT32 ui32ClearBits)
@@ -858,21 +858,21 @@ IMG_VOID SysClearInterrupts(SYS_DATA* psSysData, IMG_UINT32 ui32ClearBits)
        {
                OSWriteHWReg(gsPoulsboRegsCPUVaddr, POULSBO_INTERRUPT_IDENTITY_REG, ui32Mask);
        }
-#else  
+#else
        PVR_UNREFERENCED_PARAMETER(psSysData);
        PVR_UNREFERENCED_PARAMETER(ui32ClearBits);
-#endif 
+#endif
 }
 
 
-PVRSRV_ERROR SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE eDeviceType, 
+PVRSRV_ERROR SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE eDeviceType,
                                                                        IMG_VOID **ppvDeviceMap)
 {
        switch(eDeviceType)
        {
                case PVRSRV_DEVICE_TYPE_SGX:
                {
-                       
+
                        *ppvDeviceMap = (IMG_VOID*)&gsSGXDeviceMap;
                        break;
                }
@@ -881,18 +881,18 @@ PVRSRV_ERROR SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE eDeviceType,
                        PVR_DPF((PVR_DBG_ERROR,"SysGetDeviceMemoryMap: unsupported device type"));
                }
        }
-       return PVRSRV_OK;       
+       return PVRSRV_OK;
 }
 
 
-IMG_DEV_PHYADDR SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE eDeviceType, 
+IMG_DEV_PHYADDR SysCpuPAddrToDevPAddr (PVRSRV_DEVICE_TYPE eDeviceType,
                                                                                IMG_CPU_PHYADDR CpuPAddr)
 {
        IMG_DEV_PHYADDR DevPAddr;
 
        PVR_UNREFERENCED_PARAMETER(eDeviceType);
 
-       
+
        DevPAddr.uiAddr = CpuPAddr.uiAddr;
 
        return DevPAddr;
@@ -903,7 +903,7 @@ IMG_CPU_PHYADDR SysSysPAddrToCpuPAddr (IMG_SYS_PHYADDR sys_paddr)
 {
        IMG_CPU_PHYADDR cpu_paddr;
 
-       
+
        cpu_paddr.uiAddr = sys_paddr.uiAddr;
        return cpu_paddr;
 }
@@ -911,8 +911,8 @@ IMG_CPU_PHYADDR SysSysPAddrToCpuPAddr (IMG_SYS_PHYADDR sys_paddr)
 IMG_SYS_PHYADDR SysCpuPAddrToSysPAddr (IMG_CPU_PHYADDR cpu_paddr)
 {
        IMG_SYS_PHYADDR sys_paddr;
-       
-       
+
+
        sys_paddr.uiAddr = cpu_paddr.uiAddr;
        return sys_paddr;
 }
@@ -924,9 +924,9 @@ IMG_DEV_PHYADDR SysSysPAddrToDevPAddr (PVRSRV_DEVICE_TYPE eDeviceType, IMG_SYS_P
 
        PVR_UNREFERENCED_PARAMETER(eDeviceType);
 
-       
+
     DevPAddr.uiAddr = SysPAddr.uiAddr;
-    
+
     return DevPAddr;
 }
 
@@ -937,7 +937,7 @@ IMG_SYS_PHYADDR SysDevPAddrToSysPAddr (PVRSRV_DEVICE_TYPE eDeviceType, IMG_DEV_P
 
        PVR_UNREFERENCED_PARAMETER(eDeviceType);
 
-    
+
     SysPAddr.uiAddr = DevPAddr.uiAddr;
 
     return SysPAddr;
@@ -946,8 +946,8 @@ IMG_SYS_PHYADDR SysDevPAddrToSysPAddr (PVRSRV_DEVICE_TYPE eDeviceType, IMG_DEV_P
 
 IMG_VOID SysRegisterExternalDevice(PVRSRV_DEVICE_NODE *psDeviceNode)
 {
-  
-  psDeviceNode->ui32SOCInterruptBit = DEVICE_DISP_INTERRUPT;   
+
+  psDeviceNode->ui32SOCInterruptBit = DEVICE_DISP_INTERRUPT;
 }
 
 
@@ -956,7 +956,7 @@ IMG_VOID SysRemoveExternalDevice(PVRSRV_DEVICE_NODE *psDeviceNode)
        PVR_UNREFERENCED_PARAMETER(psDeviceNode);
 }
 
-PVRSRV_ERROR SysOEMFunction (  IMG_UINT32      ui32ID, 
+PVRSRV_ERROR SysOEMFunction (  IMG_UINT32      ui32ID,
                                                                IMG_VOID        *pvIn,
                                                                IMG_UINT32  ulInSize,
                                                                IMG_VOID        *pvOut,
@@ -997,7 +997,7 @@ static PVRSRV_ERROR SysMapInRegisters(IMG_VOID)
                case PVRSRV_DEVICE_TYPE_SGX:
                {
                        PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO *)psDeviceNodeList->pvDevice;
-                       
+
                        if (SYS_SPECIFIC_DATA_TEST(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNMAP_SGX_REGS))
                        {
                                psDevInfo->pvRegsBaseKM = OSMapPhysToLin(gsSGXDeviceMap.sRegsCpuPBase,
@@ -1020,7 +1020,7 @@ static PVRSRV_ERROR SysMapInRegisters(IMG_VOID)
                        {
                                if (SYS_SPECIFIC_DATA_TEST(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNMAP_SGX_HP))
                                {
-                                       
+
                                        psDevInfo->pvHostPortBaseKM = OSMapPhysToLin(gsSGXDeviceMap.sHPCpuPBase,
                                                                                                                     gsSGXDeviceMap.ui32HPSize,
                                                                                                                     PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
@@ -1035,7 +1035,7 @@ static PVRSRV_ERROR SysMapInRegisters(IMG_VOID)
                                psDevInfo->ui32HPSize  = gsSGXDeviceMap.ui32HPSize;
                                psDevInfo->sHPSysPAddr = gsSGXDeviceMap.sHPSysPBase;
                        }
-#endif 
+#endif
                        break;
                }
                default:
@@ -1062,7 +1062,7 @@ static PVRSRV_ERROR SysUnmapRegisters(IMG_VOID)
                {
                        PVRSRV_SGXDEV_INFO *psDevInfo = (PVRSRV_SGXDEV_INFO *)psDeviceNodeList->pvDevice;
 #if !(defined(NO_HARDWARE) && defined(__linux__))
-                       
+
                        if (psDevInfo->pvRegsBaseKM)
                        {
                                OSUnMapPhysToLin(psDevInfo->pvRegsBaseKM,
@@ -1072,7 +1072,7 @@ static PVRSRV_ERROR SysUnmapRegisters(IMG_VOID)
 
                                SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNMAP_SGX_REGS);
                        }
-#endif 
+#endif
 
                        psDevInfo->pvRegsBaseKM = IMG_NULL;
                        psDevInfo->ui32RegSize          = 0;
@@ -1081,7 +1081,7 @@ static PVRSRV_ERROR SysUnmapRegisters(IMG_VOID)
 #if defined(SGX_FEATURE_HOST_PORT)
                        if (gsSGXDeviceMap.ui32Flags & SGX_HOSTPORT_PRESENT)
                        {
-                               
+
                                if (psDevInfo->pvHostPortBaseKM)
                                {
                                        OSUnMapPhysToLin(psDevInfo->pvHostPortBaseKM,
@@ -1097,7 +1097,7 @@ static PVRSRV_ERROR SysUnmapRegisters(IMG_VOID)
                                psDevInfo->ui32HPSize  = 0;
                                psDevInfo->sHPSysPAddr.uiAddr = 0;
                        }
-#endif 
+#endif
                        break;
                }
                default:
@@ -1107,23 +1107,23 @@ static PVRSRV_ERROR SysUnmapRegisters(IMG_VOID)
        }
 
 #if !(defined(NO_HARDWARE) || defined(__linux__))
-       
+
        OSUnMapPhysToLin(gsPoulsboRegsCPUVaddr,
                                POULSBO_REG_SIZE,
                                PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
                                IMG_NULL);
 
-       
+
        OSUnMapPhysToLin(gsPoulsboDisplayRegsCPUVaddr,
                                POULSBO_DISPLAY_REG_SIZE,
                                PVRSRV_HAP_KERNEL_ONLY|PVRSRV_HAP_UNCACHED,
                                IMG_NULL);
 
-#endif 
+#endif
 
        return PVRSRV_OK;
 }
-#endif 
+#endif
 
 
 PVRSRV_ERROR SysSystemPrePowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
@@ -1136,7 +1136,7 @@ PVRSRV_ERROR SysSystemPrePowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
                if ((eNewPowerState == PVRSRV_SYS_POWER_STATE_D3) &&
                        (gpsSysData->eCurrentPowerState < PVRSRV_SYS_POWER_STATE_D3))
                {
-                       
+
                        if (SYS_SPECIFIC_DATA_TEST(&gsSysSpecificData, SYS_SPECIFIC_DATA_IRQ_ENABLED))
                        {
                                SysDisableInterrupts(gpsSysData);
@@ -1156,9 +1156,9 @@ PVRSRV_ERROR SysSystemPrePowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
                                SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNINSTALL_LISR);
                                SYS_SPECIFIC_DATA_CLEAR(&gsSysSpecificData, SYS_SPECIFIC_DATA_LISR_INSTALLED);
                        }
-#endif 
+#endif
+
 
-                       
                        SysUnmapRegisters();
 
                        eError = OSPCISuspendDev(gsSysSpecificData.hSGXPCI);
@@ -1169,11 +1169,11 @@ PVRSRV_ERROR SysSystemPrePowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
                }
        }
        return eError;
-#else  
+#else
        PVR_UNREFERENCED_PARAMETER(eNewPowerState);
 
        return PVRSRV_ERROR_NOT_SUPPORTED;
-#endif 
+#endif
 }
 
 PVRSRV_ERROR SysSystemPostPowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
@@ -1193,7 +1193,7 @@ PVRSRV_ERROR SysSystemPostPowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
                                return eError;
                        }
 
-                       
+
 
 
                        eError = SysLocateDevices(gpsSysData);
@@ -1203,7 +1203,7 @@ PVRSRV_ERROR SysSystemPostPowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
                                return eError;
                        }
 
-                       
+
                        eError = SysMapInRegisters();
                        if (eError != PVRSRV_OK)
                        {
@@ -1222,7 +1222,7 @@ PVRSRV_ERROR SysSystemPostPowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
                                SYS_SPECIFIC_DATA_SET(&gsSysSpecificData, SYS_SPECIFIC_DATA_LISR_INSTALLED);
                                SYS_SPECIFIC_DATA_CLEAR(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNINSTALL_LISR);
                        }
-#endif 
+#endif
 
                        if (SYS_SPECIFIC_DATA_TEST(&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_IRQ_DISABLE))
                        {
@@ -1234,11 +1234,11 @@ PVRSRV_ERROR SysSystemPostPowerState(PVRSRV_SYS_POWER_STATE eNewPowerState)
                }
        }
        return eError;
-#else  
+#else
        PVR_UNREFERENCED_PARAMETER(eNewPowerState);
 
        return PVRSRV_ERROR_NOT_SUPPORTED;
-#endif 
+#endif
 }
 
 
@@ -1276,7 +1276,7 @@ PVRSRV_ERROR SysDevicePrePowerState(IMG_UINT32                    ui32DeviceIndex,
                }
 #if defined(PVR_MDFLD_SYS_MSVDX_AND_TOPAZ)
                else if (ui32DeviceIndex == gui32MRSTMSVDXDeviceID)
-               {                       
+               {
                        psb_irq_uninstall_islands(gpDrmDevice, OSPM_VIDEO_DEC_ISLAND);
                        if (ospm_power_is_hw_on(OSPM_DISPLAY_ISLAND)) {
                                ospm_power_island_down(OSPM_VIDEO_DEC_ISLAND);
@@ -1308,7 +1308,7 @@ PVRSRV_ERROR SysDevicePrePowerState(IMG_UINT32                    ui32DeviceIndex,
                        ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
 #endif
 #endif
-#endif 
+#endif
        }
        return PVRSRV_OK;
 }
@@ -1342,14 +1342,14 @@ PVRSRV_ERROR SysDevicePostPowerState(IMG_UINT32                 ui32DeviceIndex,
                else if (ui32DeviceIndex == gui32MRSTMSVDXDeviceID)
                {
                        PVR_DPF((PVR_DBG_MESSAGE,"SysDevicePrePowerState: Restore MSVDX power"));
-                       if (ospm_power_is_hw_on(OSPM_DISPLAY_ISLAND)) { 
+                       if (ospm_power_is_hw_on(OSPM_DISPLAY_ISLAND)) {
                                ospm_power_island_up(OSPM_VIDEO_DEC_ISLAND);
                        } else {
                                ospm_power_island_up(OSPM_DISPLAY_ISLAND);
                                ospm_power_island_up(OSPM_VIDEO_DEC_ISLAND);
                                ospm_power_island_down(OSPM_DISPLAY_ISLAND);
                        }
-#if 0 
+#if 0
 #if defined(SUPPORT_DRI_DRM_EXT)
                        if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                        {
@@ -1375,7 +1375,7 @@ PVRSRV_ERROR SysDevicePostPowerState(IMG_UINT32                   ui32DeviceIndex,
                                ospm_power_island_up(OSPM_VIDEO_ENC_ISLAND);
                                ospm_power_island_down(OSPM_DISPLAY_ISLAND);
                        }
-#if 0 
+#if 0
 #if defined(SUPPORT_DRI_DRM_EXT)
                        if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                        {
@@ -1391,7 +1391,7 @@ PVRSRV_ERROR SysDevicePostPowerState(IMG_UINT32                   ui32DeviceIndex,
 #endif
 #endif
                }
-#endif 
+#endif
        }
 
        return PVRSRV_OK;
@@ -1415,7 +1415,7 @@ int SYSPVRServiceSGXInterrupt(struct drm_device *dev)
 
        if (gpsSGXDevNode != IMG_NULL)
        {
-               bStatus = (*gpsSGXDevNode->pfnDeviceISR)(gpsSGXDevNode->pvISRData);             
+               bStatus = (*gpsSGXDevNode->pfnDeviceISR)(gpsSGXDevNode->pvISRData);
                if (bStatus)
                {
                        OSScheduleMISR((IMG_VOID *)gpsSGXDevNode->psSysData);
old mode 100755 (executable)
new mode 100644 (file)
index bf434c7..7581aaa
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -38,7 +38,7 @@
 #define SYS_SGX_USSE_COUNT                                     (2)
 
 #define POULSBO_REGS_OFFSET    0x00000
-#define POULSBO_REG_SIZE       0x2100  
+#define POULSBO_REG_SIZE       0x2100
 
 #define SGX_REGS_OFFSET                0x80000
 #if defined(SGX544)
@@ -84,7 +84,7 @@
 #define POULSBO_VSYNC_PIPEB_EVENT_MASK         (1<<4)
 
 #define POULSBO_DISPLAY_REGS_OFFSET                    0x70000
-#define POULSBO_DISPLAY_REG_SIZE                       0x2000          
+#define POULSBO_DISPLAY_REG_SIZE                       0x2000
 
 #define POULSBO_DISPLAY_A_CONFIG                       0x00008
 #define POULSBO_DISPLAY_A_STATUS_SELECT                0x00024
 
 #if defined(SGX_FEATURE_HOST_PORT)
        #define SYS_SGX_HP_SIZE         0x8000000
-       
+
        #define SYS_SGX_HOSTPORT_BASE_DEVVADDR 0xD0000000
        #if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030)
-               
+
 
 
                #define SYS_SGX_HOSTPORT_BRN23030_OFFSET 0x7C00000
        #endif
 #endif
 
+
 typedef struct
 {
        union
@@ -117,7 +117,7 @@ typedef struct
                IMG_UINT16      aui16PCISpace[128];
                IMG_UINT32      aui32PCISpace[64];
 #endif
-               struct  
+               struct
                {
                        IMG_UINT16      ui16VenID;
                        IMG_UINT16      ui16DevID;
@@ -131,4 +131,4 @@ extern IMG_UINT32 gui32SGXDeviceID;
 extern IMG_UINT32 gui32MRSTDisplayDeviceID;
 extern IMG_UINT32 gui32MRSTMSVDXDeviceID;
 extern IMG_UINT32 gui32MRSTTOPAZDeviceID;
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index 1c6041b..a09edba
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -40,4 +40,4 @@ typedef enum _SYS_DEVICE_TYPE_
 
 #define SYS_DEVICE_COUNT 10
 
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index c069445..717c2a9
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
 #define SYS_SPECIFIC_DATA_ALLOC_DUMMY_SGX_REGS         0x00000008
 #if defined(SUPPORT_MSVDX)
 #define        SYS_SPECIFIC_DATA_ALLOC_DUMMY_MSVDX_REGS        0x00000020
-#endif 
-#endif 
+#endif
+#endif
 #define        SYS_SPECIFIC_DATA_SGX_INITIALISED               0x00000040
 #if defined(SUPPORT_MSVDX)
 #define        SYS_SPECIFIC_DATA_MSVDX_INITIALISED             0x00000080
-#endif 
+#endif
 #define        SYS_SPECIFIC_DATA_MISR_INSTALLED                0x00000100
 #define        SYS_SPECIFIC_DATA_LISR_INSTALLED                0x00000200
 #define        SYS_SPECIFIC_DATA_PDUMP_INIT                    0x00000400
 #define        SYS_SPECIFIC_DATA_CLEAR(psSysSpecData, flag) ((IMG_VOID)((psSysSpecData)->ui32SysSpecificData &= ~(flag)))
 
 #define        SYS_SPECIFIC_DATA_TEST(psSysSpecData, flag) (((psSysSpecData)->ui32SysSpecificData & (flag)) != 0)
+
+
 typedef struct _SYS_SPECIFIC_DATA_TAG_
 {
-       
+
        IMG_UINT32 ui32SysSpecificData;
 #ifdef __linux__
        PVRSRV_PCI_DEV_HANDLE hSGXPCI;
@@ -76,6 +76,6 @@ typedef struct _SYS_SPECIFIC_DATA_TAG_
        IMG_UINT32 ui32SGXFreqListIndex;
 } SYS_SPECIFIC_DATA;
 
-#endif 
+#endif
 
 
old mode 100755 (executable)
new mode 100644 (file)
index bea0a1d..d900ab1
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
old mode 100755 (executable)
new mode 100644 (file)
index f1cb02a..5a5372e
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  **************************************************************************/
 
@@ -37,12 +37,12 @@ typedef struct tagIOCTL_PACKAGE
        IMG_UINT32  ui32OutBufferSize;    // size of output data buffer
 } IOCTL_PACKAGE;
 
-IMG_UINT32 DeviceIoControl(IMG_UINT32 hDevice,         
-                                               IMG_UINT32 ui32ControlCode, 
-                                               IMG_VOID *pInBuffer,            
+IMG_UINT32 DeviceIoControl(IMG_UINT32 hDevice,
+                                               IMG_UINT32 ui32ControlCode,
+                                               IMG_VOID *pInBuffer,
                                                IMG_UINT32 ui32InBufferSize,
-                                               IMG_VOID *pOutBuffer,           
-                                               IMG_UINT32 ui32OutBufferSize,  
-                                               IMG_UINT32 *pui32BytesReturned); 
+                                               IMG_VOID *pOutBuffer,
+                                               IMG_UINT32 ui32OutBufferSize,
+                                               IMG_UINT32 *pui32BytesReturned);
 
 #endif /* _LINUXSRV_H__*/
old mode 100755 (executable)
new mode 100644 (file)
index 386aca4..f8f635f
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -121,7 +121,7 @@ DBGKM_CONNECT_NOTIFIER g_fnDBGKMNotifier;
 
 IMG_VOID IMG_CALLCONV ExtDBGDrivSetConnectNotifier(DBGKM_CONNECT_NOTIFIER fn_notifier)
 {
-       
+
        g_fnDBGKMNotifier = fn_notifier;
 }
 
@@ -129,12 +129,12 @@ IMG_VOID * IMG_CALLCONV ExtDBGDrivCreateStream(IMG_CHAR * pszName, IMG_UINT32 ui
 {
        IMG_VOID *      pvRet;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        pvRet=DBGDrivCreateStream(pszName, ui32CapMode, ui32OutMode, ui32Flags, ui32Size);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return pvRet;
@@ -142,12 +142,12 @@ IMG_VOID * IMG_CALLCONV ExtDBGDrivCreateStream(IMG_CHAR * pszName, IMG_UINT32 ui
 
 void IMG_CALLCONV ExtDBGDrivDestroyStream(PDBG_STREAM psStream)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivDestroyStream(psStream);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -157,7 +157,7 @@ IMG_VOID * IMG_CALLCONV ExtDBGDrivFindStream(IMG_CHAR * pszName, IMG_BOOL bReset
 {
        IMG_VOID *      pvRet;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        pvRet=DBGDrivFindStream(pszName, bResetStream);
@@ -168,9 +168,9 @@ IMG_VOID * IMG_CALLCONV ExtDBGDrivFindStream(IMG_CHAR * pszName, IMG_BOOL bReset
        else
        {
                PVR_DPF((PVR_DBG_ERROR, "pfnConnectNotifier not initialised.\n"));
-       }               
+       }
+
 
-       
        HostReleaseMutex(g_pvAPIMutex);
 
        return pvRet;
@@ -180,12 +180,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivWriteString(PDBG_STREAM psStream,IMG_CHAR * ps
 {
        IMG_UINT32      ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret=DBGDrivWriteString(psStream, pszString, ui32Level);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -195,12 +195,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivReadString(PDBG_STREAM psStream,IMG_CHAR * psz
 {
        IMG_UINT32 ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret=DBGDrivReadString(psStream, pszString, ui32Limit);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -210,12 +210,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivWrite(PDBG_STREAM psStream,IMG_UINT8 * pui8InB
 {
        IMG_UINT32      ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret=DBGDrivWrite(psStream, pui8InBuf, ui32InBuffSize, ui32Level);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -225,12 +225,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivRead(PDBG_STREAM psStream, IMG_BOOL bReadInitB
 {
        IMG_UINT32 ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret=DBGDrivRead(psStream, bReadInitBuffer, ui32OutBuffSize, pui8OutBuf);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -238,12 +238,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivRead(PDBG_STREAM psStream, IMG_BOOL bReadInitB
 
 void IMG_CALLCONV ExtDBGDrivSetCaptureMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode,IMG_UINT32 ui32Start,IMG_UINT32 ui32End,IMG_UINT32 ui32SampleRate)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivSetCaptureMode(psStream, ui32Mode, ui32Start, ui32End, ui32SampleRate);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -251,12 +251,12 @@ void IMG_CALLCONV ExtDBGDrivSetCaptureMode(PDBG_STREAM psStream,IMG_UINT32 ui32M
 
 void IMG_CALLCONV ExtDBGDrivSetOutputMode(PDBG_STREAM psStream,IMG_UINT32 ui32OutMode)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivSetOutputMode(psStream, ui32OutMode);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -264,12 +264,12 @@ void IMG_CALLCONV ExtDBGDrivSetOutputMode(PDBG_STREAM psStream,IMG_UINT32 ui32Ou
 
 void IMG_CALLCONV ExtDBGDrivSetDebugLevel(PDBG_STREAM psStream,IMG_UINT32 ui32DebugLevel)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivSetDebugLevel(psStream, ui32DebugLevel);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -277,12 +277,12 @@ void IMG_CALLCONV ExtDBGDrivSetDebugLevel(PDBG_STREAM psStream,IMG_UINT32 ui32De
 
 void IMG_CALLCONV ExtDBGDrivSetFrame(PDBG_STREAM psStream,IMG_UINT32 ui32Frame)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivSetFrame(psStream, ui32Frame);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -292,12 +292,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivGetFrame(PDBG_STREAM psStream)
 {
        IMG_UINT32      ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret=DBGDrivGetFrame(psStream);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -307,12 +307,12 @@ IMG_BOOL IMG_CALLCONV ExtDBGDrivIsLastCaptureFrame(PDBG_STREAM psStream)
 {
        IMG_BOOL        bRet;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        bRet = DBGDrivIsLastCaptureFrame(psStream);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return bRet;
@@ -322,12 +322,12 @@ IMG_BOOL IMG_CALLCONV ExtDBGDrivIsCaptureFrame(PDBG_STREAM psStream, IMG_BOOL bC
 {
        IMG_BOOL        bRet;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        bRet = DBGDrivIsCaptureFrame(psStream, bCheckPreviousFrame);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return bRet;
@@ -335,12 +335,12 @@ IMG_BOOL IMG_CALLCONV ExtDBGDrivIsCaptureFrame(PDBG_STREAM psStream, IMG_BOOL bC
 
 void IMG_CALLCONV ExtDBGDrivOverrideMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivOverrideMode(psStream, ui32Mode);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -348,12 +348,12 @@ void IMG_CALLCONV ExtDBGDrivOverrideMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mod
 
 void IMG_CALLCONV ExtDBGDrivDefaultMode(PDBG_STREAM psStream)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivDefaultMode(psStream);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -363,12 +363,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivWrite2(PDBG_STREAM psStream,IMG_UINT8 * pui8In
 {
        IMG_UINT32      ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret=DBGDrivWrite2(psStream, pui8InBuf, ui32InBuffSize, ui32Level);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -378,7 +378,7 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivWritePersist(PDBG_STREAM psStream,IMG_UINT8 *p
 {
        IMG_UINT32      ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret=DBGDrivWritePersist(psStream, pui8InBuf, ui32InBuffSize, ui32Level);
@@ -387,7 +387,7 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivWritePersist(PDBG_STREAM psStream,IMG_UINT8 *p
                PVR_DPF((PVR_DBG_ERROR, "An error occurred in DBGDrivWritePersist."));
        }
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -397,12 +397,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivWriteStringCM(PDBG_STREAM psStream,IMG_CHAR *
 {
        IMG_UINT32      ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret=DBGDrivWriteStringCM(psStream, pszString, ui32Level);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -411,26 +411,26 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivWriteStringCM(PDBG_STREAM psStream,IMG_CHAR *
 IMG_UINT32 IMG_CALLCONV ExtDBGDrivWriteCM(PDBG_STREAM psStream,IMG_UINT8 * pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level)
 {
        IMG_UINT32      ui32Ret;
-       
-       
+
+
        HostAquireMutex(g_pvAPIMutex);
-       
+
        ui32Ret=DBGDrivWriteCM(psStream, pui8InBuf, ui32InBuffSize, ui32Level);
-       
-       
+
+
        HostReleaseMutex(g_pvAPIMutex);
-       
+
        return ui32Ret;
 }
 
 void IMG_CALLCONV ExtDBGDrivSetMarker(PDBG_STREAM psStream, IMG_UINT32 ui32Marker)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivSetMarker(psStream, ui32Marker);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -440,12 +440,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivGetMarker(PDBG_STREAM psStream)
 {
        IMG_UINT32      ui32Marker;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Marker = DBGDrivGetMarker(psStream);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Marker;
@@ -455,12 +455,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivWriteLF(PDBG_STREAM psStream, IMG_UINT8 * pui8
 {
        IMG_UINT32      ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret = DBGDrivWriteLF(psStream, pui8InBuf, ui32InBuffSize, ui32Level, ui32Flags);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -470,12 +470,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivReadLF(PDBG_STREAM psStream, IMG_UINT32 ui32Ou
 {
        IMG_UINT32 ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret = DBGDrivReadLF(psStream, ui32OutBuffSize, pui8OutBuf);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -484,12 +484,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivReadLF(PDBG_STREAM psStream, IMG_UINT32 ui32Ou
 
 IMG_VOID IMG_CALLCONV ExtDBGDrivStartInitPhase(PDBG_STREAM psStream)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivStartInitPhase(psStream);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -497,12 +497,12 @@ IMG_VOID IMG_CALLCONV ExtDBGDrivStartInitPhase(PDBG_STREAM psStream)
 
 IMG_VOID IMG_CALLCONV ExtDBGDrivStopInitPhase(PDBG_STREAM psStream)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivStopInitPhase(psStream);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return;
@@ -512,12 +512,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivGetStreamOffset(PDBG_STREAM psStream)
 {
        IMG_UINT32 ui32Ret;
 
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        ui32Ret = DBGDrivGetStreamOffset(psStream);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 
        return ui32Ret;
@@ -525,12 +525,12 @@ IMG_UINT32 IMG_CALLCONV ExtDBGDrivGetStreamOffset(PDBG_STREAM psStream)
 
 IMG_VOID IMG_CALLCONV ExtDBGDrivSetStreamOffset(PDBG_STREAM psStream, IMG_UINT32 ui32StreamOffset)
 {
-       
+
        HostAquireMutex(g_pvAPIMutex);
 
        DBGDrivSetStreamOffset(psStream, ui32StreamOffset);
 
-       
+
        HostReleaseMutex(g_pvAPIMutex);
 }
 
@@ -538,9 +538,9 @@ IMG_VOID IMG_CALLCONV ExtDBGDrivWaitForEvent(DBG_EVENT eEvent)
 {
 #if defined(SUPPORT_DBGDRV_EVENT_OBJECTS)
        DBGDrivWaitForEvent(eEvent);
-#else  
-       PVR_UNREFERENCED_PARAMETER(eEvent);                             
-#endif 
+#else
+       PVR_UNREFERENCED_PARAMETER(eEvent);
+#endif
 }
 
 IMG_UINT32 AtoI(IMG_CHAR *szIn)
@@ -552,19 +552,19 @@ IMG_UINT32 AtoI(IMG_CHAR *szIn)
        IMG_INT         iPos;
        IMG_CHAR        bc;
 
-       
+
        while (szIn[iLen] > 0)
        {
                iLen ++;
        }
 
-       
+
        if (iLen == 0)
        {
                return (0);
        }
 
-       
+
        iPos=0;
        while (szIn[iPos] == '0')
        {
@@ -580,22 +580,22 @@ IMG_UINT32 AtoI(IMG_CHAR *szIn)
                szIn[iPos]='0';
        }
 
-       
+
        for (iPos = iLen - 1; iPos >= 0; iPos --)
        {
                bc = szIn[iPos];
 
-               if ( (bc >= 'a') && (bc <= 'f') && ui32Base == 16)                      
+               if ( (bc >= 'a') && (bc <= 'f') && ui32Base == 16)
                {
                        bc -= 'a' - 0xa;
                }
                else
-               if ( (bc >= 'A') && (bc <= 'F') && ui32Base == 16)                      
+               if ( (bc >= 'A') && (bc <= 'F') && ui32Base == 16)
                {
                        bc -= 'A' - 0xa;
                }
                else
-               if ((bc >= '0') && (bc <= '9'))                         
+               if ((bc >= '0') && (bc <= '9'))
                {
                        bc -= '0';
                }
@@ -657,34 +657,34 @@ static IMG_BOOL StreamValidForWrite(PDBG_STREAM psStream)
 
 static void Write(PDBG_STREAM psStream,IMG_PUINT8 pui8Data,IMG_UINT32 ui32InBuffSize)
 {
-       
+
 
        if (!psStream->bCircularAllowed)
        {
-               
+
        }
 
        if ((psStream->ui32WPtr + ui32InBuffSize) > psStream->ui32Size)
        {
-               
+
                IMG_UINT32 ui32B1 = psStream->ui32Size - psStream->ui32WPtr;
                IMG_UINT32 ui32B2 = ui32InBuffSize - ui32B1;
 
-               
+
                HostMemCopy((IMG_PVOID)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32WPtr),
                                (IMG_PVOID) pui8Data,
                                ui32B1);
 
-               
+
                HostMemCopy(psStream->pvBase,
                                (IMG_PVOID)(pui8Data + ui32B1),
                                ui32B2);
 
-               
+
                psStream->ui32WPtr = ui32B2;
        }
        else
-       {       
+       {
                HostMemCopy((IMG_PVOID)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32WPtr),
                                (IMG_PVOID) pui8Data,
                                ui32InBuffSize);
@@ -714,7 +714,7 @@ void MonoOut(IMG_CHAR * pszString,IMG_BOOL bNewLine)
 
        pScreen += g_ui32Line * 160;
 
-       
+
 
        i=0;
        do
@@ -733,7 +733,7 @@ void MonoOut(IMG_CHAR * pszString,IMG_BOOL bNewLine)
                g_ui32Line++;
        }
 
-       
+
 
        if (g_ui32Line == g_ui32MonoLines)
        {
@@ -743,18 +743,18 @@ void MonoOut(IMG_CHAR * pszString,IMG_BOOL bNewLine)
 
                HostMemSet((IMG_VOID *)(DBGDRIV_MONOBASE + (160 * (g_ui32MonoLines - 1))),0,160);
        }
-#endif 
+#endif
 }
 
 static IMG_UINT32 WriteExpandingBuffer(PDBG_STREAM psStream,IMG_UINT8 * pui8InBuf,IMG_UINT32 ui32InBuffSize)
 {
        IMG_UINT ui32Space;
 
-       
+
 
        ui32Space = SpaceInStream(psStream);
 
-       
+
 
        if ((psStream->psCtrl->ui32OutMode & DEBUG_OUTMODE_STREAMENABLE) == 0)
        {
@@ -762,11 +762,11 @@ static IMG_UINT32 WriteExpandingBuffer(PDBG_STREAM psStream,IMG_UINT8 * pui8InBu
                return(0);
        }
 
-       
+
 
        if (psStream->psCtrl->ui32Flags & DEBUG_FLAGS_NO_BUF_EXPANDSION)
        {
-               
+
 
 
                if (ui32Space < 32)
@@ -781,7 +781,7 @@ static IMG_UINT32 WriteExpandingBuffer(PDBG_STREAM psStream,IMG_UINT8 * pui8InBu
                {
                        IMG_UINT32      ui32NewBufSize;
 
-                       
+
 
                        ui32NewBufSize = 2 * psStream->ui32Size;
 
@@ -793,7 +793,7 @@ static IMG_UINT32 WriteExpandingBuffer(PDBG_STREAM psStream,IMG_UINT8 * pui8InBu
                                ui32NewBufSize += ui32InBuffSize;
                        }
 
-                       
+
 
                        if (!ExpandStreamBuffer(psStream,ui32NewBufSize))
                        {
@@ -805,7 +805,7 @@ static IMG_UINT32 WriteExpandingBuffer(PDBG_STREAM psStream,IMG_UINT8 * pui8InBu
                                        }
                                        else
                                        {
-                                               
+
                                                PVR_DPF((PVR_DBG_ERROR, "WriteExpandingBuffer: Unable to expand %x. Out of memory.", (IMG_UINTPTR_T) psStream));
                                                InvalidateAllStreams();
                                                return (0xFFFFFFFFUL);
@@ -813,7 +813,7 @@ static IMG_UINT32 WriteExpandingBuffer(PDBG_STREAM psStream,IMG_UINT8 * pui8InBu
                                }
                        }
 
-                       
+
 
                        ui32Space = SpaceInStream(psStream);
                        PVR_DPF((PVR_DBGDRIV_MESSAGE, "Expanded buffer, free space = %x",
@@ -821,14 +821,14 @@ static IMG_UINT32 WriteExpandingBuffer(PDBG_STREAM psStream,IMG_UINT8 * pui8InBu
                }
        }
 
-       
+
 
        if (ui32Space <= (ui32InBuffSize + 4))
        {
                ui32InBuffSize = ui32Space - 4;
        }
 
-       
+
 
        Write(psStream,pui8InBuf,ui32InBuffSize);
 
@@ -852,11 +852,11 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *            pszName,
        PDBG_LASTFRAME_BUFFER   psLFBuffer;
        PDBG_STREAM_CONTROL psCtrl;
        IMG_UINT32              ui32Off;
-       IMG_VOID *              pvBase; 
+       IMG_VOID *              pvBase;
        static IMG_CHAR pszNameInitSuffix[] = "_Init";
        IMG_UINT32              ui32OffSuffix;
 
-       
+
 
 
        psStream = (PDBG_STREAM) DBGDrivFindStream(pszName, IMG_FALSE);
@@ -866,7 +866,7 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *              pszName,
                return ((IMG_VOID *) psStream);
        }
 
-       
+
 
        psStream = HostNonPageablePageAlloc(1);
        psInitStream = HostNonPageablePageAlloc(1);
@@ -883,7 +883,7 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *              pszName,
                return((IMG_VOID *) 0);
        }
 
-       
+
        if ((ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
        {
                pvBase = HostNonPageablePageAlloc(ui32Size);
@@ -900,7 +900,7 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *              pszName,
                return((IMG_VOID *) 0);
        }
 
-       
+
        psCtrl->ui32Flags = ui32Flags;
        psCtrl->ui32CapMode = ui32CapMode;
        psCtrl->ui32OutMode = ui32OutMode;
@@ -912,7 +912,7 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *              pszName,
        psCtrl->ui32SampleRate = 1;
        psCtrl->bInitPhaseComplete = IMG_FALSE;
 
-       
+
 
        psStream->psNext = 0;
        psStream->pvBase = pvBase;
@@ -924,10 +924,10 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *            pszName,
        psStream->ui32Marker = 0;
        psStream->bCircularAllowed = IMG_TRUE;
        psStream->ui32InitPhaseWOff = 0;
-       
 
 
-       
+
+
        if ((ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
        {
                pvBase = HostNonPageablePageAlloc(ui32Size);
@@ -940,7 +940,7 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *              pszName,
        if (!pvBase)
        {
                PVR_DPF((PVR_DBG_ERROR,"DBGDriv: Couldn't alloc InitStream buffer\n\r"));
-               
+
                if ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
                {
                        HostNonPageablePageFree(psStream->pvBase);
@@ -953,7 +953,7 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *              pszName,
                return((IMG_VOID *) 0);
        }
 
-       
+
        psInitStream->psNext = 0;
        psInitStream->pvBase = pvBase;
        psInitStream->psCtrl = psCtrl;
@@ -964,12 +964,12 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *            pszName,
        psInitStream->ui32Marker = 0;
        psInitStream->bCircularAllowed = IMG_FALSE;
        psInitStream->ui32InitPhaseWOff = 0;
-       
+
 
 
        psStream->psInitStream = psInitStream;
 
-       
+
        psLFBuffer->psStream = psStream;
        psLFBuffer->ui32BufLen = 0UL;
 
@@ -977,7 +977,7 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *              pszName,
        g_ui32HotkeyMiddumpStart = 0xffffffffUL;
        g_ui32HotkeyMiddumpEnd = 0xffffffffUL;
 
-       
+
 
        ui32Off = 0;
 
@@ -988,9 +988,9 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *              pszName,
                ui32Off++;
        }
        while ((pszName[ui32Off] != 0) && (ui32Off < (4096UL - sizeof(DBG_STREAM))));
-       psStream->szName[ui32Off] = pszName[ui32Off];   
+       psStream->szName[ui32Off] = pszName[ui32Off];
+
 
-       
 
        ui32OffSuffix = 0;
        do
@@ -1001,9 +1001,9 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *            pszName,
        }
        while ( (pszNameInitSuffix[ui32OffSuffix] != 0) &&
                        (ui32Off < (4096UL - sizeof(DBG_STREAM))));
-       psInitStream->szName[ui32Off] = pszNameInitSuffix[ui32OffSuffix];       
+       psInitStream->szName[ui32Off] = pszNameInitSuffix[ui32OffSuffix];
+
 
-       
 
        psStream->psNext = g_psStreamList;
        g_psStreamList = psStream;
@@ -1012,7 +1012,7 @@ IMG_VOID * IMG_CALLCONV DBGDrivCreateStream(IMG_CHAR *            pszName,
        g_psLFBufferList = psLFBuffer;
 
        AddSIDEntry(psStream);
-       
+
        return((IMG_VOID *) psStream);
 }
 
@@ -1026,7 +1026,7 @@ void IMG_CALLCONV DBGDrivDestroyStream(PDBG_STREAM psStream)
 
        PVR_DPF((PVR_DBG_MESSAGE, "DBGDriv: Destroying stream %s\r\n", psStream->szName ));
 
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -1034,10 +1034,10 @@ void IMG_CALLCONV DBGDrivDestroyStream(PDBG_STREAM psStream)
        }
 
        RemoveSIDEntry(psStream);
-       
+
        psLFBuffer = FindLFBuf(psStream);
 
-       
+
 
        psStreamThis = g_psStreamList;
        psStreamPrev = 0;
@@ -1088,14 +1088,14 @@ void IMG_CALLCONV DBGDrivDestroyStream(PDBG_STREAM psStream)
                        psLFThis = psLFThis->psNext;
                }
        }
-       
+
 
        if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_HOTKEY)
        {
                DeactivateHotKeys();
        }
 
-       
+
 
        if ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
        {
@@ -1109,7 +1109,7 @@ void IMG_CALLCONV DBGDrivDestroyStream(PDBG_STREAM psStream)
                HostPageablePageFree(psStream->pvBase);
                HostPageablePageFree(psStream->psInitStream->pvBase);
        }
-       
+
        HostNonPageablePageFree(psStream->psInitStream);
        HostNonPageablePageFree(psStream);
        HostNonPageablePageFree(psLFBuffer);
@@ -1135,7 +1135,7 @@ IMG_VOID * IMG_CALLCONV DBGDrivFindStream(IMG_CHAR * pszName, IMG_BOOL bResetStr
                        pszName,
                        (bResetStream == IMG_TRUE) ? "with reset" : "no reset"));
 
-       
+
 
        for (psThis = g_psStreamList; psThis != IMG_NULL; psThis = psThis->psNext)
        {
@@ -1183,8 +1183,8 @@ IMG_VOID * IMG_CALLCONV DBGDrivFindStream(IMG_CHAR * pszName, IMG_BOOL bResetStr
                }
 
                {
-                       
-                       
+
+
                        psStream->psInitStream->ui32InitPhaseWOff = psStream->psInitStream->ui32WPtr;
                        PVR_DPF((PVR_DBGDRIV_MESSAGE, "Set %s client marker bo %x, total bw %x",
                                        psStream->szName,
@@ -1203,20 +1203,20 @@ static void IMG_CALLCONV DBGDrivInvalidateStream(PDBG_STREAM psStream)
        IMG_UINT32 ui32Off = 0;
        IMG_UINT32 ui32WPtr = psStream->ui32WPtr;
        IMG_PUINT8 pui8Buffer = (IMG_UINT8 *) psStream->pvBase;
-       
+
        PVR_DPF((PVR_DBG_ERROR, "DBGDrivInvalidateStream: An error occurred for stream %s\r\n", psStream->szName ));
 
-       
 
-       
 
 
 
 
-       
+
+
+
        ui32Space = SpaceInStream(psStream);
 
-       
+
        if(ui32Space > 0)
        {
                ui32Space--;
@@ -1235,7 +1235,7 @@ static void IMG_CALLCONV DBGDrivInvalidateStream(PDBG_STREAM psStream)
        pui8Buffer[ui32WPtr++] = '\0';
        psStream->ui32WPtr = ui32WPtr;
 
-       
+
        psStream->psCtrl->ui32Flags |= DEBUG_FLAGS_READONLY;
 }
 
@@ -1254,14 +1254,14 @@ static IMG_VOID InvalidateAllStreams(IMG_VOID)
 
 IMG_UINT32 IMG_CALLCONV DBGDrivWriteStringCM(PDBG_STREAM psStream,IMG_CHAR * pszString,IMG_UINT32 ui32Level)
 {
-       
+
 
        if (!StreamValidForWrite(psStream))
        {
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
        if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED)
        {
@@ -1292,21 +1292,21 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteString(PDBG_STREAM psStream,IMG_CHAR * pszSt
        IMG_UINT32      ui32WPtr;
        IMG_UINT8 *     pui8Buffer;
 
-       
+
 
        if (!StreamValidForWrite(psStream))
        {
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
        if ((psStream->psCtrl->ui32DebugLevel & ui32Level) == 0)
        {
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
 
        if ((psStream->psCtrl->ui32OutMode & DEBUG_OUTMODE_ASYNC) == 0)
@@ -1316,7 +1316,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteString(PDBG_STREAM psStream,IMG_CHAR * pszSt
                        PVR_DPF((PVR_DBG_MESSAGE,"%s: %s\r\n",psStream->szName, pszString));
                }
 
-               
+
 
                if (psStream->psCtrl->ui32OutMode & DEBUG_OUTMODE_MONO)
                {
@@ -1326,7 +1326,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteString(PDBG_STREAM psStream,IMG_CHAR * pszSt
                }
        }
 
-       
+
 
        if      (
                        !(
@@ -1338,11 +1338,11 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteString(PDBG_STREAM psStream,IMG_CHAR * pszSt
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
        ui32Space=SpaceInStream(psStream);
 
-       
+
        if(ui32Space > 0)
        {
                ui32Space--;
@@ -1365,7 +1365,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteString(PDBG_STREAM psStream,IMG_CHAR * pszSt
 
        if (ui32Len < ui32Space)
        {
-               
+
                pui8Buffer[ui32WPtr] = (IMG_UINT8)pszString[ui32Len];
                ui32Len++;
                ui32WPtr++;
@@ -1374,7 +1374,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteString(PDBG_STREAM psStream,IMG_CHAR * pszSt
                        ui32WPtr = 0;
                }
 
-               
+
                psStream->ui32WPtr = ui32WPtr;
                psStream->ui32DataWritten+= ui32Len;
        } else
@@ -1399,14 +1399,14 @@ IMG_UINT32 IMG_CALLCONV DBGDrivReadString(PDBG_STREAM psStream,IMG_CHAR * pszStr
        IMG_UINT32                              ui32Offset;
        IMG_UINT8                               *pui8Buff;
 
-       
+
 
        if (!StreamValidForRead(psStream))
        {
                return(0);
        }
 
-       
+
 
        pui8Buff = (IMG_UINT8 *)psStream->pvBase;
        ui32Offset = psStream->ui32RPtr;
@@ -1416,7 +1416,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivReadString(PDBG_STREAM psStream,IMG_CHAR * pszStr
                return(0);
        }
 
-       
+
 
        ui32Len = 0;
        while((pui8Buff[ui32Offset] != 0) && (ui32Offset != psStream->ui32WPtr))
@@ -1424,7 +1424,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivReadString(PDBG_STREAM psStream,IMG_CHAR * pszStr
                ui32Offset++;
                ui32Len++;
 
-               
+
 
                if (ui32Offset == psStream->ui32Size)
                {
@@ -1434,14 +1434,14 @@ IMG_UINT32 IMG_CALLCONV DBGDrivReadString(PDBG_STREAM psStream,IMG_CHAR * pszStr
 
        ui32OutLen = ui32Len + 1;
 
-       
+
 
        if (ui32Len > ui32Limit)
        {
                return(0);
        }
 
-       
+
 
        ui32Offset = psStream->ui32RPtr;
        ui32Len = 0;
@@ -1452,7 +1452,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivReadString(PDBG_STREAM psStream,IMG_CHAR * pszStr
                ui32Offset++;
                ui32Len++;
 
-               
+
 
                if (ui32Offset == psStream->ui32Size)
                {
@@ -1477,27 +1477,27 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWrite(PDBG_STREAM psMainStream,IMG_UINT8 * pui8In
        IMG_UINT32                              ui32Space;
        DBG_STREAM *psStream;
 
-       
+
 
        if (!StreamValidForWrite(psMainStream))
        {
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
        if ((psMainStream->psCtrl->ui32DebugLevel & ui32Level) == 0)
        {
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
        if (psMainStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED)
        {
                if      ((psMainStream->psCtrl->ui32Flags & DEBUG_FLAGS_ENABLESAMPLE) == 0)
                {
-                       
+
                        return(ui32InBuffSize);
                }
        }
@@ -1505,7 +1505,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWrite(PDBG_STREAM psMainStream,IMG_UINT8 * pui8In
        {
                if ((psMainStream->psCtrl->ui32Current != g_ui32HotKeyFrame) || (g_bHotKeyPressed == IMG_FALSE))
                {
-                       
+
                        return(ui32InBuffSize);
                }
        }
@@ -1519,7 +1519,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWrite(PDBG_STREAM psMainStream,IMG_UINT8 * pui8In
                psStream = psMainStream->psInitStream;
        }
 
-       
+
 
        ui32Space=SpaceInStream(psStream);
 
@@ -1529,7 +1529,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWrite(PDBG_STREAM psMainStream,IMG_UINT8 * pui8In
                        psStream->ui32RPtr,
                        psStream->ui32WPtr));
 
-       
+
 
        if ((psStream->psCtrl->ui32OutMode & DEBUG_OUTMODE_STREAMENABLE) == 0)
        {
@@ -1543,14 +1543,14 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWrite(PDBG_STREAM psMainStream,IMG_UINT8 * pui8In
                return(0);
        }
 
-       
+
 
        if (ui32Space <= (ui32InBuffSize + 4))
        {
                ui32InBuffSize = ui32Space - 8;
        }
 
-       
+
 
        Write(psStream,(IMG_UINT8 *) &ui32InBuffSize,4);
        Write(psStream,pui8InBuf,ui32InBuffSize);
@@ -1566,20 +1566,20 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWrite(PDBG_STREAM psMainStream,IMG_UINT8 * pui8In
 
 IMG_UINT32 IMG_CALLCONV DBGDrivWriteCM(PDBG_STREAM psStream,IMG_UINT8 * pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level)
 {
-       
+
 
        if (!StreamValidForWrite(psStream))
        {
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
        if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED)
        {
                if      ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_ENABLESAMPLE) == 0)
                {
-                       
+
                        return(ui32InBuffSize);
                }
        }
@@ -1589,7 +1589,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteCM(PDBG_STREAM psStream,IMG_UINT8 * pui8InBu
                {
                        if ((psStream->psCtrl->ui32Current != g_ui32HotKeyFrame) || (g_bHotKeyPressed == IMG_FALSE))
                        {
-                               
+
                                return(ui32InBuffSize);
                        }
                }
@@ -1604,14 +1604,14 @@ static IMG_UINT32 DBGDrivWritePersist(PDBG_STREAM psMainStream,IMG_UINT8 * pui8I
        DBG_STREAM      *psStream;
        PVR_UNREFERENCED_PARAMETER(ui32Level);
 
-       
+
 
        if (!StreamValidForWrite(psMainStream))
        {
                return(0xFFFFFFFFUL);
        }
 
-       
+
        psStream = psMainStream->psInitStream;
        if(psStream->bCircularAllowed == IMG_TRUE)
        {
@@ -1632,7 +1632,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWrite2(PDBG_STREAM psMainStream,IMG_UINT8 * pui8I
 {
        DBG_STREAM      *psStream;
 
-       
+
 
        if (!StreamValidForWrite(psMainStream))
        {
@@ -1640,7 +1640,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWrite2(PDBG_STREAM psMainStream,IMG_UINT8 * pui8I
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
        if ((psMainStream->psCtrl->ui32DebugLevel & ui32Level) == 0)
        {
@@ -1670,7 +1670,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivRead(PDBG_STREAM psMainStream, IMG_BOOL bReadInit
        IMG_UINT32 ui32Data;
        DBG_STREAM *psStream;
 
-       
+
 
        if (!StreamValidForRead(psMainStream))
        {
@@ -1687,7 +1687,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivRead(PDBG_STREAM psMainStream, IMG_BOOL bReadInit
                psStream = psMainStream;
        }
 
-       
+
        if (psStream->ui32RPtr == psStream->ui32WPtr ||
                ((psStream->ui32InitPhaseWOff > 0) &&
                 (psStream->ui32RPtr >= psStream->ui32InitPhaseWOff)) )
@@ -1695,7 +1695,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivRead(PDBG_STREAM psMainStream, IMG_BOOL bReadInit
                return(0);
        }
 
-       
+
 
        if (psStream->ui32RPtr <= psStream->ui32WPtr)
        {
@@ -1706,7 +1706,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivRead(PDBG_STREAM psMainStream, IMG_BOOL bReadInit
                ui32Data = psStream->ui32WPtr + (psStream->ui32Size - psStream->ui32RPtr);
        }
 
-       
+
 
        if ((psStream->ui32InitPhaseWOff > 0) &&
                (psStream->ui32InitPhaseWOff < psStream->ui32WPtr))
@@ -1714,7 +1714,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivRead(PDBG_STREAM psMainStream, IMG_BOOL bReadInit
                ui32Data = psStream->ui32InitPhaseWOff - psStream->ui32RPtr;
        }
 
-       
+
 
        if (ui32Data > ui32OutBuffSize)
        {
@@ -1727,36 +1727,36 @@ IMG_UINT32 IMG_CALLCONV DBGDrivRead(PDBG_STREAM psMainStream, IMG_BOOL bReadInit
                        psStream->ui32RPtr,
                        psStream->ui32WPtr));
 
-       
+
 
        if ((psStream->ui32RPtr + ui32Data) > psStream->ui32Size)
-       {       
+       {
                IMG_UINT32 ui32B1 = psStream->ui32Size - psStream->ui32RPtr;
                IMG_UINT32 ui32B2 = ui32Data - ui32B1;
 
-               
+
                HostMemCopy((IMG_VOID *) pui8OutBuf,
                                (IMG_VOID *)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32RPtr),
                                ui32B1);
 
-               
+
                HostMemCopy((IMG_VOID *)(pui8OutBuf + ui32B1),
                                psStream->pvBase,
                                ui32B2);
 
-               
+
                psStream->ui32RPtr = ui32B2;
        }
        else
-       {       
+       {
                HostMemCopy((IMG_VOID *) pui8OutBuf,
                                (IMG_VOID *)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32RPtr),
                                ui32Data);
 
-               
+
                psStream->ui32RPtr += ui32Data;
 
-               
+
                if (psStream->ui32RPtr == psStream->ui32Size)
                {
                        psStream->ui32RPtr = 0;
@@ -1768,7 +1768,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivRead(PDBG_STREAM psMainStream, IMG_BOOL bReadInit
 
 void IMG_CALLCONV DBGDrivSetCaptureMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode,IMG_UINT32 ui32Start,IMG_UINT32 ui32End,IMG_UINT32 ui32SampleRate)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -1781,7 +1781,7 @@ void IMG_CALLCONV DBGDrivSetCaptureMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode
        psStream->psCtrl->ui32End = ui32End;
        psStream->psCtrl->ui32SampleRate = ui32SampleRate;
 
-       
+
 
        if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_HOTKEY)
        {
@@ -1791,7 +1791,7 @@ void IMG_CALLCONV DBGDrivSetCaptureMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode
 
 void IMG_CALLCONV DBGDrivSetOutputMode(PDBG_STREAM psStream,IMG_UINT32 ui32OutMode)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -1803,7 +1803,7 @@ void IMG_CALLCONV DBGDrivSetOutputMode(PDBG_STREAM psStream,IMG_UINT32 ui32OutMo
 
 void IMG_CALLCONV DBGDrivSetDebugLevel(PDBG_STREAM psStream,IMG_UINT32 ui32DebugLevel)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -1815,7 +1815,7 @@ void IMG_CALLCONV DBGDrivSetDebugLevel(PDBG_STREAM psStream,IMG_UINT32 ui32Debug
 
 void IMG_CALLCONV DBGDrivSetFrame(PDBG_STREAM psStream,IMG_UINT32 ui32Frame)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -1853,7 +1853,7 @@ void IMG_CALLCONV DBGDrivSetFrame(PDBG_STREAM psStream,IMG_UINT32 ui32Frame)
                }
        }
 
-       
+
        if (g_bHotKeyRegistered)
        {
                g_bHotKeyRegistered = IMG_FALSE;
@@ -1862,23 +1862,23 @@ void IMG_CALLCONV DBGDrivSetFrame(PDBG_STREAM psStream,IMG_UINT32 ui32Frame)
 
                if (!g_bHotKeyPressed)
                {
-                       
+
 
                        g_ui32HotKeyFrame = psStream->psCtrl->ui32Current + 2;
 
-                       
+
 
                        g_bHotKeyPressed = IMG_TRUE;
                }
 
-               
 
-               if (((psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED) != 0) && 
+
+               if (((psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED) != 0) &&
                        ((psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_HOTKEY) != 0))
                {
                        if (!g_bHotkeyMiddump)
                        {
-                               
+
                                g_ui32HotkeyMiddumpStart = g_ui32HotKeyFrame + 1;
                                g_ui32HotkeyMiddumpEnd = 0xffffffff;
                                g_bHotkeyMiddump = IMG_TRUE;
@@ -1886,7 +1886,7 @@ void IMG_CALLCONV DBGDrivSetFrame(PDBG_STREAM psStream,IMG_UINT32 ui32Frame)
                        }
                        else
                        {
-                               
+
                                g_ui32HotkeyMiddumpEnd = g_ui32HotKeyFrame;
                                PVR_DPF((PVR_DBG_MESSAGE,"Turning off sampling\n"));
                        }
@@ -1894,7 +1894,7 @@ void IMG_CALLCONV DBGDrivSetFrame(PDBG_STREAM psStream,IMG_UINT32 ui32Frame)
 
        }
 
-       
+
 
        if (psStream->psCtrl->ui32Current > g_ui32HotKeyFrame)
        {
@@ -1904,7 +1904,7 @@ void IMG_CALLCONV DBGDrivSetFrame(PDBG_STREAM psStream,IMG_UINT32 ui32Frame)
 
 IMG_UINT32 IMG_CALLCONV DBGDrivGetFrame(PDBG_STREAM psStream)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -1918,7 +1918,7 @@ IMG_BOOL IMG_CALLCONV DBGDrivIsLastCaptureFrame(PDBG_STREAM psStream)
 {
        IMG_UINT32      ui32NextFrame;
 
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -1940,7 +1940,7 @@ IMG_BOOL IMG_CALLCONV DBGDrivIsCaptureFrame(PDBG_STREAM psStream, IMG_BOOL bChec
 {
        IMG_UINT32 ui32FrameShift = bCheckPreviousFrame ? 1UL : 0UL;
 
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -1949,7 +1949,7 @@ IMG_BOOL IMG_CALLCONV DBGDrivIsCaptureFrame(PDBG_STREAM psStream, IMG_BOOL bChec
 
        if (psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED)
        {
-               
+
                if (g_bHotkeyMiddump)
                {
                        if ((psStream->psCtrl->ui32Current >= (g_ui32HotkeyMiddumpStart - ui32FrameShift)) &&
@@ -1981,7 +1981,7 @@ IMG_BOOL IMG_CALLCONV DBGDrivIsCaptureFrame(PDBG_STREAM psStream, IMG_BOOL bChec
 
 void IMG_CALLCONV DBGDrivOverrideMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -1993,7 +1993,7 @@ void IMG_CALLCONV DBGDrivOverrideMode(PDBG_STREAM psStream,IMG_UINT32 ui32Mode)
 
 void IMG_CALLCONV DBGDrivDefaultMode(PDBG_STREAM psStream)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -2005,7 +2005,7 @@ void IMG_CALLCONV DBGDrivDefaultMode(PDBG_STREAM psStream)
 
 IMG_VOID IMG_CALLCONV DBGDrivSetClientMarker(PDBG_STREAM psStream, IMG_UINT32 ui32Marker)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -2017,7 +2017,7 @@ IMG_VOID IMG_CALLCONV DBGDrivSetClientMarker(PDBG_STREAM psStream, IMG_UINT32 ui
 
 void IMG_CALLCONV DBGDrivSetMarker(PDBG_STREAM psStream, IMG_UINT32 ui32Marker)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -2029,7 +2029,7 @@ void IMG_CALLCONV DBGDrivSetMarker(PDBG_STREAM psStream, IMG_UINT32 ui32Marker)
 
 IMG_UINT32 IMG_CALLCONV DBGDrivGetMarker(PDBG_STREAM psStream)
 {
-       
+
 
        if (!StreamValid(psStream))
        {
@@ -2044,7 +2044,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivGetStreamOffset(PDBG_STREAM psMainStream)
 {
        PDBG_STREAM psStream;
 
-       
+
 
        if (!StreamValid(psMainStream))
        {
@@ -2067,7 +2067,7 @@ IMG_VOID IMG_CALLCONV DBGDrivSetStreamOffset(PDBG_STREAM psMainStream, IMG_UINT3
 {
        PDBG_STREAM psStream;
 
-       
+
 
        if (!StreamValid(psMainStream))
        {
@@ -2098,27 +2098,27 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteLF(PDBG_STREAM psStream, IMG_UINT8 * pui8InB
 {
        PDBG_LASTFRAME_BUFFER   psLFBuffer;
 
-       
+
 
        if (!StreamValidForWrite(psStream))
        {
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
        if ((psStream->psCtrl->ui32DebugLevel & ui32Level) == 0)
        {
                return(0xFFFFFFFFUL);
        }
 
-       
+
 
        if ((psStream->psCtrl->ui32CapMode & DEBUG_CAPMODE_FRAMED) != 0)
        {
                if      ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_ENABLESAMPLE) == 0)
                {
-                       
+
                        return(ui32InBuffSize);
                }
        }
@@ -2126,7 +2126,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteLF(PDBG_STREAM psStream, IMG_UINT8 * pui8InB
        {
                if ((psStream->psCtrl->ui32Current != g_ui32HotKeyFrame) || (g_bHotKeyPressed == IMG_FALSE))
                {
-                       
+
                        return(ui32InBuffSize);
                }
        }
@@ -2135,7 +2135,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteLF(PDBG_STREAM psStream, IMG_UINT8 * pui8InB
 
        if (ui32Flags & WRITELF_FLAGS_RESETBUF)
        {
-               
+
 
                ui32InBuffSize = (ui32InBuffSize > LAST_FRAME_BUF_SIZE) ? LAST_FRAME_BUF_SIZE : ui32InBuffSize;
                HostMemCopy((IMG_VOID *)psLFBuffer->ui8Buffer, (IMG_VOID *)pui8InBuf, ui32InBuffSize);
@@ -2143,7 +2143,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivWriteLF(PDBG_STREAM psStream, IMG_UINT8 * pui8InB
        }
        else
        {
-               
+
 
                ui32InBuffSize = ((psLFBuffer->ui32BufLen + ui32InBuffSize) > LAST_FRAME_BUF_SIZE) ? (LAST_FRAME_BUF_SIZE - psLFBuffer->ui32BufLen) : ui32InBuffSize;
                HostMemCopy((IMG_VOID *)(&psLFBuffer->ui8Buffer[psLFBuffer->ui32BufLen]), (IMG_VOID *)pui8InBuf, ui32InBuffSize);
@@ -2158,7 +2158,7 @@ IMG_UINT32 IMG_CALLCONV DBGDrivReadLF(PDBG_STREAM psStream, IMG_UINT32 ui32OutBu
        PDBG_LASTFRAME_BUFFER   psLFBuffer;
        IMG_UINT32      ui32Data;
 
-       
+
 
        if (!StreamValidForRead(psStream))
        {
@@ -2167,11 +2167,11 @@ IMG_UINT32 IMG_CALLCONV DBGDrivReadLF(PDBG_STREAM psStream, IMG_UINT32 ui32OutBu
 
        psLFBuffer = FindLFBuf(psStream);
 
-       
+
 
        ui32Data = (ui32OutBuffSize < psLFBuffer->ui32BufLen) ? ui32OutBuffSize : psLFBuffer->ui32BufLen;
 
-       
+
 
        HostMemCopy((IMG_VOID *)pui8OutBuf, (IMG_VOID *)psLFBuffer->ui8Buffer, ui32Data);
 
@@ -2203,18 +2203,18 @@ IMG_BOOL ExpandStreamBuffer(PDBG_STREAM psStream, IMG_UINT32 ui32NewSize)
        IMG_UINT32      ui32NewROffset;
        IMG_UINT32      ui32SpaceInOldBuf;
 
-       
+
 
        if (psStream->ui32Size >= ui32NewSize)
        {
                return IMG_FALSE;
        }
 
-       
+
 
        ui32SpaceInOldBuf = SpaceInStream(psStream);
 
-       
+
 
        ui32NewSizeInPages = ((ui32NewSize + 0xfffUL) & ~0xfffUL) / 4096UL;
 
@@ -2234,12 +2234,12 @@ IMG_BOOL ExpandStreamBuffer(PDBG_STREAM psStream, IMG_UINT32 ui32NewSize)
 
        if(psStream->bCircularAllowed)
        {
-               
+
 
 
                if (psStream->ui32RPtr <= psStream->ui32WPtr)
                {
-                       
+
 
                HostMemCopy(pvNewBuf,
                                        (IMG_VOID *)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32RPtr),
@@ -2248,16 +2248,16 @@ IMG_BOOL ExpandStreamBuffer(PDBG_STREAM psStream, IMG_UINT32 ui32NewSize)
                else
                {
                        IMG_UINT32      ui32FirstCopySize;
-       
-                       
+
+
 
                        ui32FirstCopySize = psStream->ui32Size - psStream->ui32RPtr;
-       
+
                        HostMemCopy(pvNewBuf,
                                        (IMG_VOID *)((IMG_UINTPTR_T)psStream->pvBase + psStream->ui32RPtr),
                                        ui32FirstCopySize);
-       
-                       
+
+
 
                        HostMemCopy((IMG_VOID *)((IMG_UINTPTR_T)pvNewBuf + ui32FirstCopySize),
                                        (IMG_VOID *)(IMG_PBYTE)psStream->pvBase,
@@ -2267,17 +2267,17 @@ IMG_BOOL ExpandStreamBuffer(PDBG_STREAM psStream, IMG_UINT32 ui32NewSize)
        }
        else
        {
-               
+
                HostMemCopy(pvNewBuf, psStream->pvBase, psStream->ui32WPtr);
                ui32NewROffset = psStream->ui32RPtr;
        }
 
-       
 
-                                                        
+
+
        ui32NewWOffset = psStream->ui32Size - ui32SpaceInOldBuf;
 
-       
+
 
        if ((psStream->psCtrl->ui32Flags & DEBUG_FLAGS_USE_NONPAGED_MEM) != 0)
        {
@@ -2288,7 +2288,7 @@ IMG_BOOL ExpandStreamBuffer(PDBG_STREAM psStream, IMG_UINT32 ui32NewSize)
                HostPageablePageFree(psStream->pvBase);
        }
 
-       
+
 
        psStream->pvBase = pvNewBuf;
        psStream->ui32RPtr = ui32NewROffset;
@@ -2304,7 +2304,7 @@ IMG_UINT32 SpaceInStream(PDBG_STREAM psStream)
 
        if (psStream->bCircularAllowed)
        {
-               
+
        if (psStream->ui32RPtr > psStream->ui32WPtr)
        {
                ui32Space = psStream->ui32RPtr - psStream->ui32WPtr;
@@ -2316,7 +2316,7 @@ IMG_UINT32 SpaceInStream(PDBG_STREAM psStream)
        }
        else
        {
-               
+
                ui32Space = psStream->ui32Size - psStream->ui32WPtr;
        }
 
old mode 100755 (executable)
new mode 100644 (file)
index 2db4843..dc75f88
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -82,7 +82,7 @@ IMG_VOID HostMemCopy(IMG_VOID *pvDest,IMG_VOID *pvSrc,IMG_UINT32 ui32Size);
 IMG_VOID MonoOut(IMG_CHAR * pszString,IMG_BOOL bNewLine);
 
 IMG_SID PStream2SID(PDBG_STREAM psStream);
-PDBG_STREAM SID2PStream(IMG_SID hStream); 
+PDBG_STREAM SID2PStream(IMG_SID hStream);
 IMG_BOOL AddSIDEntry(PDBG_STREAM psStream);
 IMG_BOOL RemoveSIDEntry(PDBG_STREAM psStream);
 
old mode 100755 (executable)
new mode 100644 (file)
index 130c146..6849249
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
old mode 100755 (executable)
new mode 100644 (file)
index ddffb3f..8ba44df
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -47,7 +47,7 @@ IMG_SID PStream2SID(PDBG_STREAM psStream)
                {
                        if (psStream == gaSID_Xlat_Table[iIdx].psStream)
                        {
-                               
+
                                return (IMG_SID)iIdx+1;
                        }
                }
@@ -59,7 +59,7 @@ IMG_SID PStream2SID(PDBG_STREAM psStream)
 
 PDBG_STREAM SID2PStream(IMG_SID hStream)
 {
-       
+
        IMG_INT32 iIdx = (IMG_INT32)hStream-1;
 
        if (iIdx >= 0 && iIdx < MAX_SID_ENTRIES)
@@ -83,13 +83,13 @@ IMG_BOOL AddSIDEntry(PDBG_STREAM psStream)
                {
                        if (psStream == gaSID_Xlat_Table[iIdx].psStream)
                        {
-                               
+
                                return IMG_TRUE;
                        }
 
                        if (gaSID_Xlat_Table[iIdx].psStream == (PDBG_STREAM)IMG_NULL)
                        {
-                               
+
                                gaSID_Xlat_Table[iIdx].psStream = psStream;
                                return IMG_TRUE;
                        }
old mode 100755 (executable)
new mode 100644 (file)
index 70192fb..acfc439
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -52,7 +52,7 @@ IMG_INT32 HostCreateEventObjects(IMG_VOID);
 IMG_VOID HostWaitForEvent(DBG_EVENT eEvent);
 IMG_VOID HostSignalEvent(DBG_EVENT eEvent);
 IMG_VOID HostDestroyEventObjects(IMG_VOID);
-#endif 
+#endif
 
 #endif
 
old mode 100755 (executable)
new mode 100644 (file)
index a456fee..2d82b6c
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -50,15 +50,15 @@ PRIVATEHOTKEYDATA    g_PrivateHotKeyData;
 
 IMG_VOID ReadInHotKeys(IMG_VOID)
 {
-       g_PrivateHotKeyData.ui32ScanCode = 0x58;        
+       g_PrivateHotKeyData.ui32ScanCode = 0x58;
        g_PrivateHotKeyData.ui32ShiftState = 0x0;
 
-       
+
 
 #if 0
        if (_RegOpenKey(HKEY_LOCAL_MACHINE,pszRegPath,&hKey) == ERROR_SUCCESS)
        {
-               
+
 
                QueryReg(hKey,"ui32ScanCode",&g_PrivateHotKeyData.ui32ScanCode);
                QueryReg(hKey,"ui32ShiftState",&g_PrivateHotKeyData.ui32ShiftState);
@@ -83,11 +83,11 @@ IMG_VOID RegisterKeyPressed(IMG_UINT32 dwui32ScanCode, PHOTKEYINFO pInfo)
 
                if (!g_bHotKeyPressed)
                {
-                       
+
 
                        g_ui32HotKeyFrame = psStream->psCtrl->ui32Current + 2;
 
-                       
+
 
                        g_bHotKeyPressed = IMG_TRUE;
                }
@@ -96,11 +96,11 @@ IMG_VOID RegisterKeyPressed(IMG_UINT32 dwui32ScanCode, PHOTKEYINFO pInfo)
 
 IMG_VOID ActivateHotKeys(PDBG_STREAM psStream)
 {
-       
+
 
        ReadInHotKeys();
 
-       
+
 
        if (!g_PrivateHotKeyData.sHotKeyInfo.hHotKey)
        {
@@ -108,7 +108,7 @@ IMG_VOID ActivateHotKeys(PDBG_STREAM psStream)
                {
                        PVR_DPF((PVR_DBG_MESSAGE,"Activate HotKey for PDUMP.\n"));
 
-                       
+
 
                        g_PrivateHotKeyData.sHotKeyInfo.pvStream = psStream;
 
old mode 100755 (executable)
new mode 100644 (file)
index c5d84bb..942d2da
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -37,7 +37,7 @@ typedef struct _hotkeyinfo
        IMG_UINT32 ui32ShiftState;
        IMG_UINT32 ui32HotKeyProc;
        IMG_VOID *pvStream;
-       IMG_UINT32 hHotKey;                     
+       IMG_UINT32 hHotKey;
 } HOTKEYINFO, *PHOTKEYINFO;
 
 typedef struct _privatehotkeydata
old mode 100755 (executable)
new mode 100644 (file)
index 3fcded3..a455e02
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -28,7 +28,7 @@
 
 #ifdef LINUX
 #include <asm/uaccess.h>
-#endif 
+#endif
 
 #include "img_types.h"
 #include "dbgdrvif.h"
@@ -110,7 +110,7 @@ static IMG_UINT32 DBGDIOCDrivWriteString(IMG_VOID * pvInBuffer, IMG_VOID * pvOut
        }
        else
        {
-               
+
                *pui32OutLen = 0;
                return(IMG_FALSE);
        }
@@ -133,7 +133,7 @@ static IMG_UINT32 DBGDIOCDrivWriteStringCM(IMG_VOID * pvInBuffer, IMG_VOID * pvO
        }
        else
        {
-               
+
                *pui32OutLen = 0;
                return(IMG_FALSE);
        }
@@ -157,7 +157,7 @@ static IMG_UINT32 DBGDIOCDrivReadString(IMG_VOID * pvInBuffer, IMG_VOID * pvOutB
        }
        else
        {
-               
+
                *pui32OutLen = 0;
                return(IMG_FALSE);
        }
@@ -183,7 +183,7 @@ static IMG_UINT32 DBGDIOCDrivWrite(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBuffer
        }
        else
        {
-               
+
                *pui32BytesCopied = 0;
                return(IMG_FALSE);
        }
@@ -209,7 +209,7 @@ static IMG_UINT32 DBGDIOCDrivWrite2(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBuffe
        }
        else
        {
-               
+
                *pui32BytesCopied = 0;
                return(IMG_FALSE);
        }
@@ -235,7 +235,7 @@ static IMG_UINT32 DBGDIOCDrivWriteCM(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBuff
        }
        else
        {
-               
+
                *pui32BytesCopied = 0;
                return(IMG_FALSE);
        }
@@ -261,7 +261,7 @@ static IMG_UINT32 DBGDIOCDrivRead(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBuffer)
        }
        else
        {
-               
+
                *pui32BytesCopied = 0;
                return(IMG_FALSE);
        }
@@ -287,7 +287,7 @@ static IMG_UINT32 DBGDIOCDrivSetCaptureMode(IMG_VOID * pvInBuffer, IMG_VOID * pv
        }
        else
        {
-               
+
                return(IMG_FALSE);
        }
 }
@@ -308,7 +308,7 @@ static IMG_UINT32 DBGDIOCDrivSetOutMode(IMG_VOID * pvInBuffer, IMG_VOID * pvOutB
        }
        else
        {
-               
+
                return(IMG_FALSE);
        }
 }
@@ -329,7 +329,7 @@ static IMG_UINT32 DBGDIOCDrivSetDebugLevel(IMG_VOID * pvInBuffer, IMG_VOID * pvO
        }
        else
        {
-               
+
                return(IMG_FALSE);
        }
 }
@@ -350,7 +350,7 @@ static IMG_UINT32 DBGDIOCDrivSetFrame(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBuf
        }
        else
        {
-               
+
                return(IMG_FALSE);
        }
 }
@@ -362,7 +362,7 @@ static IMG_UINT32 DBGDIOCDrivGetFrame(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBuf
 
        pui32Current = (IMG_UINT32 *) pvOutBuffer;
        psStream = SID2PStream(*(IMG_SID *)pvInBuffer);
-       
+
        if (psStream != (PDBG_STREAM)IMG_NULL)
        {
                *pui32Current = ExtDBGDrivGetFrame(psStream);
@@ -370,7 +370,7 @@ static IMG_UINT32 DBGDIOCDrivGetFrame(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBuf
        }
        else
        {
-               
+
                *pui32Current = 0;
                return(IMG_FALSE);
        }
@@ -394,7 +394,7 @@ static IMG_UINT32 DBGDIOCDrivIsCaptureFrame(IMG_VOID * pvInBuffer, IMG_VOID * pv
        }
        else
        {
-               
+
                *pui32Current = 0;
                return(IMG_FALSE);
        }
@@ -416,7 +416,7 @@ static IMG_UINT32 DBGDIOCDrivOverrideMode(IMG_VOID * pvInBuffer, IMG_VOID * pvOu
        }
        else
        {
-               
+
                return(IMG_FALSE);
        }
 }
@@ -435,7 +435,7 @@ static IMG_UINT32 DBGDIOCDrivDefaultMode(IMG_VOID * pvInBuffer, IMG_VOID * pvOut
        }
        else
        {
-               
+
                return(IMG_FALSE);
        }
 }
@@ -456,7 +456,7 @@ static IMG_UINT32 DBGDIOCDrivSetMarker(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBu
        }
        else
        {
-               
+
                return(IMG_FALSE);
        }
 }
@@ -476,7 +476,7 @@ static IMG_UINT32 DBGDIOCDrivGetMarker(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBu
        }
        else
        {
-               
+
                *pui32Current = 0;
                return(IMG_FALSE);
        }
@@ -515,7 +515,7 @@ static IMG_UINT32 DBGDIOCDrivWriteLF(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBuff
        }
        else
        {
-               
+
                return(IMG_FALSE);
        }
 }
@@ -539,7 +539,7 @@ static IMG_UINT32 DBGDIOCDrivReadLF(IMG_VOID * pvInBuffer, IMG_VOID * pvOutBuffe
        }
        else
        {
-               
+
                *pui32BytesCopied = 0;
                return(IMG_FALSE);
        }
old mode 100755 (executable)
new mode 100644 (file)
index 18c8898..859591c
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -46,7 +46,7 @@
 #include <linux/wait.h>
 #include <linux/jiffies.h>
 #include <linux/delay.h>
-#endif 
+#endif
 
 #include "img_types.h"
 #include "pvr_debug.h"
@@ -79,7 +79,7 @@ void PVRSRVDebugPrintf        (
        {
                pszFileName = pszLeafName;
        }
-#endif 
+#endif
 
        bTrace = (IMG_BOOL)(ui32DebugLevel & DBGPRIV_CALLTRACE) ? IMG_TRUE : IMG_FALSE;
 
@@ -90,13 +90,13 @@ void PVRSRVDebugPrintf      (
                char *szBufferEnd = szBuffer;
                char *szBufferLimit = szBuffer + sizeof(szBuffer) - 1;
 
-               
+
                *szBufferLimit = '\0';
 
                snprintf(szBufferEnd, szBufferLimit - szBufferEnd, "PVR_K:");
                szBufferEnd += strlen(szBufferEnd);
 
-               
+
                if (bTrace == IMG_FALSE)
                {
                        switch(ui32DebugLevel)
@@ -142,10 +142,10 @@ void PVRSRVDebugPrintf    (
                va_end (vaArgs);
                szBufferEnd += strlen(szBufferEnd);
 
-               
+
                if (bTrace == IMG_FALSE)
                {
-                       snprintf(szBufferEnd, szBufferLimit - szBufferEnd, 
+                       snprintf(szBufferEnd, szBufferLimit - szBufferEnd,
                                 " [%d, %s]", (int)ui32Line, pszFileName);
                        szBufferEnd += strlen(szBufferEnd);
                }
@@ -153,7 +153,7 @@ void PVRSRVDebugPrintf      (
                printk(KERN_INFO "%s\r\n", szBuffer);
        }
 }
-#endif 
+#endif
 
 IMG_VOID HostMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_UINT32 ui32Size)
 {
@@ -179,7 +179,7 @@ IMG_VOID HostMemCopy(IMG_VOID *pvDst, IMG_VOID *pvSrc, IMG_UINT32 ui32Size)
 
 IMG_UINT32 HostReadRegistryDWORDFromString(char *pcKey, char *pcValueName, IMG_UINT32 *pui32Data)
 {
-    
+
        return 0;
 }
 
@@ -205,18 +205,18 @@ IMG_VOID HostNonPageablePageFree(IMG_VOID * pvBase)
 
 IMG_VOID * HostMapKrnBufIntoUser(IMG_VOID * pvKrnAddr, IMG_UINT32 ui32Size, IMG_VOID **ppvMdl)
 {
-    
+
        return IMG_NULL;
 }
 
 IMG_VOID HostUnMapKrnBufFromUser(IMG_VOID * pvUserAddr, IMG_VOID * pvMdl, IMG_VOID * pvProcess)
 {
-    
+
 }
 
 IMG_VOID HostCreateRegDeclStreams(IMG_VOID)
 {
-    
+
 }
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
@@ -294,12 +294,12 @@ IMG_VOID HostWaitForEvent(DBG_EVENT eEvent)
        switch(eEvent)
        {
                case DBG_EVENT_STREAM_DATA:
-                       
+
                        wait_event_interruptible_timeout(sStreamDataEvent, iStreamData != 0, EVENT_WAIT_TIMEOUT_JIFFIES);
                        iStreamData = 0;
                        break;
                default:
-                       
+
                        msleep_interruptible(EVENT_WAIT_TIMEOUT_MS);
                        break;
        }
@@ -321,4 +321,4 @@ IMG_VOID HostSignalEvent(DBG_EVENT eEvent)
 IMG_VOID HostDestroyEventObjects(IMG_VOID)
 {
 }
-#endif 
+#endif
old mode 100755 (executable)
new mode 100644 (file)
index b793e85..ca897c6
@@ -1,26 +1,26 @@
 /**********************************************************************
  *
  * Copyright (C) Imagination Technologies Ltd. All rights reserved.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope it will be useful but, except 
- * as otherwise stated in writing, without any warranty; without even the 
- * implied warranty of merchantability or fitness for a particular purpose. 
+ *
+ * This program is distributed in the hope it will be useful but, except
+ * as otherwise stated in writing, without any warranty; without even the
+ * implied warranty of merchantability or fitness for a particular purpose.
  * See the GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License along with
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * 
+ *
  * The full GNU General Public License is included in this distribution in
  * the file called "COPYING".
  *
  * Contact Information:
  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
+ * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
  *
  ******************************************************************************/
 
@@ -65,7 +65,7 @@
 #include "pvr_drm_shared.h"
 #include "pvr_drm.h"
 
-#else 
+#else
 
 #define DRVNAME "dbgdrv"
 MODULE_SUPPORTED_DEVICE(DRVNAME);
@@ -101,7 +101,7 @@ static struct file_operations dbgdrv_fops = {
        .mmap           = dbgdrv_mmap,
 };
 
-#endif  
+#endif
 
 IMG_VOID DBGDrvGetServiceTable(IMG_VOID **fn_table);
 
@@ -124,7 +124,7 @@ static void __exit dbgdrv_cleanup(void)
        class_destroy(psDbgDrvClass);
 #endif
        unregister_chrdev(AssignedMajorNumber, DRVNAME);
-#endif 
+#endif
 #if defined(SUPPORT_DBGDRV_EVENT_OBJECTS)
        HostDestroyEventObjects();
 #endif
@@ -146,14 +146,14 @@ static int __init dbgdrv_init(void)
        int err = -EBUSY;
 #endif
 
-       
+
        if ((g_pvAPIMutex=HostCreateMutex()) == IMG_NULL)
        {
                return -ENOMEM;
        }
 
 #if defined(SUPPORT_DBGDRV_EVENT_OBJECTS)
-       
+
        (void) HostCreateEventObjects();
 #endif
 
@@ -168,7 +168,7 @@ static int __init dbgdrv_init(void)
        }
 
 #if defined(LDM_PLATFORM) || defined(LDM_PCI)
-       
+
        psDbgDrvClass = class_create(THIS_MODULE, DRVNAME);
        if (IS_ERR(psDbgDrvClass))
        {
@@ -188,8 +188,8 @@ static int __init dbgdrv_init(void)
                                                                __func__, PTR_ERR(psDev)));
                goto ErrDestroyClass;
        }
-#endif 
-#endif 
+#endif
+#endif
 
        return 0;
 
@@ -205,7 +205,7 @@ ErrDestroyClass:
        class_destroy(psDbgDrvClass);
 #endif
        return err;
-#endif 
+#endif
 }
 
 #if defined(SUPPORT_DRI_DRM)
@@ -239,7 +239,7 @@ long dbgdrv_ioctl(struct file *file, unsigned int ioctlCmd, unsigned long arg)
                goto init_failed;
        }
 
-       
+
        cmd = MAKEIOCTLINDEX(pIP->ui32Cmd) - DEBUG_SERVICE_IOCTL_BASE - 1;
 
        if(pIP->ui32Cmd == DEBUG_SERVICE_READ)