20094102.3+0m5
authorNokia <nokia>
Sat, 19 May 2012 13:00:19 +0000 (16:00 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 19 May 2012 13:37:46 +0000 (16:37 +0300)
  * Fixes: NB#144114 - SGX HW locking up due to errors in PVR driver
    memory mapping
  * Fixes: NB#106381 - PVR kernel driver source incompatible with Linux
    standards

89 files changed:
pvr/INSTALL [deleted file]
pvr/Kconfig
pvr/Makefile
pvr/README
pvr/README.keep [deleted file]
pvr/bridged_pvr_bridge.c
pvr/bridged_pvr_bridge.h
pvr/buffer_manager.c
pvr/buffer_manager.h
pvr/bufferclass_example.h
pvr/bufferclass_example_linux.c
pvr/device.h
pvr/deviceclass.c
pvr/devicemem.c
pvr/event.c
pvr/handle.c
pvr/handle.h
pvr/hash.c
pvr/hash.h
pvr/img_defs.h
pvr/img_types.h
pvr/ioctldef.h
pvr/metrics.c
pvr/metrics.h
pvr/mm.c
pvr/mm.h
pvr/mmap.c
pvr/mmu.c
pvr/mmu.h
pvr/module.c
pvr/mutex.c
pvr/mutex.h
pvr/oemfuncs.h
pvr/omaplfb.h
pvr/omaplfb_displayclass.c
pvr/omaplfb_linux.c
pvr/osfunc.c
pvr/osfunc.h
pvr/pb.c
pvr/pdump.c
pvr/pdump_km.h
pvr/perproc.h
pvr/power.h
pvr/proc.c
pvr/pvr_bridge.h
pvr/pvr_bridge_k.c
pvr/pvr_bridge_km.h
pvr/pvr_debug.c
pvr/pvr_debug.h
pvr/pvrconfig.h [new file with mode: 0644]
pvr/pvrsrv.c
pvr/queue.c
pvr/queue.h
pvr/ra.c
pvr/resman.c
pvr/resman.h
pvr/services.h
pvr/services_headers.h
pvr/servicesext.h
pvr/servicesint.h
pvr/sgx2dcore.c [deleted file]
pvr/sgx_bridge.h
pvr/sgx_bridge_km.h
pvr/sgxapi_km.h
pvr/sgxconfig.h
pvr/sgxcoretypes.h
pvr/sgxdefs.h
pvr/sgxerrata.h
pvr/sgxfeaturedefs.h
pvr/sgxinfo.h
pvr/sgxinfokm.h
pvr/sgxinit.c
pvr/sgxkick.c
pvr/sgxreset.c
pvr/sgxscript.h
pvr/sgxtransfer.c
pvr/sgxutils.c
pvr/sgxutils.h
pvr/srvkm.h
pvr/syscommon.h
pvr/sysconfig.c
pvr/syslocal.h
pvr/sysutils.c [deleted file]
pvr/sysutils_linux.c
pvr/tools/Makefile [new file with mode: 0644]
pvr/tools/dbgdriv.c
pvr/tools/hostfunc.c
pvr/tools/hotkey.c
pvr/tools/ioctl.c

diff --git a/pvr/INSTALL b/pvr/INSTALL
deleted file mode 100644 (file)
index bd08a56..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-
-SGX Embedded Systems DDK for the Linux kernel.
-Copyright (C) 2008 Imagination Technologies Ltd. All rights reserved.
-======================================================================
-
-This file covers how to build and install the Imagination Technologies
-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 
-commence:
-
-$DISCIMAGE
-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 
-$ export KERNELDIR=/path/to/kernel
-
-$PATH
-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 
-$ export CROSS_COMPILE=toolchain-prefix-
-
-
-Build and Install Instructions
--------------------------------------------
-
-The SGX DDK configures different target builds within directories under 
-eurasiacon/build/linux/. 
-
-The supported build targets are:
-
-       all             Makes everything
-       clean   Removes all intermediate files created by a build.
-       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. 
-
-       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
-
-Issue the make command:
-$ make BUILD=debug all
-
-The DDK software must be installed by the root user.  Become the root user:
-$ su
-
-Install the DDK software:
-$ make install
-
-Become an ordinary user again:
-$ exit
-
-
-
-
index 1a826ab..a5ed44b 100644 (file)
@@ -2,3 +2,22 @@ menuconfig PVR
        tristate "PowerVR Services"
        depends on OMAP2_DSS
 
+if PVR
+
+choice
+       prompt "Build type"
+       default PVR_RELEASE
+config PVR_RELEASE
+       bool "Release"
+config PVR_DEBUG
+       bool "Debug"
+config PVR_TIMING
+       bool "Timing"
+endchoice
+
+config PVR_EXAMPLES
+       tristate "Example code"
+       default n
+
+endif
+
index 994c427..c41c623 100644 (file)
-PVR_SYSTEM     :=      omap3430
+obj-$(CONFIG_PVR)      += omaplfb.o pvrsrvkm.o
 
-EXTRA_CFLAGS += -D__linux__
+omaplfb-objs           := omaplfb_displayclass.o omaplfb_linux.o
 
-obj-$(CONFIG_PVR)      +=      \
-       omaplfb.o \
-       pvrsrvkm.o
+pvrsrvkm-objs          := osfunc.o mmap.o module.o pdump.o proc.o         \
+                          pvr_bridge_k.o pvr_debug.o mm.o mutex.o event.o \
+                          buffer_manager.o devicemem.o deviceclass.o      \
+                          handle.o hash.o metrics.o pvrsrv.o queue.o ra.o \
+                          resman.o power.o mem.o bridged_pvr_bridge.o     \
+                          sgxinit.o sgxreset.o sgxutils.o sgxkick.o       \
+                          sgxtransfer.o mmu.o pb.o perproc.o sysconfig.o  \
+                          sysutils_linux.o
 
-omaplfb-objs   :=      \
-       services4/3rdparty/dc_omap3430_linux/omaplfb_displayclass.o \
-       services4/3rdparty/dc_omap3430_linux/omaplfb_linux.o
+obj-$(CONFIG_PVR_EXAMPLES) += bc_example.o
 
-pvrsrvkm-objs  :=      \
-       services4/srvkm/env/linux/osfunc.o \
-       services4/srvkm/env/linux/mmap.o \
-       services4/srvkm/env/linux/module.o \
-       services4/srvkm/env/linux/pdump.o \
-       services4/srvkm/env/linux/proc.o \
-       services4/srvkm/env/linux/pvr_bridge_k.o \
-       services4/srvkm/env/linux/pvr_debug.o \
-       services4/srvkm/env/linux/mm.o \
-       services4/srvkm/env/linux/mutex.o \
-       services4/srvkm/env/linux/event.o \
-       services4/srvkm/common/buffer_manager.o \
-       services4/srvkm/common/devicemem.o \
-       services4/srvkm/common/deviceclass.o \
-       services4/srvkm/common/handle.o \
-       services4/srvkm/common/hash.o \
-       services4/srvkm/common/metrics.o \
-       services4/srvkm/common/pvrsrv.o \
-       services4/srvkm/common/queue.o \
-       services4/srvkm/common/ra.o \
-       services4/srvkm/common/resman.o \
-       services4/srvkm/common/power.o \
-       services4/srvkm/common/mem.o \
-       services4/srvkm/bridged/bridged_pvr_bridge.o \
-       services4/srvkm/devices/sgx/sgxinit.o \
-       services4/srvkm/devices/sgx/sgxreset.o \
-       services4/srvkm/devices/sgx/sgxutils.o \
-       services4/srvkm/devices/sgx/sgxkick.o \
-       services4/srvkm/devices/sgx/sgxtransfer.o \
-       services4/srvkm/devices/sgx/mmu.o \
-       services4/srvkm/devices/sgx/pb.o \
-       services4/srvkm/common/perproc.o \
-       services4/system/$(PVR_SYSTEM)/sysconfig.o \
-       services4/system/$(PVR_SYSTEM)/sysutils.o
+bc_example-objs                := bufferclass_example.o bufferclass_example_linux.o \
+                          bufferclass_example_private.o
 
-ccflags-y      :=      \
-       -I$(src)/include4 \
-       -I$(src)/services4/include \
-       -I$(src)/services4/srvkm/env/linux \
-       -I$(src)/services4/srvkm/include \
-       -I$(src)/services4/srvkm/bridged \
-       -I$(src)/services4/srvkm/devices/sgx \
-       -I$(src)/services4/system/$(PVR_SYSTEM) \
-       -I$(src)/services4/system/include \
-       -I$(src)/services4/srvkm/hwdefs \
-       -Iarch/arm/plat-omap/include/mach
-
-# Work out our origins.  eurasiacon.pj is not supplied to end-users
-# so instead we supply pvrversion.h.  We produce pvrversion.h if
-# if doesn't exist.
-#
 DATE                   := $(shell date "+%a %B %d %Z %Y" )
+CBUILD                 := -O2                                          \
+                          -DPVR_BUILD_DIR="\"$(PVR_BUILD_DIR)\""       \
+                          -DPVR_BUILD_DATE="\"$(DATE)\""
 
-SGXCORE = 530
-CORE = -DSGX530 -DSUPPORT_SGX530 -DSGX_CORE_REV=121
-
-# --------------------------------------------------------------------------------
-
-SUPPORT_SGX = 1
-SUPPORT_HW_RECOVERY = 1
-SUPPORT_SGX_HWPERF = 1
-SYS_USING_INTERRUPTS = 1
-
-PVR2D_ALT_2DHW = 1
-
-LDM_PLATFORM ?= 1
-
-# Only enable active power management if passive power management is
-# enabled, as indicated by LDM_PLATFORM being set to 1.  On OMAP,
-# the system can suspend in the case where active power management is
-# enabled in the SGX driver, but passive power management isn't. As
-# passive power management isn't enabled, the driver won't see the
-# system suspend/resume events, and so won't take appropriate action.
-ifeq ($(LDM_PLATFORM),1)
-SUPPORT_ACTIVE_POWER_MANAGEMENT ?= 1
-else
-SUPPORT_ACTIVE_POWER_MANAGEMENT = 0
-endif
-
-BUILD                  ?= release
-# The standard CFLAGS macro can be overridden on the 'make' command line.  We
-# put CBUILD in a separate macro so its setting doesn't get lost when a user
-# *does* override CFLAGS.
-#
-
-CBUILD                 =       -DPVR_BUILD_DIR="\"$(PVR_BUILD_DIR)\"" \
-                                       -DPVR_BUILD_DATE="\"$(DATE)\"" \
-                                       -DPVR_BUILD_TYPE="\"$(BUILD)\""
-
-# OPTIM contains the optimisation level in timing and release builds
-OPTIM                  = -O2
-
-#  Don't support HW recovery on debug builds
-CBUILD.debug   = -DDEBUG
-CBUILD.timing  = -DTIMING
-CBUILD.release = -DRELEASE
-_CFLAGS.debug  = -g -O0 -DDLL_METRIC=1
-_CFLAGS.timing = $(OPTIM) -g -DDLL_METRIC=1 -DTIMING
-_CFLAGS.release        = $(OPTIM) -g
-_CFLAGS          = $(_CFLAGS.$(BUILD)) -DSGX_DYNAMIC_TIMING_INFO
-
-# Defaults for useful things.
-#
-
-ifeq ("$(BUILD)", "debug")
-DEBUG_LINUX_MEMORY_ALLOCATIONS ?= 1
-DEBUG_LINUX_MEM_AREAS ?= 1
-DEBUG_LINUX_MMAP_AREAS ?= 1
-DEBUG_LINUX_XML_PROC_FILES ?= 0
-DEBUG_LINUX_SLAB_ALLOCATIONS ?= 0
-DEBUG_BRIDGE_KM ?= 1
-DEBUG_TRACE_BRIDGE_KM ?= 0
-DEBUG_BRIDGE_KM_DISPATCH_TABLE ?= 0
-endif
-
-TRANSFER_QUEUE ?= 1
-SUPPORT_SGX_EVENT_OBJECT ?=1
-SUPPORT_SECURE_HANDLES         ?= 1
-SUPPORT_SRVINIT = 1
-SUPPORT_PERCONTEXT_PB = 1
-
-SYS_CFLAGS += -DSERVICES4 -D_XOPEN_SOURCE=600 -DPVR2D_VALIDATE_INPUT_PARAMS
-
-# Thread support
-USE_PTHREADS ?= 1
-USE_GCC__thread_KEYWORD ?= 0
-OPTIMISE_NON_NPTL_SINGLE_THREAD_TLS_LOOKUP ?= 0
-DISABLE_THREADS ?= 0
-
-# Automatically define C compiler macros for features possible (or not) in use.
-
-SYS_CFLAGS.$(SUPPORT_SRVINIT)                          += -DSUPPORT_SRVINIT
-
-SYS_CFLAGS.$(SUPPORT_SGX)                                      += -DSUPPORT_SGX
-SYS_CFLAGS.$(SUPPORT_XWS)                                      += -DSUPPORT_XWS
-SYS_CFLAGS.$(PDUMP)                                                    += -DPDUMP
-SYS_CFLAGS.$(SUPPORT_POWER_MANAGEMENT)         += -DSUPPORT_POWER_MANAGEMENT
-SYS_CFLAGS.$(SUPPORT_BUFFER_CLASS)                     += -DSUPPORT_BUFFER_CLASS
-
-SYS_CFLAGS.$(SUPPORT_PERCONTEXT_PB)                    += -DSUPPORT_PERCONTEXT_PB 
-SYS_CFLAGS.$(SUPPORT_DYNAMIC_PBRESIZE)         += -DSUPPORT_DYNAMIC_PBRESIZE
-
-SYS_CFLAGS.$(USE_FBDEV)                                                += -DUSE_FBDEV
-SYS_CFLAGS.$(USE_FBDEV)                                                += -DFBDEV_NAME="\"$(FBDEV_NAME)\""
-SYS_CFLAGS.$(SUPPORT_DYNAMIC_3DCLOCKGATING) += -DSUPPORT_DYNAMIC_3DCLOCKGATING
-SYS_CFLAGS.$(REENTRANCY_PROTECTION)                    += -DREENTRANCY_PROTECTION
-SYS_CFLAGS.$(SCHEDULER_CONTROL_SUPPORT)        += -DSCHEDULER_CONTROL_SUPPORT
-SYS_CFLAGS.$(USE_IMG_POWER_DOMAIN_FUNCTION) += -DUSE_IMG_POWER_DOMAIN_FUNCTION
-
-SYS_CFLAGS.$(USE_DMALLOC)                                      += -DDMALLOC
-
-SYS_CFLAGS.$(DEBUG_LINUX_MEMORY_ALLOCATIONS)   += -DDEBUG_LINUX_MEMORY_ALLOCATIONS
-SYS_CFLAGS.$(DEBUG_LINUX_MEM_AREAS)                            += -DDEBUG_LINUX_MEM_AREAS
-SYS_CFLAGS.$(DEBUG_LINUX_MMAP_AREAS)                   += -DDEBUG_LINUX_MMAP_AREAS
-SYS_CFLAGS.$(DEBUG_LINUX_XML_PROC_FILES)               += -DDEBUG_LINUX_XML_PROC_FILES
-SYS_CFLAGS.$(DEBUG_LINUX_SLAB_ALLOCATIONS)             += -DDEBUG_LINUX_SLAB_ALLOCATIONS
-SYS_CFLAGS.$(DEBUG_BRIDGE_KM)                                  += -DDEBUG_BRIDGE_KM
-SYS_CFLAGS.$(DEBUG_TRACE_BRIDGE_KM)                            += -DDEBUG_TRACE_BRIDGE_KM
-SYS_CFLAGS.$(DEBUG_BRIDGE_KM_DISPATCH_TABLE)   += -DDEBUG_BRIDGE_KM_DISPATCH_TABLE
-
-SYS_CFLAGS.$(SUPPORT_LINUX_X86_WRITECOMBINE)   += -DSUPPORT_LINUX_X86_WRITECOMBINE
-
-SYS_CFLAGS.$(SGX_PDS_EVENTS_DISABLED)                  += -DSGX_PDS_EVENTS_DISABLED
-SYS_CFLAGS.$(USE_SUPPORT_NO_TA3D_OVERLAP)              += -DUSE_SUPPORT_NO_TA3D_OVERLAP
-SYS_CFLAGS.$(SUPPORT_SGX_TILING)                               += -DSUPPORT_SGX_TILING
-SYS_CFLAGS.$(TRANSFER_QUEUE)                                   += -DTRANSFER_QUEUE
-
-SYS_CFLAGS.$(SUPPORT_SGX_MMU_DUMMY_PAGE)               += -DSUPPORT_SGX_MMU_DUMMY_PAGE
-
-SYS_CFLAGS.$(PVRSRV_USSE_EDM_STATUS_DEBUG)             += -DPVRSRV_USSE_EDM_STATUS_DEBUG
-
-SYS_CFLAGS.$(NO_HARDWARE)                              += -DNO_HARDWARE
-
-SYS_CFLAGS.$(SUPPORT_DRI_DRM)                          += -DSUPPORT_DRI_DRM
-
-ifneq ("$(NO_HARDWARE)", "1")
-SYS_CFLAGS.$(SYS_USING_INTERRUPTS)             += -DSYS_USING_INTERRUPTS
-SYS_CFLAGS.$(SUPPORT_HW_RECOVERY)              += -DSUPPORT_HW_RECOVERY
-SYS_CFLAGS.$(SUPPORT_ACTIVE_POWER_MANAGEMENT)  += -DSUPPORT_ACTIVE_POWER_MANAGEMENT
-endif
-
-SYS_CFLAGS.$(SUPPORT_SECURE_HANDLES)   += -DPVR_SECURE_HANDLES
-
-SYS_CFLAGS.$(USE_PTHREADS)                             += -DUSE_PTHREADS
-SYS_CFLAGS.$(USE_GCC__thread_KEYWORD)  += -DUSE_GCC__thread_KEYWORD
-SYS_CFLAGS.$(OPTIMISE_NON_NPTL_SINGLE_THREAD_TLS_LOOKUP) += -DOPTIMISE_NON_NPTL_SINGLE_THREAD_TLS_LOOKUP
-SYS_CFLAGS.$(DISABLE_THREADS)                  += -DDISABLE_THREADS
-SYS_CFLAGS.$(SUPPORT_SGX_EVENT_OBJECT)                 += -DSUPPORT_SGX_EVENT_OBJECT
-SYS_CFLAGS.$(LDM_PLATFORM)                     += -DLDM_PLATFORM
-SYS_CFLAGS.$(LDM_PCI)                          += -DLDM_PCI
-SYS_CFLAGS.$(PVR_MANUAL_POWER_CONTROL)         += -DPVR_MANUAL_POWER_CONTROL
-
-SYS_CFLAGS.$(PVR2D_ALT_2DHW)                   += -DPVR2D_ALT_2DHW
-
-SYS_CFLAGS.$(SUPPORT_SGX_HWPERF)               += -DSUPPORT_SGX_HWPERF
-
-SYS_INCLUDES   =       -I$(EURASIAROOT)/include4 \
-                                       -I$(EURASIAROOT)/eurasiacon/includeext \
-                                       -isystem $(KERNELDIR)/include
-
-ALL_CFLAGS_kbuild      =       -DLINUX \
-                                               $(CBUILD) $(CBUILD.$(BUILD)) \
-                                               $(SYS_CFLAGS) $(SYS_CFLAGS.1) \
-                                               $(MODULE_CFLAGS) $(MODULE_CFLAGS.$(BUILD)) \
-                                               $(CORE) \
-                                               -Wall -fno-strict-aliasing \
-                                               $(_CFLAGS)
+ccflags-y              += $(CBUILD) -include $(src)/pvrconfig.h
 
-ccflags-y += $(ALL_CFLAGS_kbuild)
index 788a703..2f3c0cf 100644 (file)
@@ -20,27 +20,6 @@ The full GNU General Public License version 2 is included in this
 distribution in the file called "COPYING".
 
 
-Build and Install Instructions
--------------------------------------------
-
-For details see the "INSTALL" file.
-
-To build for, change to the appropriate target directory, e.g.:
-$ cd eurasiacon/build/linux/platform/kbuild
-
-Issue the make command:
-$ make BUILD=debug all
-
-The DDK software must be installed by the root user.  Become the root user:
-$ su
-
-Install the DDK software:
-$ make install
-
-Become an ordinary user again:
-$ exit
-
-
 Contact information:
 -------------------------------------------
 
diff --git a/pvr/README.keep b/pvr/README.keep
deleted file mode 100644 (file)
index 788a703..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-
-SGX Embedded Systems DDK for Linux kernel.
-Copyright (C) 2008 Imagination Technologies Ltd. All rights reserved.
-======================================================================
-
-
-About 
--------------------------------------------
-
-This is the Imagination Technologies SGX DDK for the Linux kernel. 
-
-
-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 
-distribution in the file called "COPYING".
-
-
-Build and Install Instructions
--------------------------------------------
-
-For details see the "INSTALL" file.
-
-To build for, change to the appropriate target directory, e.g.:
-$ cd eurasiacon/build/linux/platform/kbuild
-
-Issue the make command:
-$ make BUILD=debug all
-
-The DDK software must be installed by the root user.  Become the root user:
-$ su
-
-Install the DDK software:
-$ make install
-
-Become an ordinary user again:
-$ exit
-
-
-Contact information:
--------------------------------------------
-
-Imagination Technologies Ltd. <gpl-support@imgtec.com>
-Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
index 1e878b5..3dbe7ae 100644 (file)
 #include "bridged_pvr_bridge.h"
 #include "env_data.h"
 
-#if defined (__linux__)
 #include "mmap.h"
-#else
-#define PVRMMapKVIndexAddressToMMapData(A,B,C,D,E) PVRSRV_OK
-#endif
 
-#ifdef __KERNEL__
 #include <linux/pagemap.h>     /* for cache flush */
-#endif /* __KERNEL__ */
 
-#ifndef ENOMEM
-#define ENOMEM 12
-#endif
-#ifndef EFAULT
-#define EFAULT 14
-#endif
-#ifndef ENOTTY
-#define ENOTTY 25
-#endif
 
 #if defined(DEBUG)
 #define PVRSRV_BRIDGE_ASSERT_CMD(X, Y) PVR_ASSERT(X == PVRSRV_GET_BRIDGE_ID(Y))
@@ -75,9 +60,7 @@ PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY
 PVRSRV_BRIDGE_GLOBAL_STATS g_BridgeGlobalStats;
 #endif
 
-#if defined(PVR_SECURE_HANDLES)
 static IMG_BOOL abSharedDeviceMemHeap[PVRSRV_MAX_CLIENT_HEAPS];
-#endif
 
 #if defined(DEBUG_BRIDGE_KM)
 static PVRSRV_ERROR
@@ -121,9 +104,6 @@ CopyToUserWrapper(PVRSRV_PER_PROCESS_DATA * pProcData,
 #define ASSIGN_AND_EXIT_ON_ERROR(error, src)           \
        ASSIGN_AND_RETURN_ON_ERROR(error, src, 0)
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(NewHandleBatch)
-#endif
 static INLINE PVRSRV_ERROR
 NewHandleBatch(PVRSRV_PER_PROCESS_DATA * psPerProc, IMG_UINT32 ui32BatchSize)
 {
@@ -143,9 +123,6 @@ NewHandleBatch(PVRSRV_PER_PROCESS_DATA * psPerProc, IMG_UINT32 ui32BatchSize)
 #define NEW_HANDLE_BATCH_OR_ERROR(error, psPerProc, ui32BatchSize)     \
        ASSIGN_AND_EXIT_ON_ERROR(error, NewHandleBatch(psPerProc, ui32BatchSize))
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(CommitHandleBatch)
-#endif
 static INLINE PVRSRV_ERROR
 CommitHandleBatch(PVRSRV_PER_PROCESS_DATA * psPerProc)
 {
@@ -159,9 +136,6 @@ CommitHandleBatch(PVRSRV_PER_PROCESS_DATA * psPerProc)
 #define COMMIT_HANDLE_BATCH_OR_ERROR(error, psPerProc)                         \
        ASSIGN_AND_EXIT_ON_ERROR(error, CommitHandleBatch(psPerProc))
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(ReleaseHandleBatch)
-#endif
 static INLINE IMG_VOID ReleaseHandleBatch(PVRSRV_PER_PROCESS_DATA * psPerProc)
 {
        if (psPerProc->bHandlesBatched) {
@@ -320,9 +294,7 @@ PVRSRVCreateDeviceMemContextBW(IMG_UINT32 ui32BridgeID,
                                           ui32ClientHeapCount,
                                           &psCreateDevMemContextOUT->
                                           sHeapInfo[0], &bCreated
-#if defined(PVR_SECURE_HANDLES)
                                           , abSharedDeviceMemHeap
-#endif
            );
 
        if (psCreateDevMemContextOUT->eError != PVRSRV_OK) {
@@ -349,9 +321,7 @@ PVRSRVCreateDeviceMemContextBW(IMG_UINT32 ui32BridgeID,
        for (i = 0; i < psCreateDevMemContextOUT->ui32ClientHeapCount; i++) {
                IMG_HANDLE hDevMemHeapExt;
 
-#if defined(PVR_SECURE_HANDLES)
                if (abSharedDeviceMemHeap[i])
-#endif
                {
 
                        PVRSRVAllocHandleNR(psPerProc->psHandleBase,
@@ -361,7 +331,6 @@ PVRSRVCreateDeviceMemContextBW(IMG_UINT32 ui32BridgeID,
                                            PVRSRV_HANDLE_TYPE_DEV_MEM_HEAP,
                                            PVRSRV_HANDLE_ALLOC_FLAG_SHARED);
                }
-#if defined(PVR_SECURE_HANDLES)
                else {
 
                        if (bCreated) {
@@ -386,7 +355,6 @@ PVRSRVCreateDeviceMemContextBW(IMG_UINT32 ui32BridgeID,
                                }
                        }
                }
-#endif
                psCreateDevMemContextOUT->sHeapInfo[i].hDevMemHeap =
                    hDevMemHeapExt;
        }
@@ -490,9 +458,7 @@ PVRSRVGetDeviceMemHeapInfoBW(IMG_UINT32 ui32BridgeID,
                                         &psGetDevMemHeapInfoOUT->
                                         ui32ClientHeapCount,
                                         &psGetDevMemHeapInfoOUT->sHeapInfo[0]
-#if defined(PVR_SECURE_HANDLES)
                                         , abSharedDeviceMemHeap
-#endif
            );
 
        if (psGetDevMemHeapInfoOUT->eError != PVRSRV_OK) {
@@ -502,9 +468,7 @@ PVRSRVGetDeviceMemHeapInfoBW(IMG_UINT32 ui32BridgeID,
        for (i = 0; i < psGetDevMemHeapInfoOUT->ui32ClientHeapCount; i++) {
                IMG_HANDLE hDevMemHeapExt;
 
-#if defined(PVR_SECURE_HANDLES)
                if (abSharedDeviceMemHeap[i])
-#endif
                {
 
                        PVRSRVAllocHandleNR(psPerProc->psHandleBase,
@@ -514,7 +478,6 @@ PVRSRVGetDeviceMemHeapInfoBW(IMG_UINT32 ui32BridgeID,
                                            PVRSRV_HANDLE_TYPE_DEV_MEM_HEAP,
                                            PVRSRV_HANDLE_ALLOC_FLAG_SHARED);
                }
-#if defined(PVR_SECURE_HANDLES)
                else {
 
                        psGetDevMemHeapInfoOUT->eError =
@@ -527,7 +490,6 @@ PVRSRVGetDeviceMemHeapInfoBW(IMG_UINT32 ui32BridgeID,
                                return 0;
                        }
                }
-#endif
                psGetDevMemHeapInfoOUT->sHeapInfo[i].hDevMemHeap =
                    hDevMemHeapExt;
        }
@@ -537,13 +499,6 @@ PVRSRVGetDeviceMemHeapInfoBW(IMG_UINT32 ui32BridgeID,
        return 0;
 }
 
-#if defined(OS_PVRSRV_ALLOC_DEVICE_MEM_BW)
-int
-PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
-                      PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM * psAllocDeviceMemIN,
-                      PVRSRV_BRIDGE_OUT_ALLOCDEVICEMEM * psAllocDeviceMemOUT,
-                      PVRSRV_PER_PROCESS_DATA * psPerProc);
-#else
 static int
 PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
                       PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM * psAllocDeviceMemIN,
@@ -599,11 +554,7 @@ PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
                psAllocDeviceMemOUT->sClientMemInfo.pvLinAddrKM =
                    psMemInfo->sMemBlk.hOSMemHandle;
        }
-#if defined (__linux__)
        psAllocDeviceMemOUT->sClientMemInfo.pvLinAddr = 0;
-#else
-       psAllocDeviceMemOUT->sClientMemInfo.pvLinAddr = psMemInfo->pvLinAddrKM;
-#endif
        psAllocDeviceMemOUT->sClientMemInfo.sDevVAddr = psMemInfo->sDevVAddr;
        psAllocDeviceMemOUT->sClientMemInfo.ui32Flags = psMemInfo->ui32Flags;
        psAllocDeviceMemOUT->sClientMemInfo.ui32AllocSize =
@@ -658,7 +609,6 @@ PVRSRVAllocDeviceMemBW(IMG_UINT32 ui32BridgeID,
        return 0;
 }
 
-#endif
 
 static int
 PVRSRVFreeDeviceMemBW(IMG_UINT32 ui32BridgeID,
@@ -914,12 +864,8 @@ PVRSRVMapDeviceClassMemoryBW(IMG_UINT32 ui32BridgeID,
        }
 
        switch (eHandleType) {
-#if defined(PVR_SECURE_HANDLES)
        case PVRSRV_HANDLE_TYPE_DISP_BUFFER:
        case PVRSRV_HANDLE_TYPE_BUF_BUFFER:
-#else
-       case PVRSRV_HANDLE_TYPE_NONE:
-#endif
                break;
        default:
                psMapDevClassMemOUT->eError = PVRSRV_ERROR_GENERIC;
@@ -1032,13 +978,6 @@ PVRSRVUnmapDeviceClassMemoryBW(IMG_UINT32 ui32BridgeID,
        return 0;
 }
 
-#if defined(OS_PVRSRV_WRAP_EXT_MEM_BW)
-int
-PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
-                     PVRSRV_BRIDGE_IN_WRAP_EXT_MEMORY * psWrapExtMemIN,
-                     PVRSRV_BRIDGE_OUT_WRAP_EXT_MEMORY * psWrapExtMemOUT,
-                     PVRSRV_PER_PROCESS_DATA * psPerProc);
-#else
 static int
 PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
                      PVRSRV_BRIDGE_IN_WRAP_EXT_MEMORY * psWrapExtMemIN,
@@ -1147,7 +1086,6 @@ PVRSRVWrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
 
        return 0;
 }
-#endif
 
 static int
 PVRSRVUnwrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
@@ -1848,7 +1786,6 @@ Exit:
 }
 #endif
 
-#if defined(SUPPORT_SGX)
 static int
 SGXGetClientInfoBW(IMG_UINT32 ui32BridgeID,
                   PVRSRV_BRIDGE_IN_GETCLIENTINFO * psGetClientInfoIN,
@@ -2082,7 +2019,6 @@ SGXDoKickBW(IMG_UINT32 ui32BridgeID,
        return 0;
 }
 
-#if defined(TRANSFER_QUEUE)
 static int
 SGXSubmitTransferBW(IMG_UINT32 ui32BridgeID,
                    PVRSRV_BRIDGE_IN_SUBMITTRANSFER * psSubmitTransferIN,
@@ -2174,96 +2110,7 @@ SGXSubmitTransferBW(IMG_UINT32 ui32BridgeID,
        return 0;
 }
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-static int
-SGXSubmit2DBW(IMG_UINT32 ui32BridgeID,
-             PVRSRV_BRIDGE_IN_SUBMIT2D * psSubmit2DIN,
-             PVRSRV_BRIDGE_RETURN * psRetOUT,
-             PVRSRV_PER_PROCESS_DATA * psPerProc)
-{
-       IMG_HANDLE hDevCookieInt;
-       PVRSRV_2D_SGX_KICK *psKick;
-       IMG_UINT32 i;
-
-       PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SGX_SUBMIT2D);
-       PVR_UNREFERENCED_PARAMETER(ui32BridgeID);
-
-       psRetOUT->eError =
-           PVRSRVLookupHandle(psPerProc->psHandleBase,
-                              &hDevCookieInt,
-                              psSubmit2DIN->hDevCookie,
-                              PVRSRV_HANDLE_TYPE_DEV_NODE);
-
-       if (psRetOUT->eError != PVRSRV_OK) {
-               return 0;
-       }
-
-       psKick = &psSubmit2DIN->sKick;
-
-       psRetOUT->eError =
-           PVRSRVLookupHandle(psPerProc->psHandleBase,
-                              &psKick->hCCBMemInfo,
-                              psKick->hCCBMemInfo,
-                              PVRSRV_HANDLE_TYPE_MEM_INFO);
-       if (psRetOUT->eError != PVRSRV_OK) {
-               return 0;
-       }
-
-       if (psKick->hTASyncInfo != IMG_NULL) {
-               psRetOUT->eError =
-                   PVRSRVLookupHandle(psPerProc->psHandleBase,
-                                      &psKick->hTASyncInfo,
-                                      psKick->hTASyncInfo,
-                                      PVRSRV_HANDLE_TYPE_SYNC_INFO);
-               if (psRetOUT->eError != PVRSRV_OK) {
-                       return 0;
-               }
-       }
-
-       if (psKick->h3DSyncInfo != IMG_NULL) {
-               psRetOUT->eError =
-                   PVRSRVLookupHandle(psPerProc->psHandleBase,
-                                      &psKick->h3DSyncInfo,
-                                      psKick->h3DSyncInfo,
-                                      PVRSRV_HANDLE_TYPE_SYNC_INFO);
-               if (psRetOUT->eError != PVRSRV_OK) {
-                       return 0;
-               }
-       }
-
-       if (psKick->ui32NumSrcSync > SGX_MAX_2D_SRC_SYNC_OPS) {
-               psRetOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
-               return 0;
-       }
-       for (i = 0; i < psKick->ui32NumSrcSync; i++) {
-               psRetOUT->eError =
-                   PVRSRVLookupHandle(psPerProc->psHandleBase,
-                                      &psKick->ahSrcSyncInfo[i],
-                                      psKick->ahSrcSyncInfo[i],
-                                      PVRSRV_HANDLE_TYPE_SYNC_INFO);
-               if (psRetOUT->eError != PVRSRV_OK) {
-                       return 0;
-               }
-       }
-
-       if (psKick->hDstSyncInfo != IMG_NULL) {
-               psRetOUT->eError =
-                   PVRSRVLookupHandle(psPerProc->psHandleBase,
-                                      &psKick->hDstSyncInfo,
-                                      psKick->hDstSyncInfo,
-                                      PVRSRV_HANDLE_TYPE_SYNC_INFO);
-               if (psRetOUT->eError != PVRSRV_OK) {
-                       return 0;
-               }
-       }
-
-       psRetOUT->eError = SGXSubmit2DKM(hDevCookieInt, psKick);
-
-       return 0;
-}
-#endif
 
-#endif
 
 static int
 SGXGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
@@ -2298,7 +2145,6 @@ SGXGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
        if (psRetOUT->eError != PVRSRV_OK) {
                return -EFAULT;
        }
-#ifdef SUPPORT_SGX_HWPERF
        if (sMiscInfo.eRequest == SGX_MISC_INFO_REQUEST_HWPERF_RETRIEVE_CB) {
                void *pAllocated;
                IMG_HANDLE hAllocatedHandle;
@@ -2341,7 +2187,6 @@ SGXGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
                        return -EFAULT;
                }
        } else
-#endif
        {
                psRetOUT->eError = SGXGetMiscInfoKM(psDevInfo, &sMiscInfo);
                if (psRetOUT->eError != PVRSRV_OK) {
@@ -2359,7 +2204,6 @@ SGXGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
        return 0;
 }
 
-#if defined(SUPPORT_SGX_HWPERF)
 static int
 SGXReadDiffCountersBW(IMG_UINT32 ui32BridgeID,
                      PVRSRV_BRIDGE_IN_SGX_READ_DIFF_COUNTERS *
@@ -2404,7 +2248,6 @@ SGXReadDiffCountersBW(IMG_UINT32 ui32BridgeID,
 
        return 0;
 }
-#endif
 
 static int
 PVRSRVInitSrvConnectBW(IMG_UINT32 ui32BridgeID,
@@ -2423,9 +2266,7 @@ PVRSRVInitSrvConnectBW(IMG_UINT32 ui32BridgeID,
                psRetOUT->eError = PVRSRV_ERROR_GENERIC;
                return 0;
        }
-#if defined (__linux__)
        PVRSRVSetInitServerState(PVRSRV_INIT_SERVER_RUNNING, IMG_TRUE);
-#endif
        psPerProc->bInitProcess = IMG_TRUE;
 
        psRetOUT->eError = PVRSRV_OK;
@@ -2624,23 +2465,13 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
                                    PVRSRV_HANDLE_TYPE_MEM_INFO);
        bLookupFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
 
-#if defined(SGX_SUPPORT_HWPROFILING)
-       eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
-                                   &hDummy,
-                                   psSGXDevInitPart2IN->sInitInfo.
-                                   hKernelHWProfilingMemInfo,
-                                   PVRSRV_HANDLE_TYPE_MEM_INFO);
-       bLookupFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
-#endif
 
-#if defined(SUPPORT_SGX_HWPERF)
        eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
                                    &hDummy,
                                    psSGXDevInitPart2IN->sInitInfo.
                                    hKernelHWPerfCBMemInfo,
                                    PVRSRV_HANDLE_TYPE_MEM_INFO);
        bLookupFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
-#endif
 
        for (i = 0; i < SGX_MAX_INIT_MEM_HANDLES; i++) {
                IMG_HANDLE hHandle =
@@ -2696,17 +2527,7 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
                                              PVRSRV_HANDLE_TYPE_MEM_INFO);
        bReleaseFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
 
-#if defined(SGX_SUPPORT_HWPROFILING)
-       eError = PVRSRVLookupAndReleaseHandle(psPerProc->psHandleBase,
-                                             &psSGXDevInitPart2IN->sInitInfo.
-                                             hKernelHWProfilingMemInfo,
-                                             psSGXDevInitPart2IN->sInitInfo.
-                                             hKernelHWProfilingMemInfo,
-                                             PVRSRV_HANDLE_TYPE_MEM_INFO);
-       bReleaseFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
-#endif
 
-#if defined(SUPPORT_SGX_HWPERF)
        eError = PVRSRVLookupAndReleaseHandle(psPerProc->psHandleBase,
                                              &psSGXDevInitPart2IN->sInitInfo.
                                              hKernelHWPerfCBMemInfo,
@@ -2714,7 +2535,6 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
                                              hKernelHWPerfCBMemInfo,
                                              PVRSRV_HANDLE_TYPE_MEM_INFO);
        bReleaseFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
-#endif
 
        for (i = 0; i < SGX_MAX_INIT_MEM_HANDLES; i++) {
                IMG_HANDLE *phHandle =
@@ -2763,21 +2583,12 @@ SGXDevInitPart2BW(IMG_UINT32 ui32BridgeID,
                                        hKernelSGXHostCtlMemInfo);
        bDissociateFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
 
-#if defined(SGX_SUPPORT_HWPROFILING)
-       eError =
-           PVRSRVDissociateDeviceMemKM(hDevCookieInt,
-                                       psSGXDevInitPart2IN->sInitInfo.
-                                       hKernelHWProfilingMemInfo);
-       bDissociateFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
-#endif
 
-#if defined(SUPPORT_SGX_HWPERF)
        eError =
            PVRSRVDissociateDeviceMemKM(hDevCookieInt,
                                        psSGXDevInitPart2IN->sInitInfo.
                                        hKernelHWPerfCBMemInfo);
        bDissociateFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
-#endif
 
        for (i = 0; i < SGX_MAX_INIT_MEM_HANDLES; i++) {
                IMG_HANDLE hHandle =
@@ -2998,87 +2809,6 @@ SGXUnregisterHWTransferContextBW(IMG_UINT32 ui32BridgeID,
        return 0;
 }
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-static int
-SGXRegisterHW2DContextBW(IMG_UINT32 ui32BridgeID,
-                        PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_2D_CONTEXT *
-                        psSGXRegHW2DContextIN,
-                        PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_2D_CONTEXT *
-                        psSGXRegHW2DContextOUT,
-                        PVRSRV_PER_PROCESS_DATA * psPerProc)
-{
-       IMG_HANDLE hDevCookieInt;
-       IMG_HANDLE hHW2DContextInt;
-
-       PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID,
-                                PVRSRV_BRIDGE_SGX_REGISTER_HW_2D_CONTEXT);
-
-       NEW_HANDLE_BATCH_OR_ERROR(psSGXRegHW2DContextOUT->eError, psPerProc, 1);
-
-       psSGXRegHW2DContextOUT->eError =
-           PVRSRVLookupHandle(psPerProc->psHandleBase,
-                              &hDevCookieInt,
-                              psSGXRegHW2DContextIN->hDevCookie,
-                              PVRSRV_HANDLE_TYPE_DEV_NODE);
-       if (psSGXRegHW2DContextOUT->eError != PVRSRV_OK) {
-               return 0;
-       }
-
-       hHW2DContextInt =
-           SGXRegisterHW2DContextKM(hDevCookieInt,
-                                    &psSGXRegHW2DContextIN->
-                                    sHW2DContextDevVAddr, psPerProc);
-
-       if (hHW2DContextInt == IMG_NULL) {
-               psSGXRegHW2DContextOUT->eError = PVRSRV_ERROR_GENERIC;
-               return 0;
-       }
-
-       PVRSRVAllocHandleNR(psPerProc->psHandleBase,
-                           &psSGXRegHW2DContextOUT->hHW2DContext,
-                           hHW2DContextInt,
-                           PVRSRV_HANDLE_TYPE_SGX_HW_2D_CONTEXT,
-                           PVRSRV_HANDLE_ALLOC_FLAG_NONE);
-
-       COMMIT_HANDLE_BATCH_OR_ERROR(psSGXRegHW2DContextOUT->eError, psPerProc);
-
-       return 0;
-}
-
-static int
-SGXUnregisterHW2DContextBW(IMG_UINT32 ui32BridgeID,
-                          PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT *
-                          psSGXUnregHW2DContextIN,
-                          PVRSRV_BRIDGE_RETURN * psRetOUT,
-                          PVRSRV_PER_PROCESS_DATA * psPerProc)
-{
-       IMG_HANDLE hHW2DContextInt;
-
-       PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID,
-                                PVRSRV_BRIDGE_SGX_UNREGISTER_HW_2D_CONTEXT);
-
-       psRetOUT->eError =
-           PVRSRVLookupHandle(psPerProc->psHandleBase,
-                              &hHW2DContextInt,
-                              psSGXUnregHW2DContextIN->hHW2DContext,
-                              PVRSRV_HANDLE_TYPE_SGX_HW_2D_CONTEXT);
-       if (psRetOUT->eError != PVRSRV_OK) {
-               return 0;
-       }
-
-       psRetOUT->eError = SGXUnregisterHW2DContextKM(hHW2DContextInt);
-       if (psRetOUT->eError != PVRSRV_OK) {
-               return 0;
-       }
-
-       psRetOUT->eError =
-           PVRSRVReleaseHandle(psPerProc->psHandleBase,
-                               psSGXUnregHW2DContextIN->hHW2DContext,
-                               PVRSRV_HANDLE_TYPE_SGX_HW_2D_CONTEXT);
-
-       return 0;
-}
-#endif
 
 static int
 SGXFlushHWRenderTargetBW(IMG_UINT32 ui32BridgeID,
@@ -3492,7 +3222,6 @@ PVRSRV_BRIDGE_SGX_ADDSHAREDPBDESC_RETURN_RESULT:
        return ret;
 }
 
-#endif
 
 static int
 PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
@@ -4488,13 +4217,9 @@ PVRSRVMapMemInfoMemBW(IMG_UINT32 ui32BridgeID,
        }
 
        switch (eHandleType) {
-#if defined(PVR_SECURE_HANDLES)
        case PVRSRV_HANDLE_TYPE_MEM_INFO:
        case PVRSRV_HANDLE_TYPE_MEM_INFO_REF:
        case PVRSRV_HANDLE_TYPE_SHARED_SYS_MEM_INFO:
-#else
-       case PVRSRV_HANDLE_TYPE_NONE:
-#endif
                break;
        default:
                psMapMemInfoMemOUT->eError = PVRSRV_ERROR_GENERIC;
@@ -4649,11 +4374,6 @@ _SetDispatchTableEntry(IMG_UINT32 ui32Index,
        PVR_UNREFERENCED_PARAMETER(pszFunctionName);
 #endif
 
-#if defined(DEBUG_BRIDGE_KM_DISPATCH_TABLE)
-
-       PVR_DPF((PVR_DBG_WARNING, "%s: %d %s %s", __FUNCTION__, ui32Index,
-                pszIOCName, pszFunctionName));
-#endif
 
        if (g_BridgeDispatchTable[ui32Index].pfFunction) {
 #if defined(DEBUG_BRIDGE_KM)
@@ -4761,10 +4481,6 @@ PVRSRV_ERROR CommonBridgeInit(IMG_VOID)
        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);
@@ -4868,7 +4584,6 @@ PVRSRV_ERROR CommonBridgeInit(IMG_VOID)
        SetDispatchTableEntry(PVRSRV_BRIDGE_EVENT_OBJECT_CLOSE,
                              PVRSRVEventObjectCloseBW);
 
-#if defined(SUPPORT_SGX)
 
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_GETCLIENTINFO,
                              SGXGetClientInfoBW);
@@ -4886,10 +4601,8 @@ PVRSRV_ERROR CommonBridgeInit(IMG_VOID)
 
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_GETMMUPDADDR, DummyBW);
 
-#if defined(TRANSFER_QUEUE)
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_SUBMITTRANSFER,
                              SGXSubmitTransferBW);
-#endif
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_GETMISCINFO, SGXGetMiscInfoBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGXINFO_FOR_SRVINIT,
                              SGXGetInfoForSrvinitBW);
@@ -4908,24 +4621,12 @@ PVRSRV_ERROR CommonBridgeInit(IMG_VOID)
                              SGXFlushHWRenderTargetBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_UNREGISTER_HW_RENDER_CONTEXT,
                              SGXUnregisterHWRenderContextBW);
-#if defined(SGX_FEATURE_2D_HARDWARE)
-#if defined(TRANSFER_QUEUE)
-       SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_SUBMIT2D, SGXSubmit2DBW);
-#endif
-       SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_REGISTER_HW_2D_CONTEXT,
-                             SGXRegisterHW2DContextBW);
-       SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_UNREGISTER_HW_2D_CONTEXT,
-                             SGXUnregisterHW2DContextBW);
-#endif
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_REGISTER_HW_TRANSFER_CONTEXT,
                              SGXRegisterHWTransferContextBW);
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_UNREGISTER_HW_TRANSFER_CONTEXT,
                              SGXUnregisterHWTransferContextBW);
-#endif
-#if defined(SUPPORT_SGX_HWPERF)
        SetDispatchTableEntry(PVRSRV_BRIDGE_SGX_READ_DIFF_COUNTERS,
                              SGXReadDiffCountersBW);
-#endif
 
        for (i = 0; i < BRIDGE_DISPATCH_TABLE_ENTRY_COUNT; i++) {
                if (!g_BridgeDispatchTable[i].pfFunction) {
@@ -4954,10 +4655,6 @@ int BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
        IMG_UINT32 ui32BridgeID = psBridgePackageKM->ui32BridgeID;
        int err = -EFAULT;
 
-#if defined(DEBUG_TRACE_BRIDGE_KM)
-       PVR_DPF((PVR_DBG_ERROR, "%s: %s",
-                __FUNCTION__, g_BridgeDispatchTable[ui32BridgeID].pszIOCName));
-#endif
 
 #if defined(DEBUG_BRIDGE_KM)
        g_BridgeDispatchTable[ui32BridgeID].ui32CallCount++;
@@ -4998,7 +4695,6 @@ int BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
                }
        }
 
-#if defined(__linux__)
        {
 
                SYS_DATA *psSysData;
@@ -5033,10 +4729,6 @@ int BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
                        }
                }
        }
-#else
-       psBridgeIn = psBridgePackageKM->pvParamIn;
-       psBridgeOut = psBridgePackageKM->pvParamOut;
-#endif
 
        if (ui32BridgeID >= (BRIDGE_DISPATCH_TABLE_ENTRY_COUNT)) {
                PVR_DPF((PVR_DBG_ERROR,
@@ -5052,7 +4744,6 @@ int BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
                goto return_fault;
        }
 
-#if defined(__linux__)
 
        if (CopyToUserWrapper(psPerProc,
                              ui32BridgeID,
@@ -5061,7 +4752,6 @@ int BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
            != PVRSRV_OK) {
                goto return_fault;
        }
-#endif
 
        err = 0;
 return_fault:
index c0130c5..3282168 100644 (file)
 
 #include "pvr_bridge.h"
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
 
-#if defined(__linux__)
 #define PVRSRV_GET_BRIDGE_ID(X)        _IOC_NR(X)
-#else
-#define PVRSRV_GET_BRIDGE_ID(X)        (X - PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST))
-#endif
 
        typedef int (*BridgeWrapperFunction) (IMG_UINT32 ui32BridgeID,
                                              IMG_VOID * psBridgeIn,
@@ -56,11 +49,7 @@ extern "C" {
 #endif
        } PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY;
 
-#if defined(SUPPORT_SGX)
 #define BRIDGE_DISPATCH_TABLE_ENTRY_COUNT (PVRSRV_BRIDGE_LAST_SGX_CMD+1)
-#else
-#error "FIXME: BRIDGE_DISPATCH_TABLE_ENTRY_COUNT unset"
-#endif
 
        extern PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY
            g_BridgeDispatchTable[BRIDGE_DISPATCH_TABLE_ENTRY_COUNT];
@@ -80,7 +69,4 @@ extern "C" {
        int BridgedDispatchKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
                              PVRSRV_BRIDGE_PACKAGE * psBridgePackageKM);
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index 4e0eb12..222ed98 100644 (file)
@@ -1224,9 +1224,6 @@ DevMemoryAlloc(BM_CONTEXT * pBMContext,
                PVR_DPF((PVR_DBG_ERROR, "DevMemoryAlloc ERROR MMU_Alloc"));
                return IMG_FALSE;
        }
-#ifdef SUPPORT_SGX_MMU_BYPASS
-       EnableHostAccess(pBMContext->psMMUContext);
-#endif
 
        PDUMPMALLOCPAGES(psDeviceNode->sDevId.eDeviceType,
                         pMapping->DevVAddr.uiAddr, pMapping->CpuVAddr,
@@ -1281,9 +1278,6 @@ DevMemoryAlloc(BM_CONTEXT * pBMContext,
                return IMG_FALSE;
        }
 
-#ifdef SUPPORT_SGX_MMU_BYPASS
-       DisableHostAccess(pBMContext->psMMUContext);
-#endif
 
        return IMG_TRUE;
 }
index 709b59f..2184ba4 100644 (file)
@@ -31,9 +31,6 @@
 #include "ra.h"
 #include "perproc.h"
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
 
        typedef struct _BM_HEAP_ BM_HEAP;
 
@@ -183,7 +180,4 @@ extern "C" {
 
        IMG_HANDLE BM_GetMappingHandle(PVRSRV_KERNEL_MEM_INFO * psMemInfo);
 
-#if defined(__cplusplus)
-}
-#endif
 #endif
index a31aa44..3e2a9ff 100644 (file)
@@ -31,9 +31,6 @@
 #include "servicesext.h"
 #include "kernelbuffer.h"
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
 
        extern IMG_IMPORT IMG_BOOL
            PVRGetBufferClassJTable(PVRSRV_BC_BUFFER2SRV_KMJTABLE * psJTable);
@@ -48,14 +45,6 @@ extern "C" {
 #define BC_EXAMPLE_STRIDE              (320)
 #define BC_EXAMPLE_PIXELFORMAT (PVRSRV_PIXEL_FORMAT_NV12)
 
-#else
-#ifdef YUV422
-
-#define BC_EXAMPLE_WIDTH               (320)
-#define BC_EXAMPLE_HEIGHT              (160)
-#define BC_EXAMPLE_STRIDE              (320*2)
-#define BC_EXAMPLE_PIXELFORMAT (PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY)
-
 #else
 
 #define BC_EXAMPLE_WIDTH               (320)
@@ -63,7 +52,6 @@ extern "C" {
 #define BC_EXAMPLE_STRIDE              (320*2)
 #define BC_EXAMPLE_PIXELFORMAT (PVRSRV_PIXEL_FORMAT_RGB565)
 
-#endif
 #endif
 
 #define BC_EXAMPLE_DEVICEID             0
@@ -126,7 +114,4 @@ extern "C" {
                                      PFN_BC_GET_PVRJTABLE * ppfnFuncTable);
        BC_EXAMPLE_DEVINFO *GetAnchorPtr(IMG_VOID);
 
-#if defined(__cplusplus)
-}
-#endif
 #endif
index 77ff988..1b4aec7 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
-#if defined(LMA)
-#include <linux/pci.h>
-#else
 #include <linux/dma-mapping.h>
-#endif
 
 #include "bufferclass_example.h"
 #include "bufferclass_example_linux.h"
@@ -58,42 +54,10 @@ ioctl:      BC_Example_Bridge,
 
 #define unref__ __attribute__ ((unused))
 
-#if defined(LMA)
-#define PVR_BUFFERCLASS_MEMOFFSET (220 * 1024 * 1024)
-#define PVR_BUFFERCLASS_MEMSIZE          (4 * 1024 * 1024)
-
-unsigned int g_ui32MemBase = 0;
-unsigned int g_ui32MemCurrent = 0;
-
-#define VENDOR_ID_PVR                                  0x1010
-#define DEVICE_ID_PVR                                  0x1CF1
-
-#define PVR_MEM_PCI_BASENUM                    2
-#endif
 
 static int __init BC_Example_ModInit(void)
 {
-#if defined(LMA)
-       struct pci_dev *psPCIDev;
-       int error;
-#endif
-
-#if defined(LMA)
-       psPCIDev = pci_get_device(VENDOR_ID_PVR, DEVICE_ID_PVR, NULL);
-       if (psPCIDev == NULL) {
-               printk(KERN_ERR DRVNAME
-                      ": BC_Example_ModInit:  pci_get_device failed\n");
 
-               goto ExitError;
-       }
-
-       if ((error = pci_enable_device(psPCIDev)) != 0) {
-               printk(KERN_ERR DRVNAME
-                      ": BC_Example_ModInit: pci_enable_device failed (%d)\n",
-                      error);
-               goto ExitError;
-       }
-#endif
 
        AssignedMajorNumber =
            register_chrdev(0, DEVNAME, &bufferclass_example_fops);
@@ -109,32 +73,18 @@ static int __init BC_Example_ModInit(void)
               AssignedMajorNumber);
 #endif
 
-#if defined(LMA)
-
-       g_ui32MemBase =
-           pci_resource_start(psPCIDev,
-                              PVR_MEM_PCI_BASENUM) + PVR_BUFFERCLASS_MEMOFFSET;
-#endif
 
        if (BC_Example_Init() != PVRSRV_OK) {
                printk(KERN_ERR DRVNAME
                       ": BC_Example_ModInit: can't init device\n");
                goto ExitUnregister;
        }
-#if defined(LMA)
-
-       pci_disable_device(psPCIDev);
-#endif
 
        return 0;
 
 ExitUnregister:
        unregister_chrdev(AssignedMajorNumber, DEVNAME);
 ExitDisable:
-#if defined(LMA)
-       pci_disable_device(psPCIDev);
-ExitError:
-#endif
        return -EBUSY;
 }
 
@@ -164,24 +114,6 @@ PVRSRV_ERROR BCAllocContigMemory(IMG_UINT32 ui32Size,
                                 IMG_CPU_VIRTADDR * pLinAddr,
                                 IMG_CPU_PHYADDR * pPhysAddr)
 {
-#if defined(LMA)
-       IMG_VOID *pvLinAddr;
-
-       if (g_ui32MemCurrent + ui32Size >= PVR_BUFFERCLASS_MEMSIZE) {
-               return PVRSRV_ERROR_OUT_OF_MEMORY;
-       }
-
-       pvLinAddr = ioremap(g_ui32MemBase + g_ui32MemCurrent, ui32Size);
-
-       if (pvLinAddr) {
-               pPhysAddr->uiAddr = g_ui32MemBase + g_ui32MemCurrent;
-               *pLinAddr = pvLinAddr;
-
-               g_ui32MemCurrent += ui32Size;
-               return PVRSRV_OK;
-       }
-       return PVRSRV_ERROR_OUT_OF_MEMORY;
-#else
        dma_addr_t dma;
        IMG_VOID *pvLinAddr;
 
@@ -195,20 +127,14 @@ PVRSRV_ERROR BCAllocContigMemory(IMG_UINT32 ui32Size,
        *pLinAddr = pvLinAddr;
 
        return PVRSRV_OK;
-#endif
 }
 
 void BCFreeContigMemory(IMG_UINT32 ui32Size,
                        IMG_HANDLE unref__ hMemHandle,
                        IMG_CPU_VIRTADDR LinAddr, IMG_CPU_PHYADDR PhysAddr)
 {
-#if defined(LMA)
-       g_ui32MemCurrent -= ui32Size;
-       iounmap(LinAddr);
-#else
        dma_free_coherent(NULL, ui32Size, LinAddr,
                          (dma_addr_t) PhysAddr.uiAddr);
-#endif
 }
 
 IMG_SYS_PHYADDR CpuPAddrToSysPAddrBC(IMG_CPU_PHYADDR cpu_paddr)
index 2eb003d..cc44ff6 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef __DEVICE_H__
 #define __DEVICE_H__
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
 
 #include "ra.h"
 #include "resman.h"
@@ -217,7 +214,6 @@ extern "C" {
        PVRSRV_ERROR IMG_CALLCONV PVRSRVDeinitialiseDevice(IMG_UINT32
                                                           ui32DevIndex);
 
-#if !defined(USE_CODE)
 
        IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PollForValueKM(volatile IMG_UINT32
                                                            * pui32LinMemAddr,
@@ -229,14 +225,7 @@ extern "C" {
                                                            IMG_UINT32
                                                            ui32Tries);
 
-#endif
 
-#if defined (USING_ISR_INTERRUPTS)
-       PVRSRV_ERROR IMG_CALLCONV PollForInterruptKM(IMG_UINT32 ui32Value,
-                                                    IMG_UINT32 ui32Mask,
-                                                    IMG_UINT32 ui32Waitus,
-                                                    IMG_UINT32 ui32Tries);
-#endif
 
        PVRSRV_ERROR IMG_CALLCONV PVRSRVInit(PSYS_DATA psSysData);
        IMG_VOID IMG_CALLCONV PVRSRVDeInit(PSYS_DATA psSysData);
@@ -245,7 +234,4 @@ extern "C" {
        IMG_BOOL IMG_CALLCONV PVRSRVSystemLISR(IMG_VOID * pvSysData);
        IMG_VOID IMG_CALLCONV PVRSRVMISR(IMG_VOID * pvSysData);
 
-#if defined(__cplusplus)
-}
-#endif
 #endif
index f041255..7ecc805 100644 (file)
@@ -1028,12 +1028,6 @@ IMG_EXPORT
                         "PVRSRVSwapToDCBufferKM: Invalid parameters"));
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
-#if defined(SUPPORT_LMA)
-       eError = PVRSRVPowerLock(KERNEL_ID, IMG_FALSE);
-       if (eError != PVRSRV_OK) {
-               return eError;
-       }
-#endif
 
        psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
        psBuffer = (PVRSRV_DC_BUFFER *) hBuffer;
@@ -1118,9 +1112,6 @@ ProcessedQueues:
        psBuffer->psSwapChain->psLastFlipBuffer = psBuffer;
 
 Exit:
-#if defined(SUPPORT_LMA)
-       PVRSRVPowerUnlock(KERNEL_ID);
-#endif
        return eError;
 }
 
@@ -1144,12 +1135,6 @@ IMG_EXPORT
                         "PVRSRVSwapToDCSystemKM: Invalid parameters"));
                return PVRSRV_ERROR_INVALID_PARAMS;
        }
-#if defined(SUPPORT_LMA)
-       eError = PVRSRVPowerLock(KERNEL_ID, IMG_FALSE);
-       if (eError != PVRSRV_OK) {
-               return eError;
-       }
-#endif
 
        psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
        psSwapChain = (PVRSRV_DC_SWAPCHAIN *) hSwapChain;
@@ -1227,9 +1212,6 @@ ProcessedQueues:
        eError = PVRSRV_OK;
 
 Exit:
-#if defined(SUPPORT_LMA)
-       PVRSRVPowerUnlock(KERNEL_ID);
-#endif
        return eError;
 }
 
index d6a2de5..b6b2cc3 100644 (file)
@@ -92,10 +92,8 @@ IMG_EXPORT
                                                             psHeapInfo,
                                                             IMG_BOOL *
                                                             pbCreated
-#if defined(PVR_SECURE_HANDLES)
                                                             ,
                                                             IMG_BOOL * pbShared
-#endif
     )
 {
        PVRSRV_DEVICE_NODE *psDeviceNode;
@@ -138,9 +136,7 @@ IMG_EXPORT
                                    psDeviceMemoryHeap[i].ui32HeapSize;
                                psHeapInfo[ui32ClientHeapCount].ui32Attribs =
                                    psDeviceMemoryHeap[i].ui32Attribs;
-#if defined(PVR_SECURE_HANDLES)
                                pbShared[ui32ClientHeapCount] = IMG_TRUE;
-#endif
                                ui32ClientHeapCount++;
                                break;
                        }
@@ -161,9 +157,7 @@ IMG_EXPORT
                                    psDeviceMemoryHeap[i].ui32HeapSize;
                                psHeapInfo[ui32ClientHeapCount].ui32Attribs =
                                    psDeviceMemoryHeap[i].ui32Attribs;
-#if defined(PVR_SECURE_HANDLES)
                                pbShared[ui32ClientHeapCount] = IMG_FALSE;
-#endif
 
                                ui32ClientHeapCount++;
                                break;
@@ -199,9 +193,7 @@ IMG_EXPORT
                                                           pui32ClientHeapCount,
                                                           PVRSRV_HEAP_INFO *
                                                           psHeapInfo
-#if defined(PVR_SECURE_HANDLES)
                                                           , IMG_BOOL * pbShared
-#endif
     )
 {
        PVRSRV_DEVICE_NODE *psDeviceNode;
@@ -234,9 +226,7 @@ IMG_EXPORT
                                    psDeviceMemoryHeap[i].ui32HeapSize;
                                psHeapInfo[ui32ClientHeapCount].ui32Attribs =
                                    psDeviceMemoryHeap[i].ui32Attribs;
-#if defined(PVR_SECURE_HANDLES)
                                pbShared[ui32ClientHeapCount] = IMG_TRUE;
-#endif
                                ui32ClientHeapCount++;
                                break;
                        }
@@ -257,9 +247,7 @@ IMG_EXPORT
                                    psDeviceMemoryHeap[i].ui32HeapSize;
                                psHeapInfo[ui32ClientHeapCount].ui32Attribs =
                                    psDeviceMemoryHeap[i].ui32Attribs;
-#if defined(PVR_SECURE_HANDLES)
                                pbShared[ui32ClientHeapCount] = IMG_FALSE;
-#endif
 
                                ui32ClientHeapCount++;
                                break;
@@ -1032,7 +1020,7 @@ PVRSRVMapDeviceClassMemoryKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
        psBMContext = (BM_CONTEXT *) psDeviceClassBuffer->hDevMemContext;
        psDevMemoryInfo = &psBMContext->psDeviceNode->sDevMemoryInfo;
        hDevMemHeap =
-           psDevMemoryInfo->psDeviceMemoryHeap[SGX_GENERAL_MAPPING_HEAP_ID].
+           psDevMemoryInfo->psDeviceMemoryHeap[SGX_FB_MAPPING_HEAP_ID].
            hDevMemHeap;
 
        ui32Offset = ((IMG_UINT32) pvCPUVAddr) & (ui32PageSize - 1);
index cb152c3..c373209 100644 (file)
@@ -31,9 +31,7 @@
 #include <linux/version.h>
 #include <asm/io.h>
 #include <asm/page.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
 #include <asm/system.h>
-#endif
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
index ddbb468..d79e991 100644 (file)
@@ -24,7 +24,6 @@
  *
  ******************************************************************************/
 
-#ifdef PVR_SECURE_HANDLES
 #include <stddef.h>
 
 #include "services_headers.h"
@@ -148,9 +147,6 @@ PVRSRV_HANDLE_BASE *gpsKernelHandleBase;
 
 typedef IMG_UINTPTR_T HAND_KEY[HAND_KEY_LEN];
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(HandleListInit)
-#endif
 static INLINE
     IMG_VOID HandleListInit(IMG_UINT32 ui32Index, struct sHandleList *psList,
                            IMG_HANDLE hParent)
@@ -160,9 +156,6 @@ static INLINE
        psList->hParent = hParent;
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(InitParentList)
-#endif
 static INLINE
     IMG_VOID InitParentList(PVRSRV_HANDLE_BASE * psBase,
                            struct sHandle *psHandle)
@@ -173,9 +166,6 @@ static INLINE
                       INDEX_TO_HANDLE(psBase, ui32Parent));
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(InitChildEntry)
-#endif
 static INLINE
     IMG_VOID InitChildEntry(PVRSRV_HANDLE_BASE * psBase,
                            struct sHandle *psHandle)
@@ -184,9 +174,6 @@ static INLINE
                       &psHandle->sSiblings, IMG_NULL);
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(HandleListIsEmpty)
-#endif
 static INLINE
     IMG_BOOL HandleListIsEmpty(IMG_UINT32 ui32Index, struct sHandleList *psList)
 {
@@ -207,9 +194,6 @@ static INLINE
 }
 
 #ifdef DEBUG
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(NoChildren)
-#endif
 static INLINE
     IMG_BOOL NoChildren(PVRSRV_HANDLE_BASE * psBase, struct sHandle *psHandle)
 {
@@ -220,9 +204,6 @@ static INLINE
                                 &psHandle->sChildren);
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(NoParent)
-#endif
 static INLINE
     IMG_BOOL NoParent(PVRSRV_HANDLE_BASE * psBase, struct sHandle *psHandle)
 {
@@ -237,9 +218,6 @@ static INLINE
        return IMG_FALSE;
 }
 #endif
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(ParentHandle)
-#endif
 static INLINE IMG_HANDLE ParentHandle(struct sHandle *psHandle)
 {
        return psHandle->sSiblings.hParent;
@@ -248,9 +226,6 @@ static INLINE IMG_HANDLE ParentHandle(struct sHandle *psHandle)
 #define        LIST_PTR_FROM_INDEX_AND_OFFSET(psBase, i, p, po, eo) \
                ((struct sHandleList *)((char *)(INDEX_TO_HANDLE_PTR(psBase, i)) + (((i) == (p)) ? (po) : (eo))))
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(HandleListInsertBefore)
-#endif
 static INLINE
     IMG_VOID HandleListInsertBefore(PVRSRV_HANDLE_BASE * psBase,
                                    IMG_UINT32 ui32InsIndex,
@@ -281,9 +256,6 @@ static INLINE
        psEntry->hParent = INDEX_TO_HANDLE(psBase, ui32ParentIndex);
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(AdoptChild)
-#endif
 static INLINE
     IMG_VOID AdoptChild(PVRSRV_HANDLE_BASE * psBase, struct sHandle *psParent,
                        struct sHandle *psChild)
@@ -303,9 +275,6 @@ static INLINE
 
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(HandleListRemove)
-#endif
 static INLINE
     IMG_VOID HandleListRemove(PVRSRV_HANDLE_BASE * psBase,
                              IMG_UINT32 ui32EntryIndex,
@@ -338,9 +307,6 @@ static INLINE
        }
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(UnlinkFromParent)
-#endif
 static INLINE
     IMG_VOID UnlinkFromParent(PVRSRV_HANDLE_BASE * psBase,
                              struct sHandle *psHandle)
@@ -351,9 +317,6 @@ static INLINE
                         offsetof(struct sHandle, sChildren));
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(HandleListIterate)
-#endif
 static INLINE
     PVRSRV_ERROR HandleListIterate(PVRSRV_HANDLE_BASE * psBase,
                                   struct sHandleList *psHead,
@@ -389,9 +352,6 @@ static INLINE
        return PVRSRV_OK;
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(IterateOverChildren)
-#endif
 static INLINE
     PVRSRV_ERROR IterateOverChildren(PVRSRV_HANDLE_BASE * psBase,
                                     struct sHandle *psParent,
@@ -404,9 +364,6 @@ static INLINE
                                 pfnIterFunc);
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(GetHandleStructure)
-#endif
 static INLINE
     PVRSRV_ERROR GetHandleStructure(PVRSRV_HANDLE_BASE * psBase,
                                    struct sHandle **ppsHandle,
@@ -445,18 +402,12 @@ static INLINE
        return PVRSRV_OK;
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(ParentIfPrivate)
-#endif
 static INLINE IMG_HANDLE ParentIfPrivate(struct sHandle *psHandle)
 {
        return TEST_ALLOC_FLAG(psHandle, PVRSRV_HANDLE_ALLOC_FLAG_PRIVATE) ?
            ParentHandle(psHandle) : IMG_NULL;
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(InitKey)
-#endif
 static INLINE
     IMG_VOID InitKey(HAND_KEY aKey, PVRSRV_HANDLE_BASE * psBase,
                     IMG_VOID * pvData, PVRSRV_HANDLE_TYPE eType,
@@ -636,9 +587,6 @@ static PVRSRV_ERROR FreeHandleBase(PVRSRV_HANDLE_BASE * psBase)
        return PVRSRV_OK;
 }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(FindHandle)
-#endif
 static INLINE
     IMG_HANDLE FindHandle(PVRSRV_HANDLE_BASE * psBase, IMG_VOID * pvData,
                          PVRSRV_HANDLE_TYPE eType, IMG_HANDLE hParent)
@@ -1362,5 +1310,3 @@ PVRSRV_ERROR PVRSRVHandleDeInit(IMG_VOID)
 
        return eError;
 }
-#else
-#endif
index cca1cfb..5f89144 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef __HANDLE_H__
 #define __HANDLE_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #include "img_types.h"
 #include "hash.h"
@@ -72,7 +69,6 @@ extern "C" {
        struct _PVRSRV_HANDLE_BASE_;
        typedef struct _PVRSRV_HANDLE_BASE_ PVRSRV_HANDLE_BASE;
 
-#ifdef PVR_SECURE_HANDLES
        extern PVRSRV_HANDLE_BASE *gpsKernelHandleBase;
 
 #define        KERNEL_HANDLE_BASE (gpsKernelHandleBase)
@@ -138,223 +134,6 @@ extern "C" {
 
        PVRSRV_ERROR PVRSRVHandleDeInit(IMG_VOID);
 
-#else
-
-#define KERNEL_HANDLE_BASE IMG_NULL
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVAllocHandle)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVAllocHandle(PVRSRV_HANDLE_BASE * psBase,
-                                          IMG_HANDLE * phHandle,
-                                          IMG_VOID * pvData,
-                                          PVRSRV_HANDLE_TYPE eType,
-                                          PVRSRV_HANDLE_ALLOC_FLAG eFlag) {
-               PVR_UNREFERENCED_PARAMETER(eType);
-               PVR_UNREFERENCED_PARAMETER(eFlag);
-               PVR_UNREFERENCED_PARAMETER(psBase);
-
-               *phHandle = pvData;
-               return PVRSRV_OK;
-       }
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVAllocSubHandle)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVAllocSubHandle(PVRSRV_HANDLE_BASE * psBase,
-                                             IMG_HANDLE * phHandle,
-                                             IMG_VOID * pvData,
-                                             PVRSRV_HANDLE_TYPE eType,
-                                             PVRSRV_HANDLE_ALLOC_FLAG eFlag,
-                                             IMG_HANDLE hParent) {
-               PVR_UNREFERENCED_PARAMETER(eType);
-               PVR_UNREFERENCED_PARAMETER(eFlag);
-               PVR_UNREFERENCED_PARAMETER(hParent);
-               PVR_UNREFERENCED_PARAMETER(psBase);
-
-               *phHandle = pvData;
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVFindHandle)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVFindHandle(PVRSRV_HANDLE_BASE * psBase,
-                                         IMG_HANDLE * phHandle,
-                                         IMG_VOID * pvData,
-                                         PVRSRV_HANDLE_TYPE eType) {
-               PVR_UNREFERENCED_PARAMETER(eType);
-               PVR_UNREFERENCED_PARAMETER(psBase);
-
-               *phHandle = pvData;
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVLookupHandleAnyType)
-#endif
-       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;
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVLookupHandle)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVLookupHandle(PVRSRV_HANDLE_BASE * psBase,
-                                           IMG_PVOID * ppvData,
-                                           IMG_HANDLE hHandle,
-                                           PVRSRV_HANDLE_TYPE eType) {
-               PVR_UNREFERENCED_PARAMETER(psBase);
-               PVR_UNREFERENCED_PARAMETER(eType);
-
-               *ppvData = hHandle;
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVLookupSubHandle)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVLookupSubHandle(PVRSRV_HANDLE_BASE * psBase,
-                                              IMG_PVOID * ppvData,
-                                              IMG_HANDLE hHandle,
-                                              PVRSRV_HANDLE_TYPE eType,
-                                              IMG_HANDLE hAncestor) {
-               PVR_UNREFERENCED_PARAMETER(psBase);
-               PVR_UNREFERENCED_PARAMETER(eType);
-               PVR_UNREFERENCED_PARAMETER(hAncestor);
-
-               *ppvData = hHandle;
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVGetParentHandle)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVGetParentHandle(PVRSRV_HANDLE_BASE * psBase,
-                                              IMG_PVOID * phParent,
-                                              IMG_HANDLE hHandle,
-                                              PVRSRV_HANDLE_TYPE eType) {
-               PVR_UNREFERENCED_PARAMETER(psBase);
-               PVR_UNREFERENCED_PARAMETER(eType);
-               PVR_UNREFERENCED_PARAMETER(hHandle);
-
-               *phParent = IMG_NULL;
-
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVLookupAndReleaseHandle)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVLookupAndReleaseHandle(PVRSRV_HANDLE_BASE *
-                                                     psBase,
-                                                     IMG_PVOID * ppvData,
-                                                     IMG_HANDLE hHandle,
-                                                     PVRSRV_HANDLE_TYPE eType)
-       {
-               PVR_UNREFERENCED_PARAMETER(eType);
-               PVR_UNREFERENCED_PARAMETER(psBase);
-
-               *ppvData = hHandle;
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVReleaseHandle)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVReleaseHandle(PVRSRV_HANDLE_BASE * psBase,
-                                            IMG_HANDLE hHandle,
-                                            PVRSRV_HANDLE_TYPE eType) {
-               PVR_UNREFERENCED_PARAMETER(hHandle);
-               PVR_UNREFERENCED_PARAMETER(eType);
-               PVR_UNREFERENCED_PARAMETER(psBase);
-
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVNewHandleBatch)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVNewHandleBatch(PVRSRV_HANDLE_BASE * psBase,
-                                             IMG_UINT32 ui32BatchSize) {
-               PVR_UNREFERENCED_PARAMETER(psBase);
-               PVR_UNREFERENCED_PARAMETER(ui32BatchSize);
-
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVCommitHandleBatch)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVCommitHandleBatch(PVRSRV_HANDLE_BASE * psBase) {
-               PVR_UNREFERENCED_PARAMETER(psBase);
-
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVReleaseHandleBatch)
-#endif
-       static INLINE void PVRSRVReleaseHandleBatch(PVRSRV_HANDLE_BASE * psBase) {
-               PVR_UNREFERENCED_PARAMETER(psBase);
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVAllocHandleBase)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVAllocHandleBase(PVRSRV_HANDLE_BASE ** ppsBase,
-                                              IMG_UINT32 ui32PID) {
-               PVR_UNREFERENCED_PARAMETER(ui32PID);
-
-               *ppsBase = IMG_NULL;
-
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVFreeHandleBase)
-#endif
-       static INLINE
-           PVRSRV_ERROR PVRSRVFreeHandleBase(PVRSRV_HANDLE_BASE * psBase) {
-               PVR_UNREFERENCED_PARAMETER(psBase);
-
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVHandleInit)
-#endif
-       static INLINE PVRSRV_ERROR PVRSRVHandleInit(IMG_VOID) {
-               return PVRSRV_OK;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVHandleDeInit)
-#endif
-       static INLINE PVRSRV_ERROR PVRSRVHandleDeInit(IMG_VOID) {
-               return PVRSRV_OK;
-       }
-
-#endif
 
 #define PVRSRVAllocHandleNR(psBase, phHandle, pvData, eType, eFlag) \
        (void)PVRSRVAllocHandle(psBase, phHandle, pvData, eType, eFlag)
@@ -362,8 +141,5 @@ extern "C" {
 #define PVRSRVAllocSubHandleNR(psBase, phHandle, pvData, eType, eFlag, hParent) \
        (void)PVRSRVAllocSubHandle(psBase, phHandle, pvData, eType, eFlag, hParent)
 
-#if defined (__cplusplus)
-}
-#endif
 
 #endif
index 3058f2c..1d2ec39 100644 (file)
@@ -360,27 +360,3 @@ IMG_UINTPTR_T HASH_Retrieve(HASH_TABLE * pHash, IMG_UINTPTR_T k)
        return HASH_Retrieve_Extended(pHash, &k);
 }
 
-#ifdef HASH_TRACE
-void HASH_Dump(HASH_TABLE * pHash)
-{
-       IMG_UINT32 uIndex;
-       IMG_UINT32 uMaxLength = 0;
-       IMG_UINT32 uEmptyCount = 0;
-
-       PVR_ASSERT(pHash != IMG_NULL);
-       for (uIndex = 0; uIndex < pHash->uSize; uIndex++) {
-               BUCKET *pBucket;
-               IMG_UINT32 uLength = 0;
-               if (pHash->ppBucketTable[uIndex] == IMG_NULL)
-                       uEmptyCount++;
-               for (pBucket = pHash->ppBucketTable[uIndex];
-                    pBucket != IMG_NULL; pBucket = pBucket->pNext)
-                       uLength++;
-               uMaxLength = PRIVATE_MAX(uMaxLength, uLength);
-       }
-
-       PVR_TRACE(("hash table: uMinimumSize=%d  size=%d  count=%d",
-                  pHash->uMinimumSize, pHash->uSize, pHash->uCount));
-       PVR_TRACE(("  empty=%d  max=%d", uEmptyCount, uMaxLength));
-}
-#endif
index 59b7f0a..6d3993f 100644 (file)
@@ -30,9 +30,6 @@
 #include "img_types.h"
 #include "osfunc.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
        typedef IMG_UINT32 HASH_FUNC(IMG_SIZE_T uKeySize, IMG_VOID * pKey,
                                     IMG_UINT32 uHashTabLen);
@@ -71,11 +68,5 @@ extern "C" {
 
        IMG_UINTPTR_T HASH_Retrieve(HASH_TABLE * pHash, IMG_UINTPTR_T k);
 
-#ifdef HASH_TRACE
-       void HASH_Dump(HASH_TABLE * pHash);
-#endif
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index 5cc140c..aa9d5b9 100644 (file)
@@ -39,18 +39,8 @@ typedef enum img_tag_TriStateSwitch {
 
 #define                IMG_NO_REG                              1
 
-#if defined (NO_INLINE_FUNCS)
-#define        INLINE
-#define        FORCE_INLINE
-#else
-#if defined (__cplusplus)
-#define INLINE                                 inline
-#define        FORCE_INLINE                    inline
-#else
 #define        INLINE                                  __inline
 #define        FORCE_INLINE                    static __inline
-#endif
-#endif
 
 #ifndef PVR_UNREFERENCED_PARAMETER
 #define        PVR_UNREFERENCED_PARAMETER(param) (param) = (param)
@@ -62,16 +52,9 @@ typedef enum img_tag_TriStateSwitch {
 #define unref__
 #endif
 
-#ifndef _TCHAR_DEFINED
-#if defined(UNICODE)
-typedef unsigned short TCHAR, *PTCHAR, *PTSTR;
-#else
 typedef char TCHAR, *PTCHAR, *PTSTR;
-#endif
 #define _TCHAR_DEFINED
-#endif
 
-#if defined(__linux__)
 
 #define IMG_CALLCONV
 #define IMG_INTERNAL   __attribute__ ((visibility ("hidden")))
@@ -79,20 +62,11 @@ typedef char TCHAR, *PTCHAR, *PTSTR;
 #define IMG_IMPORT
 #define IMG_RESTRICT   __restrict__
 
-#else
-#error("define an OS")
-#endif
 
-#ifndef IMG_ABORT
 #define IMG_ABORT()    abort()
-#endif
 
-#ifndef IMG_MALLOC
 #define IMG_MALLOC(A)          malloc  (A)
-#endif
 
-#ifndef IMG_FREE
 #define IMG_FREE(A)                    free    (A)
-#endif
 
 #endif
index b0ec065..4e636d9 100644 (file)
@@ -40,18 +40,10 @@ typedef signed short IMG_INT16, *IMG_PINT16;
 typedef unsigned long IMG_UINT32, *IMG_PUINT32;
 typedef signed long IMG_INT32, *IMG_PINT32;
 
-#if defined(LINUX)
-#if !defined(USE_CODE)
 typedef unsigned long long IMG_UINT64, *IMG_PUINT64;
 typedef long long IMG_INT64, *IMG_PINT64;
-#endif
-#else
-
-#error("define an OS")
-
-#endif
 
-#if !(defined(LINUX) && defined (__KERNEL__))
+#ifndef __KERNEL__
 typedef float IMG_FLOAT, *IMG_PFLOAT;
 typedef double IMG_DOUBLE, *IMG_PDOUBLE;
 #endif
index c9ae96d..80ed44e 100644 (file)
@@ -29,7 +29,6 @@
 
 #define MAKEIOCTLINDEX(i)      (((i) >> 2) & 0xFFF)
 
-#ifndef CTL_CODE
 
 #define DEVICE_TYPE ULONG
 
@@ -92,6 +91,5 @@
 #define FILE_READ_ACCESS          ( 0x0001 )
 #define FILE_WRITE_ACCESS         ( 0x0002 )
 
-#endif
 
 #endif
index dab858c..29f1041 100644 (file)
@@ -52,15 +52,9 @@ IMG_UINT32 PVRSRVTimeNow(IMG_VOID)
 
                return 0;
        }
-#if defined(__sh__)
-
-       return (0xffffffff - *pui32TimerRegister);
-
-#else
 
        return 0;
 
-#endif
 }
 
 static IMG_UINT32 PVRSRVGetCPUFreq(IMG_VOID)
@@ -90,21 +84,9 @@ IMG_VOID PVRSRVSetupMetricTimers(IMG_VOID * pvDevInfo)
                asTimers[ui32Loop].ui32Count = 0;
        }
 
-#if defined(__sh__)
-
-       *TCR_2 = TIMER_DIVISOR;
-
-       *TCOR_2 = *TCNT_2 = (unsigned int)0xffffffff;
-
-       *TST_REG |= (unsigned char)0x04;
-
-       pui32TimerRegister = (IMG_UINT32 *) TCNT_2;
-
-#else
 
        pui32TimerRegister = 0;
 
-#endif
 
 }
 
@@ -127,18 +109,6 @@ IMG_VOID PVRSRVOutputMetricTotals(IMG_VOID)
                                 ui32Loop));
                }
        }
-#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
index c41d735..d44f954 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef _METRICS_
 #define _METRICS_
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #if defined(DEBUG) || defined(TIMING)
 
@@ -81,17 +78,6 @@ extern "C" {
                                                                        asTimers[X].ui32Count = 0; \
                                                                }
 
-#if defined(__sh__)
-
-#define TST_REG   ((volatile unsigned char *) (psDevInfo->pvSOCRegsBaseKM))
-
-#define TCOR_2    ((volatile unsigned int *)  (psDevInfo->pvSOCRegsBaseKM+28))
-#define TCNT_2    ((volatile unsigned int *)  (psDevInfo->pvSOCRegsBaseKM+32))
-#define TCR_2     ((volatile unsigned short *)(psDevInfo->pvSOCRegsBaseKM+36))
-
-#define TIMER_DIVISOR  4
-
-#endif
 
 #else
 
@@ -106,7 +92,4 @@ extern "C" {
 
 #endif
 
-#if defined(__cplusplus)
-}
-#endif
 #endif
index 6a149bd..8c93b60 100644 (file)
--- a/pvr/mm.c
+++ b/pvr/mm.c
@@ -32,9 +32,6 @@
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
 #include <asm/io.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
-#include <linux/wrapper.h>
-#endif
 #include <linux/slab.h>
 #include <linux/highmem.h>
 #include <linux/sched.h>
 #include "proc.h"
 #include "mutex.h"
 
-#if defined(CONFIG_ARCH_OMAP)
 #define        PVR_FLUSH_CACHE_BEFORE_KMAP
-#endif
 
-#if defined(PVR_FLUSH_CACHE_BEFORE_KMAP)
 #include <asm/cacheflush.h>
-#endif
 
 extern PVRSRV_LINUX_MUTEX gPVRSRVLock;
 
@@ -137,10 +130,6 @@ static off_t printLinuxMemAreaRecords(char *buffer, size_t size, off_t off);
 
 static LinuxKMemCache *psLinuxMemAreaCache;
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-static IMG_VOID ReservePages(IMG_VOID * pvAddress, IMG_UINT32 ui32Length);
-static IMG_VOID UnreservePages(IMG_VOID * pvAddress, IMG_UINT32 ui32Length);
-#endif
 
 static LinuxMemArea *LinuxMemAreaStructAlloc(IMG_VOID);
 static IMG_VOID LinuxMemAreaStructFree(LinuxMemArea * psLinuxMemArea);
@@ -440,11 +429,7 @@ IMG_VOID *_VMallocWrapper(IMG_UINT32 ui32Bytes,
                PGProtFlags = PAGE_KERNEL;
                break;
        case PVRSRV_HAP_WRITECOMBINE:
-#if defined(__arm__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
                PGProtFlags = pgprot_writecombine(PAGE_KERNEL);
-#else
-               PGProtFlags = pgprot_noncached(PAGE_KERNEL);
-#endif
                break;
        case PVRSRV_HAP_UNCACHED:
                PGProtFlags = pgprot_noncached(PAGE_KERNEL);
@@ -500,10 +485,6 @@ LinuxMemArea *NewVMallocLinuxMemArea(IMG_UINT32 ui32Bytes,
        if (!pvCpuVAddr) {
                goto failed;
        }
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-
-       ReservePages(pvCpuVAddr, ui32Bytes);
-#endif
 
        psLinuxMemArea->eAreaType = LINUX_MEM_AREA_VMALLOC;
        psLinuxMemArea->uData.sVmalloc.pvVmallocAddress = pvCpuVAddr;
@@ -532,10 +513,6 @@ IMG_VOID FreeVMallocLinuxMemArea(LinuxMemArea * psLinuxMemArea)
        DebugLinuxMemAreaRecordRemove(psLinuxMemArea);
 #endif
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-       UnreservePages(psLinuxMemArea->uData.sVmalloc.pvVmallocAddress,
-                      psLinuxMemArea->ui32ByteSize);
-#endif
 
        PVR_DPF((PVR_DBG_MESSAGE, "%s: pvCpuVAddr: %p",
                 __FUNCTION__,
@@ -545,35 +522,6 @@ IMG_VOID FreeVMallocLinuxMemArea(LinuxMemArea * psLinuxMemArea)
        LinuxMemAreaStructFree(psLinuxMemArea);
 }
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-static IMG_VOID ReservePages(IMG_VOID * pvAddress, IMG_UINT32 ui32Length)
-{
-       IMG_VOID *pvPage;
-       IMG_VOID *pvEnd = pvAddress + ui32Length;
-
-       for (pvPage = pvAddress; pvPage < pvEnd; pvPage += PAGE_SIZE) {
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
-               SetPageReserved(vmalloc_to_page(pvPage));
-#else
-               mem_map_reserve(vmalloc_to_page(pvPage));
-#endif
-       }
-}
-
-static IMG_VOID UnreservePages(IMG_VOID * pvAddress, IMG_UINT32 ui32Length)
-{
-       IMG_VOID *pvPage;
-       IMG_VOID *pvEnd = pvAddress + ui32Length;
-
-       for (pvPage = pvAddress; pvPage < pvEnd; pvPage += PAGE_SIZE) {
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
-               ClearPageReserved(vmalloc_to_page(pvPage));
-#else
-               mem_map_unreserve(vmalloc_to_page(pvPage));
-#endif
-       }
-}
-#endif
 
 IMG_VOID *_IORemapWrapper(IMG_CPU_PHYADDR BasePAddr,
                          IMG_UINT32 ui32Bytes,
@@ -584,7 +532,7 @@ IMG_VOID *_IORemapWrapper(IMG_CPU_PHYADDR BasePAddr,
 
        switch (ui32MappingFlags & PVRSRV_HAP_CACHETYPE_MASK) {
        case PVRSRV_HAP_CACHED:
-#if defined(__arm__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+#if defined(__arm__)
                pvIORemapCookie =
                    (IMG_VOID *) ioremap_cached(BasePAddr.uiAddr, ui32Bytes);
 #else
@@ -594,29 +542,11 @@ IMG_VOID *_IORemapWrapper(IMG_CPU_PHYADDR BasePAddr,
                break;
        case PVRSRV_HAP_WRITECOMBINE:
 #if defined(__arm__)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
                pvIORemapCookie =
                    (IMG_VOID *) ioremap_nocache(BasePAddr.uiAddr, ui32Bytes);
-#else
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17))
-               pvIORemapCookie =
-                   (IMG_VOID *) __ioremap(BasePAddr.uiAddr, ui32Bytes,
-                                          L_PTE_BUFFERABLE);
-#else
-               pvIORemapCookie =
-                   (IMG_VOID *) __ioremap(BasePAddr.uiAddr, ui32Bytes,
-                                          L_PTE_BUFFERABLE, 1);
-#endif
-#endif
-#else
-#if defined(__i386__) && defined(SUPPORT_LINUX_X86_WRITECOMBINE)
-               pvIORemapCookie =
-                   (IMG_VOID *) __ioremap(BasePAddr.uiAddr, ui32Bytes,
-                                          _PAGE_PCD);
 #else
                pvIORemapCookie =
                    (IMG_VOID *) ioremap_nocache(BasePAddr.uiAddr, ui32Bytes);
-#endif
 #endif
                break;
        case PVRSRV_HAP_UNCACHED:
@@ -807,14 +737,6 @@ LinuxMemArea *NewAllocPagesLinuxMemArea(IMG_UINT32 ui32Bytes,
                if (!pvPageList[i]) {
                        goto failed_alloc_pages;
                }
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
-               SetPageReserved(pvPageList[i]);
-#else
-               mem_map_reserve(pvPageList[i]);
-#endif
-#endif
 
        }
 
@@ -869,13 +791,6 @@ IMG_VOID FreeAllocPagesLinuxMemArea(LinuxMemArea * psLinuxMemArea)
 #endif
 
        for (i = 0; i < ui32PageCount; i++) {
-#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
                __free_pages(pvPageList[i], 0);
        }
        VFreeWrapper(psLinuxMemArea->uData.sPageList.pvPageList);
@@ -919,10 +834,8 @@ IMG_VOID *_KMapWrapper(struct page * psPage, IMG_CHAR * pszFileName,
 {
        IMG_VOID *pvRet;
 
-#if defined(PVR_FLUSH_CACHE_BEFORE_KMAP)
 
        flush_cache_all();
-#endif
 
        pvRet = kmap(psPage);
 
@@ -953,13 +866,7 @@ LinuxKMemCache *KMemCacheCreateWrapper(IMG_CHAR * pszName,
                                       size_t Size,
                                       size_t Align, IMG_UINT32 ui32Flags)
 {
-#if defined(DEBUG_LINUX_SLAB_ALLOCATIONS)
-       ui32Flags |= SLAB_POISON | SLAB_RED_ZONE;
-#endif
        return kmem_cache_create(pszName, Size, Align, ui32Flags, NULL
-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22))
-                                , NULL
-#endif
            );
 }
 
@@ -969,11 +876,7 @@ IMG_VOID KMemCacheDestroyWrapper(LinuxKMemCache * psCache)
 }
 
 IMG_VOID *_KMemCacheAllocWrapper(LinuxKMemCache * psCache,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
                                 gfp_t Flags,
-#else
-                                int Flags,
-#endif
                                 IMG_CHAR * pszFileName, IMG_UINT32 ui32Line)
 {
        IMG_VOID *pvRet;
@@ -1056,16 +959,7 @@ IMG_VOID FreeSubLinuxMemArea(LinuxMemArea * psLinuxMemArea)
 
 static LinuxMemArea *LinuxMemAreaStructAlloc(IMG_VOID)
 {
-#if 0
-       LinuxMemArea *psLinuxMemArea;
-       psLinuxMemArea = kmem_cache_alloc(psLinuxMemAreaCache, GFP_KERNEL);
-       printk(KERN_ERR "%s: psLinuxMemArea=%p\n", __FUNCTION__,
-              psLinuxMemArea);
-       dump_stack();
-       return psLinuxMemArea;
-#else
        return KMemCacheAllocWrapper(psLinuxMemAreaCache, GFP_KERNEL);
-#endif
 }
 
 static IMG_VOID LinuxMemAreaStructFree(LinuxMemArea * psLinuxMemArea)
@@ -1363,7 +1257,6 @@ static off_t printLinuxMemAreaRecords(char *buffer, size_t count, off_t off)
                        Ret = 0;
                        goto unlock_and_return;
                }
-#if !defined(DEBUG_LINUX_XML_PROC_FILES)
                Ret = printAppend(buffer, count, 0,
                                  "Number of Linux Memory Areas: %lu\n"
                                  "At the current water mark these areas correspond to %lu bytes (excluding SUB areas)\n"
@@ -1377,17 +1270,6 @@ static off_t printLinuxMemAreaRecords(char *buffer, size_t count, off_t off)
                                  "LinuxMemType",
                                  "CpuVAddr",
                                  "CpuPAddr", "Bytes", "Pid", "Flags");
-#else
-               Ret = printAppend(buffer, count, 0,
-                                 "<mem_areas_header>\n"
-                                 "\t<count>%lu</count>\n"
-                                 "\t<watermark key=\"mar0\" description=\"current\" bytes=\"%lu\"/>\n"
-                                 "\t<watermark key=\"mar1\" description=\"high\" bytes=\"%lu\"/>\n"
-                                 "</mem_areas_header>\n",
-                                 g_LinuxMemAreaCount,
-                                 g_LinuxMemAreaWaterMark,
-                                 g_LinuxMemAreaHighWaterMark);
-#endif
                goto unlock_and_return;
        }
 
@@ -1404,20 +1286,7 @@ static off_t printLinuxMemAreaRecords(char *buffer, size_t count, off_t off)
        }
 
        Ret = printAppend(buffer, count, 0,
-#if !defined(DEBUG_LINUX_XML_PROC_FILES)
                          "%8p       %-24s %8p %08lx %-8ld %-5u %08lx=(%s)\n",
-#else
-                         "<linux_mem_area>\n"
-                         "\t<pointer>%8p</pointer>\n"
-                         "\t<type>%s</type>\n"
-                         "\t<cpu_virtual>%8p</cpu_virtual>\n"
-                         "\t<cpu_physical>%08lx</cpu_physical>\n"
-                         "\t<bytes>%ld</bytes>\n"
-                         "\t<pid>%u</pid>\n"
-                         "\t<flags>%08lx</flags>\n"
-                         "\t<flags_string>%s</flags_string>\n"
-                         "</linux_mem_area>\n",
-#endif
                          psRecord->psLinuxMemArea,
                          LinuxMemAreaTypeToString(psRecord->psLinuxMemArea->
                                                   eAreaType),
@@ -1449,7 +1318,6 @@ static off_t printMemoryRecords(char *buffer, size_t count, off_t off)
                        Ret = 0;
                        goto unlock_and_return;
                }
-#if !defined(DEBUG_LINUX_XML_PROC_FILES)
 
                Ret = printAppend(buffer, count, 0, "%-60s: %ld bytes\n",
                                  "Current Water Mark of bytes allocated via kmalloc",
@@ -1539,93 +1407,6 @@ static off_t printMemoryRecords(char *buffer, size_t count, off_t off)
                                "CpuVAddr", "CpuPAddr", "Bytes", "PID",
                                "PrivateData", "Filename:Line");
 
-#else
-
-               Ret =
-                   printAppend(buffer, count, 0,
-                               "<meminfo>\n<meminfo_header>\n");
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr0\" description=\"kmalloc_current\" bytes=\"%ld\"/>\n",
-                               g_WaterMarkData[DEBUG_MEM_ALLOC_TYPE_KMALLOC]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr1\" description=\"kmalloc_high\" bytes=\"%ld\"/>\n",
-                               g_HighWaterMarkData
-                               [DEBUG_MEM_ALLOC_TYPE_KMALLOC]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr2\" description=\"vmalloc_current\" bytes=\"%ld\"/>\n",
-                               g_WaterMarkData[DEBUG_MEM_ALLOC_TYPE_VMALLOC]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr3\" description=\"vmalloc_high\" bytes=\"%ld\"/>\n",
-                               g_HighWaterMarkData
-                               [DEBUG_MEM_ALLOC_TYPE_VMALLOC]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr4\" description=\"alloc_pages_current\" bytes=\"%ld\"/>\n",
-                               g_WaterMarkData
-                               [DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr5\" description=\"alloc_pages_high\" bytes=\"%ld\"/>\n",
-                               g_HighWaterMarkData
-                               [DEBUG_MEM_ALLOC_TYPE_ALLOC_PAGES]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr6\" description=\"ioremap_current\" bytes=\"%ld\"/>\n",
-                               g_WaterMarkData[DEBUG_MEM_ALLOC_TYPE_IOREMAP]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr7\" description=\"ioremap_high\" bytes=\"%ld\"/>\n",
-                               g_HighWaterMarkData
-                               [DEBUG_MEM_ALLOC_TYPE_IOREMAP]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr8\" description=\"io_current\" bytes=\"%ld\"/>\n",
-                               g_WaterMarkData[DEBUG_MEM_ALLOC_TYPE_IO]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr9\" description=\"io_high\" bytes=\"%ld\"/>\n",
-                               g_HighWaterMarkData[DEBUG_MEM_ALLOC_TYPE_IO]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr10\" description=\"kmem_cache_current\" bytes=\"%ld\"/>\n",
-                               g_WaterMarkData
-                               [DEBUG_MEM_ALLOC_TYPE_KMEM_CACHE]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr11\" description=\"kmem_cache_high\" bytes=\"%ld\"/>\n",
-                               g_HighWaterMarkData
-                               [DEBUG_MEM_ALLOC_TYPE_KMEM_CACHE]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr12\" description=\"kmap_current\" bytes=\"%ld\"/>\n",
-                               g_WaterMarkData[DEBUG_MEM_ALLOC_TYPE_KMAP]);
-               Ret =
-                   printAppend(buffer, count, Ret,
-                               "<watermark key=\"mr13\" description=\"kmap_high\" bytes=\"%ld\"/>\n",
-                               g_HighWaterMarkData[DEBUG_MEM_ALLOC_TYPE_KMAP]);
-
-               Ret = printAppend(buffer, count, Ret, "\n");
-
-               Ret = printAppend(buffer, count, Ret,
-                                 "<watermark key=\"mr14\" description=\"system_ram_current\" bytes=\"%ld\"/>\n",
-                                 g_SysRAMWaterMark);
-               Ret = printAppend(buffer, count, Ret,
-                                 "<watermark key=\"mr15\" description=\"system_ram_high\" bytes=\"%ld\"/>\n",
-                                 g_SysRAMHighWaterMark);
-               Ret = printAppend(buffer, count, Ret,
-                                 "<watermark key=\"mr16\" description=\"system_io_current\" bytes=\"%ld\"/>\n",
-                                 g_IOMemWaterMark);
-               Ret = printAppend(buffer, count, Ret,
-                                 "<watermark key=\"mr17\" description=\"system_io_high\" bytes=\"%ld\"/>\n",
-                                 g_IOMemHighWaterMark);
-
-               Ret = printAppend(buffer, count, Ret, "</meminfo_header>\n");
-
-#endif
 
                goto unlock_and_return;
        }
@@ -1638,31 +1419,13 @@ static off_t printMemoryRecords(char *buffer, size_t count, off_t off)
        for (psRecord = g_MemoryRecords; --off && psRecord;
             psRecord = psRecord->psNext) ;
        if (!psRecord) {
-#if defined(DEBUG_LINUX_XML_PROC_FILES)
-               if (off == 0) {
-                       Ret = printAppend(buffer, count, 0, "</meminfo>\n");
-                       goto unlock_and_return;
-               }
-#endif
                Ret = END_OF_FILE;
                goto unlock_and_return;
        }
 
        if (psRecord->eAllocType != DEBUG_MEM_ALLOC_TYPE_KMEM_CACHE) {
                Ret = printAppend(buffer, count, 0,
-#if !defined(DEBUG_LINUX_XML_PROC_FILES)
                                  "%-16s %-8p %08lx %-10ld %-5d %-10s %s:%ld\n",
-#else
-                                 "<allocation>\n"
-                                 "\t<type>%s</type>\n"
-                                 "\t<cpu_virtual>%-8p</cpu_virtual>\n"
-                                 "\t<cpu_physical>%08lx</cpu_physical>\n"
-                                 "\t<bytes>%ld</bytes>\n"
-                                 "\t<pid>%d</pid>\n"
-                                 "\t<private>%s</private>\n"
-                                 "\t<filename>%s</filename>\n"
-                                 "\t<line>%ld</line>\n" "</allocation>\n",
-#endif
                                  DebugMemAllocRecordTypeToString(psRecord->
                                                                  eAllocType),
                                  psRecord->pvCpuVAddr, psRecord->ulCpuPAddr,
@@ -1670,19 +1433,7 @@ static off_t printMemoryRecords(char *buffer, size_t count, off_t off)
                                  psRecord->pszFileName, psRecord->ui32Line);
        } else {
                Ret = printAppend(buffer, count, 0,
-#if !defined(DEBUG_LINUX_XML_PROC_FILES)
                                  "%-16s %-8p %08lx %-10ld %-5d %-10s %s:%ld\n",
-#else
-                                 "<allocation>\n"
-                                 "\t<type>%s</type>\n"
-                                 "\t<cpu_virtual>%-8p</cpu_virtual>\n"
-                                 "\t<cpu_physical>%08lx</cpu_physical>\n"
-                                 "\t<bytes>%ld</bytes>\n"
-                                 "\t<pid>%d</pid>\n"
-                                 "\t<private>%s</private>\n"
-                                 "\t<filename>%s</filename>\n"
-                                 "\t<line>%ld</line>\n" "</allocation>\n",
-#endif
                                  DebugMemAllocRecordTypeToString(psRecord->
                                                                  eAllocType),
                                  psRecord->pvCpuVAddr, psRecord->ulCpuPAddr,
index a0d0269..6d5961a 100644 (file)
--- a/pvr/mm.h
+++ b/pvr/mm.h
 
 #define        ADDR_TO_PAGE_OFFSET(addr) (((unsigned long)(addr)) & (PAGE_SIZE - 1))
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
 #define        REMAP_PFN_RANGE(vma, addr, pfn, size, prot) remap_pfn_range(vma, addr, pfn, size, prot)
-#else
-#define        REMAP_PFN_RANGE(vma, addr, pfn, size, prot) remap_page_range(vma, addr, PFN_TO_PHYS(pfn), size, prot)
-#endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
 #define        IO_REMAP_PFN_RANGE(vma, addr, pfn, size, prot) io_remap_pfn_range(vma, addr, pfn, size, prot)
-#else
-#define        IO_REMAP_PFN_RANGE(vma, addr, pfn, size, prot) io_remap_page_range(vma, addr, PFN_TO_PHYS(pfn), size, prot)
-#endif
 
 static inline IMG_UINT32 VMallocToPhys(IMG_VOID * pCpuVAddr)
 {
@@ -115,11 +107,7 @@ struct _LinuxMemArea {
        IMG_UINT32 ui32ByteSize;
 };
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17))
-typedef kmem_cache_t LinuxKMemCache;
-#else
 typedef struct kmem_cache LinuxKMemCache;
-#endif
 
 PVRSRV_ERROR LinuxMMInit(IMG_VOID);
 
@@ -228,13 +216,8 @@ IMG_VOID KMemCacheDestroyWrapper(LinuxKMemCache * psCache);
 #define KMemCacheAllocWrapper(psCache, Flags) _KMemCacheAllocWrapper(psCache, Flags, NULL, 0)
 #endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
 IMG_VOID *_KMemCacheAllocWrapper(LinuxKMemCache * psCache, gfp_t Flags,
                                 IMG_CHAR * pszFileName, IMG_UINT32 ui32Line);
-#else
-IMG_VOID *_KMemCacheAllocWrapper(LinuxKMemCache * psCache, int Flags,
-                                IMG_CHAR * pszFileName, IMG_UINT32 ui32Line);
-#endif
 
 #if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
 #define KMemCacheFreeWrapper(psCache, pvObject) _KMemCacheFreeWrapper(psCache, pvObject, __FILE__, __LINE__)
index 09c9431..534dd22 100644 (file)
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/vmalloc.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
-#include <linux/wrapper.h>
-#endif
 #include <linux/slab.h>
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/shmparam.h>
 #include <asm/pgtable.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
 #include <linux/sched.h>
 #include <asm/current.h>
-#endif
 #include "img_defs.h"
 #include "services.h"
 #include "servicesint.h"
@@ -457,30 +452,8 @@ int PVRMMap(struct file *pFile, struct vm_area_struct *ps_vma)
 
                break;
        case PVRSRV_HAP_WRITECOMBINE:
-#if defined(__arm__) || defined(__sh__)
                ps_vma->vm_page_prot =
                    pgprot_writecombine(ps_vma->vm_page_prot);
-#else
-#if defined(__i386__)
-               ps_vma->vm_page_prot = pgprot_noncached(ps_vma->vm_page_prot);
-
-#if defined(SUPPORT_LINUX_X86_WRITECOMBINE)
-
-               if (psCurrentRec->psLinuxMemArea->eAreaType ==
-                   LINUX_MEM_AREA_IOREMAP
-                   || psCurrentRec->psLinuxMemArea->eAreaType ==
-                   LINUX_MEM_AREA_IO) {
-                       ps_vma->vm_page_prot =
-                           __pgprot(pgprot_val(ps_vma->vm_page_prot) &=
-                                    ~_PAGE_PWT);
-               }
-#endif
-
-#else
-               ps_vma->vm_page_prot = pgprot_noncached(ps_vma->vm_page_prot);
-#error  Unsupported architecture!
-#endif
-#endif
                break;
        case PVRSRV_HAP_UNCACHED:
                ps_vma->vm_page_prot = pgprot_noncached(ps_vma->vm_page_prot);
@@ -535,10 +508,6 @@ DoMapToUser(LinuxMemArea * psLinuxMemArea,
 
        PVR_ASSERT(ADDR_TO_PAGE_OFFSET(ui32ByteSize) == 0);
 
-#if defined (__sparc__)
-
-#error "SPARC not supported"
-#endif
 
        if (LinuxMemAreaPhysIsContig(psLinuxMemArea)) {
 
@@ -621,9 +590,6 @@ static void MMapVOpen(struct vm_area_struct *ps_vma)
                 psOffsetStruct->ui32MMapOffset, psOffsetStruct->ui16Mapped));
 #endif
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
-       MOD_INC_USE_COUNT;
-#endif
 }
 
 static void MMapVClose(struct vm_area_struct *ps_vma)
@@ -642,9 +608,6 @@ static void MMapVClose(struct vm_area_struct *ps_vma)
                 psOffsetStruct->ui32MMapOffset, psOffsetStruct->ui16Mapped));
 #endif
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
-       MOD_DEC_USE_COUNT;
-#endif
 }
 
 #if defined(DEBUG_LINUX_MMAP_AREAS)
@@ -656,7 +619,6 @@ static off_t PrintMMapRegistrations(char *buffer, size_t size, off_t off)
        down_read(&g_mmap_sem);
        if (!off) {
                Ret = printAppend(buffer, size, 0,
-#if !defined(DEBUG_LINUX_XML_PROC_FILES)
                                  "Allocations registered for mmap: %lu\n"
                                  "In total these areas correspond to %lu bytes (excluding SUB areas)\n"
                                  "psLinuxMemArea "
@@ -666,11 +628,6 @@ static off_t PrintMMapRegistrations(char *buffer, size_t size, off_t off)
                                  "ByteLength "
                                  "LinuxMemType             "
                                  "Pid   Name     Mapped Flags\n",
-#else
-                                 "<mmap_header>\n"
-                                 "\t<count>%lu</count>\n"
-                                 "\t<bytes>%lu</bytes>\n" "</mmap_header>\n",
-#endif
                                  g_ui32RegisteredAreas, g_ui32TotalByteSize);
 
                goto unlock_and_return;
@@ -689,23 +646,7 @@ static off_t PrintMMapRegistrations(char *buffer, size_t size, off_t off)
        }
 
        Ret = printAppend(buffer, size, 0,
-#if !defined(DEBUG_LINUX_XML_PROC_FILES)
                          "%-8p       %-8p %08lx %08lx   %-8ld   %-24s %-5d %-8s %-5u  %08lx(%s)\n",
-#else
-                         "<mmap_record>\n"
-                         "\t<pointer>%-8p</pointer>\n"
-                         "\t<cpu_virtual>%-8p</cpu_virtual>\n"
-                         "\t<cpu_physical>%08lx</cpu_physical>\n"
-                         "\t<mmap_offset>%08lx</mmap_offset>\n"
-                         "\t<bytes>%-8ld</bytes>\n"
-                         "\t<linux_mem_area_type>%-24s</linux_mem_area_type>\n"
-                         "\t<pid>%-5d</pid>\n"
-                         "\t<name>%-8s</name>\n"
-                         "\t<mapping_count>%-5u</mapping_count>\n"
-                         "\t<flags>%08lx</flags>\n"
-                         "\t<flags_string>%s</flags_string>\n"
-                         "</mmap_record>\n",
-#endif
                          psOffsetStruct->psLinuxMemArea,
                          LinuxMemAreaToCpuVAddr(psOffsetStruct->
                                                 psLinuxMemArea),
index 5b638b1..7ec338c 100644 (file)
--- a/pvr/mmu.c
+++ b/pvr/mmu.c
@@ -71,9 +71,6 @@ struct _MMU_HEAP_ {
        DEV_ARENA_DESCRIPTOR *psDevArena;
 };
 
-#if defined (SUPPORT_SGX_MMU_DUMMY_PAGE)
-#define DUMMY_DATA_PAGE_SIGNATURE      0xDEADBEEF
-#endif
 
 #if defined(PDUMP)
 static IMG_VOID
@@ -84,37 +81,7 @@ MMU_PDumpPageTables(MMU_HEAP * pMMUHeap,
 #endif
 
 #define PAGE_TEST                                      0
-#if PAGE_TEST
-static void PageTest(void *pMem, IMG_DEV_PHYADDR sDevPAddr);
-#endif
-
-#ifdef SUPPORT_SGX_MMU_BYPASS
-IMG_VOID EnableHostAccess(MMU_CONTEXT * psMMUContext)
-{
-       IMG_UINT32 ui32RegVal;
-       IMG_VOID *pvRegsBaseKM = psMMUContext->psDevInfo->pvRegsBaseKM;
-
-       ui32RegVal = OSReadHWReg(pvRegsBaseKM, EUR_CR_BIF_CTRL);
 
-       OSWriteHWReg(pvRegsBaseKM,
-                    EUR_CR_BIF_CTRL,
-                    ui32RegVal | EUR_CR_BIF_CTRL_MMU_BYPASS_HOST_MASK);
-
-       PDUMPREG(EUR_CR_BIF_CTRL, EUR_CR_BIF_CTRL_MMU_BYPASS_HOST_MASK);
-}
-
-IMG_VOID 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(EUR_CR_BIF_CTRL, 0);
-}
-#endif
 
 IMG_VOID MMU_InvalidateDirectoryCache(PVRSRV_SGXDEV_INFO * psDevInfo)
 {
@@ -205,15 +172,8 @@ _DeferredFreePageTable(MMU_HEAP * pMMUHeap, IMG_UINT32 ui32PTIndex)
                                    (IMG_UINT32 *) psMMUContext->pvPDCpuVAddr;
                                pui32PDEntry += ui32PDIndex;
 
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
-                               pui32PDEntry[ui32PTIndex] =
-                                   psMMUContext->psDevInfo->sDummyPTDevPAddr.
-                                   uiAddr | SGX_MMU_PDE_VALID;
-#else
 
                                pui32PDEntry[ui32PTIndex] = 0;
-#endif
 
                                PDUMPMEM2(PVRSRV_DEVICE_TYPE_SGX,
                                          (IMG_VOID *) &
@@ -234,15 +194,8 @@ _DeferredFreePageTable(MMU_HEAP * pMMUHeap, IMG_UINT32 ui32PTIndex)
                            (IMG_UINT32 *) pMMUHeap->psMMUContext->pvPDCpuVAddr;
                        pui32PDEntry += ui32PDIndex;
 
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
-                       pui32PDEntry[ui32PTIndex] =
-                           pMMUHeap->psMMUContext->psDevInfo->sDummyPTDevPAddr.
-                           uiAddr | SGX_MMU_PDE_VALID;
-#else
 
                        pui32PDEntry[ui32PTIndex] = 0;
-#endif
 
                        PDUMPMEM2(PVRSRV_DEVICE_TYPE_SGX,
                                  (IMG_VOID *) & pui32PDEntry[ui32PTIndex],
@@ -345,9 +298,7 @@ _DeferredAllocPagetables(MMU_HEAP * pMMUHeap, IMG_DEV_VIRTADDR DevVAddr,
        MMU_PT_INFO **ppsPTInfoList;
        SYS_DATA *psSysData;
 
-#if SGX_FEATURE_ADDRESS_SPACE_SIZE < 32
        PVR_ASSERT(DevVAddr.uiAddr < (1 << SGX_FEATURE_ADDRESS_SPACE_SIZE));
-#endif
 
        if (SysAcquireData(&psSysData) != PVRSRV_OK) {
                return IMG_FALSE;
@@ -388,13 +339,8 @@ _DeferredAllocPagetables(MMU_HEAP * pMMUHeap, IMG_DEV_VIRTADDR DevVAddr,
                    && ppsPTInfoList[i]->PTPageCpuVAddr == IMG_NULL) {
                        IMG_CPU_PHYADDR sCpuPAddr;
                        IMG_DEV_PHYADDR sDevPAddr;
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-                       IMG_UINT32 *pui32Tmp;
-                       IMG_UINT32 j;
-#else
 
                        PVR_ASSERT(pui32PDEntry[i] == 0);
-#endif
 
                        if (pMMUHeap->psDevArena->psDeviceMemoryHeapInfo->
                            psLocalDevMemArena == IMG_NULL) {
@@ -456,27 +402,11 @@ _DeferredAllocPagetables(MMU_HEAP * pMMUHeap, IMG_DEV_VIRTADDR DevVAddr,
                                    SysCpuPAddrToDevPAddr
                                    (PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
 
-#if PAGE_TEST
-                               PageTest(ppsPTInfoList[i]->PTPageCpuVAddr,
-                                        sDevPAddr);
-#endif
                        }
 
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-                       pui32Tmp =
-                           (IMG_UINT32 *) ppsPTInfoList[i]->PTPageCpuVAddr;
-
-                       for (j = 0; j < SGX_MMU_PT_SIZE; j++) {
-                               pui32Tmp[j] =
-                                   pMMUHeap->psMMUContext->psDevInfo->
-                                   sDummyDataDevPAddr.
-                                   uiAddr | SGX_MMU_PTE_VALID;
-                       }
-#else
 
                        OSMemSet(ppsPTInfoList[i]->PTPageCpuVAddr, 0,
                                 SGX_MMU_PAGE_SIZE);
-#endif
 
                        PDUMPMALLOCPAGETABLE(PVRSRV_DEVICE_TYPE_SGX,
                                             ppsPTInfoList[i]->PTPageCpuVAddr,
@@ -548,11 +478,9 @@ _DeferredAllocPagetables(MMU_HEAP * pMMUHeap, IMG_DEV_VIRTADDR DevVAddr,
                                }
                        }
 
-#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
 
                        MMU_InvalidateDirectoryCache(pMMUHeap->psMMUContext->
                                                     psDevInfo);
-#endif
                } else {
 
                        PVR_ASSERT(pui32PDEntry[i] != 0);
@@ -617,66 +545,7 @@ MMU_Initialise(PVRSRV_DEVICE_NODE * psDeviceNode, MMU_CONTEXT ** ppsMMUContext,
                sPDDevPAddr =
                    SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX, sCpuPAddr);
 
-#if PAGE_TEST
-               PageTest(pvPDCpuVAddr, sPDDevPAddr);
-#endif
-
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
-               if (!psDevInfo->pvMMUContextList) {
-
-                       if (OSAllocPages
-                           (PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_KERNEL_ONLY,
-                            SGX_MMU_PAGE_SIZE,
-                            &psDevInfo->pvDummyPTPageCpuVAddr,
-                            &psDevInfo->hDummyPTPageOSMemHandle) !=
-                           PVRSRV_OK) {
-                               PVR_DPF((PVR_DBG_ERROR,
-                                        "MMU_Initialise: ERROR call to OSAllocPages failed"));
-                               return PVRSRV_ERROR_GENERIC;
-                       }
-
-                       if (psDevInfo->pvDummyPTPageCpuVAddr) {
-                               sCpuPAddr =
-                                   OSMapLinToCPUPhys(psDevInfo->
-                                                     pvDummyPTPageCpuVAddr);
-                       } 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,
-                            &psDevInfo->pvDummyDataPageCpuVAddr,
-                            &psDevInfo->hDummyDataPageOSMemHandle) !=
-                           PVRSRV_OK) {
-                               PVR_DPF((PVR_DBG_ERROR,
-                                        "MMU_Initialise: ERROR call to OSAllocPages failed"));
-                               return PVRSRV_ERROR_GENERIC;
-                       }
-
-                       if (psDevInfo->pvDummyDataPageCpuVAddr) {
-                               sCpuPAddr =
-                                   OSMapLinToCPUPhys(psDevInfo->
-                                                     pvDummyDataPageCpuVAddr);
-                       } else {
-                               sCpuPAddr =
-                                   OSMemHandleToCpuPAddr(psDevInfo->
-                                                         hDummyDataPageOSMemHandle,
-                                                         0);
-                       }
-                       psDevInfo->sDummyDataDevPAddr =
-                           SysCpuPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX,
-                                                 sCpuPAddr);
-               }
-#endif
        } else {
                IMG_SYS_PHYADDR sSysPAddr;
 
@@ -704,76 +573,10 @@ MMU_Initialise(PVRSRV_DEVICE_NODE * psDeviceNode, MMU_CONTEXT ** ppsMMUContext,
                                 "MMU_Initialise: ERROR failed to map page tables"));
                        return PVRSRV_ERROR_GENERIC;
                }
-#if PAGE_TEST
-               PageTest(pvPDCpuVAddr, sPDDevPAddr);
-#endif
-
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
 
-               if (!psDevInfo->pvMMUContextList) {
-
-                       if (RA_Alloc(psDeviceNode->psLocalDevMemArena,
-                                    SGX_MMU_PAGE_SIZE,
-                                    IMG_NULL,
-                                    IMG_NULL,
-                                    0,
-                                    SGX_MMU_PAGE_SIZE,
-                                    0, &(sSysPAddr.uiAddr)) != IMG_TRUE) {
-                               PVR_DPF((PVR_DBG_ERROR,
-                                        "MMU_Initialise: ERROR call to RA_Alloc failed"));
-                               return PVRSRV_ERROR_GENERIC;
-                       }
-
-                       sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
-                       psDevInfo->sDummyPTDevPAddr =
-                           SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX,
-                                                 sSysPAddr);
-                       psDevInfo->pvDummyPTPageCpuVAddr =
-                           OSMapPhysToLin(sCpuPAddr, SGX_MMU_PAGE_SIZE,
-                                          PVRSRV_HAP_WRITECOMBINE |
-                                          PVRSRV_HAP_KERNEL_ONLY,
-                                          &psDevInfo->hDummyPTPageOSMemHandle);
-                       if (!psDevInfo->pvDummyPTPageCpuVAddr) {
-                               PVR_DPF((PVR_DBG_ERROR,
-                                        "MMU_Initialise: ERROR failed to map page tables"));
-                               return PVRSRV_ERROR_GENERIC;
-                       }
-
-                       if (RA_Alloc(psDeviceNode->psLocalDevMemArena,
-                                    SGX_MMU_PAGE_SIZE,
-                                    IMG_NULL,
-                                    IMG_NULL,
-                                    0,
-                                    SGX_MMU_PAGE_SIZE,
-                                    0, &(sSysPAddr.uiAddr)) != IMG_TRUE) {
-                               PVR_DPF((PVR_DBG_ERROR,
-                                        "MMU_Initialise: ERROR call to RA_Alloc failed"));
-                               return PVRSRV_ERROR_GENERIC;
-                       }
-
-                       sCpuPAddr = SysSysPAddrToCpuPAddr(sSysPAddr);
-                       psDevInfo->sDummyDataDevPAddr =
-                           SysSysPAddrToDevPAddr(PVRSRV_DEVICE_TYPE_SGX,
-                                                 sSysPAddr);
-                       psDevInfo->pvDummyDataPageCpuVAddr =
-                           OSMapPhysToLin(sCpuPAddr, SGX_MMU_PAGE_SIZE,
-                                          PVRSRV_HAP_WRITECOMBINE |
-                                          PVRSRV_HAP_KERNEL_ONLY,
-                                          &psDevInfo->
-                                          hDummyDataPageOSMemHandle);
-                       if (!psDevInfo->pvDummyDataPageCpuVAddr) {
-                               PVR_DPF((PVR_DBG_ERROR,
-                                        "MMU_Initialise: ERROR failed to map page tables"));
-                               return PVRSRV_ERROR_GENERIC;
-                       }
-               }
-#endif
        }
 
        PDUMPCOMMENT("Alloc page directory");
-#ifdef SUPPORT_SGX_MMU_BYPASS
-       EnableHostAccess(psMMUContext);
-#endif
 
        PDUMPMALLOCPAGETABLE(PVRSRV_DEVICE_TYPE_SGX, pvPDCpuVAddr,
                             SGX_MMU_PAGE_SIZE, PDUMP_PD_UNIQUETAG);
@@ -786,44 +589,11 @@ MMU_Initialise(PVRSRV_DEVICE_NODE * psDeviceNode, MMU_CONTEXT ** ppsMMUContext,
                return PVRSRV_ERROR_GENERIC;
        }
 
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
-       for (i = 0; i < SGX_MMU_PD_SIZE; i++) {
-               pui32Tmp[i] =
-                   psDevInfo->sDummyPTDevPAddr.uiAddr | SGX_MMU_PDE_VALID;
-       }
-
-       if (!psDevInfo->pvMMUContextList) {
-
-               pui32Tmp = (IMG_UINT32 *) psDevInfo->pvDummyPTPageCpuVAddr;
-               for (i = 0; i < SGX_MMU_PT_SIZE; i++) {
-                       pui32Tmp[i] =
-                           psDevInfo->sDummyDataDevPAddr.
-                           uiAddr | SGX_MMU_PTE_VALID;
-               }
-
-               PDUMPCOMMENT("Dummy Page table contents");
-               PDUMPMEM2(PVRSRV_DEVICE_TYPE_SGX,
-                         psDevInfo->pvDummyPTPageCpuVAddr, SGX_MMU_PAGE_SIZE,
-                         0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
-
-               pui32Tmp = (IMG_UINT32 *) psDevInfo->pvDummyDataPageCpuVAddr;
-               for (i = 0; i < (SGX_MMU_PAGE_SIZE / 4); i++) {
-                       pui32Tmp[i] = DUMMY_DATA_PAGE_SIGNATURE;
-               }
-
-               PDUMPCOMMENT("Dummy Data Page contents");
-               PDUMPMEM2(PVRSRV_DEVICE_TYPE_SGX,
-                         psDevInfo->pvDummyDataPageCpuVAddr, SGX_MMU_PAGE_SIZE,
-                         0, IMG_TRUE, PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
-       }
-#else
 
        for (i = 0; i < SGX_MMU_PD_SIZE; i++) {
 
                pui32Tmp[i] = 0;
        }
-#endif
 
        PDUMPCOMMENT("Page directory contents");
        PDUMPMEM2(PVRSRV_DEVICE_TYPE_SGX, pvPDCpuVAddr, SGX_MMU_PAGE_SIZE, 0,
@@ -840,9 +610,6 @@ MMU_Initialise(PVRSRV_DEVICE_NODE * psDeviceNode, MMU_CONTEXT ** ppsMMUContext,
        psMMUContext->psNext = (MMU_CONTEXT *) psDevInfo->pvMMUContextList;
        psDevInfo->pvMMUContextList = (IMG_VOID *) psMMUContext;
 
-#ifdef SUPPORT_SGX_MMU_BYPASS
-       DisableHostAccess(psMMUContext);
-#endif
 
        return PVRSRV_OK;
 }
@@ -852,12 +619,6 @@ IMG_VOID MMU_Finalise(MMU_CONTEXT * psMMUContext)
        IMG_UINT32 *pui32Tmp, i;
        SYS_DATA *psSysData;
        MMU_CONTEXT **ppsMMUContext;
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-       PVRSRV_SGXDEV_INFO *psDevInfo =
-           (PVRSRV_SGXDEV_INFO *) psMMUContext->psDevInfo;
-       MMU_CONTEXT *psMMUContextList =
-           (MMU_CONTEXT *) psDevInfo->pvMMUContextList;
-#endif
 
        if (SysAcquireData(&psSysData) != PVRSRV_OK) {
                PVR_DPF((PVR_DBG_ERROR,
@@ -868,14 +629,6 @@ IMG_VOID MMU_Finalise(MMU_CONTEXT * psMMUContext)
        PDUMPCOMMENT("Free page directory");
        PDUMPFREEPAGETABLE(PVRSRV_DEVICE_TYPE_SGX, psMMUContext->pvPDCpuVAddr,
                           SGX_MMU_PAGE_SIZE, PDUMP_PT_UNIQUETAG);
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-       PDUMPFREEPAGETABLE(PVRSRV_DEVICE_TYPE_SGX,
-                          psDevInfo->pvDummyPTPageCpuVAddr, SGX_MMU_PAGE_SIZE,
-                          PDUMP_PT_UNIQUETAG);
-       PDUMPFREEPAGETABLE(PVRSRV_DEVICE_TYPE_SGX,
-                          psDevInfo->pvDummyDataPageCpuVAddr,
-                          SGX_MMU_PAGE_SIZE, PDUMP_PT_UNIQUETAG);
-#endif
 
        pui32Tmp = (IMG_UINT32 *) psMMUContext->pvPDCpuVAddr;
 
@@ -890,19 +643,6 @@ IMG_VOID MMU_Finalise(MMU_CONTEXT * psMMUContext)
                            psMMUContext->pvPDCpuVAddr,
                            psMMUContext->hPDOSMemHandle);
 
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
-               if (!psMMUContextList->psNext) {
-                       OSFreePages(PVRSRV_HAP_WRITECOMBINE |
-                                   PVRSRV_HAP_KERNEL_ONLY, SGX_MMU_PAGE_SIZE,
-                                   psDevInfo->pvDummyPTPageCpuVAddr,
-                                   psDevInfo->hDummyPTPageOSMemHandle);
-                       OSFreePages(PVRSRV_HAP_WRITECOMBINE |
-                                   PVRSRV_HAP_KERNEL_ONLY, SGX_MMU_PAGE_SIZE,
-                                   psDevInfo->pvDummyDataPageCpuVAddr,
-                                   psDevInfo->hDummyDataPageOSMemHandle);
-               }
-#endif
        } else {
                IMG_SYS_PHYADDR sSysPAddr;
                IMG_CPU_PHYADDR sCpuPAddr;
@@ -919,38 +659,6 @@ IMG_VOID MMU_Finalise(MMU_CONTEXT * psMMUContext)
                RA_Free(psMMUContext->psDeviceNode->psLocalDevMemArena,
                        sSysPAddr.uiAddr, IMG_FALSE);
 
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
-               if (!psMMUContextList->psNext) {
-
-                       sCpuPAddr =
-                           OSMapLinToCPUPhys(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->
-                                             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
        }
 
        PVR_DPF((PVR_DBG_MESSAGE, "MMU_Finalise"));
@@ -977,9 +685,7 @@ IMG_VOID MMU_InsertHeap(MMU_CONTEXT * psMMUContext, MMU_HEAP * psMMUHeap)
        IMG_UINT32 *pui32KernelPDCpuVAddr =
            (IMG_UINT32 *) psMMUHeap->psMMUContext->pvPDCpuVAddr;
        IMG_UINT32 ui32PDEntry;
-#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
        IMG_BOOL bInvalidateDirectoryCache = IMG_FALSE;
-#endif
 
        pui32PDCpuVAddr +=
            psMMUHeap->psDevArena->BaseDevVAddr.uiAddr >> (SGX_MMU_PAGE_SHIFT +
@@ -989,16 +695,11 @@ IMG_VOID MMU_InsertHeap(MMU_CONTEXT * psMMUContext, MMU_HEAP * psMMUHeap)
                                                           SGX_MMU_PT_SHIFT);
 
        PDUMPCOMMENT("Page directory shared heap range copy");
-#ifdef SUPPORT_SGX_MMU_BYPASS
-       EnableHostAccess(psMMUContext);
-#endif
 
        for (ui32PDEntry = 0; ui32PDEntry < psMMUHeap->ui32PTPageCount;
             ui32PDEntry++) {
-#if !defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
 
                PVR_ASSERT(pui32PDCpuVAddr[ui32PDEntry] == 0);
-#endif
 
                pui32PDCpuVAddr[ui32PDEntry] =
                    pui32KernelPDCpuVAddr[ui32PDEntry];
@@ -1008,22 +709,15 @@ IMG_VOID MMU_InsertHeap(MMU_CONTEXT * psMMUContext, MMU_HEAP * psMMUHeap)
                                  sizeof(IMG_UINT32), 0, IMG_FALSE,
                                  PDUMP_PD_UNIQUETAG, PDUMP_PT_UNIQUETAG);
 
-#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
                        bInvalidateDirectoryCache = IMG_TRUE;
-#endif
                }
        }
 
-#ifdef SUPPORT_SGX_MMU_BYPASS
-       DisableHostAccess(psMMUContext);
-#endif
 
-#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
        if (bInvalidateDirectoryCache) {
 
                MMU_InvalidateDirectoryCache(psMMUContext->psDevInfo);
        }
-#endif
 }
 
 static IMG_VOID
@@ -1091,15 +785,8 @@ MMU_UnmapPagesAndFreePTs(MMU_HEAP * psMMUHeap,
                        PVR_ASSERT((IMG_INT32) ppsPTInfoList[0]->
                                   ui32ValidPTECount >= 0);
 
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
-                       pui32Tmp[ui32PTIndex] =
-                           psMMUHeap->psMMUContext->psDevInfo->
-                           sDummyDataDevPAddr.uiAddr | SGX_MMU_PTE_VALID;
-#else
 
                        pui32Tmp[ui32PTIndex] = 0;
-#endif
                }
 
                if (ppsPTInfoList[0]
@@ -1192,28 +879,6 @@ MMU_HEAP *MMU_Create(MMU_CONTEXT * psMMUContext,
                          pMMUHeap, IMG_NULL);
                return IMG_NULL;
        }
-#if 0
-
-       if (psDevArena->ui32HeapID == SGX_TILED_HEAP_ID) {
-               IMG_UINT32 ui32RegVal;
-               IMG_UINT32 ui32XTileStride;
-
-               ui32XTileStride = 2;
-
-               ui32RegVal = (EUR_CR_BIF_TILE0_MIN_ADDRESS_MASK
-                             & ((psDevArena->BaseDevVAddr.uiAddr >> 20)
-                                << EUR_CR_BIF_TILE0_MIN_ADDRESS_SHIFT))
-                   | (EUR_CR_BIF_TILE0_MAX_ADDRESS_MASK
-                      &
-                      (((psDevArena->BaseDevVAddr.uiAddr +
-                         psDevArena->ui32Size) >> 20)
-                       << EUR_CR_BIF_TILE0_MAX_ADDRESS_SHIFT))
-                   | (EUR_CR_BIF_TILE0_CFG_MASK
-                      & (((ui32XTileStride << 1) | 8) <<
-                         EUR_CR_BIF_TILE0_CFG_SHIFT));
-               PDUMPREG(EUR_CR_BIF_TILE0, ui32RegVal);
-       }
-#endif
 
        *ppsVMArena = pMMUHeap->psVMArena;
 
@@ -1228,13 +893,7 @@ IMG_VOID MMU_Delete(MMU_HEAP * pMMUHeap)
                if (pMMUHeap->psVMArena) {
                        RA_Delete(pMMUHeap->psVMArena);
                }
-#ifdef SUPPORT_SGX_MMU_BYPASS
-               EnableHostAccess(pMMUHeap->psMMUContext);
-#endif
                _DeferredFreePageTables(pMMUHeap);
-#ifdef SUPPORT_SGX_MMU_BYPASS
-               DisableHostAccess(pMMUHeap->psMMUContext);
-#endif
 
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(MMU_HEAP),
                          pMMUHeap, IMG_NULL);
@@ -1268,15 +927,9 @@ MMU_Alloc(MMU_HEAP * pMMUHeap,
                        return bStatus;
                }
        }
-#ifdef SUPPORT_SGX_MMU_BYPASS
-       EnableHostAccess(pMMUHeap->psMMUContext);
-#endif
 
        bStatus = _DeferredAllocPagetables(pMMUHeap, *psDevVAddr, uSize);
 
-#ifdef SUPPORT_SGX_MMU_BYPASS
-       DisableHostAccess(pMMUHeap->psMMUContext);
-#endif
 
        if (!bStatus) {
                PVR_DPF((PVR_DBG_ERROR,
@@ -1424,7 +1077,6 @@ MMU_MapPage(MMU_HEAP * pMMUHeap,
 
        pui32Tmp = (IMG_UINT32 *) ppsPTInfoList[0]->PTPageCpuVAddr;
 
-#if !defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
 
        if (pui32Tmp[ui32Index] & SGX_MMU_PTE_VALID) {
                PVR_DPF((PVR_DBG_ERROR,
@@ -1435,7 +1087,6 @@ MMU_MapPage(MMU_HEAP * pMMUHeap,
        }
 
        PVR_ASSERT((pui32Tmp[ui32Index] & SGX_MMU_PTE_VALID) == 0);
-#endif
 
        ppsPTInfoList[0]->ui32ValidPTECount++;
 
@@ -1664,15 +1315,8 @@ MMU_UnmapPages(MMU_HEAP * psMMUHeap,
                PVR_ASSERT((IMG_INT32) ppsPTInfoList[0]->ui32ValidPTECount >=
                           0);
 
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
-               pui32Tmp[ui32PTIndex] =
-                   psMMUHeap->psMMUContext->psDevInfo->sDummyDataDevPAddr.
-                   uiAddr | SGX_MMU_PTE_VALID;
-#else
 
                pui32Tmp[ui32PTIndex] = 0;
-#endif
 
                sTmpDevVAddr.uiAddr += uPageSize;
        }
@@ -1877,53 +1521,3 @@ IMG_VOID MMU_BIFResetPDFree(PVRSRV_SGXDEV_INFO * psDevInfo)
        }
 }
 
-#if PAGE_TEST
-static void PageTest(void *pMem, IMG_DEV_PHYADDR sDevPAddr)
-{
-       volatile IMG_UINT32 ui32WriteData;
-       volatile IMG_UINT32 ui32ReadData;
-       volatile IMG_UINT32 *pMem32 = (volatile IMG_UINT32 *)pMem;
-       int n;
-       IMG_BOOL bOK = IMG_TRUE;
-
-       ui32WriteData = 0xffffffff;
-
-       for (n = 0; n < 1024; n++) {
-               pMem32[n] = ui32WriteData;
-               ui32ReadData = pMem32[n];
-
-               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;
-               }
-       }
-
-       ui32WriteData = 0;
-
-       for (n = 0; n < 1024; n++) {
-               pMem32[n] = ui32WriteData;
-               ui32ReadData = pMem32[n];
-
-               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;
-               }
-       }
-
-       if (bOK) {
-               PVR_DPF((PVR_DBG_VERBOSE, "MMU Page 0x%08X is OK",
-                        sDevPAddr.uiAddr));
-       } else {
-               PVR_DPF((PVR_DBG_VERBOSE, "MMU Page 0x%08X *** FAILED ***",
-                        sDevPAddr.uiAddr));
-       }
-}
-#endif
index 1a4e0f8..23db591 100644 (file)
--- a/pvr/mmu.h
+++ b/pvr/mmu.h
@@ -88,11 +88,6 @@ MMU_GetPhysPageAddr(MMU_HEAP * pMMUHeap, IMG_DEV_VIRTADDR sDevVPageAddr);
 
 IMG_DEV_PHYADDR MMU_GetPDDevPAddr(MMU_CONTEXT * pMMUContext);
 
-#ifdef SUPPORT_SGX_MMU_BYPASS
-IMG_VOID EnableHostAccess(MMU_CONTEXT * psMMUContext);
-
-IMG_VOID DisableHostAccess(MMU_CONTEXT * psMMUContext);
-#endif
 
 IMG_VOID MMU_InvalidateDirectoryCache(PVRSRV_SGXDEV_INFO * psDevInfo);
 
index ae6e03b..affc598 100644 (file)
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
 
-#if defined(LDM_PLATFORM)
 #include <linux/platform_device.h>
-#endif
-
-#if defined(LDM_PCI)
-#include <linux/pci.h>
-#endif
 
-#if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
-#include <asm/uaccess.h>
-#endif
 
 #include "img_defs.h"
 #include "services.h"
 MODULE_SUPPORTED_DEVICE(DEVNAME);
 #ifdef DEBUG
 static int debug = DBGPRIV_WARNING;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
 #include <linux/moduleparam.h>
 module_param(debug, int, 0);
-#else
-MODULE_PARM(debug, "i");
-MODULE_PARM_DESC(debug, "Sets the level of debug output (default=0x4)");
-#endif
 #endif
 
 void PVRDebugSetLevel(IMG_UINT32 uDebugLevel);
@@ -105,63 +91,23 @@ release:PVRSRVRelease,
 mmap:  PVRMMap,
 };
 
-#if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
-static IMG_UINT32 gPVRPowerLevel;
-#endif
-
-#if defined(LDM_PLATFORM) || defined(LDM_PCI)
-
-#if defined(LDM_PLATFORM)
 #define        LDM_DEV struct platform_device
 #define        LDM_DRV struct platform_driver
-#if defined(LDM_PCI)
-#undef LDM_PCI
-#endif
-#endif
 
-#if defined(LDM_PCI)
-#define        LDM_DEV struct pci_dev
-#define        LDM_DRV struct pci_driver
-#endif
 
-#if defined(LDM_PLATFORM)
 static int PVRSRVDriverRemove(LDM_DEV * device);
 static int PVRSRVDriverProbe(LDM_DEV * device);
-#endif
-#if defined(LDM_PCI)
-static void PVRSRVDriverRemove(LDM_DEV * device);
-static int PVRSRVDriverProbe(LDM_DEV * device, const struct pci_device_id *id);
-#endif
 static int PVRSRVDriverSuspend(LDM_DEV * device, pm_message_t state);
 static void PVRSRVDriverShutdown(LDM_DEV * device);
 static int PVRSRVDriverResume(LDM_DEV * device);
 
-#if defined(LDM_PCI)
-struct pci_device_id powervr_id_table[] __devinitdata = {
-       {PCI_DEVICE(SYS_SGX_DEV_VENDOR_ID, SYS_SGX_DEV_DEVICE_ID)},
-       {0}
-};
-
-MODULE_DEVICE_TABLE(pci, powervr_id_table);
-#endif
 
 static LDM_DRV powervr_driver = {
-#if defined(LDM_PLATFORM)
        .driver = {
                   .name = DRVNAME,
                   },
-#endif
-#if defined(LDM_PCI)
-       .name = DRVNAME,
-       .id_table = powervr_id_table,
-#endif
        .probe = PVRSRVDriverProbe,
-#if defined(LDM_PLATFORM)
        .remove = PVRSRVDriverRemove,
-#endif
-#if defined(LDM_PCI)
-       .remove = __devexit_p(PVRSRVDriverRemove),
-#endif
        .suspend = PVRSRVDriverSuspend,
        .resume = PVRSRVDriverResume,
        .shutdown = PVRSRVDriverShutdown,
@@ -169,7 +115,6 @@ static LDM_DRV powervr_driver = {
 
 LDM_DEV *gpsPVRLDMDev;
 
-#if defined(LDM_PLATFORM)
 static void PVRSRVDeviceRelease(struct device *device);
 
 static struct platform_device powervr_device = {
@@ -178,15 +123,8 @@ static struct platform_device powervr_device = {
        .dev = {
                .release = PVRSRVDeviceRelease}
 };
-#endif
 
-#if defined(LDM_PLATFORM)
 static int PVRSRVDriverProbe(LDM_DEV * pDevice)
-#endif
-#if defined(LDM_PCI)
-static int __devinit PVRSRVDriverProbe(LDM_DEV * pDevice,
-                                      const struct pci_device_id *id)
-#endif
 {
        SYS_DATA *psSysData;
 
@@ -194,12 +132,6 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV * pDevice,
 
        pDevice->dev.driver_data = NULL;
 
-#if 0
-
-       if (PerDeviceSysInitialise((IMG_PVOID) pDevice) != PVRSRV_OK) {
-               return -EINVAL;
-       }
-#endif
 
        if (SysAcquireData(&psSysData) != PVRSRV_OK) {
                gpsPVRLDMDev = pDevice;
@@ -212,42 +144,19 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV * pDevice,
        return 0;
 }
 
-#if defined (LDM_PLATFORM)
 static int PVRSRVDriverRemove(LDM_DEV * pDevice)
-#endif
-#if defined(LDM_PCI)
-static void __devexit PVRSRVDriverRemove(LDM_DEV * pDevice)
-#endif
 {
        SYS_DATA *psSysData;
 
        PVR_TRACE(("PVRSRVDriverRemove(pDevice=%p)", pDevice));
 
        if (SysAcquireData(&psSysData) == PVRSRV_OK) {
-#if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
-               if (gPVRPowerLevel != 0) {
-                       if (PVRSRVSetPowerStateKM(PVRSRV_POWER_STATE_D0) ==
-                           PVRSRV_OK) {
-                               gPVRPowerLevel = 0;
-                       }
-               }
-#endif
                SysDeinitialise(psSysData);
 
                gpsPVRLDMDev = IMG_NULL;
        }
-#if 0
-       if (PerDeviceSysDeInitialise((IMG_PVOID) pDevice) != PVRSRV_OK) {
-               return -EINVAL;
-       }
-#endif
 
-#if defined (LDM_PLATFORM)
        return 0;
-#endif
-#if defined (LDM_PCI)
-       return;
-#endif
 }
 
 static void PVRSRVDriverShutdown(LDM_DEV * pDevice)
@@ -259,81 +168,28 @@ static void PVRSRVDriverShutdown(LDM_DEV * pDevice)
 
 static int PVRSRVDriverSuspend(LDM_DEV * pDevice, pm_message_t state)
 {
-#if !(defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL))
        PVR_TRACE(("PVRSRVDriverSuspend(pDevice=%p)", pDevice));
 
        if (PVRSRVSetPowerStateKM(PVRSRV_POWER_STATE_D3) != PVRSRV_OK) {
                return -EINVAL;
        }
-#endif
        return 0;
 }
 
 static int PVRSRVDriverResume(LDM_DEV * pDevice)
 {
-#if !(defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL))
        PVR_TRACE(("PVRSRVDriverResume(pDevice=%p)", pDevice));
 
        if (PVRSRVSetPowerStateKM(PVRSRV_POWER_STATE_D0) != PVRSRV_OK) {
                return -EINVAL;
        }
-#endif
        return 0;
 }
 
-#if defined(LDM_PLATFORM)
 static void PVRSRVDeviceRelease(struct device *pDevice)
 {
        PVR_DPF((PVR_DBG_WARNING, "PVRSRVDeviceRelease(pDevice=%p)", pDevice));
 }
-#endif
-#endif
-
-#if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
-int PVRProcSetPowerLevel(struct file *file, const char *buffer,
-                        unsigned long count, void *data)
-{
-       char data_buffer[2];
-       IMG_UINT32 PVRPowerLevel;
-
-       if (count != sizeof(data_buffer)) {
-               return -EINVAL;
-       } else {
-               if (copy_from_user(data_buffer, buffer, count))
-                       return -EINVAL;
-               if (data_buffer[count - 1] != '\n')
-                       return -EINVAL;
-               PVRPowerLevel = data_buffer[0] - '0';
-               if (PVRPowerLevel != gPVRPowerLevel) {
-                       if (PVRPowerLevel != 0) {
-                               if (PVRSRVSetPowerStateKM(PVRSRV_POWER_STATE_D3)
-                                   != PVRSRV_OK) {
-                                       return -EINVAL;
-                               }
-                       } else {
-                               if (PVRSRVSetPowerStateKM(PVRSRV_POWER_STATE_D0)
-                                   != PVRSRV_OK) {
-                                       return -EINVAL;
-                               }
-                       }
-
-                       gPVRPowerLevel = PVRPowerLevel;
-               }
-       }
-       return (count);
-}
-
-int PVRProcGetPowerLevel(char *page, char **start, off_t off, int count,
-                        int *eof, void *data)
-{
-       if (off == 0) {
-               *start = (char *)1;
-               return printAppend(page, count, 0, "%lu\n", gPVRPowerLevel);
-       }
-       *eof = 1;
-       return 0;
-}
-#endif
 
 static int PVRSRVOpen(struct inode unref__ * pInode,
                      struct file unref__ * pFile)
@@ -368,9 +224,6 @@ static int PVRSRVRelease(struct inode unref__ * pInode,
 static int __init PVRCore_Init(void)
 {
        int error;
-#if !(defined(LDM_PLATFORM) || defined(LDM_PCI))
-       PVRSRV_ERROR eError;
-#endif
 
        PVR_TRACE(("PVRCore_Init"));
 
@@ -406,9 +259,6 @@ static int __init PVRCore_Init(void)
 
        PVRMMapInit();
 
-#if defined(LDM_PLATFORM) || defined(LDM_PCI)
-
-#if defined(LDM_PLATFORM)
        if ((error = platform_driver_register(&powervr_driver)) != 0) {
                PVR_DPF((PVR_DBG_ERROR,
                         "PVRCore_Init: unable to register platform driver (%d)",
@@ -428,31 +278,7 @@ static int __init PVRCore_Init(void)
 
                goto init_failed;
        }
-#endif
-
-#if defined(LDM_PCI)
-       if ((error = pci_register_driver(&powervr_driver)) != 0) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "PVRCore_Init: unable to register PCI driver (%d)",
-                        error));
-
-               goto init_failed;
-       }
-#endif
-
-#else
 
-       if ((eError = SysInitialise()) != PVRSRV_OK) {
-               error = -ENODEV;
-#if defined(TCF_REV) && (TCF_REV == 110)
-               if (eError == PVRSRV_ERROR_NOT_SUPPORTED) {
-                       printk("\nAtlas wrapper (FPGA image) version mismatch");
-                       error = -ENODEV;
-               }
-#endif
-               goto init_failed;
-       }
-#endif
 
        return 0;
 
@@ -475,41 +301,12 @@ static void __exit PVRCore_Cleanup(void)
 
        SysAcquireData(&psSysData);
 
-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22))
-       if (
-#endif
                   unregister_chrdev(AssignedMajorNumber, DRVNAME)
-#if !(LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22))
                   ;
-#else
-           ) {
-               PVR_DPF((PVR_DBG_ERROR, " can't unregister device major %d",
-                        AssignedMajorNumber));
-       }
-#endif
-
-#if defined(LDM_PLATFORM) || defined(LDM_PCI)
 
-#if defined(LDM_PCI)
-       pci_unregister_driver(&powervr_driver);
-#endif
 
-#if defined (LDM_PLATFORM)
        platform_device_unregister(&powervr_device);
        platform_driver_unregister(&powervr_driver);
-#endif
-
-#else
-#if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
-       if (gPVRPowerLevel != 0) {
-               if (PVRSRVSetPowerStateKM(PVRSRV_POWER_STATE_D0) == PVRSRV_OK) {
-                       gPVRPowerLevel = 0;
-               }
-       }
-#endif
-
-       SysDeinitialise(psSysData);
-#endif
 
        PVRMMapCleanup();
 
index 6381282..082be86 100644 (file)
 
 #include <linux/version.h>
 #include <linux/errno.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
 #include <linux/mutex.h>
-#else
-#include <asm/semaphore.h>
-#endif
 #include <linux/module.h>
 
-#include <img_defs.h>
-#include <services.h>
+#include "img_defs.h"
+#include "services.h"
 
 #include "mutex.h"
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
 
 IMG_VOID LinuxInitMutex(PVRSRV_LINUX_MUTEX * psPVRSRVMutex)
 {
@@ -74,54 +69,3 @@ IMG_BOOL LinuxIsLockedMutex(PVRSRV_LINUX_MUTEX * psPVRSRVMutex)
        return mutex_is_locked(psPVRSRVMutex);
 }
 
-#else
-
-IMG_VOID LinuxInitMutex(PVRSRV_LINUX_MUTEX * psPVRSRVMutex)
-{
-       init_MUTEX(&psPVRSRVMutex->sSemaphore);
-       atomic_set(&psPVRSRVMutex->Count, 0);
-}
-
-IMG_VOID LinuxLockMutex(PVRSRV_LINUX_MUTEX * psPVRSRVMutex)
-{
-       down(&psPVRSRVMutex->sSemaphore);
-       atomic_dec(&psPVRSRVMutex->Count);
-}
-
-PVRSRV_ERROR LinuxLockMutexInterruptible(PVRSRV_LINUX_MUTEX * psPVRSRVMutex)
-{
-       if (down_interruptible(&psPVRSRVMutex->sSemaphore) == -EINTR) {
-
-               return PVRSRV_ERROR_GENERIC;
-       } else {
-               atomic_dec(&psPVRSRVMutex->Count);
-               return PVRSRV_OK;
-       }
-}
-
-IMG_INT32 LinuxTryLockMutex(PVRSRV_LINUX_MUTEX * psPVRSRVMutex)
-{
-       IMG_INT32 Status = down_trylock(&psPVRSRVMutex->sSemaphore);
-       if (Status == 0) {
-               atomic_dec(&psPVRSRVMutex->Count);
-       }
-
-       return Status;
-}
-
-IMG_VOID LinuxUnLockMutex(PVRSRV_LINUX_MUTEX * psPVRSRVMutex)
-{
-       atomic_inc(&psPVRSRVMutex->Count);
-       up(&psPVRSRVMutex->sSemaphore);
-}
-
-IMG_BOOL LinuxIsLockedMutex(PVRSRV_LINUX_MUTEX * psPVRSRVMutex)
-{
-       IMG_INT32 iCount;
-
-       iCount = atomic_read(&psPVRSRVMutex->Count);
-
-       return (IMG_BOOL) iCount;
-}
-
-#endif
index 41223f6..f69a74f 100644 (file)
 
 #include <linux/version.h>
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
 #include <linux/mutex.h>
-#else
-#include <asm/semaphore.h>
-#endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
 
 typedef struct mutex PVRSRV_LINUX_MUTEX;
 
-#else
-
-typedef struct {
-       struct semaphore sSemaphore;
-
-       atomic_t Count;
-} PVRSRV_LINUX_MUTEX;
-
-#endif
 
 extern IMG_VOID LinuxInitMutex(PVRSRV_LINUX_MUTEX * psPVRSRVMutex);
 
index 9225b0d..c26ef67 100644 (file)
@@ -27,9 +27,6 @@
 #if !defined(__OEMFUNCS_H__)
 #define __OEMFUNCS_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
        typedef IMG_UINT32(*PFN_SRV_BRIDGEDISPATCH) (IMG_UINT32 Ioctl,
                                                     IMG_BYTE * pInBuf,
@@ -48,7 +45,4 @@ extern "C" {
 
 #define OEM_GET_EXT_FUNCS                      (1<<1)
 
-#if defined(__cplusplus)
-}
-#endif
 #endif
index 43241bb..2536731 100644 (file)
@@ -182,10 +182,8 @@ typedef struct OMAPLFB_DEVINFO_TAG {
 PVRSRV_ERROR OMAPLFBInit(IMG_VOID);
 PVRSRV_ERROR OMAPLFBDeinit(IMG_VOID);
 
-#ifdef LDM_PLATFORM
 IMG_VOID OMAPLFBDriverSuspend(IMG_VOID);
 IMG_VOID OMAPLFBDriverResume(IMG_VOID);
-#endif
 
 IMG_VOID *OMAPLFBAllocKernelMem(IMG_UINT32 ui32Size);
 IMG_VOID OMAPLFBFreeKernelMem(IMG_VOID * pvMem);
index 5e3d6d9..48ff8f0 100644 (file)
@@ -867,9 +867,7 @@ static IMG_BOOL ProcessFlip(IMG_HANDLE hCmdCookie,
        OMAPLFB_DEVINFO *psDevInfo;
        OMAPLFB_BUFFER *psBuffer;
        OMAPLFB_SWAPCHAIN *psSwapChain;
-#if defined(SYS_USING_INTERRUPTS)
        OMAPLFB_VSYNC_FLIP_ITEM *psFlipItem;
-#endif
        unsigned long ulLockFlags;
 
        if (!hCmdCookie || !pvData) {
@@ -895,17 +893,14 @@ static IMG_BOOL ProcessFlip(IMG_HANDLE hCmdCookie,
                                                               IMG_TRUE);
                goto ExitTrueUnlock;
        }
-#if defined(SYS_USING_INTERRUPTS)
 
        if (psFlipCmd->ui32SwapInterval == 0 || psSwapChain->bFlushCommands) {
-#endif
 
                OMAPLFBFlip(psSwapChain, psBuffer->sSysAddr.uiAddr);
 
                psSwapChain->psPVRJTable->pfnPVRSRVCmdComplete(hCmdCookie,
                                                               IMG_TRUE);
 
-#if defined(SYS_USING_INTERRUPTS)
                goto ExitTrueUnlock;
        }
 
@@ -939,7 +934,6 @@ static IMG_BOOL ProcessFlip(IMG_HANDLE hCmdCookie,
 
        spin_unlock_irqrestore(&psDevInfo->SwapChainLock, ulLockFlags);
        return IMG_FALSE;
-#endif
 
 ExitTrueUnlock:
        spin_unlock_irqrestore(&psDevInfo->SwapChainLock, ulLockFlags);
@@ -984,8 +978,7 @@ static void SetDevinfo(OMAPLFB_DEVINFO * psDevInfo)
        psPVRFBInfo->ui32ByteStride = psLINFBInfo->fix.line_length;
        psPVRFBInfo->ui32FBSize = FBSize;
        psPVRFBInfo->ui32BufferSize =
-           max(psPVRFBInfo->ui32Height, psPVRFBInfo->ui32Width)
-           * psPVRFBInfo->ui32ByteStride;
+           psPVRFBInfo->ui32Height * psPVRFBInfo->ui32ByteStride;
 
        psPVRFBInfo->ui32RoundedBufferSize =
            OMAPLFB_PAGE_ROUNDUP(psPVRFBInfo->ui32BufferSize);
@@ -1274,7 +1267,6 @@ PVRSRV_ERROR OMAPLFBDeinit(IMG_VOID)
        return PVRSRV_OK;
 }
 
-#if defined(LDM_PLATFORM)
 IMG_VOID OMAPLFBDriverSuspend(IMG_VOID)
 {
        OMAPLFB_DEVINFO *psDevInfo = GetAnchorPtr();
@@ -1322,4 +1314,3 @@ IMG_VOID OMAPLFBDriverResume(IMG_VOID)
 
        spin_unlock_irqrestore(&psDevInfo->SwapChainLock, ulLockFlags);
 }
-#endif
index 5d4ddd8..e824887 100644 (file)
@@ -37,9 +37,7 @@
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 
-#if defined(LDM_PLATFORM)
 #include <linux/platform_device.h>
-#endif
 
 #include <asm/io.h>
 
 #include "omaplfb.h"
 #include "pvrmodule.h"
 
-#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
-extern void omap_dispc_set_plane_base(int plane, IMG_UINT32 phys_addr);
-#elif defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
 #include <mach/display.h>
-#else
-#error "PVR needs OMAPFB, but it's disabled"
-#endif
 
 MODULE_SUPPORTED_DEVICE(DEVNAME);
 
@@ -95,44 +87,25 @@ IMG_VOID OMAPLFBDisableVSyncInterrupt(OMAPLFB_SWAPCHAIN * psSwapChain)
 {
 }
 
-#if defined(SYS_USING_INTERRUPTS)
-#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
-static void OMAPLFBVSyncISR(void *arg)
-#else
 static void OMAPLFBVSyncISR(void *arg, u32 mask)
-#endif
 {
        (void)OMAPLFBVSyncIHandler((OMAPLFB_SWAPCHAIN *) arg);
 }
-#endif
 
-#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
-#define DISPC_IRQ_VSYNC 0x0002
-#endif
 
 PVRSRV_ERROR OMAPLFBInstallVSyncISR(OMAPLFB_SWAPCHAIN * psSwapChain)
 {
-#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
-       if (omap_dispc_request_irq
-           (DISPC_IRQ_VSYNC, OMAPLFBVSyncISR, psSwapChain) != 0)
-               return PVRSRV_ERROR_OUT_OF_MEMORY;
-#else
        if (omap_dispc_register_isr
            (OMAPLFBVSyncISR, psSwapChain, DISPC_IRQ_VSYNC) != 0)
                return PVRSRV_ERROR_OUT_OF_MEMORY;
-#endif
 
        return PVRSRV_OK;
 }
 
 PVRSRV_ERROR OMAPLFBUninstallVSyncISR(OMAPLFB_SWAPCHAIN * psSwapChain)
 {
-#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
-       omap_dispc_free_irq(DISPC_IRQ_VSYNC, OMAPLFBVSyncISR, psSwapChain);
-#else
        omap_dispc_unregister_isr(OMAPLFBVSyncISR, psSwapChain,
                                  DISPC_IRQ_VSYNC);
-#endif
        return PVRSRV_OK;
 }
 
@@ -152,14 +125,9 @@ IMG_VOID OMAPLFBDisableDisplayRegisterAccess(IMG_VOID)
 
 IMG_VOID OMAPLFBFlip(OMAPLFB_SWAPCHAIN * psSwapChain, IMG_UINT32 aPhyAddr)
 {
-#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
-       omap_dispc_set_plane_base(0, aPhyAddr);
-#else
        omap_dispc_set_plane_ba0(OMAP_DSS_CHANNEL_LCD, OMAP_DSS_GFX, aPhyAddr);
-#endif
 }
 
-#if defined(LDM_PLATFORM)
 
 static IMG_BOOL bDeviceSuspended;
 
@@ -228,20 +196,16 @@ static struct platform_device omaplfb_device = {
        .dev = {
                .release = OMAPLFBDeviceRelease_Entry}
 };
-#endif
 
 static int __init OMAPLFB_Init(void)
 {
-#if defined(LDM_PLATFORM)
        int error;
-#endif
 
        if (OMAPLFBInit() != PVRSRV_OK) {
                printk(KERN_WARNING DRIVER_PREFIX
                       ": OMAPLFB_Init: OMAPLFBInit failed\n");
                return -ENODEV;
        }
-#if defined(LDM_PLATFORM)
        if ((error = platform_driver_register(&omaplfb_driver)) != 0) {
                printk(KERN_WARNING DRIVER_PREFIX
                       ": OMAPLFB_Init: Unable to register platform driver (%d)\n",
@@ -257,11 +221,9 @@ static int __init OMAPLFB_Init(void)
 
                goto ExitDriverUnregister;
        }
-#endif
 
        return 0;
 
-#if defined(LDM_PLATFORM)
 ExitDriverUnregister:
        platform_driver_unregister(&omaplfb_driver);
 
@@ -272,15 +234,12 @@ ExitDeinit:
        }
 
        return -ENODEV;
-#endif
 }
 
 static void __exit OMAPLFB_Cleanup(void)
 {
-#if defined (LDM_PLATFORM)
        platform_device_unregister(&omaplfb_device);
        platform_driver_unregister(&omaplfb_driver);
-#endif
 
        if (OMAPLFBDeinit() != PVRSRV_OK) {
                printk(KERN_WARNING DRIVER_PREFIX
index 68b441d..2bd64b2 100644 (file)
@@ -31,9 +31,7 @@
 #include <linux/version.h>
 #include <asm/io.h>
 #include <asm/page.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
 #include <asm/system.h>
-#endif
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/hugetlb.h>
@@ -152,13 +150,6 @@ OSAllocPages(IMG_UINT32 ui32AllocFlags,
 {
        LinuxMemArea *psLinuxMemArea;
 
-#if 0
-
-       if (ui32AllocFlags & PVRSRV_HAP_SINGLE_PROCESS) {
-               ui32AllocFlags &= ~PVRSRV_HAP_SINGLE_PROCESS;
-               ui32AllocFlags |= PVRSRV_HAP_MULTI_PROCESS;
-       }
-#endif
 
        switch (ui32AllocFlags & PVRSRV_HAP_MAPTYPE_MASK) {
        case PVRSRV_HAP_KERNEL_ONLY:
@@ -185,11 +176,6 @@ OSAllocPages(IMG_UINT32 ui32AllocFlags,
 
        case PVRSRV_HAP_MULTI_PROCESS:
                {
-
-#if defined(VIVT_CACHE) || defined(__sh__)
-
-                       ui32AllocFlags &= ~PVRSRV_HAP_CACHED;
-#endif
                        psLinuxMemArea =
                            NewVMallocLinuxMemArea(ui32Size, ui32AllocFlags);
                        if (!psLinuxMemArea) {
@@ -330,33 +316,12 @@ OSMemHandleToCpuPAddr(IMG_VOID * hOSMemHandle, IMG_UINT32 ui32ByteOffset)
 
 IMG_VOID OSMemCopy(IMG_VOID * pvDst, IMG_VOID * pvSrc, IMG_UINT32 ui32Size)
 {
-#if defined(USE_UNOPTIMISED_MEMCPY)
-       unsigned char *Src, *Dst;
-       int i;
-
-       Src = (unsigned char *)pvSrc;
-       Dst = (unsigned char *)pvDst;
-       for (i = 0; i < ui32Size; i++) {
-               Dst[i] = Src[i];
-       }
-#else
        memcpy(pvDst, pvSrc, ui32Size);
-#endif
 }
 
 IMG_VOID OSMemSet(IMG_VOID * pvDest, IMG_UINT8 ui8Value, IMG_UINT32 ui32Size)
 {
-#if defined(USE_UNOPTIMISED_MEMSET)
-       unsigned char *Buff;
-       int i;
-
-       Buff = (unsigned char *)pvDest;
-       for (i = 0; i < ui32Size; i++) {
-               Buff[i] = ui8Value;
-       }
-#else
        memset(pvDest, (int)ui8Value, (size_t) ui32Size);
-#endif
 }
 
 IMG_CHAR *OSStringCopy(IMG_CHAR * pszDest, const IMG_CHAR * pszSrc)
@@ -481,41 +446,20 @@ IMG_UINT32 OSGetCurrentProcessIDKM(IMG_VOID)
        if (in_interrupt()) {
                return KERNEL_ID;
        }
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
-       return current->pgrp;
-#else
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
        return task_tgid_nr(current);
-#else
-       return current->tgid;
-#endif
-#endif
 }
 
 IMG_UINT32 OSGetPageSize(IMG_VOID)
 {
-#if defined(__sh__)
-       IMG_UINT32 ui32ReturnValue = PAGE_SIZE;
-
-       return (ui32ReturnValue);
-#else
        return PAGE_SIZE;
-#endif
 }
 
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))
 static irqreturn_t DeviceISRWrapper(int irq, void *dev_id
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
-                                   , struct pt_regs *regs
-#endif
     )
 {
        PVRSRV_DEVICE_NODE *psDeviceNode;
        IMG_BOOL bStatus = IMG_FALSE;
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
-       PVR_UNREFERENCED_PARAMETER(regs);
-#endif
        psDeviceNode = (PVRSRV_DEVICE_NODE *) dev_id;
        if (!psDeviceNode) {
                PVR_DPF((PVR_DBG_ERROR, "DeviceISRWrapper: invalid params\n"));
@@ -532,23 +476,15 @@ static irqreturn_t DeviceISRWrapper(int irq, void *dev_id
        }
 
 out:
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
        return bStatus ? IRQ_HANDLED : IRQ_NONE;
-#endif
 }
 
 static irqreturn_t SystemISRWrapper(int irq, void *dev_id
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
-                                   , struct pt_regs *regs
-#endif
     )
 {
        SYS_DATA *psSysData;
        IMG_BOOL bStatus = IMG_FALSE;
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
-       PVR_UNREFERENCED_PARAMETER(regs);
-#endif
        psSysData = (SYS_DATA *) dev_id;
        if (!psSysData) {
                PVR_DPF((PVR_DBG_ERROR, "SystemISRWrapper: invalid params\n"));
@@ -564,9 +500,7 @@ static irqreturn_t SystemISRWrapper(int irq, void *dev_id
        }
 
 out:
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
        return bStatus ? IRQ_HANDLED : IRQ_NONE;
-#endif
 }
 
 PVRSRV_ERROR OSInstallDeviceLISR(IMG_VOID * pvSysData,
@@ -587,11 +521,7 @@ PVRSRV_ERROR OSInstallDeviceLISR(IMG_VOID * pvSysData,
                   pszISRName, ui32Irq, pvDeviceNode));
 
        if (request_irq(ui32Irq, DeviceISRWrapper,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22))
-                       SA_SHIRQ
-#else
                        IRQF_SHARED
-#endif
                        , pszISRName, pvDeviceNode)) {
                PVR_DPF((PVR_DBG_ERROR,
                         "OSInstallDeviceLISR: Couldn't install device LISR on IRQ %d",
@@ -644,11 +574,7 @@ PVRSRV_ERROR OSInstallSystemLISR(IMG_VOID * pvSysData, IMG_UINT32 ui32Irq)
                   pvSysData));
 
        if (request_irq(ui32Irq, SystemISRWrapper,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22))
-                       SA_SHIRQ
-#else
                        IRQF_SHARED
-#endif
                        , "PowerVR", pvSysData)) {
                PVR_DPF((PVR_DBG_ERROR,
                         "OSInstallSystemLISR: Couldn't install system LISR on IRQ %d",
@@ -747,13 +673,8 @@ PVRSRV_ERROR OSScheduleMISR(IMG_VOID * pvSysData)
        return PVRSRV_OK;
 }
 
-#endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
 #define        OS_TAS(p)       xchg((p), 1)
-#else
-#define        OS_TAS(p)       tas(p)
-#endif
 PVRSRV_ERROR OSLockResource(PVRSRV_RESOURCE * psResource, IMG_UINT32 ui32ID)
 {
        PVRSRV_ERROR eError = PVRSRV_OK;
@@ -903,11 +824,6 @@ 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,
@@ -1010,13 +926,6 @@ OSReservePhys(IMG_CPU_PHYADDR BasePAddr,
 {
        LinuxMemArea *psLinuxMemArea;
 
-#if 0
-
-       if (ui32MappingFlags & PVRSRV_HAP_SINGLE_PROCESS) {
-               ui32MappingFlags &= ~PVRSRV_HAP_SINGLE_PROCESS;
-               ui32MappingFlags |= PVRSRV_HAP_MULTI_PROCESS;
-       }
-#endif
 
        switch (ui32MappingFlags & PVRSRV_HAP_MAPTYPE_MASK) {
        case PVRSRV_HAP_KERNEL_ONLY:
@@ -1045,11 +954,6 @@ 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);
@@ -1120,366 +1024,37 @@ PVRSRV_ERROR OSBaseAllocContigMemory(IMG_UINT32 ui32Size,
                                     IMG_CPU_VIRTADDR * pvLinAddr,
                                     IMG_CPU_PHYADDR * psPhysAddr)
 {
-#if !defined(NO_HARDWARE)
        PVR_UNREFERENCED_PARAMETER(ui32Size);
        PVR_UNREFERENCED_PARAMETER(pvLinAddr);
        PVR_UNREFERENCED_PARAMETER(psPhysAddr);
        PVR_DPF((PVR_DBG_ERROR, "%s: Not available", __FUNCTION__));
 
        return PVRSRV_ERROR_OUT_OF_MEMORY;
-#else
-       void *pvKernLinAddr;
-
-#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
-       pvKernLinAddr = _KMallocWrapper(ui32Size, __FILE__, __LINE__);
-#else
-       pvKernLinAddr = KMallocWrapper(ui32Size);
-#endif
-       if (!pvKernLinAddr) {
-               return PVRSRV_ERROR_OUT_OF_MEMORY;
-       }
-
-       *pvLinAddr = pvKernLinAddr;
-
-       psPhysAddr->uiAddr = virt_to_phys(pvKernLinAddr);
-
-       return PVRSRV_OK;
-#endif
 }
 
 PVRSRV_ERROR OSBaseFreeContigMemory(IMG_UINT32 ui32Size,
                                    IMG_CPU_VIRTADDR pvLinAddr,
                                    IMG_CPU_PHYADDR psPhysAddr)
 {
-#if !defined(NO_HARDWARE)
        PVR_UNREFERENCED_PARAMETER(ui32Size);
        PVR_UNREFERENCED_PARAMETER(pvLinAddr);
        PVR_UNREFERENCED_PARAMETER(psPhysAddr);
 
        PVR_DPF((PVR_DBG_WARNING, "%s: Not available", __FUNCTION__));
-#else
-       PVR_UNREFERENCED_PARAMETER(ui32Size);
-       PVR_UNREFERENCED_PARAMETER(psPhysAddr);
-
-       KFreeWrapper(pvLinAddr);
-#endif
        return PVRSRV_OK;
 }
 
 IMG_UINT32 OSReadHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset)
 {
-#if !defined(NO_HARDWARE)
        return (IMG_UINT32) readl(pvLinRegBaseAddr + ui32Offset);
-#else
-       return *(IMG_UINT32 *) (pvLinRegBaseAddr + ui32Offset);
-#endif
 }
 
 IMG_VOID OSWriteHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset,
                      IMG_UINT32 ui32Value)
 {
-#if !defined(NO_HARDWARE)
        writel(ui32Value, pvLinRegBaseAddr + ui32Offset);
-#else
-       *(IMG_UINT32 *) (pvLinRegBaseAddr + ui32Offset) = ui32Value;
-#endif
 }
 
-#if defined(CONFIG_PCI) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
-
-PVRSRV_PCI_DEV_HANDLE OSPCISetDev(IMG_VOID * pvPCICookie,
-                                 HOST_PCI_INIT_FLAGS eFlags)
-{
-       int err;
-       IMG_UINT32 i;
-       PVR_PCI_DEV *psPVRPCI;
-
-       PVR_TRACE(("OSPCISetDev"));
-
-       if (OSAllocMem
-           (PVRSRV_OS_PAGEABLE_HEAP, sizeof(*psPVRPCI),
-            (IMG_VOID *) & psPVRPCI, IMG_NULL) != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCISetDev: Couldn't allocate PVR PCI structure"));
-               return IMG_NULL;
-       }
-
-       psPVRPCI->psPCIDev = (struct pci_dev *)pvPCICookie;
-       psPVRPCI->ePCIFlags = eFlags;
-
-       err = pci_enable_device(psPVRPCI->psPCIDev);
-       if (err != 0) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCISetDev: Couldn't enable device (%d)", err));
-               return IMG_NULL;
-       }
-
-       if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)
-               pci_set_master(psPVRPCI->psPCIDev);
-
-       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
-               psPVRPCI->abPCIResourceInUse[i] = IMG_FALSE;
-       }
-
-       return (PVRSRV_PCI_DEV_HANDLE) psPVRPCI;
-}
-
-PVRSRV_PCI_DEV_HANDLE OSPCIAcquireDev(IMG_UINT16 ui16VendorID,
-                                     IMG_UINT16 ui16DeviceID,
-                                     HOST_PCI_INIT_FLAGS eFlags)
-{
-       struct pci_dev *psPCIDev;
-
-       psPCIDev = pci_get_device(ui16VendorID, ui16DeviceID, NULL);
-       if (psPCIDev == NULL) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCIAcquireDev: Couldn't acquire device"));
-               return IMG_NULL;
-       }
-
-       return OSPCISetDev((IMG_VOID *) psPCIDev, eFlags);
-}
-
-PVRSRV_ERROR OSPCIIRQ(PVRSRV_PCI_DEV_HANDLE hPVRPCI, IMG_UINT32 * pui32IRQ)
-{
-       PVR_PCI_DEV *psPVRPCI = (PVR_PCI_DEV *) hPVRPCI;
-
-       *pui32IRQ = psPVRPCI->psPCIDev->irq;
-
-       return PVRSRV_OK;
-}
-
-enum HOST_PCI_ADDR_RANGE_FUNC {
-       HOST_PCI_ADDR_RANGE_FUNC_LEN,
-       HOST_PCI_ADDR_RANGE_FUNC_START,
-       HOST_PCI_ADDR_RANGE_FUNC_END,
-       HOST_PCI_ADDR_RANGE_FUNC_REQUEST,
-       HOST_PCI_ADDR_RANGE_FUNC_RELEASE
-};
-
-static IMG_UINT32 OSPCIAddrRangeFunc(enum HOST_PCI_ADDR_RANGE_FUNC eFunc,
-                                    PVRSRV_PCI_DEV_HANDLE hPVRPCI,
-                                    IMG_UINT32 ui32Index)
-{
-       PVR_PCI_DEV *psPVRPCI = (PVR_PCI_DEV *) hPVRPCI;
-
-       if (ui32Index >= DEVICE_COUNT_RESOURCE) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCIAddrRangeFunc: Index out of range"));
-               return 0;
-
-       }
-
-       switch (eFunc) {
-       case HOST_PCI_ADDR_RANGE_FUNC_LEN:
-               return pci_resource_len(psPVRPCI->psPCIDev, ui32Index);
-       case HOST_PCI_ADDR_RANGE_FUNC_START:
-               return pci_resource_start(psPVRPCI->psPCIDev, ui32Index);
-       case HOST_PCI_ADDR_RANGE_FUNC_END:
-               return pci_resource_end(psPVRPCI->psPCIDev, ui32Index);
-       case HOST_PCI_ADDR_RANGE_FUNC_REQUEST:
-               {
-                       int err;
-
-                       err =
-                           pci_request_region(psPVRPCI->psPCIDev, ui32Index,
-                                              "PowerVR");
-                       if (err != 0) {
-                               PVR_DPF((PVR_DBG_ERROR,
-                                        "OSPCIAddrRangeFunc: pci_request_region_failed (%d)",
-                                        err));
-                               return 0;
-                       }
-                       psPVRPCI->abPCIResourceInUse[ui32Index] = IMG_TRUE;
-                       return 1;
-               }
-       case HOST_PCI_ADDR_RANGE_FUNC_RELEASE:
-               if (psPVRPCI->abPCIResourceInUse[ui32Index]) {
-                       pci_release_region(psPVRPCI->psPCIDev, ui32Index);
-                       psPVRPCI->abPCIResourceInUse[ui32Index] = IMG_FALSE;
-               }
-               return 1;
-       default:
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCIAddrRangeFunc: Unknown function"));
-               break;
-       }
-
-       return 0;
-}
-
-IMG_UINT32 OSPCIAddrRangeLen(PVRSRV_PCI_DEV_HANDLE hPVRPCI,
-                            IMG_UINT32 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);
-}
-
-IMG_UINT32 OSPCIAddrRangeEnd(PVRSRV_PCI_DEV_HANDLE hPVRPCI,
-                            IMG_UINT32 ui32Index)
-{
-       return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_END, hPVRPCI,
-                                 ui32Index);
-}
-
-PVRSRV_ERROR OSPCIRequestAddrRange(PVRSRV_PCI_DEV_HANDLE hPVRPCI,
-                                  IMG_UINT32 ui32Index)
-{
-       return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_REQUEST, hPVRPCI,
-                                 ui32Index) ==
-           0 ? PVRSRV_ERROR_GENERIC : PVRSRV_OK;
-}
-
-PVRSRV_ERROR OSPCIReleaseAddrRange(PVRSRV_PCI_DEV_HANDLE hPVRPCI,
-                                  IMG_UINT32 ui32Index)
-{
-       return OSPCIAddrRangeFunc(HOST_PCI_ADDR_RANGE_FUNC_RELEASE, hPVRPCI,
-                                 ui32Index) ==
-           0 ? PVRSRV_ERROR_GENERIC : PVRSRV_OK;
-}
-
-PVRSRV_ERROR OSPCIReleaseDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
-{
-       PVR_PCI_DEV *psPVRPCI = (PVR_PCI_DEV *) hPVRPCI;
-       int i;
-
-       PVR_TRACE(("OSPCIReleaseDev"));
-
-       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
-               if (psPVRPCI->abPCIResourceInUse[i]) {
-                       PVR_TRACE(("OSPCIReleaseDev: Releasing Address range %d", i));
-                       pci_release_region(psPVRPCI->psPCIDev, i);
-                       psPVRPCI->abPCIResourceInUse[i] = IMG_FALSE;
-               }
-       }
-
-       pci_disable_device(psPVRPCI->psPCIDev);
-
-       OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(*psPVRPCI),
-                 (IMG_VOID *) psPVRPCI, IMG_NULL);
-
-       return PVRSRV_OK;
-}
-
-PVRSRV_ERROR OSPCISuspendDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
-{
-       PVR_PCI_DEV *psPVRPCI = (PVR_PCI_DEV *) hPVRPCI;
-       int i;
-       int err;
-
-       PVR_TRACE(("OSPCISuspendDev"));
-
-       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
-               if (psPVRPCI->abPCIResourceInUse[i]) {
-                       pci_release_region(psPVRPCI->psPCIDev, i);
-               }
-       }
-
-       err = pci_save_state(psPVRPCI->psPCIDev);
-       if (err != 0) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCISuspendDev: pci_save_state_failed (%d)", err));
-               return PVRSRV_ERROR_GENERIC;
-       }
-
-       pci_disable_device(psPVRPCI->psPCIDev);
-
-       err =
-           pci_set_power_state(psPVRPCI->psPCIDev,
-                               pci_choose_state(psPVRPCI->psPCIDev,
-                                                PMSG_SUSPEND));
-       switch (err) {
-       case 0:
-               break;
-       case -EIO:
-               PVR_DPF((PVR_DBG_WARNING,
-                        "OSPCISuspendDev: device doesn't support PCI PM"));
-               break;
-       case -EINVAL:
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCISuspendDev: can't enter requested power state"));
-               break;
-       default:
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCISuspendDev: pci_set_power_state failed (%d)",
-                        err));
-               break;
-       }
-
-       return PVRSRV_OK;
-}
-
-PVRSRV_ERROR OSPCIResumeDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
-{
-       PVR_PCI_DEV *psPVRPCI = (PVR_PCI_DEV *) hPVRPCI;
-       int err;
-       int i;
-
-       PVR_TRACE(("OSPCIResumeDev"));
-
-       err =
-           pci_set_power_state(psPVRPCI->psPCIDev,
-                               pci_choose_state(psPVRPCI->psPCIDev, PMSG_ON));
-       switch (err) {
-       case 0:
-               break;
-       case -EIO:
-               PVR_DPF((PVR_DBG_WARNING,
-                        "OSPCIResumeDev: device doesn't support PCI PM"));
-               break;
-       case -EINVAL:
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCIResumeDev: can't enter requested power state"));
-               return PVRSRV_ERROR_GENERIC;
-       default:
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCIResumeDev: pci_set_power_state failed (%d)",
-                        err));
-               return PVRSRV_ERROR_GENERIC;
-       }
-
-       err = pci_restore_state(psPVRPCI->psPCIDev);
-       if (err != 0) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCIResumeDev: pci_restore_state failed (%d)", err));
-               return PVRSRV_ERROR_GENERIC;
-       }
-
-       err = pci_enable_device(psPVRPCI->psPCIDev);
-       if (err != 0) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "OSPCIResumeDev: Couldn't enable device (%d)", err));
-               return PVRSRV_ERROR_GENERIC;
-       }
-
-       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]) {
-                       err =
-                           pci_request_region(psPVRPCI->psPCIDev, i,
-                                              "PowerVR");
-                       if (err != 0) {
-                               PVR_DPF((PVR_DBG_ERROR,
-                                        "OSPCIResumeDev: pci_request_region_failed (region %d, error %d)",
-                                        i, err));
-                       }
-               }
-
-       }
-
-       return PVRSRV_OK;
-}
-
-#endif
 
 typedef struct TIMER_CALLBACK_DATA_TAG {
        PFN_TIMER_FUNC pfnTimerFunc;
@@ -1784,7 +1359,6 @@ static void CheckPagesContiguous(sWrapMemInfo * psInfo)
 static struct page *CPUVAddrToPage(struct vm_area_struct *psVMArea,
                                   unsigned long ulCPUVAddr)
 {
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10))
        pgd_t *psPGD;
        pud_t *psPUD;
        pmd_t *psPMD;
@@ -1824,9 +1398,6 @@ exit_unlock:
        pte_unmap_unlock(psPTE, psPTLock);
 
        return psPage;
-#else
-       return NULL;
-#endif
 }
 
 PVRSRV_ERROR OSReleasePhysPageAddr(IMG_HANDLE hOSWrapMem)
@@ -2119,7 +1690,6 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID * pvCPUVAddr,
 
                psInfo->eType = WRAP_TYPE_FIND_VMA_PAGES;
        } else {
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10))
 
                if ((psVMArea->vm_flags & VM_PFNMAP) == 0) {
                        printk(KERN_WARNING
@@ -2145,11 +1715,6 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID * pvCPUVAddr,
 
                printk(KERN_WARNING
                       ": OSCpuVToPageList: Region can't be locked down");
-#else
-               printk(KERN_WARNING
-                      ": OSCpuVToPageList: Raw PFN mappings not supported.  Giving up.");
-               goto error_release_mmap_sem;
-#endif
        }
 
        up_read(&current->mm->mmap_sem);
index c0fbd69..833aee1 100644 (file)
  *
  ******************************************************************************/
 
-#ifdef DEBUG_RELEASE_BUILD
-#pragma optimize( "", off )
-#define DEBUG          1
-#endif
 
 #ifndef __OSFUNC_H__
 #define __OSFUNC_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
-#ifdef __linux__
 #ifdef __KERNEL__
 #include <linux/string.h>
 #endif
-#endif
 
 #define KERNEL_ID                      0xffffffffL
 #define POWER_MANAGER_ID       0xfffffffeL
@@ -87,7 +78,6 @@ extern "C" {
                                     IMG_UINT32 ui32Bytes, IMG_UINT32 ui32Flags,
                                     IMG_HANDLE hOSMemHandle);
 
-#if defined(__linux__)
        PVRSRV_ERROR OSRegisterDiscontigMem(IMG_SYS_PHYADDR * pBasePAddr,
                                            IMG_VOID * pvCpuVAddr,
                                            IMG_UINT32 ui32Bytes,
@@ -97,49 +87,7 @@ extern "C" {
                                              IMG_UINT32 ui32Bytes,
                                              IMG_UINT32 ui32Flags,
                                              IMG_HANDLE hOSMemHandle);
-#else
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(OSRegisterDiscontigMem)
-#endif
-       static INLINE PVRSRV_ERROR OSRegisterDiscontigMem(IMG_SYS_PHYADDR *
-                                                         pBasePAddr,
-                                                         IMG_VOID * pvCpuVAddr,
-                                                         IMG_UINT32 ui32Bytes,
-                                                         IMG_UINT32 ui32Flags,
-                                                         IMG_HANDLE *
-                                                         phOSMemHandle) {
-               PVR_UNREFERENCED_PARAMETER(pBasePAddr);
-               PVR_UNREFERENCED_PARAMETER(pvCpuVAddr);
-               PVR_UNREFERENCED_PARAMETER(ui32Bytes);
-               PVR_UNREFERENCED_PARAMETER(ui32Flags);
-               PVR_UNREFERENCED_PARAMETER(phOSMemHandle);
-
-               return PVRSRV_ERROR_NOT_SUPPORTED;
-       }
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(OSUnRegisterDiscontigMem)
-#endif
-       static INLINE PVRSRV_ERROR OSUnRegisterDiscontigMem(IMG_VOID *
-                                                           pvCpuVAddr,
-                                                           IMG_UINT32
-                                                           ui32Bytes,
-                                                           IMG_UINT32
-                                                           ui32Flags,
-                                                           IMG_HANDLE
-                                                           hOSMemHandle) {
-               PVR_UNREFERENCED_PARAMETER(pvCpuVAddr);
-               PVR_UNREFERENCED_PARAMETER(ui32Bytes);
-               PVR_UNREFERENCED_PARAMETER(ui32Flags);
-               PVR_UNREFERENCED_PARAMETER(hOSMemHandle);
 
-               return PVRSRV_ERROR_NOT_SUPPORTED;
-       }
-#endif
-
-#if defined(__linux__)
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(OSReserveDiscontigPhys)
-#endif
        static INLINE PVRSRV_ERROR OSReserveDiscontigPhys(IMG_SYS_PHYADDR *
                                                          pBasePAddr,
                                                          IMG_UINT32 ui32Bytes,
@@ -148,19 +96,10 @@ extern "C" {
                                                          ppvCpuVAddr,
                                                          IMG_HANDLE *
                                                          phOSMemHandle) {
-#if defined(__linux__)
                *ppvCpuVAddr = IMG_NULL;
                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
        }
 
        static INLINE PVRSRV_ERROR OSUnReserveDiscontigPhys(IMG_VOID *
@@ -171,53 +110,11 @@ extern "C" {
                                                            ui32Flags,
                                                            IMG_HANDLE
                                                            hOSMemHandle) {
-#if defined(__linux__)
                OSUnRegisterDiscontigMem(pvCpuVAddr, ui32Bytes, ui32Flags,
                                         hOSMemHandle);
-#endif
 
                return PVRSRV_OK;
        }
-#else
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(OSReserveDiscontigPhys)
-#endif
-       static INLINE PVRSRV_ERROR OSReserveDiscontigPhys(IMG_SYS_PHYADDR *
-                                                         pBasePAddr,
-                                                         IMG_UINT32 ui32Bytes,
-                                                         IMG_UINT32 ui32Flags,
-                                                         IMG_VOID **
-                                                         ppvCpuVAddr,
-                                                         IMG_HANDLE *
-                                                         phOSMemHandle) {
-               PVR_UNREFERENCED_PARAMETER(pBasePAddr);
-               PVR_UNREFERENCED_PARAMETER(ui32Bytes);
-               PVR_UNREFERENCED_PARAMETER(ui32Flags);
-               PVR_UNREFERENCED_PARAMETER(ppvCpuVAddr);
-               PVR_UNREFERENCED_PARAMETER(phOSMemHandle);
-
-               return PVRSRV_ERROR_NOT_SUPPORTED;
-       }
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(OSUnReserveDiscontigPhys)
-#endif
-       static INLINE PVRSRV_ERROR OSUnReserveDiscontigPhys(IMG_VOID *
-                                                           pvCpuVAddr,
-                                                           IMG_UINT32
-                                                           ui32Bytes,
-                                                           IMG_UINT32
-                                                           ui32Flags,
-                                                           IMG_HANDLE
-                                                           hOSMemHandle) {
-               PVR_UNREFERENCED_PARAMETER(pvCpuVAddr);
-               PVR_UNREFERENCED_PARAMETER(ui32Bytes);
-               PVR_UNREFERENCED_PARAMETER(ui32Flags);
-               PVR_UNREFERENCED_PARAMETER(hOSMemHandle);
-
-               return PVRSRV_ERROR_NOT_SUPPORTED;
-       }
-#endif
 
        PVRSRV_ERROR OSRegisterMem(IMG_CPU_PHYADDR BasePAddr,
                                   IMG_VOID * pvCpuVAddr, IMG_UINT32 ui32Bytes,
@@ -227,7 +124,6 @@ extern "C" {
                                     IMG_UINT32 ui32Bytes, IMG_UINT32 ui32Flags,
                                     IMG_HANDLE hOSMemHandle);
 
-#if defined(__linux__)
        PVRSRV_ERROR OSGetSubMemHandle(IMG_HANDLE hOSMemHandle,
                                       IMG_UINT32 ui32ByteOffset,
                                       IMG_UINT32 ui32Bytes,
@@ -235,39 +131,13 @@ extern "C" {
                                       IMG_HANDLE * phOSMemHandleRet);
        PVRSRV_ERROR OSReleaseSubMemHandle(IMG_HANDLE hOSMemHandle,
                                           IMG_UINT32 ui32Flags);
-#else
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(OSGetSubMemHandle)
-#endif
-       static INLINE PVRSRV_ERROR OSGetSubMemHandle(IMG_HANDLE hOSMemHandle,
-                                                    IMG_UINT32 ui32ByteOffset,
-                                                    IMG_UINT32 ui32Bytes,
-                                                    IMG_UINT32 ui32Flags,
-                                                    IMG_HANDLE *
-                                                    phOSMemHandleRet) {
-               PVR_UNREFERENCED_PARAMETER(ui32ByteOffset);
-               PVR_UNREFERENCED_PARAMETER(ui32Bytes);
-               PVR_UNREFERENCED_PARAMETER(ui32Flags);
-
-               *phOSMemHandleRet = hOSMemHandle;
-               return PVRSRV_OK;
-       }
-
-       static INLINE PVRSRV_ERROR OSReleaseSubMemHandle(IMG_HANDLE
-                                                        hOSMemHandle,
-                                                        IMG_UINT32 ui32Flags) {
-               PVR_UNREFERENCED_PARAMETER(hOSMemHandle);
-               PVR_UNREFERENCED_PARAMETER(ui32Flags);
-               return PVRSRV_OK;
-       }
-#endif
 
        IMG_UINT32 OSGetCurrentProcessIDKM(IMG_VOID);
        IMG_UINT32 OSGetCurrentThreadID(IMG_VOID);
        IMG_VOID OSMemSet(IMG_VOID * pvDest, IMG_UINT8 ui8Value,
                          IMG_UINT32 ui32Size);
 
-#if defined(__linux__) && defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
+#ifdef DEBUG_LINUX_MEMORY_ALLOCATIONS
        PVRSRV_ERROR _OSAllocMem(IMG_UINT32 ui32Flags, IMG_UINT32 ui32Size,
                                 IMG_PVOID * ppvLinAddr,
                                 IMG_HANDLE * phBlockAlloc,
@@ -289,24 +159,8 @@ extern "C" {
                                  IMG_HANDLE * phPageAlloc);
        PVRSRV_ERROR OSFreePages(IMG_UINT32 ui32Flags, IMG_UINT32 ui32Size,
                                 IMG_PVOID pvLinAddr, IMG_HANDLE hPageAlloc);
-#if defined(__linux__)
        IMG_CPU_PHYADDR OSMemHandleToCpuPAddr(IMG_VOID * hOSMemHandle,
                                              IMG_UINT32 ui32ByteOffset);
-#else
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(OSMemHandleToCpuPAddr)
-#endif
-       static INLINE IMG_CPU_PHYADDR OSMemHandleToCpuPAddr(IMG_HANDLE
-                                                           hOSMemHandle,
-                                                           IMG_UINT32
-                                                           ui32ByteOffset) {
-               IMG_CPU_PHYADDR sCpuPAddr;
-               PVR_UNREFERENCED_PARAMETER(hOSMemHandle);
-               PVR_UNREFERENCED_PARAMETER(ui32ByteOffset);
-               sCpuPAddr.uiAddr = 0;
-               return sCpuPAddr;
-       }
-#endif
        PVRSRV_ERROR OSInitEnvData(IMG_PVOID * ppvEnvSpecificData);
        PVRSRV_ERROR OSDeInitEnvData(IMG_PVOID pvEnvSpecificData);
        IMG_CHAR *OSStringCopy(IMG_CHAR * pszDest, const IMG_CHAR * pszSrc);
@@ -374,14 +228,10 @@ extern "C" {
                                 IMG_UINT32 ui32Func, IMG_UINT32 ui32Reg,
                                 IMG_UINT32 ui32Value);
 
-#ifndef OSReadHWReg
        IMG_UINT32 OSReadHWReg(IMG_PVOID pvLinRegBaseAddr,
                               IMG_UINT32 ui32Offset);
-#endif
-#ifndef OSWriteHWReg
        IMG_VOID OSWriteHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset,
                              IMG_UINT32 ui32Value);
-#endif
 
        typedef IMG_VOID(*PFN_TIMER_FUNC) (IMG_VOID *);
        IMG_HANDLE OSAddTimer(PFN_TIMER_FUNC pfnTimerFunc, IMG_VOID * pvData,
@@ -438,39 +288,11 @@ extern "C" {
        PVRSRV_ERROR OSCopyFromUser(IMG_PVOID pvProcess, IMG_VOID * pvDest,
                                    IMG_VOID * pvSrc, IMG_UINT32 ui32Bytes);
 
-#if defined(__linux__)
        PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID * pvCPUVAddr,
                                           IMG_UINT32 ui32Bytes,
                                           IMG_SYS_PHYADDR * psSysPAddr,
                                           IMG_HANDLE * phOSWrapMem);
        PVRSRV_ERROR OSReleasePhysPageAddr(IMG_HANDLE hOSWrapMem);
-#else
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(OSAcquirePhysPageAddr)
-#endif
-       static INLINE PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID * pvCPUVAddr,
-                                                        IMG_UINT32 ui32Bytes,
-                                                        IMG_SYS_PHYADDR *
-                                                        psSysPAddr,
-                                                        IMG_HANDLE *
-                                                        phOSWrapMem) {
-               PVR_UNREFERENCED_PARAMETER(pvCPUVAddr);
-               PVR_UNREFERENCED_PARAMETER(ui32Bytes);
-               PVR_UNREFERENCED_PARAMETER(psSysPAddr);
-               PVR_UNREFERENCED_PARAMETER(phOSWrapMem);
-               return PVRSRV_OK;
-       }
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(OSReleasePhysPageAddr)
-#endif
-       static INLINE PVRSRV_ERROR OSReleasePhysPageAddr(IMG_HANDLE hOSWrapMem) {
-               PVR_UNREFERENCED_PARAMETER(hOSWrapMem);
-               return PVRSRV_OK;
-       }
-#endif
 
-#if defined (__cplusplus)
-}
-#endif
 
 #endif
index f3b5042..d4986ac 100644 (file)
--- a/pvr/pb.c
+++ b/pvr/pb.c
@@ -33,9 +33,6 @@
 #include "pvr_bridge_km.h"
 #include "pdump_km.h"
 
-#ifndef __linux__
-#pragma message("TODO: Review use of OS_PAGEABLE vs OS_NON_PAGEABLE")
-#endif
 
 static PRESMAN_ITEM psResItemCreateSharedPB = IMG_NULL;
 static PVRSRV_PER_PROCESS_DATA *psPerProcCreateSharedPB = IMG_NULL;
index 59c6996..ee70123 100644 (file)
@@ -1047,20 +1047,6 @@ PVRSRV_ERROR PDumpBitmapKM(IMG_CHAR * pszFileName,
        PDUMPCOMMENTWITHFLAGS(ui32PDumpFlags,
                              "\r\n-- Dump bitmap of render\r\n");
 
-#if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-
-       snprintf(pszScript,
-                SZ_SCRIPT_SIZE_MAX,
-                "SII %s %s.bin :SGXMEM:v%x:0x%08lX 0x%08lX 0x%08lX 0x%08X 0x%08lX 0x%08lX 0x%08lX 0x%08X\r\n",
-                pszFileName,
-                pszFileName,
-                PDUMP_DATAMASTER_PIXEL,
-                sDevBaseAddr.uiAddr,
-                ui32Size,
-                ui32FileOffset,
-                ePixelFormat,
-                ui32Width, ui32Height, ui32StrideInBytes, eMemFormat);
-#else
        snprintf(pszScript,
                 SZ_SCRIPT_SIZE_MAX,
                 "SII %s %s.bin :SGXMEM:v:0x%08lX 0x%08lX 0x%08lX 0x%08X 0x%08lX 0x%08lX 0x%08lX 0x%08X\r\n",
@@ -1071,7 +1057,6 @@ PVRSRV_ERROR PDumpBitmapKM(IMG_CHAR * pszFileName,
                 ui32FileOffset,
                 ePixelFormat,
                 ui32Width, ui32Height, ui32StrideInBytes, eMemFormat);
-#endif
 
        PDumpWriteString2(pszScript, ui32PDumpFlags);
        return PVRSRV_OK;
index 988f105..26a5232 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef _PDUMP_KM_H_
 #define _PDUMP_KM_H_
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
 
 #define PDUMP_FLAGS_NEVER                      0x08000000
 #define PDUMP_FLAGS_TOOUT2MEM          0x10000000
@@ -250,7 +247,6 @@ extern "C" {
 #define PDUMPRESUME                            PDumpResumeKM
 
 #else
-#if ((defined(LINUX) || defined(GCC_IA32)) || defined(GCC_ARM))
 #define PDUMPMEMPOL(args...)
 #define PDUMPMEM(args...)
 #define PDUMPMEM2(args...)
@@ -289,12 +285,6 @@ extern "C" {
 #define PDUMPSUSPEND(args...)
 #define PDUMPRESUME(args...)
 #define PDUMPMSVDXWRITEREF(args...)
-#else
-#error Compiler not specified
-#endif
 #endif
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index 8c4d61d..740d790 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef __PERPROC_H__
 #define __PERPROC_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #include "img_types.h"
 #include "resman.h"
@@ -60,7 +57,4 @@ extern "C" {
        PVRSRV_ERROR PVRSRVPerProcessDataInit(IMG_VOID);
        PVRSRV_ERROR PVRSRVPerProcessDataDeInit(IMG_VOID);
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index 20270b2..0819477 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef POWER_H
 #define POWER_H
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
 
        typedef struct _PVRSRV_POWER_DEV_TAG_ {
                PFN_PRE_POWER pfnPrePower;
@@ -118,7 +115,4 @@ extern "C" {
                                                      IMG_BOOL bIdleDevice,
                                                      IMG_VOID * pvInfo);
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index f19a189..cfa8bc7 100644 (file)
@@ -49,12 +49,6 @@ int PVRDebugProcSetLevel(struct file *file, const char *buffer,
 int PVRDebugProcGetLevel(char *page, char **start, off_t off, int count,
                         int *eof, void *data);
 
-#ifdef PVR_MANUAL_POWER_CONTROL
-int PVRProcSetPowerLevel(struct file *file, const char *buffer,
-                        unsigned long count, void *data);
-int PVRProcGetPowerLevel(char *page, char **start, off_t off, int count,
-                        int *eof, void *data);
-#endif
 #endif
 
 static struct proc_dir_entry *dir;
@@ -197,17 +191,8 @@ int CreateProcEntries(void)
                PVR_DPF((PVR_DBG_ERROR,
                         "CreateProcEntries: couldn't make /proc/pvr/debug_level"));
 
-               return -ENOMEM;
-       }
-#ifdef PVR_MANUAL_POWER_CONTROL
-       if (CreateProcEntry
-           ("power_control", PVRProcGetPowerLevel, PVRProcSetPowerLevel, 0)) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "CreateProcEntries: couldn't make /proc/pvr/power_control"));
-
                return -ENOMEM;
        }
-#endif
 #endif
 
        return 0;
@@ -226,9 +211,6 @@ void RemoveProcEntries(void)
 {
 #ifdef DEBUG
        RemoveProcEntry("debug_level");
-#ifdef PVR_MANUAL_POWER_CONTROL
-       RemoveProcEntry("power_control");
-#endif
 #endif
        RemoveProcEntry("queue");
        RemoveProcEntry("nodes");
index 1168999..703aace 100644 (file)
 #ifndef __PVR_BRIDGE_H__
 #define __PVR_BRIDGE_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #include "servicesint.h"
 
-#ifdef __linux__
 
 #include <linux/ioctl.h>
 
@@ -43,17 +39,6 @@ extern "C" {
 #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
-
-#error Unknown platform: Cannot define ioctls
-
-#define PVRSRV_IO(INDEX)    (PVRSRV_IOC_GID + INDEX)
-#define PVRSRV_IOW(INDEX)   (PVRSRV_IOC_GID + INDEX)
-#define PVRSRV_IOR(INDEX)   (PVRSRV_IOC_GID + INDEX)
-#define PVRSRV_IOWR(INDEX)  (PVRSRV_IOC_GID + INDEX)
-
-#define PVRSRV_BRIDGE_BASE                  PVRSRV_IOC_GID
-#endif
 
 #define PVRSRV_BRIDGE_CORE_CMD_FIRST                   0
 #define PVRSRV_BRIDGE_ENUM_DEVICES                             PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+0)
@@ -107,10 +92,6 @@ extern "C" {
 #define PVRSRV_BRIDGE_MISC_CMD_LAST                            (PVRSRV_BRIDGE_MISC_CMD_FIRST+1)
 
 #define PVRSRV_BRIDGE_OVERLAY_CMD_FIRST                        (PVRSRV_BRIDGE_MISC_CMD_LAST+1)
-#if defined (SUPPORT_OVERLAY_ROTATE_BLIT)
-#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)
-#endif
 #define PVRSRV_BRIDGE_OVERLAY_CMD_LAST                 (PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+1)
 
 #if defined(PDUMP)
@@ -1028,7 +1009,4 @@ extern "C" {
                IMG_HANDLE hOSEventKM;
        } PVRSRV_BRIDGE_IN_EVENT_OBJECT_CLOSE;
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index 1037cd7..72a631b 100644 (file)
 
 #include "bridged_pvr_bridge.h"
 
-#ifdef MODULE_TEST
-#include "pvr_test_bridge.h"
-#include "kern_test.h"
-#endif
 
 #if defined(DEBUG_BRIDGE_KM)
 static off_t printLinuxBridgeStats(char *buffer, size_t size, off_t off);
@@ -155,171 +151,6 @@ PVRSRV_BridgeDispatchKM(struct file *file, unsigned int cmd, unsigned long arg)
            != PVRSRV_OK) {
                goto unlock_and_return;
        }
-#ifdef MODULE_TEST
-       switch (cmd) {
-       case PVRSRV_BRIDGE_SERVICES_TEST_MEM1:
-               {
-                       PVRSRV_ERROR eError = MemTest1();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-       case PVRSRV_BRIDGE_SERVICES_TEST_MEM2:
-               {
-                       PVRSRV_ERROR eError = MemTest2();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-
-       case PVRSRV_BRIDGE_SERVICES_TEST_RESOURCE:
-               {
-                       PVRSRV_ERROR eError = ResourceTest();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-
-       case PVRSRV_BRIDGE_SERVICES_TEST_EVENTOBJECT:
-               {
-                       PVRSRV_ERROR eError = EventObjectTest();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-
-       case PVRSRV_BRIDGE_SERVICES_TEST_MEMMAPPING:
-               {
-                       PVRSRV_ERROR eError = MemMappingTest();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-
-       case PVRSRV_BRIDGE_SERVICES_TEST_PROCESSID:
-               {
-                       PVRSRV_ERROR eError = ProcessIDTest();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-
-       case PVRSRV_BRIDGE_SERVICES_TEST_CLOCKUSWAITUS:
-               {
-                       PVRSRV_ERROR eError = ClockusWaitusTest();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-
-       case PVRSRV_BRIDGE_SERVICES_TEST_TIMER:
-               {
-                       PVRSRV_ERROR eError = TimerTest();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-
-       case PVRSRV_BRIDGE_SERVICES_TEST_PRIVSRV:
-               {
-                       PVRSRV_ERROR eError = PrivSrvTest();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-       case PVRSRV_BRIDGE_SERVICES_TEST_COPYDATA:
-               {
-                       IMG_UINT32 ui32PID;
-                       PVRSRV_PER_PROCESS_DATA *psPerProc;
-                       PVRSRV_ERROR eError;
-
-                       ui32PID = OSGetCurrentProcessIDKM();
-
-                       PVRSRVTrace("PVRSRV_BRIDGE_SERVICES_TEST_COPYDATA %d",
-                                   ui32PID);
-
-                       psPerProc = PVRSRVPerProcessData(ui32PID);
-
-                       eError =
-                           CopyDataTest(sBridgePackageKM.pvParamIn,
-                                        sBridgePackageKM.pvParamOut,
-                                        psPerProc);
-
-                       *(PVRSRV_ERROR *) sBridgePackageKM.pvParamOut = eError;
-                       err = 0;
-                       goto unlock_and_return;
-               }
-
-       case PVRSRV_BRIDGE_SERVICES_TEST_POWERMGMT:
-               {
-                       PVRSRV_ERROR eError = PowerMgmtTest();
-                       if (sBridgePackageKM.ui32OutBufferSize ==
-                           sizeof(PVRSRV_BRIDGE_RETURN)) {
-                               PVRSRV_BRIDGE_RETURN *pReturn =
-                                   (PVRSRV_BRIDGE_RETURN *) sBridgePackageKM.
-                                   pvParamOut;
-                               pReturn->eError = eError;
-                       }
-               }
-               err = 0;
-               goto unlock_and_return;
-
-       }
-#endif
 
        if (ui32BridgeID !=
            PVRSRV_GET_BRIDGE_ID(PVRSRV_BRIDGE_CONNECT_SERVICES)) {
index a144092..901bf91 100644 (file)
 #ifndef __PVR_BRIDGE_KM_H_
 #define __PVR_BRIDGE_KM_H_
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #include "pvr_bridge.h"
 #include "perproc.h"
 
-#if defined(__linux__)
        PVRSRV_ERROR LinuxBridgeInit(IMG_VOID);
        IMG_VOID LinuxBridgeDeInit(IMG_VOID);
-#endif
 
         IMG_IMPORT
            PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDevicesKM(IMG_UINT32 *
@@ -87,11 +82,9 @@ extern "C" {
                                                                     psHeapInfo,
                                                                     IMG_BOOL *
                                                                     pbCreated
-#if defined(PVR_SECURE_HANDLES)
                                                                     ,
                                                                     IMG_BOOL *
                                                                     pbShared
-#endif
            );
 
         IMG_IMPORT
@@ -111,11 +104,9 @@ extern "C" {
                                                                   pui32ClientHeapCount,
                                                                   PVRSRV_HEAP_INFO
                                                                   * psHeapInfo
-#if defined(PVR_SECURE_HANDLES)
                                                                   ,
                                                                   IMG_BOOL *
                                                                   pbShared
-#endif
            );
 
         IMG_IMPORT
@@ -349,7 +340,4 @@ extern "C" {
            PVRSRVDissociateMemFromResmanKM(PVRSRV_KERNEL_MEM_INFO *
                                            psKernelMemInfo);
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index f56b2a1..6c2ce3b 100644 (file)
@@ -51,7 +51,6 @@ void PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel,
     )
 {
        IMG_BOOL bTrace, bDebug;
-#if !defined(__sh__)
        IMG_CHAR *pszLeafName;
 
        pszLeafName = (char *)strrchr(pszFileName, '\\');
@@ -59,7 +58,6 @@ void PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel,
        if (pszLeafName) {
                pszFileName = pszLeafName;
        }
-#endif
 
        bTrace = gPVRDebugLevel & ui32DebugLevel & DBGPRIV_CALLTRACE;
        bDebug = ((gPVRDebugLevel & DBGPRIV_ALLLEVELS) >= ui32DebugLevel);
index 3b0d026..a5ec8dd 100644 (file)
@@ -29,9 +29,6 @@
 
 #include "img_types.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #define PVR_MAX_DEBUG_MESSAGE_LEN      (512)
 
@@ -53,13 +50,7 @@ extern "C" {
 #define PVR_DBG_ALLOC          DBGPRIV_ALLOC,__FILE__, __LINE__
 
 #if defined(DEBUG)
-#if !defined (QAC_ANALYSE)
 #define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__);
-#else
-       void __cdecl _assert(void *, void *, unsigned);
-
-#define PVR_ASSERT(exp) (void)( (exp) || (_assert(#exp, __FILE__, __LINE__), 0) )
-#endif
 
 #define PVR_DPF(X)             PVRSRVDebugPrintf X
 #define PVR_TRACE(X)   PVRSRVTrace X
@@ -106,7 +97,4 @@ extern "C" {
 #endif
 #endif
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
diff --git a/pvr/pvrconfig.h b/pvr/pvrconfig.h
new file mode 100644 (file)
index 0000000..9bc9837
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef _PVRCONFIG_H
+#define _PVRCONFIG_H
+
+#define SGX530                         1
+#define SGX_CORE_REV                   121
+
+#ifdef CONFIG_PVR_DEBUG
+# define PVR_BUILD_TYPE                "debug"
+# define DEBUG                 1
+#elif defined(CONFIG_PVR_TIMING)
+# define PVR_BUILD_TYPE                "timing"
+# define TIMING                        1
+#elif defined(CONFIG_PVR_RELEASE)
+# define PVR_BUILD_TYPE                "release"
+#endif
+
+#ifdef DEBUG
+# define DEBUG_LINUX_MEMORY_ALLOCATIONS        1
+# define DEBUG_LINUX_MEM_AREAS         1
+# define DEBUG_LINUX_MMAP_AREAS                1
+# define DEBUG_BRIDGE_KM               1
+#endif
+
+#endif
index 4539b44..bf53d7b 100644 (file)
@@ -83,16 +83,13 @@ PVRSRV_ERROR FreeDeviceID(SYS_DATA * psSysData, IMG_UINT32 ui32DevID)
        return PVRSRV_ERROR_GENERIC;
 }
 
-#ifndef ReadHWReg
 IMG_EXPORT
     IMG_UINT32 ReadHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset)
 {
        return *(volatile IMG_UINT32 *)((IMG_UINT32) pvLinRegBaseAddr +
                                        ui32Offset);
 }
-#endif
 
-#ifndef WriteHWReg
 IMG_EXPORT
     IMG_VOID WriteHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset,
                        IMG_UINT32 ui32Value)
@@ -103,9 +100,7 @@ IMG_EXPORT
        *(IMG_UINT32 *) ((IMG_UINT32) pvLinRegBaseAddr + ui32Offset) =
            ui32Value;
 }
-#endif
 
-#ifndef WriteHWRegs
 IMG_EXPORT
     IMG_VOID WriteHWRegs(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Count,
                         PVRSRV_HWREG * psHWRegs)
@@ -116,7 +111,6 @@ IMG_EXPORT
                psHWRegs++;
        }
 }
-#endif
 
 IMG_EXPORT
     PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDevicesKM(IMG_UINT32 *
@@ -537,43 +531,6 @@ IMG_EXPORT
        return PVRSRV_ERROR_GENERIC;
 }
 
-#if defined (USING_ISR_INTERRUPTS)
-
-extern IMG_UINT32 gui32EventStatusServicesByISR;
-
-PVRSRV_ERROR PollForInterruptKM(IMG_UINT32 ui32Value,
-                               IMG_UINT32 ui32Mask,
-                               IMG_UINT32 ui32Waitus, IMG_UINT32 ui32Tries)
-{
-       IMG_BOOL bStart = IMG_FALSE;
-       IMG_UINT32 uiStart = 0, uiCurrent = 0, uiMaxTime;
-
-       uiMaxTime = ui32Tries * ui32Waitus;
-
-       do {
-               if ((gui32EventStatusServicesByISR & ui32Mask) == ui32Value) {
-                       gui32EventStatusServicesByISR = 0;
-                       return PVRSRV_OK;
-               }
-
-               if (bStart == IMG_FALSE) {
-                       bStart = IMG_TRUE;
-                       uiStart = OSClockus();
-               }
-
-               OSWaitus(ui32Waitus);
-
-               uiCurrent = OSClockus();
-               if (uiCurrent < uiStart) {
-
-                       uiStart = 0;
-               }
-
-       } while ((uiCurrent - uiStart) < uiMaxTime);
-
-       return PVRSRV_ERROR_GENERIC;
-}
-#endif
 
 IMG_EXPORT
     PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO * psMiscInfo)
index c49cb4e..9a42390 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "services_headers.h"
 
-#if defined(__linux__) && defined(__KERNEL__)
 #include "proc.h"
 
 static int
@@ -79,7 +78,6 @@ off_t QueuePrintQueues(char *buffer, size_t size, off_t off)
        return psQueue ? QueuePrintCommands(psQueue, buffer,
                                            size) : END_OF_FILE;
 }
-#endif
 
 #define GET_SPACE_IN_CMDQ(psQueue)                                                                             \
        (((psQueue->ui32ReadOffset - psQueue->ui32WriteOffset)                          \
@@ -699,13 +697,9 @@ IMG_EXPORT
 
        PVRSRVCommandCompleteCallbacks();
 
-#if defined(SYS_USING_INTERRUPTS)
        if (bScheduleMISR) {
                OSScheduleMISR(psSysData);
        }
-#else
-       PVR_UNREFERENCED_PARAMETER(bScheduleMISR);
-#endif
 }
 
 IMG_VOID PVRSRVCommandCompleteCallbacks(IMG_VOID)
index a380a9f..274be5b 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef QUEUE_H
 #define QUEUE_H
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
 
 #define UPDATE_QUEUE_ROFF(psQueue, ui32Size)                                           \
        psQueue->ui32ReadOffset = (psQueue->ui32ReadOffset + ui32Size)  \
@@ -45,13 +42,12 @@ extern "C" {
                IMG_UINT32 ui32AllocSize;
        } COMMAND_COMPLETE_DATA, *PCOMMAND_COMPLETE_DATA;
 
-#if !defined(USE_CODE)
 
         IMG_IMPORT
            PVRSRV_ERROR PVRSRVProcessQueues(IMG_UINT32 ui32CallerID,
                                             IMG_BOOL bFlush);
 
-#if defined(__linux__) && defined(__KERNEL__)
+#ifdef __KERNEL__
 #include <linux/types.h>
         off_t QueuePrintQueues(char *buffer, size_t size, off_t off);
 #endif
@@ -117,9 +113,5 @@ extern "C" {
                                                           IMG_UINT32
                                                           ui32CmdCount);
 
-#endif
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index e6e5850..b78e314 100644 (file)
--- a/pvr/ra.c
+++ b/pvr/ra.c
 #include "buffer_manager.h"
 #include "osfunc.h"
 
-#ifdef __linux__
 #include <linux/kernel.h>
 #include "proc.h"
-#endif
 
-#ifdef USE_BM_FREESPACE_CHECK
-#include <stdio.h>
-#endif
 
 #define MINIMUM_HASH_SIZE (64)
 
@@ -107,9 +102,6 @@ static int RA_DumpInfo(char *page, char **start, off_t off, int count, int *eof,
                       void *data);
 #endif
 
-#ifdef USE_BM_FREESPACE_CHECK
-void CheckBMFreespace(void);
-#endif
 
 static IMG_BOOL
 _RequestAllocFail(void *_h,
@@ -446,11 +438,6 @@ _AttemptAllocAligned(RA_ARENA * pArena,
 
        uIndex = pvr_log2(uSize);
 
-#if 0
-
-       if (1u << uIndex < uSize)
-               uIndex++;
-#endif
 
        while (uIndex < FREE_TABLE_LIMIT
               && pArena->aHeadFree[uIndex] == IMG_NULL)
@@ -736,9 +723,6 @@ RA_Alloc(RA_ARENA * pArena,
 
        PVR_ASSERT(pArena != IMG_NULL);
 
-#ifdef USE_BM_FREESPACE_CHECK
-       CheckBMFreespace();
-#endif
 
        if (pActualSize != IMG_NULL)
                *pActualSize = uSize;
@@ -820,9 +804,6 @@ void RA_Free(RA_ARENA * pArena, IMG_UINTPTR_T base, IMG_BOOL bFreeBackingStore)
 
        PVR_ASSERT(pArena != IMG_NULL);
 
-#ifdef USE_BM_FREESPACE_CHECK
-       CheckBMFreespace();
-#endif
 
        PVR_DPF((PVR_DBG_MESSAGE,
                 "RA_Free: name='%s', base=0x%x", pArena->name, base));
@@ -837,33 +818,6 @@ void RA_Free(RA_ARENA * pArena, IMG_UINTPTR_T base, IMG_BOOL bFreeBackingStore)
                pArena->sStatistics.uCumulativeFrees++;
 #endif
 
-#ifdef USE_BM_FREESPACE_CHECK
-               {
-                       unsigned char *p;
-                       unsigned char *endp;
-
-                       p = (unsigned char *)pBT->base +
-                           SysGetDevicePhysOffset();
-                       endp = (unsigned char *)((IMG_UINT32) (p + pBT->uSize));
-                       while ((IMG_UINT32) p & 3) {
-                               *p++ = 0xAA;
-                       }
-                       while (p <
-                              (unsigned char *)((IMG_UINT32) endp &
-                                                0xfffffffc)) {
-                               *(IMG_UINT32 *) p = 0xAAAAAAAA;
-                               p += sizeof(IMG_UINT32);
-                       }
-                       while (p < endp) {
-                               *p++ = 0xAA;
-                       }
-                       PVR_DPF((PVR_DBG_MESSAGE,
-                                "BM_FREESPACE_CHECK: RA_Free Cleared %08X to %08X (size=0x%x)",
-                                (unsigned char *)pBT->base +
-                                SysGetDevicePhysOffset(), endp - 1,
-                                pBT->uSize));
-               }
-#endif
                _FreeBT(pArena, pBT, bFreeBackingStore);
        }
 }
@@ -900,50 +854,6 @@ IMG_BOOL RA_GetNextLiveSegment(IMG_HANDLE hArena,
        return IMG_FALSE;
 }
 
-#ifdef USE_BM_FREESPACE_CHECK
-RA_ARENA *pJFSavedArena = IMG_NULL;
-
-void CheckBMFreespace(void)
-{
-       BT *pBT;
-       unsigned char *p;
-       unsigned char *endp;
-
-       if (pJFSavedArena != IMG_NULL) {
-               for (pBT = pJFSavedArena->pHeadSegment; pBT != IMG_NULL;
-                    pBT = pBT->pNextSegment) {
-                       if (pBT->type == btt_free) {
-                               p = (unsigned char *)pBT->base +
-                                   SysGetDevicePhysOffset();
-                               endp =
-                                   (unsigned char
-                                    *)((IMG_UINT32) (p +
-                                                     pBT->uSize) & 0xfffffffc);
-
-                               while ((IMG_UINT32) p & 3) {
-                                       if (*p++ != 0xAA) {
-                                               fprintf(stderr,
-                                                       "BM_FREESPACE_CHECK: Blank space at %08X has changed to 0x%x\n",
-                                                       p, *(unsigned long *)p);
-                                               for (;;) ;
-                                               break;
-                                       }
-                               }
-                               while (p < endp) {
-                                       if (*(unsigned long *)p != 0xAAAAAAAA) {
-                                               fprintf(stderr,
-                                                       "BM_FREESPACE_CHECK: Blank space at %08X has changed to 0x%x\n",
-                                                       p, *(unsigned long *)p);
-                                               for (;;) ;
-                                               break;
-                                       }
-                                       p += 4;
-                               }
-                       }
-               }
-       }
-}
-#endif
 
 #if (defined(CONFIG_PROC_FS) && defined(DEBUG)) || defined (RA_STATS)
 static char *_BTType(int eType)
index e6fc1f8..e2d9c52 100644 (file)
 #include "services_headers.h"
 #include "resman.h"
 
-#ifdef __linux__
 #ifndef AUTOCONF_INCLUDED
 #include <linux/config.h>
 #endif
 
 #include <linux/version.h>
 #include <linux/sched.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9)
 #include <linux/hardirq.h>
-#else
-#include <asm/hardirq.h>
-#endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
 #include <linux/semaphore.h>
-#else
-#include <asm/semaphore.h>
-#endif
 
 static DECLARE_MUTEX(lock);
 
@@ -57,12 +48,6 @@ static DECLARE_MUTEX(lock);
 } while (0)
 #define RELEASE_SYNC_OBJ up (&lock)
 
-#else
-
-#define ACQUIRE_SYNC_OBJ
-#define RELEASE_SYNC_OBJ
-
-#endif
 
 #define RESMAN_SIGNATURE 0x12345678
 
index 1078f64..f0af9d1 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef __RESMAN_H__
 #define __RESMAN_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
        enum {
 
@@ -97,7 +94,4 @@ extern "C" {
        IMG_VOID PVRSRVResManDisconnect(PRESMAN_CONTEXT hResManContext,
                                        IMG_BOOL bKernelContext);
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index c151f54..c8fbedd 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef __SERVICES_H__
 #define __SERVICES_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #include "img_defs.h"
 #include "servicesext.h"
@@ -199,21 +196,6 @@ extern "C" {
 
        } PVRSRV_CLIENT_MEM_INFO, *PPVRSRV_CLIENT_MEM_INFO;
 
-#if 0
-       typedef struct _PVRSRV_CLIENT_SYNC_INFO_ {
-
-               PVRSRV_SYNC_DATA *psSyncData;
-
-               IMG_DEV_VIRTADDR sWriteOpsCompleteDevVAddr;
-
-               IMG_DEV_VIRTADDR sReadOpsCompleteDevVAddr;
-
-               IMG_HANDLE hMappingInfo;
-
-               IMG_HANDLE hKernelSyncInfo;
-
-       } PVRSRV_CLIENT_SYNC_INFO, *PPVRSRV_CLIENT_SYNC_INFO;
-#endif
 
 #define PVRSRV_MAX_CLIENT_HEAPS (32)
        typedef struct _PVRSRV_HEAP_INFO_ {
@@ -298,7 +280,6 @@ extern "C" {
                                                            PVRSRV_MISC_INFO *
                                                            psMiscInfo);
 
-#if 1
         IMG_IMPORT
            IMG_UINT32 ReadHWReg(IMG_PVOID pvLinRegBaseAddr,
                                 IMG_UINT32 ui32Offset);
@@ -310,7 +291,6 @@ extern "C" {
        IMG_IMPORT IMG_VOID WriteHWRegs(IMG_PVOID pvLinRegBaseAddr,
                                        IMG_UINT32 ui32Count,
                                        PVRSRV_HWREG * psHWRegs);
-#endif
 
         IMG_IMPORT
            PVRSRV_ERROR PVRSRVPollForValue(PVRSRV_CONNECTION * psConnection,
@@ -965,7 +945,7 @@ extern "C" {
        IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE
                                                           hMutex);
 
-#if (defined(DEBUG) && defined(__linux__))
+#ifdef DEBUG
        IMG_PVOID PVRSRVAllocUserModeMemTracking(IMG_UINT32 ui32Size,
                                                 IMG_CHAR * pszFileName,
                                                 IMG_UINT32 ui32LineNumber);
@@ -985,7 +965,4 @@ extern "C" {
 
 #define TIME_NOT_PASSED_UINT32(a,b,c)          ((a - b) < c)
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index 3e25dee..db4cb7e 100644 (file)
 #ifndef SERVICES_HEADERS_H
 #define SERVICES_HEADERS_H
 
-#ifdef DEBUG_RELEASE_BUILD
-#pragma optimize( "", off )
-#define DEBUG          1
-#endif
 
 #include "img_defs.h"
 #include "services.h"
index 1f05e4d..4d12a9a 100644 (file)
@@ -311,10 +311,6 @@ typedef struct DISPLAY_INFO_TAG {
 
        IMG_CHAR szDisplayName[MAX_DISPLAY_NAME_SIZE];
 
-#if defined(SUPPORT_HW_CURSOR)
-       IMG_UINT16 ui32CursorWidth;
-       IMG_UINT16 ui32CursorHeight;
-#endif
 
 } DISPLAY_INFO;
 
index 49269e2..d3a5023 100644 (file)
@@ -27,9 +27,6 @@
 #if !defined (__SERVICESINT_H__)
 #define __SERVICESINT_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #include "services.h"
 #include "sysinfo.h"
@@ -135,9 +132,6 @@ extern "C" {
                IMG_HANDLE hServices;
        } PVRSRV_CLIENT_DEVICECLASS_INFO;
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVGetWriteOpsPending)
-#endif
        static INLINE
            IMG_UINT32 PVRSRVGetWriteOpsPending(PVRSRV_KERNEL_SYNC_INFO *
                                                psSyncInfo,
@@ -156,9 +150,6 @@ extern "C" {
                return ui32WriteOpsPending;
        }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(PVRSRVGetReadOpsPending)
-#endif
        static INLINE
            IMG_UINT32 PVRSRVGetReadOpsPending(PVRSRV_KERNEL_SYNC_INFO *
                                               psSyncInfo, IMG_BOOL bIsReadOp) {
@@ -204,7 +195,4 @@ extern "C" {
                                IMG_HANDLE hKernelMemInfo,
                                PVRSRV_CLIENT_MEM_INFO ** ppsClientMemInfo);
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
diff --git a/pvr/sgx2dcore.c b/pvr/sgx2dcore.c
deleted file mode 100644 (file)
index fcf4dfa..0000000
+++ /dev/null
@@ -1,846 +0,0 @@
-/**********************************************************************
- *
- * 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. 
- * 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 
- *
- ******************************************************************************/
-
-#include "sgxdefs.h"
-#include "services_headers.h"
-#include "sgxinfo.h"
-#include "sgxinfokm.h"
-
-#if defined(SGX_FEATURE_2D_HARDWARE)
-
-#include "sgx2dcore.h"
-
-#define SGX2D_FLUSH_BH 0xF0000000
-#define        SGX2D_FENCE_BH  0x70000000
-
-#define SGX2D_QUEUED_BLIT_PAD  4
-
-#define SGX2D_COMMAND_QUEUE_SIZE 1024
-
-#define SGX2D_2D_NOT_IDLE(psDevInfo)   ((psDevInfo)->ui322DFifoSize > SGX2DFifoFreeSpace(psDevInfo) || SGX2DIsBusy(psDevInfo))
-
-static IMG_VOID SGX2DHardwareKick(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-
-       OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS,
-                    EUR_CR_EVENT_STATUS_MASTER_INTERRUPT_MASK |
-                    EUR_CR_EVENT_STATUS_TWOD_COMPLETE_MASK);
-}
-
-IMG_VOID SGX2DHWRecoveryStart(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-       psDevInfo->b2DHWRecoveryInProgress = IMG_TRUE;
-       psDevInfo->b2DHWRecoveryEndPending = IMG_FALSE;
-}
-
-IMG_VOID SGX2DHWRecoveryEnd(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-       psDevInfo->b2DHWRecoveryEndPending = IMG_TRUE;
-       psDevInfo->b2DHWRecoveryInProgress = IMG_FALSE;
-       SGX2DHardwareKick(psDevInfo);
-}
-
-#if !defined(NO_HARDWARE)
-static IMG_VOID SGX2DKick(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-       IMG_BOOL bStart = IMG_FALSE;
-       IMG_UINT32 uiStart = 0;
-
-       PVR_UNREFERENCED_PARAMETER(psDevInfo);
-
-       do {
-               if (PVRSRVProcessQueues(KERNEL_ID, IMG_FALSE) !=
-                   PVRSRV_ERROR_PROCESSING_BLOCKED) {
-                       break;
-               }
-
-               if (bStart == IMG_FALSE) {
-                       uiStart = OSClockus();
-                       bStart = IMG_TRUE;
-               }
-               OSWaitus(MAX_HW_TIME_US / WAIT_TRY_COUNT);
-       } while ((OSClockus() - uiStart) < MAX_HW_TIME_US);
-}
-#endif
-
-IMG_BOOL SGX2DIsBusy(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-       IMG_UINT32 ui32BlitStatus;
-
-       ui32BlitStatus = OSReadHWReg(psDevInfo->pvRegsBaseKM,
-                                    EUR_CR_2D_BLIT_STATUS);
-
-       return (ui32BlitStatus & EUR_CR_2D_BLIT_STATUS_BUSY_MASK) != 0;
-}
-
-IMG_UINT32 SGX2DCompletedBlits(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-       IMG_UINT32 ui32BlitStatus;
-
-       ui32BlitStatus = OSReadHWReg(psDevInfo->pvRegsBaseKM,
-                                    EUR_CR_2D_BLIT_STATUS);
-
-       return (ui32BlitStatus & EUR_CR_2D_BLIT_STATUS_COMPLETE_MASK) >>
-           EUR_CR_2D_BLIT_STATUS_COMPLETE_SHIFT;
-}
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGX2DAcquireSlavePort)
-#endif
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGX2DAcquireSlavePort)
-#endif
-static INLINE
-    PVRSRV_ERROR SGX2DAcquireSlavePort(PVRSRV_SGXDEV_INFO * psDevInfo,
-                                      IMG_BOOL bBlock)
-{
-#if defined(SGX2D_DIRECT_BLITS)
-       PVR_UNREFERENCED_PARAMETER(bBlock);
-       return OSLockResource(&psDevInfo->s2DSlaveportResource, ISR_ID);
-#else
-       PVR_UNREFERENCED_PARAMETER(psDevInfo);
-       PVR_UNREFERENCED_PARAMETER(bBlock);
-
-       return PVRSRV_OK;
-#endif
-}
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGX2DReleaseSlavePort)
-#endif
-static INLINE PVRSRV_ERROR SGX2DReleaseSlavePort(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-#if defined(SGX2D_DIRECT_BLITS)
-       return OSUnlockResource(&psDevInfo->s2DSlaveportResource, ISR_ID);
-#else
-       PVR_UNREFERENCED_PARAMETER(psDevInfo);
-
-       return PVRSRV_OK;
-#endif
-}
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGX2DAcquireFifoSpace)
-#endif
-static INLINE
-    PVRSRV_ERROR SGX2DAcquireFifoSpace(PVRSRV_SGXDEV_INFO * psDevInfo,
-                                      IMG_UINT32 ui32MinBytesRequired,
-                                      IMG_UINT32 * pui32BytesObtained)
-{
-       PVRSRV_ERROR eError = PVRSRV_ERROR_FIFO_SPACE;
-       IMG_UINT32 ui32FifoBytes;
-
-#if defined(DEBUG) && defined(SGX2D_DIRECT_BLITS)
-
-       if (OSIsResourceLocked(&psDevInfo->s2DSlaveportResource, ISR_ID) ==
-           IMG_FALSE) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DAcquireFifoSpace: 2D slaveport is not locked"));
-               return PVRSRV_ERROR_PROCESSING_BLOCKED;
-       }
-#endif
-
-       ui32FifoBytes = SGX2DFifoFreeSpace(psDevInfo);
-
-       if (ui32FifoBytes >= ui32MinBytesRequired) {
-               if (pui32BytesObtained)
-                       *pui32BytesObtained = ui32FifoBytes;
-
-               eError = PVRSRV_OK;
-       }
-
-       return eError;
-}
-
-#if defined(DEBUG) && defined (SGX2D_TRACE_BLIT)
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGX2DTraceBlt)
-#endif
-FORCE_INLINE
-    IMG_VOID SGX2DTraceBlt(IMG_UINT32 * pui32BltData, IMG_UINT32 ui32Count)
-{
-       IMG_UINT32 i;
-
-       PVR_TRACE(("----SGX 2D BLIT----"));
-
-       for (i = 0; i < ui32Count; i++) {
-               PVR_TRACE(("word[%02d]: 0x%08x", i, pui32BltData[i]));
-       }
-}
-#else
-#define SGX2DTraceBlt(pui32BltData, ui32Count)
-#endif
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGX2DWriteSlavePort)
-#endif
-FORCE_INLINE
-    IMG_VOID SGX2DWriteSlavePort(PVRSRV_SGXDEV_INFO * psDevInfo,
-                                IMG_UINT32 ui32Value)
-{
-       SGX_SLAVE_PORT *psSlavePort = &psDevInfo->s2DSlavePortKM;
-#if defined(SGX2D_INCREMENTING_SP_WRITES)
-       IMG_UINT32 *pui32Offset = psSlavePort->pui32Offset;
-
-       if (*pui32Offset > (psSlavePort->ui32DataRange >> 1)) {
-
-               *pui32Offset = 0;
-       }
-#endif
-
-       SGX2DTraceBlt(&ui32Value, 1);
-
-#if defined(SGX2D_INCREMENTING_SP_WRITES)
-       *((IMG_UINT32 *) ((IMG_UINT32) psSlavePort->pvData + *pui32Offset)) =
-           ui32Value;
-#else
-       *((IMG_UINT32 *) psSlavePort->pvData) = ui32Value;
-#endif
-
-#if defined(SGX2D_INCREMENTING_SP_WRITES)
-       *pui32Offset += 4;
-#endif
-}
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGX2DWriteSlavePortBatch)
-#endif
-FORCE_INLINE
-    PVRSRV_ERROR SGX2DWriteSlavePortBatch(PVRSRV_SGXDEV_INFO * psDevInfo,
-                                         IMG_UINT32 * pui32LinDataAddr,
-                                         IMG_UINT32 ui32Bytes)
-{
-       IMG_INT32 i;
-       SGX_SLAVE_PORT *psSlavePort = &psDevInfo->s2DSlavePortKM;
-       IMG_UINT32 *pui32LinPortAddrBase = (IMG_UINT32 *) psSlavePort->pvData;
-       IMG_UINT32 ui32DWORDs = ui32Bytes >> 2;
-#if defined(SGX2D_INCREMENTING_SP_WRITES)
-       IMG_UINT32 *pui32Offset = psSlavePort->pui32Offset;
-       IMG_UINT32 *pui32LinPortAddr;
-
-       if (ui32Bytes > (psSlavePort->ui32DataRange >> 1)) {
-               return PVRSRV_ERROR_CMD_TOO_BIG;
-       }
-
-       if (*pui32Offset > (psSlavePort->ui32DataRange >> 1)) {
-
-               *pui32Offset = 0;
-       }
-
-       pui32LinPortAddr =
-           (IMG_UINT32 *) ((IMG_UINT32) pui32LinPortAddrBase + *pui32Offset);
-#endif
-
-       SGX2DTraceBlt(pui32LinDataAddr, ui32DWORDs);
-
-       for (i = ui32DWORDs; i != 0; i -= ui32DWORDs) {
-               ui32DWORDs = (i < 32) ? i : 32;
-
-               switch (ui32DWORDs) {
-#if defined(SGX2D_INCREMENTING_SP_WRITES)
-               case 32:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 31:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 30:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 29:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 28:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 27:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 26:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 25:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 24:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 23:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 22:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 21:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 20:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 19:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 18:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 17:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 16:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 15:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 14:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 13:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 12:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 11:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 10:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 9:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 8:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 7:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 6:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 5:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 4:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 3:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 2:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-               case 1:
-                       *pui32LinPortAddr++ = *pui32LinDataAddr++;
-#else
-               case 32:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 31:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 30:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 29:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 28:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 27:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 26:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 25:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 24:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 23:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 22:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 21:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 20:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 19:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 18:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 17:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 16:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 15:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 14:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 13:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 12:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 11:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 10:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 9:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 8:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 7:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 6:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 5:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 4:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 3:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 2:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-               case 1:
-                       *pui32LinPortAddrBase = *pui32LinDataAddr++;
-#endif
-               }
-       }
-
-#if defined(SGX2D_INCREMENTING_SP_WRITES)
-
-       *pui32Offset += ui32Bytes;
-#endif
-
-       return PVRSRV_OK;
-}
-
-IMG_BOOL SGX2DProcessBlit(IMG_HANDLE hCmdCookie,
-                         IMG_UINT32 ui32DataSize, IMG_VOID * pvData)
-{
-       PVRSRV_BLT_CMD_INFO *psBltCmd;
-       PVRSRV_SGXDEV_INFO *psDevInfo;
-       IMG_UINT32 ui32BytesRequired;
-       IMG_UINT32 ui32BytesObtained = 0;
-       IMG_BOOL bError = IMG_TRUE;
-       PVRSRV_ERROR eError;
-
-       PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DProcessBlit: Start"));
-
-       psBltCmd = (PVRSRV_BLT_CMD_INFO *) pvData;
-
-       if (psBltCmd == IMG_NULL || psBltCmd->ui32CmdSize != ui32DataSize) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "ProcessBlit: Data packet size is incorrect"));
-               return IMG_FALSE;
-       }
-
-       psDevInfo = psBltCmd->psDevInfo;
-
-       if (psDevInfo->h2DCmdCookie != IMG_NULL) {
-               return IMG_FALSE;
-       }
-
-       if (psDevInfo->b2DHWRecoveryInProgress) {
-               psDevInfo->h2DCmdCookie = hCmdCookie;
-               SGX2DHardwareKick(psDevInfo);
-               return IMG_TRUE;
-       }
-
-       if (SGX2DAcquireSlavePort(psDevInfo, IMG_FALSE) != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "ProcessBlit: Couldn't acquire slaveport"));
-               return IMG_FALSE;
-       }
-#ifdef FIXME
-
-#endif
-
-       if (psDevInfo->b2DHWRecoveryEndPending && SGX2D_2D_NOT_IDLE(psDevInfo)) {
-               psDevInfo->h2DCmdCookie = hCmdCookie;
-               SGX2DHardwareKick(psDevInfo);
-               PVR_ASSERT(bError);
-               goto ErrorExit;
-       }
-       psDevInfo->b2DHWRecoveryEndPending = IMG_FALSE;
-
-       ui32BytesRequired = psBltCmd->ui32DataByteSize + SGX2D_QUEUED_BLIT_PAD;
-
-       eError =
-           SGX2DAcquireFifoSpace(psDevInfo, ui32BytesRequired,
-                                 &ui32BytesObtained);
-       if (eError != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR, "ProcessBlit: Get Fifo Space failed"));
-               bError = IMG_FALSE;
-               goto ErrorExit;
-       }
-
-       SGX2DWriteSlavePortBatch(psDevInfo,
-                                psBltCmd->aui32BltData,
-                                psBltCmd->ui32DataByteSize);
-
-       psDevInfo->h2DCmdCookie = hCmdCookie;
-
-       SGX2DWriteSlavePort(psDevInfo, SGX2D_FLUSH_BH);
-
-       PVR_ASSERT(bError);
-ErrorExit:
-
-       if (SGX2DReleaseSlavePort(psDevInfo) != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DReleaseSlavePort: failed to release slaveport"));
-       }
-
-       PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DProcessBlit: Exit.  Error %d",
-                (int)bError));
-
-       return bError;
-}
-
-IMG_VOID SGX2DHandle2DComplete(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-       IMG_HANDLE hCmdCookie;
-
-       PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DHandle2DComplete: Start"));
-
-       hCmdCookie = psDevInfo->h2DCmdCookie;
-       psDevInfo->h2DCmdCookie = IMG_NULL;
-
-       if (hCmdCookie != IMG_NULL) {
-               PVRSRVCommandCompleteKM(hCmdCookie, IMG_TRUE);
-       }
-
-       PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DHandle2DComplete: Exit"));
-}
-
-IMG_EXPORT
-    PVRSRV_ERROR SGX2DQueueBlitKM(PVRSRV_SGXDEV_INFO * psDevInfo,
-                                 PVRSRV_KERNEL_SYNC_INFO * psDstSync,
-                                 IMG_UINT32 ui32NumSrcSyncs,
-                                 PVRSRV_KERNEL_SYNC_INFO * apsSrcSync[],
-                                 IMG_UINT32 ui32DataByteSize,
-                                 IMG_UINT32 * pui32BltData)
-{
-#if defined(NO_HARDWARE)
-       PVR_UNREFERENCED_PARAMETER(psDevInfo);
-       PVR_UNREFERENCED_PARAMETER(psDstSync);
-       PVR_UNREFERENCED_PARAMETER(ui32NumSrcSyncs);
-       PVR_UNREFERENCED_PARAMETER(apsSrcSync);
-       PVR_UNREFERENCED_PARAMETER(ui32DataByteSize);
-       PVR_UNREFERENCED_PARAMETER(pui32BltData);
-
-       return PVRSRV_OK;
-#else
-       PVRSRV_COMMAND *psCommand;
-       PVRSRV_BLT_CMD_INFO *psBltCmd;
-       IMG_UINT32 ui32CmdByteSize;
-       IMG_UINT32 i;
-       PVRSRV_ERROR eError;
-
-       PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DQueueBlitKM: Start"));
-
-       if (psDevInfo->b2DHWRecoveryInProgress == IMG_TRUE) {
-               return PVRSRV_ERROR_CANNOT_GET_QUEUE_SPACE;
-       }
-
-       if ((ui32DataByteSize + SGX2D_QUEUED_BLIT_PAD) >
-           psDevInfo->ui322DFifoSize) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DQueueBlitKM: Blit too big for FIFO. Blit size: %d (+ padding %d), FIFO size: %d",
-                        ui32DataByteSize, SGX2D_QUEUED_BLIT_PAD,
-                        psDevInfo->ui322DFifoSize));
-
-               return PVRSRV_ERROR_CMD_TOO_BIG;
-       }
-
-       ui32CmdByteSize = sizeof(PVRSRV_BLT_CMD_INFO)
-           + ui32DataByteSize - sizeof(IMG_UINT32);
-
-       eError =
-           PVRSRVInsertCommandKM((PVRSRV_QUEUE_INFO *) psDevInfo->h2DQueue,
-                                 &psCommand, SYS_DEVICE_SGX,
-                                 SGX_2D_BLT_COMMAND,
-                                 (psDstSync == IMG_NULL) ? 0 : 1, &psDstSync,
-                                 ui32NumSrcSyncs, apsSrcSync, ui32CmdByteSize);
-       if (eError != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DQueueBlitKM: PVRSRVInsertCommandKM failed. Error %d",
-                        eError));
-#ifdef DEBUG
-               if (eError == PVRSRV_ERROR_CANNOT_GET_QUEUE_SPACE) {
-                       if (!SGX2DIsBusy(psDevInfo)) {
-
-                               PVR_DPF((PVR_DBG_ERROR,
-                                        "SGX2DQueueBlitKM: 2D core not busy, command queue full - lockup suspected"));
-                       }
-               }
-#endif
-               return eError;
-       }
-
-       psBltCmd = (PVRSRV_BLT_CMD_INFO *) psCommand->pvData;
-       psBltCmd->ui32CmdSize = ui32CmdByteSize;
-       psBltCmd->psDevInfo = psDevInfo;
-
-       psBltCmd->psDstSync = psDstSync;
-
-       psBltCmd->ui32NumSrcSyncInfos = ui32NumSrcSyncs;
-       for (i = 0; i < ui32NumSrcSyncs; i++) {
-
-               psBltCmd->apsSrcSync[i] = apsSrcSync[i];
-       }
-
-       if (pui32BltData != IMG_NULL) {
-               for (i = 0; i < (ui32DataByteSize >> 2); i++) {
-                       psBltCmd->aui32BltData[i] = pui32BltData[i];
-               }
-       }
-
-       psBltCmd->ui32DataByteSize = ui32DataByteSize;
-
-       eError =
-           PVRSRVSubmitCommandKM((PVRSRV_QUEUE_INFO *) psDevInfo->h2DQueue,
-                                 psCommand);
-       if (eError != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DQueueBlitKM: PVRSRVSubmitCommandKM failed. Error %d",
-                        eError));
-       }
-
-       SGX2DKick(psDevInfo);
-
-       PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DQueueBlitKM: Exit. Error: %d",
-                eError));
-
-       return eError;
-#endif
-}
-
-#if defined(SGX2D_DIRECT_BLITS)
-IMG_EXPORT
-    PVRSRV_ERROR SGX2DDirectBlitKM(PVRSRV_SGXDEV_INFO * psDevInfo,
-                                  IMG_UINT32 ui32DataByteSize,
-                                  IMG_UINT32 * pui32BltData)
-{
-#if defined(NO_HARDWARE)
-       PVR_UNREFERENCED_PARAMETER(psDevInfo);
-       PVR_UNREFERENCED_PARAMETER(ui32DataByteSize);
-       PVR_UNREFERENCED_PARAMETER(pui32BltData);
-
-       return PVRSRV_OK;
-#else
-       PVRSRV_ERROR eError;
-       PVRSRV_ERROR eSrvErr;
-
-       IMG_UINT32 ui32CmdByteSize = ui32DataByteSize + 4;
-       IMG_BOOL bStart = IMG_FALSE;
-       IMG_UINT32 uiStart = 0;
-
-       PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DDirectBlitKM: Start"));
-
-       if (psDevInfo->b2DHWRecoveryInProgress == IMG_TRUE) {
-               return PVRSRV_ERROR_FIFO_SPACE;
-       }
-
-       if (ui32CmdByteSize > psDevInfo->ui322DFifoSize) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DDirectBlitKM: Blit too big for FIFO. Blit size: %d (+ padding %d), FIFO size: %d",
-                        ui32DataByteSize, 4, psDevInfo->ui322DFifoSize));
-
-               return PVRSRV_ERROR_CMD_TOO_BIG;
-       }
-
-       eSrvErr = SGX2DAcquireSlavePort(psDevInfo, IMG_TRUE);
-       if (eSrvErr != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DDirectBlitKM: Cannot acquire slaveport. Error %d",
-                        eSrvErr));
-               return eSrvErr;
-       }
-#ifdef FIXME
-
-#endif
-       do {
-               eSrvErr = SGX2DAcquireFifoSpace(psDevInfo,
-                                               ui32CmdByteSize, IMG_NULL);
-               if (eSrvErr == PVRSRV_OK) {
-                       break;
-               }
-
-               if (bStart == IMG_FALSE) {
-                       uiStart = OSClockus();
-                       bStart = IMG_TRUE;
-               }
-
-               OSWaitus(MAX_HW_TIME_US / WAIT_TRY_COUNT);
-       } while ((OSClockus() - uiStart) < MAX_HW_TIME_US);
-
-       if (eSrvErr != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DDirectBlitKM: Cannot acquire FIFO space. Error %d",
-                        eSrvErr));
-
-               eError = eSrvErr;
-       } else {
-
-               if (psDevInfo->b2DHWRecoveryEndPending
-                   && SGX2D_2D_NOT_IDLE(psDevInfo)) {
-                       eError = PVRSRV_ERROR_FIFO_SPACE;
-               } else {
-                       eError = PVRSRV_OK;
-
-                       psDevInfo->b2DHWRecoveryEndPending = IMG_FALSE;
-
-                       SGX2DWriteSlavePortBatch(psDevInfo, pui32BltData,
-                                                ui32DataByteSize);
-
-                       SGX2DWriteSlavePort(psDevInfo, SGX2D_FENCE_BH);
-               }
-       }
-
-       eSrvErr = SGX2DReleaseSlavePort(psDevInfo);
-       if (eSrvErr != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DDirectBlitKM: Cannot release slave port.  Error %d",
-                        eSrvErr));
-
-               if (eError != PVRSRV_OK) {
-                       eError = eSrvErr;
-               }
-       }
-
-       PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DDirectBlitKM: Exit.  Error: %d",
-                eError));
-
-       SGX2DKick(psDevInfo);
-
-       return eError;
-#endif
-}
-#endif
-
-#endif
-
-#if defined(SGX_FEATURE_2D_HARDWARE) || defined(PVR2D_ALT_2DHW)
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGX2DQuerySyncOpsComplete)
-#endif
-static INLINE
-    IMG_BOOL SGX2DQuerySyncOpsComplete(PVRSRV_KERNEL_SYNC_INFO * psSyncInfo)
-{
-       PVRSRV_SYNC_DATA *psSyncData = psSyncInfo->psSyncData;
-
-       return (IMG_BOOL) ((psSyncData->ui32ReadOpsComplete ==
-                           psSyncData->ui32ReadOpsPending)
-                          && (psSyncData->ui32WriteOpsComplete ==
-                              psSyncData->ui32WriteOpsPending)
-           );
-}
-
-IMG_EXPORT
-    PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(PVRSRV_SGXDEV_INFO * psDevInfo,
-                                          PVRSRV_KERNEL_SYNC_INFO * psSyncInfo,
-                                          IMG_BOOL bWaitForComplete)
-{
-       IMG_BOOL bStart = IMG_FALSE;
-       IMG_UINT32 uiStart = 0;
-
-       PVR_UNREFERENCED_PARAMETER(psDevInfo);
-
-       PVR_DPF((PVR_DBG_CALLTRACE, "SGX2DQueryBlitsCompleteKM: Start"));
-
-       if (SGX2DQuerySyncOpsComplete(psSyncInfo)) {
-
-               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."));
-       do {
-               OSWaitus(MAX_HW_TIME_US / WAIT_TRY_COUNT);
-
-               if (SGX2DQuerySyncOpsComplete(psSyncInfo)) {
-
-                       PVR_DPF((PVR_DBG_CALLTRACE,
-                                "SGX2DQueryBlitsCompleteKM: Wait over.  Blits complete."));
-                       return PVRSRV_OK;
-               }
-
-               if (bStart == IMG_FALSE) {
-                       uiStart = OSClockus();
-                       bStart = IMG_TRUE;
-               }
-
-               OSWaitus(MAX_HW_TIME_US / WAIT_TRY_COUNT);
-       } while ((OSClockus() - uiStart) < MAX_HW_TIME_US);
-
-       PVR_DPF((PVR_DBG_ERROR,
-                "SGX2DQueryBlitsCompleteKM: Timed out. Ops pending."));
-
-#if defined(DEBUG)
-       {
-               PVRSRV_SYNC_DATA *psSyncData = psSyncInfo->psSyncData;
-
-               PVR_TRACE(("SGX2DQueryBlitsCompleteKM: Syncinfo: %p, Syncdata: %p", psSyncInfo, psSyncData));
-
-               PVR_TRACE(("SGX2DQueryBlitsCompleteKM: Read ops complete: %d, Read ops pending: %d", psSyncData->ui32ReadOpsComplete, psSyncData->ui32ReadOpsPending));
-               PVR_TRACE(("SGX2DQueryBlitsCompleteKM: Write ops complete: %d, Write ops pending: %d", psSyncData->ui32WriteOpsComplete, psSyncData->ui32WriteOpsPending));
-
-       }
-#endif
-
-       return PVRSRV_ERROR_TIMEOUT;
-}
-#endif
-
-#if defined(SGX_FEATURE_2D_HARDWARE)
-PVRSRV_ERROR SGX2DInit(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-       PVRSRV_ERROR eError;
-
-       PVR_ASSERT(psDevInfo->ui322DFifoSize == 0);
-       psDevInfo->ui322DFifoSize = SGX2DFifoFreeSpace(psDevInfo);
-
-       PVR_TRACE(("SGX2DInit: 2D FIFO size: %d", psDevInfo->ui322DFifoSize));
-
-       PVR_ASSERT(psDevInfo->s2DSlavePortKM.pui32Offset == 0);
-       PVR_ASSERT(psDevInfo->ui322DFifoOffset == 0);
-       psDevInfo->s2DSlavePortKM.pui32Offset = &psDevInfo->ui322DFifoOffset;
-
-       PVR_ASSERT(psDevInfo->h2DQueue == IMG_NULL);
-       eError = PVRSRVCreateCommandQueueKM(SGX2D_COMMAND_QUEUE_SIZE,
-                                           (PVRSRV_QUEUE_INFO **) & psDevInfo->
-                                           h2DQueue);
-       if (eError != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGX2DInit: PVRSRVCreateCommandQueueKM failed (%d)",
-                        eError));
-
-               return eError;
-       }
-
-       PVR_ASSERT(psDevInfo->h2DCmdCookie == IMG_NULL);
-       PVR_ASSERT(!psDevInfo->b2DHWRecoveryInProgress);
-       PVR_ASSERT(!psDevInfo->b2DHWRecoveryEndPending);
-       PVR_ASSERT(psDevInfo->ui322DCompletedBlits == 0);
-
-       return PVRSRV_OK;
-}
-
-PVRSRV_ERROR SGX2DDeInit(PVRSRV_SGXDEV_INFO * psDevInfo)
-{
-       PVRSRV_ERROR eError;
-
-       if (psDevInfo->h2DQueue != IMG_NULL) {
-               eError =
-                   PVRSRVDestroyCommandQueueKM((PVRSRV_QUEUE_INFO *)
-                                               psDevInfo->h2DQueue);
-               if (eError != PVRSRV_OK) {
-                       PVR_DPF((PVR_DBG_ERROR,
-                                "SGX2DDeInit: PVRSRVDestroyCommandQueueKM failed (%d)",
-                                eError));
-
-                       return eError;
-               }
-       }
-
-       return PVRSRV_OK;
-}
-
-#endif
index 521d2d4..69ccf98 100644 (file)
@@ -31,9 +31,6 @@
 #include "sgxinfo.h"
 #include "pvr_bridge.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #define PVRSRV_BRIDGE_SGX_CMD_BASE (PVRSRV_BRIDGE_LAST_NON_DEVICE_CMD+1)
 #define PVRSRV_BRIDGE_SGX_GETCLIENTINFO                        PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+0)
@@ -48,9 +45,7 @@ extern "C" {
 
 #define PVRSRV_BRIDGE_SGX_GETMMUPDADDR                 PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+10)
 
-#if defined(TRANSFER_QUEUE)
 #define PVRSRV_BRIDGE_SGX_SUBMITTRANSFER                       PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+13)
-#endif
 #define PVRSRV_BRIDGE_SGX_GETMISCINFO                          PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+14)
 #define PVRSRV_BRIDGE_SGXINFO_FOR_SRVINIT                      PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+15)
 #define PVRSRV_BRIDGE_SGX_DEVINITPART2                         PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+16)
@@ -61,11 +56,6 @@ extern "C" {
 #define PVRSRV_BRIDGE_SGX_REGISTER_HW_RENDER_CONTEXT   PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+20)
 #define PVRSRV_BRIDGE_SGX_FLUSH_HW_RENDER_TARGET       PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+21)
 #define PVRSRV_BRIDGE_SGX_UNREGISTER_HW_RENDER_CONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+22)
-#if defined(SGX_FEATURE_2D_HARDWARE)
-#define PVRSRV_BRIDGE_SGX_SUBMIT2D                                     PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+23)
-#define PVRSRV_BRIDGE_SGX_REGISTER_HW_2D_CONTEXT       PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+24)
-#define PVRSRV_BRIDGE_SGX_UNREGISTER_HW_2D_CONTEXT     PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+25)
-#endif
 #define PVRSRV_BRIDGE_SGX_REGISTER_HW_TRANSFER_CONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+26)
 #define PVRSRV_BRIDGE_SGX_UNREGISTER_HW_TRANSFER_CONTEXT       PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+27)
 #define PVRSRV_BRIDGE_SGX_READ_DIFF_COUNTERS           PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+28)
@@ -132,7 +122,6 @@ extern "C" {
                PVR3DIF4_CCB_KICK sCCBKick;
        } PVRSRV_BRIDGE_IN_DOKICK;
 
-#if defined(TRANSFER_QUEUE)
 
        typedef struct PVRSRV_BRIDGE_IN_SUBMITTRANSFER_TAG {
                IMG_UINT32 ui32BridgeFlags;
@@ -140,15 +129,6 @@ extern "C" {
                PVRSRV_TRANSFER_SGX_KICK sKick;
        } PVRSRV_BRIDGE_IN_SUBMITTRANSFER;
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-
-       typedef struct PVRSRV_BRIDGE_IN_SUBMIT2D_TAG {
-               IMG_UINT32 ui32BridgeFlags;
-               IMG_HANDLE hDevCookie;
-               PVRSRV_2D_SGX_KICK sKick;
-       } PVRSRV_BRIDGE_IN_SUBMIT2D;
-#endif
-#endif
 
        typedef struct PVRSRV_BRIDGE_IN_READREGDWORD_TAG {
                IMG_UINT32 ui32BridgeFlags;
@@ -321,26 +301,6 @@ extern "C" {
                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_HANDLE hDevCookie;
-               IMG_DEV_VIRTADDR sHW2DContextDevVAddr;
-       } PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_2D_CONTEXT;
-
-       typedef struct PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_2D_CONTEXT_TAG {
-               PVRSRV_ERROR eError;
-               IMG_HANDLE hHW2DContext;
-       } PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_2D_CONTEXT;
-
-       typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT_TAG {
-               IMG_UINT32 ui32BridgeFlags;
-               IMG_HANDLE hDevCookie;
-               IMG_HANDLE hHW2DContext;
-       } PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT;
-
-#define        SGX2D_MAX_BLT_CMD_SIZ           256
-#endif
 
        typedef struct PVRSRV_BRIDGE_IN_SGX_READ_DIFF_COUNTERS_TAG {
                IMG_UINT32 ui32BridgeFlags;
@@ -360,7 +320,4 @@ extern "C" {
                PVRSRV_SGXDEV_DIFF_INFO sDiffs;
        } PVRSRV_BRIDGE_OUT_SGX_READ_DIFF_COUNTERS;
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index 86c5525..872ba3c 100644 (file)
 #include "pvr_bridge.h"
 #include "perproc.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
        IMG_IMPORT
            PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle,
                                             PVRSRV_TRANSFER_SGX_KICK * psKick);
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-       IMG_IMPORT
-           PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle,
-                                      PVRSRV_2D_SGX_KICK * psKick);
-#endif
 
        IMG_IMPORT
            PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle,
@@ -74,7 +66,6 @@ extern "C" {
            PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO * psDevInfo,
                                          SGX_MISC_INFO * psMiscInfo);
 
-#if defined(SUPPORT_SGX_HWPERF)
        IMG_IMPORT
            PVRSRV_ERROR SGXReadDiffCountersKM(IMG_HANDLE hDevHandle,
                                               IMG_UINT32 ui32Reg,
@@ -87,7 +78,6 @@ extern "C" {
                                               IMG_BOOL * pbActive,
                                               PVRSRV_SGXDEV_DIFF_INFO *
                                               psDiffs);
-#endif
 
        IMG_IMPORT
            PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(PVRSRV_SGXDEV_INFO *
@@ -146,7 +136,4 @@ extern "C" {
                                    PVR3DIF4_INTERNAL_DEVINFO *
                                    psSGXInternalDevInfo);
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index 4ce6525..c6e0c2f 100644 (file)
 #ifndef __SGXAPI_KM_H__
 #define __SGXAPI_KM_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #include "sgxdefs.h"
 
-#if defined(__linux__) && !defined(USE_CODE)
-#if defined(__KERNEL__)
-#include <asm/unistd.h>
-#else
-#include <unistd.h>
-#endif
-#endif
 
 #define SGX_GENERAL_HEAP_ID                                    0
 #define SGX_TADATA_HEAP_ID                                     1
@@ -55,14 +45,9 @@ extern "C" {
 #define SGX_GENERAL_MAPPING_HEAP_ID                    11
 #define SGX_UNDEFINED_HEAP_ID                          (~0LU)
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-#define SGX_2D_HEAP_ID                                 12
-#define SGX_ALT_MAPPING_HEAP_ID                                13
-#define SGX_MAX_HEAP_ID                                        14
-#else
 #define SGX_ALT_MAPPING_HEAP_ID                         12
-#define SGX_MAX_HEAP_ID                                        13
-#endif
+#define SGX_FB_MAPPING_HEAP_ID                         13
+#define SGX_MAX_HEAP_ID                                        14
 
 #define SGX_MAX_TA_STATUS_VALS 32
 #define SGX_MAX_3D_STATUS_VALS 2
@@ -76,7 +61,6 @@ extern "C" {
                IMG_SYS_PHYADDR sPhysBase;
        } SGX_SLAVE_PORT;
 
-#ifdef SUPPORT_SGX_HWPERF
 
 #define PVRSRV_SGX_HWPERF_CBSIZE                                       0x100
 
@@ -111,15 +95,12 @@ extern "C" {
                IMG_UINT32 ui32DataCount;
                IMG_UINT32 ui32Time;
        } SGX_MISC_INFO_HWPERF_RETRIEVE_CB;
-#endif
 
        typedef enum _SGX_MISC_INFO_REQUEST_ {
                SGX_MISC_INFO_REQUEST_CLOCKSPEED = 0,
-#ifdef SUPPORT_SGX_HWPERF
                SGX_MISC_INFO_REQUEST_HWPERF_CB_ON,
                SGX_MISC_INFO_REQUEST_HWPERF_CB_OFF,
                SGX_MISC_INFO_REQUEST_HWPERF_RETRIEVE_CB,
-#endif
                SGX_MISC_INFO_REQUEST_FORCE_I16 = 0x7fff
        } SGX_MISC_INFO_REQUEST;
 
@@ -129,15 +110,10 @@ extern "C" {
                union {
                        IMG_UINT32 reserved;
                        IMG_UINT32 ui32SGXClockSpeed;
-#ifdef SUPPORT_SGX_HWPERF
                        SGX_MISC_INFO_HWPERF_RETRIEVE_CB sRetrieveCB;
-#endif
                } uData;
        } SGX_MISC_INFO;
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-#define PVRSRV_MAX_BLT_SRC_SYNCS               3
-#endif
 
 #define PVR3DIF4_KICKTA_DUMPBITMAP_MAX_NAME_LENGTH             256
 
@@ -193,16 +169,7 @@ extern "C" {
        } PVR3DIF4_KICKTA_PDUMP, *PPVR3DIF4_KICKTA_PDUMP;
 #endif
 
-#if defined(TRANSFER_QUEUE)
-#if defined(SGX_FEATURE_2D_HARDWARE)
-#define SGX_MAX_2D_BLIT_CMD_SIZE               26
-#define SGX_MAX_2D_SRC_SYNC_OPS                        3
-#endif
 #define SGX_MAX_TRANSFER_STATUS_VALS   2
 #define SGX_MAX_TRANSFER_SYNC_OPS      5
-#endif
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index 9f8da2d..b95eefa 100644 (file)
 #ifndef __SGXCONFIG_H__
 #define __SGXCONFIG_H__
 
+#ifndef SGX530
+#error "sgxconfig.h: ERROR: unspecified SGX Core version"
+#endif
+
 #define DEV_DEVICE_TYPE                        PVRSRV_DEVICE_TYPE_SGX
 #define DEV_DEVICE_CLASS               PVRSRV_DEVICE_CLASS_3D
 
 #define DEV_MAJOR_VERSION              1
 #define DEV_MINOR_VERSION              0
 
-#if SGX_FEATURE_ADDRESS_SPACE_SIZE == 32
-#define SGX_ADDRESS_SPACE_SIZE                         32
-
-#define SGX_GENERAL_HEAP_BASE                          0x00400000
-#define SGX_GENERAL_HEAP_SIZE                          (0x78000000-0x00800000)
-
-#define SGX_TADATA_HEAP_BASE                           0x78000000
-#define SGX_TADATA_HEAP_SIZE                           (0x08000000-0x00400000)
-
-#define SGX_KERNEL_CODE_HEAP_BASE                      0x80000000
-#define SGX_KERNEL_CODE_HEAP_SIZE                      0x00080000
-
-#define SGX_VIDEO_CODE_HEAP_BASE                       0x81000000
-#define SGX_VIDEO_CODE_HEAP_SIZE                       0x00080000
-
-#define SGX_KERNEL_VIDEO_DATA_HEAP_BASE                0x82000000
-#define SGX_KERNEL_VIDEO_DATA_HEAP_SIZE                0x05000000
-
-#define SGX_PIXELSHADER_HEAP_BASE                      0x88000000
-#define SGX_PIXELSHADER_HEAP_SIZE                      0x00500000
-
-#define SGX_VERTEXSHADER_HEAP_BASE                     0x89000000
-#define SGX_VERTEXSHADER_HEAP_SIZE                     0x00200000
-
-#define SGX_PDSPIXEL_CODEDATA_HEAP_BASE                0x8A000000
-#define SGX_PDSPIXEL_CODEDATA_HEAP_SIZE                0x02000000
-
-#define SGX_PDSVERTEX_CODEDATA_HEAP_BASE       0x8C000000
-#define SGX_PDSVERTEX_CODEDATA_HEAP_SIZE       0x02000000
-
-#define SGX_SYNCINFO_HEAP_BASE                         0xA0000000
-#define SGX_SYNCINFO_HEAP_SIZE                         0x01000000
-
-#define SGX_3DPARAMETERS_HEAP_BASE                     0xC0000000
-#define SGX_3DPARAMETERS_HEAP_SIZE                     (0x10000000-0x00400000)
-
-#define SGX_2D_HEAP_BASE                                       0xD0000000
-#define SGX_2D_HEAP_SIZE                                       (0x08000000-0x00400000)
-
-#define SGX_GENERAL_MAPPING_HEAP_BASE          0xD8000000
-#define SGX_GENERAL_MAPPING_HEAP_SIZE          (0x08000000-0x00400000)
-
-#define SGX_CORE_IDENTIFIED
-#endif
 
-#if SGX_FEATURE_ADDRESS_SPACE_SIZE == 28
 #define SGX_ADDRESS_SPACE_SIZE                         28
 
 #define SGX_GENERAL_HEAP_BASE          0x00400000
 #define SGX_GENERAL_HEAP_SIZE          (0x05000000-0x00401000)
 
 #define SGX_GENERAL_MAPPING_HEAP_BASE  0x05000000
-#define SGX_GENERAL_MAPPING_HEAP_SIZE  (0x07000000-0x05001000)
+#define SGX_GENERAL_MAPPING_HEAP_SIZE  (0x06C00000-0x05001000)
+
+#define SGX_FB_MAPPING_HEAP_BASE       0x06C00000
+#define SGX_FB_MAPPING_HEAP_SIZE       (0x07000000-0x06C01000)
 
 #define SGX_TADATA_HEAP_BASE                           0x07000000
 #define SGX_TADATA_HEAP_SIZE                           (0x01000000-0x00001000)
 #define SGX_SYNCINFO_HEAP_BASE                         0x0FC00000
 #define SGX_SYNCINFO_HEAP_SIZE                         (0x00400000-0x00001000)
 
-#define SGX_CORE_IDENTIFIED
-#endif
-
-#if !defined(SGX_CORE_IDENTIFIED)
-#error "sgxconfig.h: ERROR: unspecified SGX Core version"
-#endif
-
 #endif
index ff5f6b8..be661d0 100644 (file)
@@ -30,7 +30,7 @@
 typedef enum {
        SGX_CORE_ID_INVALID = 0,
        SGX_CORE_ID_530 = 2,
-       SGX_CORE_ID_535 = 3,
+       SGX_UNUSED = 3,
 } SGX_CORE_ID_TYPE;
 
 typedef struct _SGX_CORE_INFO {
index f58ca26..2fa6ed5 100644 (file)
 #ifndef _SGXDEFS_H_
 #define        _SGXDEFS_H_
 
-#if defined(SGX530)
 #include "sgx530defs.h"
-#else
-#if defined(SGX535)
-#include "sgx535defs.h"
-#else
-#if defined(SGX520)
-#include "sgx520defs.h"
-#else
-#if defined(SGX535_V1_1)
-#include "sgx535defs.h"
-#else
-#if defined(SGX540)
-#include "sgx540defs.h"
-#else
-#if defined(SGX531)
-#include "sgx531defs.h"
-#endif
-#endif
-#endif
-#endif
-#endif
-#endif
-
 #include "sgxerrata.h"
 #include "sgxfeaturedefs.h"
 
index 7a02d93..da80ad9 100644 (file)
 #ifndef _SGXERRATA_KM_H_
 #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
-
-#if SGX_CORE_REV == 100
-#else
-#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
-#else
-#error "sgxerrata.h: SGX520 Core Revision unspecified"
-#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
-
 #if SGX_CORE_REV == 103
 #else
 #if SGX_CORE_REV == 110
@@ -66,8 +38,6 @@
 #if SGX_CORE_REV == 121
 #else
 #if SGX_CORE_REV == 125
-#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
-
-#if SGX_CORE_REV == 100
-#else
-#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
-#else
-#error "sgxerrata.h: SGX531 Core Revision unspecified"
-#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
-
-#if SGX_CORE_REV == 111
-#define FIX_HW_BRN_23281
-#define FIX_HW_BRN_23410
-#define FIX_HW_BRN_22693
-#define FIX_HW_BRN_22997
-#define FIX_HW_BRN_23030
-#else
-#if SGX_CORE_REV == 1111
-#define FIX_HW_BRN_23281
-#define FIX_HW_BRN_23410
-#define FIX_HW_BRN_22693
-#define FIX_HW_BRN_22997
-#define FIX_HW_BRN_23030
-#else
-#if SGX_CORE_REV == 112
-#define FIX_HW_BRN_23281
-#define FIX_HW_BRN_23410
-#define FIX_HW_BRN_22693
-#define FIX_HW_BRN_22997
-#define FIX_HW_BRN_23030
-#else
-#if SGX_CORE_REV == 113
-#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_23944
-#define FIX_HW_BRN_23410
-#else
-#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
-#else
-#error "sgxerrata.h: SGX535 Core Revision unspecified"
-
-#endif
-#endif
-#endif
-#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
-
-#if SGX_CORE_REV == 101
-#define FIX_HW_BRN_25503
-#else
-#if SGX_CORE_REV == 110
-#define FIX_HW_BRN_25503
-#else
-#if SGX_CORE_REV == SGX_CORE_REV_HEAD
-
-#else
-#error "sgxerrata.h: SGX540 Core Revision unspecified"
-#endif
-#endif
-#endif
-
-#define SGX_CORE_DEFINED
-#endif
-
-#if !defined(SGX_CORE_DEFINED)
-#if defined (__GNUC__)
-#warning "sgxerrata.h: SGX Core Version unspecified"
-#else
-#pragma message("sgxerrata.h: SGX Core Version unspecified")
-#endif
-#endif
 
 #endif
index 78e0061..94ebe64 100644 (file)
  *
  ******************************************************************************/
 
-#if defined(SGX520)
-#define SGX_CORE_FRIENDLY_NAME                                                 "SGX520"
-#define SGX_CORE_ID                                                                            SGX_CORE_ID_520
-#define SGX_FEATURE_ADDRESS_SPACE_SIZE                                 (28)
-#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_AUTOCLOCKGATING
-#else
-#if defined(SGX535)
-#define SGX_CORE_FRIENDLY_NAME                                                 "SGX535"
-#define SGX_CORE_ID                                                                            SGX_CORE_ID_535
-#define SGX_FEATURE_ADDRESS_SPACE_SIZE                                 (32)
-#define SGX_FEATURE_MULTIPLE_MEM_CONTEXTS
-#define SGX_FEATURE_2D_HARDWARE
+#define SGX_CORE_FRIENDLY_NAME         "SGX530"
+#define SGX_CORE_ID                    SGX_CORE_ID_530
+#define SGX_FEATURE_ADDRESS_SPACE_SIZE 28
 #define SGX_FEATURE_AUTOCLOCKGATING
 #else
-#if defined(SGX540)
-#define SGX_CORE_FRIENDLY_NAME                                                 "SGX540"
-#define SGX_CORE_ID                                                                            SGX_CORE_ID_540
-#define SGX_FEATURE_ADDRESS_SPACE_SIZE                                 (28)
-#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_AUTOCLOCKGATING
-#endif
-#endif
-#endif
-#endif
-#endif
-
-#if !defined(SGX_DONT_SWITCH_OFF_FEATURES)
-
-#if defined(FIX_HW_BRN_22693)
-#undef SGX_FEATURE_AUTOCLOCKGATING
-#endif
-
+#error Unsupported SGX core
 #endif
 
 #include "img_types.h"
index 8f0c407..bd7336f 100644 (file)
@@ -49,18 +49,7 @@ typedef struct _SGX_BRIDGE_INIT_INFO_ {
        IMG_HANDLE hKernelSGXHostCtlMemInfo;
        IMG_UINT32 ui32TAKickAddress;
        IMG_UINT32 ui32VideoHandlerAddress;
-#if defined(SGX_SUPPORT_HWPROFILING)
-       IMG_HANDLE hKernelHWProfilingMemInfo;
-#endif
-#if defined(SUPPORT_SGX_HWPERF)
        IMG_HANDLE hKernelHWPerfCBMemInfo;
-#endif
-#if defined(SGX_FEATURE_OVERLAPPED_SPM)
-       IMG_HANDLE hKernelTmpRgnHeaderMemInfo;
-#endif
-#if defined(SGX_FEATURE_SPM_MODE_0)
-       IMG_HANDLE hKernelTmpDPMStateMemInfo;
-#endif
 
        IMG_UINT32 ui32EDMTaskReg0;
        IMG_UINT32 ui32EDMTaskReg1;
@@ -105,9 +94,6 @@ typedef enum _PVRSRV_SGX_COMMAND_TYPE_ {
 #define PVRSRV_CCBFLAGS_RASTERCMD                      0x1
 #define PVRSRV_CCBFLAGS_TRANSFERCMD                    0x2
 #define PVRSRV_CCBFLAGS_PROCESS_QUEUESCMD      0x3
-#if defined(SGX_FEATURE_2D_HARDWARE)
-#define PVRSRV_CCBFLAGS_2DCMD                          0x4
-#endif
 
 #define        SGX_BIF_INVALIDATE_PTCACHE      0x1
 #define        SGX_BIF_INVALIDATE_PDCACHE      0x2
@@ -125,12 +111,10 @@ typedef struct _PVR3DIF4_CCB_KICK_ {
        IMG_HANDLE ah3DStatusSyncInfo[SGX_MAX_3D_STATUS_VALS];
 
        IMG_BOOL bFirstKickOrResume;
-#if (defined(NO_HARDWARE) || defined(PDUMP))
+#ifdef PDUMP
        IMG_BOOL bTerminateOrAbort;
 #endif
-#if defined(SUPPORT_SGX_HWPERF)
        IMG_BOOL bKickRender;
-#endif
 
        IMG_UINT32 ui32CCBOffset;
 
@@ -145,9 +129,6 @@ typedef struct _PVR3DIF4_CCB_KICK_ {
 #if defined(PDUMP)
        IMG_UINT32 ui32CCBDumpWOff;
 #endif
-#if defined(NO_HARDWARE)
-       IMG_UINT32 ui32WriteOpsPendingVal;
-#endif
 } PVR3DIF4_CCB_KICK;
 
 #define SGX_VIDEO_USE_CODE_BASE_INDEX          14
@@ -156,11 +137,9 @@ typedef struct _PVR3DIF4_CCB_KICK_ {
 typedef struct _PVRSRV_SGX_HOST_CTL_ {
 
        volatile IMG_UINT32 ui32PowManFlags;
-#if defined(SUPPORT_HW_RECOVERY)
        IMG_UINT32 ui32uKernelDetectedLockups;
        IMG_UINT32 ui32HostDetectedLockups;
        IMG_UINT32 ui32HWRecoverySampleRate;
-#endif
        IMG_UINT32 ui32ActivePowManSampleRate;
        IMG_UINT32 ui32InterruptFlags;
        IMG_UINT32 ui32InterruptClearFlags;
@@ -174,9 +153,7 @@ typedef struct _PVRSRV_SGX_HOST_CTL_ {
 
        IMG_UINT32 ui32NumActivePowerEvents;
 
-#if defined(SUPPORT_SGX_HWPERF)
        IMG_UINT32 ui32HWPerfFlags;
-#endif
 
        IMG_UINT32 ui32TimeWraps;
 } PVRSRV_SGX_HOST_CTL;
@@ -231,7 +208,6 @@ typedef struct _CTL_STATUS_ {
        IMG_UINT32 ui32StatusValue;
 } CTL_STATUS, *PCTL_STATUS;
 
-#if defined(TRANSFER_QUEUE)
 #define SGXTQ_MAX_STATUS                                               SGX_MAX_TRANSFER_STATUS_VALS + 2
 typedef struct _PVR3DIF4_CMDTA_SHARED_ {
        IMG_UINT32 ui32NumTAStatusVals;
@@ -321,40 +297,6 @@ typedef struct _PVRSRV_TRANSFER_SGX_KICK_ {
 #endif
 } PVRSRV_TRANSFER_SGX_KICK, *PPVRSRV_TRANSFER_SGX_KICK;
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-typedef struct _PVR3DIF4_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;
-} PVR3DIF4_2DCMD_SHARED, *PPVR3DIF4_2DCMD_SHARED;
-
-typedef struct _PVRSRV_2D_SGX_KICK_ {
-       IMG_HANDLE hCCBMemInfo;
-       IMG_UINT32 ui32SharedCmdCCBOffset;
-
-       IMG_DEV_VIRTADDR sHW2DContextDevVAddr;
-
-       IMG_UINT32 ui32NumSrcSync;
-       IMG_HANDLE ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
-
-       IMG_HANDLE hDstSyncInfo;
-
-       IMG_HANDLE hTASyncInfo;
-
-       IMG_HANDLE h3DSyncInfo;
-
-#if defined(PDUMP)
-       IMG_UINT32 ui32CCBDumpWOff;
-#endif
-} PVRSRV_2D_SGX_KICK, *PPVRSRV_2D_SGX_KICK;
-#endif
-#endif
 
 #define PVRSRV_SGX_DIFF_NUM_COUNTERS   9
 
index 0a84a86..da05079 100644 (file)
@@ -33,9 +33,6 @@
 #include "sgxscript.h"
 #include "sgxinfo.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #define                SGX_HOSTPORT_PRESENT                    0x00000001UL
 
@@ -79,23 +76,6 @@ extern "C" {
                IMG_UINT32 ui32CoreClockSpeed;
                IMG_UINT32 ui32uKernelTimerClock;
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-
-               SGX_SLAVE_PORT s2DSlavePortKM;
-
-               PVRSRV_RESOURCE s2DSlaveportResource;
-
-               IMG_UINT32 ui322DFifoSize;
-               IMG_UINT32 ui322DFifoOffset;
-
-               IMG_HANDLE h2DCmdCookie;
-
-               IMG_HANDLE h2DQueue;
-               IMG_BOOL b2DHWRecoveryInProgress;
-               IMG_BOOL b2DHWRecoveryEndPending;
-               IMG_UINT32 ui322DCompletedBlits;
-               IMG_BOOL b2DLockupSuspected;
-#endif
 
                IMG_VOID *psStubPBDescListKM;
 
@@ -112,23 +92,12 @@ extern "C" {
                IMG_UINT32 ui32TAKickAddress;
                IMG_UINT32 ui32TexLoadKickAddress;
                IMG_UINT32 ui32VideoHandlerAddress;
-#if defined(SGX_SUPPORT_HWPROFILING)
-               PPVRSRV_KERNEL_MEM_INFO psKernelHWProfilingMemInfo;
-#endif
                IMG_UINT32 ui32KickTACounter;
                IMG_UINT32 ui32KickTARenderCounter;
-#if defined(SUPPORT_SGX_HWPERF)
                PPVRSRV_KERNEL_MEM_INFO psKernelHWPerfCBMemInfo;
                PVRSRV_SGXDEV_DIFF_INFO sDiffInfo;
                IMG_UINT32 ui32HWGroupRequested;
                IMG_UINT32 ui32HWReset;
-#endif
-#if defined(SGX_FEATURE_OVERLAPPED_SPM)
-               PPVRSRV_KERNEL_MEM_INFO psKernelTmpRgnHeaderMemInfo;
-#endif
-#if defined(SGX_FEATURE_SPM_MODE_0)
-               PPVRSRV_KERNEL_MEM_INFO psKernelTmpDPMStateMemInfo;
-#endif
 
                IMG_UINT32 ui32ClientRefCount;
 
@@ -153,12 +122,10 @@ extern "C" {
                IMG_UINT32 *pui32BIFResetPD;
                IMG_UINT32 *pui32BIFResetPT;
 
-#if defined(SUPPORT_HW_RECOVERY)
 
                IMG_HANDLE hTimer;
 
                IMG_UINT32 ui32TimeStamp;
-#endif
 
                IMG_UINT32 ui32NumResets;
 
@@ -171,15 +138,6 @@ extern "C" {
                PVRSRV_SGX_PDUMP_CONTEXT sPDContext;
 #endif
 
-#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE)
-
-               IMG_VOID *pvDummyPTPageCpuVAddr;
-               IMG_DEV_PHYADDR sDummyPTDevPAddr;
-               IMG_HANDLE hDummyPTPageOSMemHandle;
-               IMG_VOID *pvDummyDataPageCpuVAddr;
-               IMG_DEV_PHYADDR sDummyDataDevPAddr;
-               IMG_HANDLE hDummyDataPageOSMemHandle;
-#endif
 
                IMG_UINT32 asSGXDevData[SGX_MAX_DEV_DATA];
 
@@ -212,10 +170,6 @@ extern "C" {
 
                IMG_UINT32 ui32IRQ;
 
-#if !defined(SGX_DYNAMIC_TIMING_INFO)
-
-               SGX_TIMING_INFORMATION sTimingInfo;
-#endif
        } SGX_DEVICE_MAP;
 
        typedef struct _PVRSRV_STUB_PBDESC_ PVRSRV_STUB_PBDESC;
@@ -246,33 +200,7 @@ extern "C" {
 
        IMG_VOID SGXOSTimer(IMG_VOID * pvData);
 
-#if defined(SGX_DYNAMIC_TIMING_INFO)
        IMG_VOID SysGetSGXTimingInformation(SGX_TIMING_INFORMATION *
                                            psSGXTimingInfo);
-#endif
 
-#if defined(NO_HARDWARE)
-       static INLINE IMG_VOID NoHardwareGenerateEvent(PVRSRV_SGXDEV_INFO *
-                                                      psDevInfo,
-                                                      IMG_UINT32
-                                                      ui32StatusRegister,
-                                                      IMG_UINT32
-                                                      ui32StatusValue,
-                                                      IMG_UINT32
-                                                      ui32StatusMask) {
-               IMG_UINT32 ui32RegVal;
-
-                ui32RegVal =
-                   OSReadHWReg(psDevInfo->pvRegsBaseKM, ui32StatusRegister);
-
-                ui32RegVal &= ~ui32StatusMask;
-                ui32RegVal |= (ui32StatusValue & ui32StatusMask);
-
-                OSWriteHWReg(psDevInfo->pvRegsBaseKM, ui32StatusRegister,
-                             ui32RegVal);
-       }
-#endif
-#if defined(__cplusplus)
-}
-#endif
 #endif
index e80e94f..33ff9b7 100644 (file)
@@ -47,9 +47,6 @@
 
 #include "sgxutils.h"
 
-#if defined (SGX_FEATURE_2D_HARDWARE)
-#define        SGX_USING_CMD_PROC_LIST
-#endif
 
 IMG_BOOL SGX_ISRHandler(IMG_VOID * pvData);
 
@@ -151,22 +148,8 @@ static PVRSRV_ERROR InitDevInfo(PVRSRV_PER_PROCESS_DATA * psPerProc,
            (PVRSRV_SGX_HOST_CTL *) psDevInfo->psKernelSGXHostCtlMemInfo->
            pvLinAddrKM;
 
-#if defined(SGX_SUPPORT_HWPROFILING)
-       psDevInfo->psKernelHWProfilingMemInfo =
-           (PVRSRV_KERNEL_MEM_INFO *) psInitInfo->hKernelHWProfilingMemInfo;
-#endif
-#if defined(SUPPORT_SGX_HWPERF)
        psDevInfo->psKernelHWPerfCBMemInfo =
            (PVRSRV_KERNEL_MEM_INFO *) psInitInfo->hKernelHWPerfCBMemInfo;
-#endif
-#if defined(SGX_FEATURE_OVERLAPPED_SPM)
-       psDevInfo->psKernelTmpRgnHeaderMemInfo =
-           (PVRSRV_KERNEL_MEM_INFO *) psInitInfo->hKernelTmpRgnHeaderMemInfo;
-#endif
-#if defined(SGX_FEATURE_SPM_MODE_0)
-       psDevInfo->psKernelTmpDPMStateMemInfo =
-           (PVRSRV_KERNEL_MEM_INFO *) psInitInfo->hKernelTmpDPMStateMemInfo;
-#endif
 
        eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                            sizeof(PVRSRV_SGX_CCB_INFO),
@@ -215,24 +198,13 @@ failed_allockernelccb:
 static IMG_VOID SGXGetTimingInfo(PVRSRV_DEVICE_NODE * psDeviceNode)
 {
        PVRSRV_SGXDEV_INFO *psDevInfo = psDeviceNode->pvDevice;
-#if defined(SGX_DYNAMIC_TIMING_INFO)
        SGX_TIMING_INFORMATION sSGXTimingInfo = { 0 };
-#else
-       SGX_DEVICE_MAP *psSGXDeviceMap;
-#endif
        IMG_UINT32 ui32ActivePowManSampleRate;
        SGX_TIMING_INFORMATION *psSGXTimingInfo;
 
-#if defined(SGX_DYNAMIC_TIMING_INFO)
        psSGXTimingInfo = &sSGXTimingInfo;
        SysGetSGXTimingInformation(psSGXTimingInfo);
-#else
-       SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE_SGX,
-                             (IMG_VOID **) & psSGXDeviceMap);
-       psSGXTimingInfo = &psSGXDeviceMap->sTimingInfo;
-#endif
 
-#if defined(SUPPORT_HW_RECOVERY)
        {
                PVRSRV_ERROR eError;
                IMG_UINT32 ui32OlduKernelFreq;
@@ -267,7 +239,6 @@ static IMG_VOID SGXGetTimingInfo(PVRSRV_DEVICE_NODE * psDeviceNode)
                    psSGXTimingInfo->ui32uKernelFreq /
                    psSGXTimingInfo->ui32HWRecoveryFreq;
        }
-#endif
 
        psDevInfo->ui32CoreClockSpeed = psSGXTimingInfo->ui32CoreClockSpeed;
        psDevInfo->ui32uKernelTimerClock =
@@ -287,9 +258,6 @@ static IMG_VOID SGXStartTimer(PVRSRV_SGXDEV_INFO * psDevInfo,
 {
        IMG_UINT32 ui32RegVal;
 
-#if !defined(SUPPORT_HW_RECOVERY)
-       PVR_UNREFERENCED_PARAMETER(bStartOSTimer);
-#endif
 
        ui32RegVal =
            EUR_CR_EVENT_TIMER_ENABLE_MASK | psDevInfo->ui32uKernelTimerClock;
@@ -297,7 +265,6 @@ static IMG_VOID SGXStartTimer(PVRSRV_SGXDEV_INFO * psDevInfo,
        PDUMPREGWITHFLAGS(EUR_CR_EVENT_TIMER, ui32RegVal,
                          PDUMP_FLAGS_CONTINUOUS);
 
-#if defined(SUPPORT_HW_RECOVERY)
        if (bStartOSTimer) {
                PVRSRV_ERROR eError;
                eError = OSEnableTimer(psDevInfo->hTimer);
@@ -306,7 +273,6 @@ static IMG_VOID SGXStartTimer(PVRSRV_SGXDEV_INFO * psDevInfo,
                                 "SGXStartTimer : Failed to enable host timer"));
                }
        }
-#endif
 }
 
 static PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE hDevHandle,
@@ -321,14 +287,12 @@ static PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE hDevHandle,
                PVRSRV_SGX_HOST_CTL *psSGXHostCtl = psDevInfo->psSGXHostCtl;
                IMG_UINT32 ui32PowManRequest, ui32PowManComplete;
 
-#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
 
                if (eNewPowerState == PVR_DEVICE_POWER_STATE_OFF) {
                        ui32PowManRequest =
@@ -352,7 +316,6 @@ static PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE hDevHandle,
                         MAKEUNIQUETAG(psDevInfo->psKernelSGXHostCtlMemInfo));
 #endif
 
-#if !defined(NO_HARDWARE)
                if (PollForValueKM(&psSGXHostCtl->ui32PowManFlags,
                                   ui32PowManComplete,
                                   ui32PowManComplete,
@@ -361,7 +324,6 @@ static PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE hDevHandle,
                        PVR_DPF((PVR_DBG_ERROR,
                                 "SGXPrePowerState: Wait for SGX ukernel power transition failed."));
                }
-#endif
 
 #if defined(PDUMP)
                PDUMPCOMMENT
@@ -374,10 +336,8 @@ static PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE hDevHandle,
                                          psKernelSGXHostCtlMemInfo));
 #endif
 
-#if defined(SGX_FEATURE_AUTOCLOCKGATING)
 
                {
-#if !defined(NO_HARDWARE)
                        if (PollForValueKM
                            ((IMG_UINT32 *) psDevInfo->pvRegsBaseKM +
                             (EUR_CR_CLKGATESTATUS >> 2), 0,
@@ -387,13 +347,11 @@ static PVRSRV_ERROR SGXPrePowerState(IMG_HANDLE hDevHandle,
                                PVR_DPF((PVR_DBG_ERROR,
                                         "SGXPrePowerState: Wait for SGX clock gating failed."));
                        }
-#endif
 
                        PDUMPCOMMENT("Wait for SGX clock gating.");
                        PDUMPREGPOL(EUR_CR_CLKGATESTATUS, 0,
                                    psDevInfo->ui32ClkGateStatusMask);
                }
-#endif
 
                if (eNewPowerState == PVR_DEVICE_POWER_STATE_OFF) {
                        eError = SGXDeinitialise(psDevInfo);
@@ -603,33 +561,10 @@ static PVRSRV_ERROR SGXInitialise(PVRSRV_SGXDEV_INFO * psDevInfo,
                     psDevInfo->ui32ClkGateCtl);
        PDUMPREGWITHFLAGS(EUR_CR_CLKGATECTL, psDevInfo->ui32ClkGateCtl,
                          PDUMP_FLAGS_CONTINUOUS);
-#if defined(SGX540)
-       OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_CLKGATECTL2,
-                    psDevInfo->ui32ClkGateCtl2);
-       PDUMPREGWITHFLAGS(EUR_CR_CLKGATECTL2, psDevInfo->ui32ClkGateCtl2,
-                         PDUMP_FLAGS_CONTINUOUS);
-#endif
 
        SGXReset(psDevInfo, PDUMP_FLAGS_CONTINUOUS);
 
-#if defined(EUR_CR_POWER)
-#if defined(SGX531)
-
-       OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_POWER, 1);
-       PDUMPREG(EUR_CR_POWER, 1);
-#else
-
-       OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_POWER, 0);
-       PDUMPREG(EUR_CR_POWER, 0);
-#endif
-#endif
 
-#if defined(SGX_FEATURE_SYSTEM_CACHE)
-
-       OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_MNE_CR_CTRL,
-                    EUR_CR_MNE_CR_CTRL_BYP_CC_MASK);
-       PDUMPREG(EUR_CR_MNE_CR_CTRL, EUR_CR_MNE_CR_CTRL_BYP_CC_MASK);
-#endif
 
        *psDevInfo->pui32KernelCCBEventKicker = 0;
 #if defined(PDUMP)
@@ -838,14 +773,6 @@ IMG_EXPORT
                goto failed_init_dev_info;
        }
 
-#ifdef SGX_FEATURE_2D_HARDWARE
-       eError = OSCreateResource(&psDevInfo->s2DSlaveportResource);
-       if (eError != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "DevInitSGXPart2KM: Failed to create resource !"));
-               return PVRSRV_ERROR_INIT_FAILURE;
-       }
-#endif
 
        eError = SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE_SGX,
                                       (IMG_VOID **) & psSGXDeviceMap);
@@ -873,45 +800,17 @@ IMG_EXPORT
        psDevInfo->ui32RegSize = psSGXDeviceMap->ui32RegsSize;
        psDevInfo->sRegsPhysBase = psSGXDeviceMap->sRegsSysPBase;
 
-#ifdef SGX_FEATURE_2D_HARDWARE
-
-       if (psSGXDeviceMap->pvSPCpuVBase) {
-               psDevInfo->s2DSlavePortKM.pvData = psSGXDeviceMap->pvSPCpuVBase;
-       } else {
 
-               psDevInfo->s2DSlavePortKM.pvData =
-                   OSMapPhysToLin(psSGXDeviceMap->sSPCpuPBase,
-                                  psSGXDeviceMap->ui32SPSize,
-                                  PVRSRV_HAP_KERNEL_ONLY | PVRSRV_HAP_UNCACHED,
-                                  IMG_NULL);
-
-               if (!psDevInfo->s2DSlavePortKM.pvData) {
-                       PVR_DPF((PVR_DBG_ERROR,
-                                "DevInitSGXPart2KM: Failed to map 2D Slave port region\n"));
-                       return PVRSRV_ERROR_BAD_MAPPING;
-               }
-
-       }
-       psDevInfo->s2DSlavePortKM.ui32DataRange = psSGXDeviceMap->ui32SPSize;
-       psDevInfo->s2DSlavePortKM.sPhysBase = psSGXDeviceMap->sSPSysPBase;
-#endif
-
-#if defined (SYS_USING_INTERRUPTS)
 
        psDeviceNode->pvISRData = psDeviceNode;
 
        PVR_ASSERT(psDeviceNode->pfnDeviceISR == SGX_ISRHandler);
 
-#endif
 
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
 
        psDevInfo->psSGXHostCtl->ui32PowManFlags |=
            PVRSRV_USSE_EDM_POWMAN_NO_WORK;
        eDefaultPowerState = PVRSRV_POWER_STATE_D3;
-#else
-       eDefaultPowerState = PVRSRV_POWER_STATE_D0;
-#endif
        eError = PVRSRVRegisterPowerDevice(psDeviceNode->sDevId.ui32DeviceIndex,
                                           SGXPrePowerStateExt,
                                           SGXPostPowerStateExt,
@@ -966,7 +865,6 @@ static PVRSRV_ERROR DevDeInitSGX(IMG_VOID * pvDeviceNode)
                PVR_DPF((PVR_DBG_ERROR, "DevDeInitSGX: Null DevInfo"));
                return PVRSRV_OK;
        }
-#if defined(SUPPORT_HW_RECOVERY)
        if (psDevInfo->hTimer) {
                eError = OSRemoveTimer(psDevInfo->hTimer);
                if (eError != PVRSRV_OK) {
@@ -976,22 +874,11 @@ static PVRSRV_ERROR DevDeInitSGX(IMG_VOID * pvDeviceNode)
                }
                psDevInfo->hTimer = IMG_NULL;
        }
-#endif
 
        MMU_BIFResetPDFree(psDevInfo);
 
        DeinitDevInfo(psDevInfo);
 
-#if defined(SGX_USING_CMD_PROC_LIST)
-       eError =
-           PVRSRVRemoveCmdProcListKM(psDeviceNode->sDevId.ui32DeviceIndex,
-                                     SGX_COMMAND_COUNT);
-       if (eError != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "DevDeInitSGX: PVRSRVRemoveCmdProcList failed"));
-               return eError;
-       }
-#endif
 
        psDeviceMemoryHeap =
            (DEVICE_MEMORY_HEAP_INFO *) psDevInfo->pvDeviceMemoryHeap;
@@ -1028,12 +915,6 @@ static PVRSRV_ERROR DevDeInitSGX(IMG_VOID * pvDeviceNode)
        if (eError != PVRSRV_OK) {
                return eError;
        }
-#ifdef SGX_FEATURE_2D_HARDWARE
-       eError = OSDestroyResource(&psDevInfo->s2DSlaveportResource);
-       if (eError != PVRSRV_OK) {
-               return eError;
-       }
-#endif
 
        eError = SysGetDeviceMemoryMap(PVRSRV_DEVICE_TYPE_SGX,
                                       (IMG_VOID **) & psSGXDeviceMap);
@@ -1052,18 +933,6 @@ static PVRSRV_ERROR DevDeInitSGX(IMG_VOID * pvDeviceNode)
                                         PVRSRV_HAP_UNCACHED, IMG_NULL);
                }
        }
-#ifdef SGX_FEATURE_2D_HARDWARE
-
-       if (!psSGXDeviceMap->pvSPCpuVBase) {
-               if (psDevInfo->s2DSlavePortKM.pvData != IMG_NULL) {
-                       OSUnMapPhysToLin(psDevInfo->s2DSlavePortKM.pvData,
-                                        psDevInfo->s2DSlavePortKM.
-                                        ui32DataRange,
-                                        PVRSRV_HAP_KERNEL_ONLY |
-                                        PVRSRV_HAP_UNCACHED, IMG_NULL);
-               }
-       }
-#endif
 
        OSFreePages(PVRSRV_OS_PAGEABLE_HEAP | PVRSRV_HAP_MULTI_PROCESS,
                    sizeof(PVRSRV_SGXDEV_INFO), psDevInfo, hDevInfoOSMemHandle);
@@ -1080,7 +949,6 @@ static PVRSRV_ERROR DevDeInitSGX(IMG_VOID * pvDeviceNode)
        return PVRSRV_OK;
 }
 
-#if defined(SYS_USING_INTERRUPTS) || defined(SUPPORT_HW_RECOVERY)
 static
 IMG_VOID HWRecoveryResetSGX(PVRSRV_DEVICE_NODE * psDeviceNode,
                            IMG_UINT32 ui32Component, IMG_UINT32 ui32CallerID)
@@ -1103,8 +971,7 @@ IMG_VOID HWRecoveryResetSGX(PVRSRV_DEVICE_NODE * psDeviceNode,
 
        psSGXHostCtl->ui32InterruptClearFlags |= PVRSRV_USSE_EDM_INTERRUPT_HWR;
 
-       PVR_DPF((PVR_DBG_ERROR,
-                "HWRecoveryResetSGX: SGX Hardware Recovery triggered"));
+       pr_err("HWRecoveryResetSGX: SGX Hardware Recovery triggered\n");
 
        PDUMPSUSPEND();
 
@@ -1126,7 +993,6 @@ IMG_VOID HWRecoveryResetSGX(PVRSRV_DEVICE_NODE * psDeviceNode,
 
        PVRSRVProcessQueues(ui32CallerID, IMG_TRUE);
 }
-#endif
 
 static struct workdata {
        PVRSRV_DEVICE_NODE *psDeviceNode;
@@ -1143,7 +1009,6 @@ static void HWRecoveryWrapper(struct work_struct *work)
 
 DECLARE_WORK(gWork, HWRecoveryWrapper);
 
-#if defined(SUPPORT_HW_RECOVERY)
 IMG_VOID SGXOSTimer(IMG_VOID * pvData)
 {
        PVRSRV_DEVICE_NODE *psDeviceNode = pvData;
@@ -1205,9 +1070,7 @@ IMG_VOID SGXOSTimer(IMG_VOID * pvData)
                schedule_work(&gWork);
        }
 }
-#endif
 
-#if defined(SYS_USING_INTERRUPTS)
 
 IMG_BOOL SGX_ISRHandler(IMG_VOID * pvData)
 {
@@ -1269,11 +1132,8 @@ IMG_VOID SGX_MISRHandler(IMG_VOID * pvData)
                 ui32InterruptClearFlags & PVRSRV_USSE_EDM_INTERRUPT_HWR)) {
                HWRecoveryResetSGX(psDeviceNode, 0, ISR_ID);
        }
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
        SGXTestActivePowerEvent(psDeviceNode, ISR_ID);
-#endif
 }
-#endif
 
 PVRSRV_ERROR SGXRegisterDevice(PVRSRV_DEVICE_NODE * psDeviceNode)
 {
@@ -1300,11 +1160,9 @@ PVRSRV_ERROR SGXRegisterDevice(PVRSRV_DEVICE_NODE * psDeviceNode)
        psDeviceNode->pfnMMUGetPhysPageAddr = MMU_GetPhysPageAddr;
        psDeviceNode->pfnMMUGetPDDevPAddr = MMU_GetPDDevPAddr;
 
-#if defined (SYS_USING_INTERRUPTS)
 
        psDeviceNode->pfnDeviceISR = SGX_ISRHandler;
        psDeviceNode->pfnDeviceMISR = SGX_MISRHandler;
-#endif
 
        psDeviceNode->pfnDeviceCommandComplete = SGXCommandComplete;
 
@@ -1357,11 +1215,7 @@ PVRSRV_ERROR SGXRegisterDevice(PVRSRV_DEVICE_NODE * psDeviceNode)
            SGX_TADATA_HEAP_SIZE;
        psDeviceMemoryHeap[SGX_TADATA_HEAP_ID].ui32Attribs =
            PVRSRV_HAP_WRITECOMBINE | PVRSRV_MEM_RAM_BACKED_ALLOCATION
-#if 0
-           | PVRSRV_HAP_KERNEL_ONLY;
-#else
            | PVRSRV_HAP_MULTI_PROCESS;
-#endif
        psDeviceMemoryHeap[SGX_TADATA_HEAP_ID].pszName = "TA Data";
        psDeviceMemoryHeap[SGX_TADATA_HEAP_ID].pszBSName = "TA Data BS";
        psDeviceMemoryHeap[SGX_TADATA_HEAP_ID].DevMemHeapType =
@@ -1375,11 +1229,7 @@ PVRSRV_ERROR SGXRegisterDevice(PVRSRV_DEVICE_NODE * psDeviceNode)
            SGX_KERNEL_CODE_HEAP_SIZE;
        psDeviceMemoryHeap[SGX_KERNEL_CODE_HEAP_ID].ui32Attribs =
            PVRSRV_HAP_WRITECOMBINE | PVRSRV_MEM_RAM_BACKED_ALLOCATION
-#if 0
-           | PVRSRV_HAP_KERNEL_ONLY;
-#else
            | PVRSRV_HAP_MULTI_PROCESS;
-#endif
        psDeviceMemoryHeap[SGX_KERNEL_CODE_HEAP_ID].pszName = "Kernel";
        psDeviceMemoryHeap[SGX_KERNEL_CODE_HEAP_ID].pszBSName = "Kernel BS";
        psDeviceMemoryHeap[SGX_KERNEL_CODE_HEAP_ID].DevMemHeapType =
@@ -1407,11 +1257,7 @@ PVRSRV_ERROR SGXRegisterDevice(PVRSRV_DEVICE_NODE * psDeviceNode)
            SGX_KERNEL_VIDEO_DATA_HEAP_SIZE;
        psDeviceMemoryHeap[SGX_KERNEL_VIDEO_DATA_HEAP_ID].ui32Attribs =
            PVRSRV_HAP_WRITECOMBINE | PVRSRV_MEM_RAM_BACKED_ALLOCATION |
-#if 0
-           PVRSRV_HAP_KERNEL_ONLY;
-#else
            PVRSRV_HAP_MULTI_PROCESS;
-#endif
        psDeviceMemoryHeap[SGX_KERNEL_VIDEO_DATA_HEAP_ID].pszName =
            "KernelVideoData";
        psDeviceMemoryHeap[SGX_KERNEL_VIDEO_DATA_HEAP_ID].pszBSName =
@@ -1507,19 +1353,11 @@ PVRSRV_ERROR SGXRegisterDevice(PVRSRV_DEVICE_NODE * psDeviceNode)
        psDeviceMemoryHeap[SGX_3DPARAMETERS_HEAP_ID].pszName = "3DParameters";
        psDeviceMemoryHeap[SGX_3DPARAMETERS_HEAP_ID].pszBSName =
            "3DParameters BS";
-#if defined(SUPPORT_PERCONTEXT_PB)
        psDeviceMemoryHeap[SGX_3DPARAMETERS_HEAP_ID].ui32Attribs =
            PVRSRV_HAP_WRITECOMBINE | PVRSRV_MEM_RAM_BACKED_ALLOCATION |
            PVRSRV_HAP_SINGLE_PROCESS;
        psDeviceMemoryHeap[SGX_3DPARAMETERS_HEAP_ID].DevMemHeapType =
            DEVICE_MEMORY_HEAP_PERCONTEXT;
-#else
-       psDeviceMemoryHeap[SGX_3DPARAMETERS_HEAP_ID].ui32Attribs =
-           PVRSRV_HAP_WRITECOMBINE | PVRSRV_MEM_RAM_BACKED_ALLOCATION |
-           PVRSRV_HAP_MULTI_PROCESS;
-       psDeviceMemoryHeap[SGX_3DPARAMETERS_HEAP_ID].DevMemHeapType =
-           DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-#endif
 
        psDeviceMemoryHeap[SGX_GENERAL_MAPPING_HEAP_ID].ui32HeapID =
            HEAP_ID(PVRSRV_DEVICE_TYPE_SGX, SGX_GENERAL_MAPPING_HEAP_ID);
@@ -1537,6 +1375,22 @@ PVRSRV_ERROR SGXRegisterDevice(PVRSRV_DEVICE_NODE * psDeviceNode)
        psDeviceMemoryHeap[SGX_GENERAL_MAPPING_HEAP_ID].DevMemHeapType =
            DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
 
+       psDeviceMemoryHeap[SGX_FB_MAPPING_HEAP_ID].ui32HeapID =
+           HEAP_ID(PVRSRV_DEVICE_TYPE_SGX, SGX_FB_MAPPING_HEAP_ID);
+       psDeviceMemoryHeap[SGX_FB_MAPPING_HEAP_ID].sDevVAddrBase.uiAddr =
+           SGX_FB_MAPPING_HEAP_BASE;
+       psDeviceMemoryHeap[SGX_FB_MAPPING_HEAP_ID].ui32HeapSize =
+           SGX_FB_MAPPING_HEAP_SIZE;
+       psDeviceMemoryHeap[SGX_FB_MAPPING_HEAP_ID].ui32Attribs =
+           PVRSRV_HAP_WRITECOMBINE | PVRSRV_HAP_MULTI_PROCESS;
+       psDeviceMemoryHeap[SGX_FB_MAPPING_HEAP_ID].pszName =
+           "FramebufferMapping";
+       psDeviceMemoryHeap[SGX_FB_MAPPING_HEAP_ID].pszBSName =
+           "FramebufferMapping BS";
+
+       psDeviceMemoryHeap[SGX_FB_MAPPING_HEAP_ID].DevMemHeapType =
+           DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
+
        psDeviceMemoryHeap[SGX_ALT_MAPPING_HEAP_ID].ui32HeapID =
            HEAP_ID(PVRSRV_DEVICE_TYPE_SGX, SGX_ALT_MAPPING_HEAP_ID);
        psDeviceMemoryHeap[SGX_ALT_MAPPING_HEAP_ID].sDevVAddrBase.uiAddr =
@@ -1551,21 +1405,6 @@ PVRSRV_ERROR SGXRegisterDevice(PVRSRV_DEVICE_NODE * psDeviceNode)
        psDeviceMemoryHeap[SGX_ALT_MAPPING_HEAP_ID].DevMemHeapType =
            DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-
-       psDeviceMemoryHeap[SGX_2D_HEAP_ID].ui32HeapID =
-           HEAP_ID(PVRSRV_DEVICE_TYPE_SGX, SGX_2D_HEAP_ID);
-       psDeviceMemoryHeap[SGX_2D_HEAP_ID].sDevVAddrBase.uiAddr =
-           SGX_2D_HEAP_BASE;
-       psDeviceMemoryHeap[SGX_2D_HEAP_ID].ui32HeapSize = SGX_2D_HEAP_SIZE;
-       psDeviceMemoryHeap[SGX_2D_HEAP_ID].ui32Attribs = PVRSRV_HAP_WRITECOMBINE
-           | PVRSRV_MEM_RAM_BACKED_ALLOCATION | PVRSRV_HAP_SINGLE_PROCESS;
-       psDeviceMemoryHeap[SGX_2D_HEAP_ID].pszName = "2D";
-       psDeviceMemoryHeap[SGX_2D_HEAP_ID].pszBSName = "2D BS";
-
-       psDeviceMemoryHeap[SGX_2D_HEAP_ID].DevMemHeapType =
-           DEVICE_MEMORY_HEAP_SHARED_EXPORTED;
-#endif
 
        return PVRSRV_OK;
 }
@@ -1604,7 +1443,6 @@ IMG_EXPORT
                            psDevInfo->ui32CoreClockSpeed;
                        return PVRSRV_OK;
                }
-#ifdef SUPPORT_SGX_HWPERF
        case SGX_MISC_INFO_REQUEST_HWPERF_CB_ON:
                {
                        psDevInfo->psSGXHostCtl->ui32HWPerfFlags |=
@@ -1646,7 +1484,6 @@ IMG_EXPORT
                        psRetrieve->ui32Time = OSClockus();
                        return PVRSRV_OK;
                }
-#endif
        default:
                {
 
@@ -1655,7 +1492,6 @@ IMG_EXPORT
        }
 }
 
-#if defined(SUPPORT_SGX_HWPERF)
 IMG_EXPORT
     PVRSRV_ERROR SGXReadDiffCountersKM(IMG_HANDLE hDevHandle,
                                       IMG_UINT32 ui32Reg,
@@ -1775,11 +1611,7 @@ IMG_EXPORT
 
        PVRSRVPowerUnlock(KERNEL_ID);
 
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
        SGXTestActivePowerEvent(psDeviceNode, KERNEL_ID);
-#endif
 
        return eError;
 }
-#else
-#endif
index 4d192a7..08df1d5 100644 (file)
@@ -47,20 +47,16 @@ IMG_EXPORT
            (PVRSRV_KERNEL_MEM_INFO *) psCCBKick->hCCBKernelMemInfo;
        PVR3DIF4_CMDTA_SHARED *psTACmd;
        IMG_UINT32 i;
-#if defined(SUPPORT_SGX_HWPERF)
        PVRSRV_DEVICE_NODE *psDeviceNode;
        PVRSRV_SGXDEV_INFO *psDevInfo;
 
        psDeviceNode = (PVRSRV_DEVICE_NODE *) hDevHandle;
        psDevInfo = (PVRSRV_SGXDEV_INFO *) psDeviceNode->pvDevice;
-#endif
 
-#if defined(SUPPORT_SGX_HWPERF)
        if (psCCBKick->bKickRender) {
                ++psDevInfo->ui32KickTARenderCounter;
        }
        ++psDevInfo->ui32KickTACounter;
-#endif
 
        if (!CCB_OFFSET_IS_VALID
            (PVR3DIF4_CMDTA_SHARED, psCCBMemInfo, psCCBKick, ui32CCBOffset)) {
@@ -323,73 +319,6 @@ IMG_EXPORT
                return eError;
        }
 
-#if defined(NO_HARDWARE)
-
-       if (psCCBKick->hTA3DSyncInfo) {
-               psSyncInfo =
-                   (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->hTA3DSyncInfo;
-
-               if (psCCBKick->bTADependency) {
-                       psSyncInfo->psSyncData->ui32WriteOpsComplete =
-                           psSyncInfo->psSyncData->ui32WriteOpsPending;
-               }
-       }
-
-       if (psCCBKick->hTASyncInfo != IMG_NULL) {
-               psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->hTASyncInfo;
-
-               psSyncInfo->psSyncData->ui32ReadOpsComplete =
-                   psSyncInfo->psSyncData->ui32ReadOpsPending;
-       }
-
-       if (psCCBKick->h3DSyncInfo != IMG_NULL) {
-               psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->h3DSyncInfo;
-
-               psSyncInfo->psSyncData->ui32ReadOpsComplete =
-                   psSyncInfo->psSyncData->ui32ReadOpsPending;
-       }
-
-       for (i = 0; i < psCCBKick->ui32NumTAStatusVals; i++) {
-               psSyncInfo =
-                   (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->
-                   ahTAStatusSyncInfo[i];
-
-               psSyncInfo->psSyncData->ui32ReadOpsComplete =
-                   psTACmd->sCtlTAStatusInfo[i].ui32StatusValue;
-       }
-
-       for (i = 0; i < psCCBKick->ui32NumSrcSyncs; i++) {
-               psSyncInfo =
-                   (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->
-                   ahSrcKernelSyncInfo[i];
-
-               psSyncInfo->psSyncData->ui32ReadOpsComplete =
-                   psSyncInfo->psSyncData->ui32ReadOpsPending;
-
-       }
-
-       if (psCCBKick->bTerminateOrAbort) {
-               if (psCCBKick->hRenderSurfSyncInfo != IMG_NULL) {
-                       psSyncInfo =
-                           (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->
-                           hRenderSurfSyncInfo;
-                       psSyncInfo->psSyncData->ui32WriteOpsComplete =
-                           psCCBKick->bFirstKickOrResume ? psSyncInfo->
-                           psSyncData->ui32WriteOpsPending : (psCCBKick->
-                                                              ui32WriteOpsPendingVal
-                                                              + 1);
-               }
-
-               for (i = 0; i < psCCBKick->ui32Num3DStatusVals; i++) {
-                       psSyncInfo =
-                           (PVRSRV_KERNEL_SYNC_INFO *) psCCBKick->
-                           ah3DStatusSyncInfo[i];
-
-                       psSyncInfo->psSyncData->ui32ReadOpsComplete =
-                           psTACmd->sCtl3DStatusInfo[i].ui32StatusValue;
-               }
-       }
-#endif
 
        return eError;
 }
index 345ce08..f7dcc99 100644 (file)
 
 #include "pdump_km.h"
 
-#if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-#define SGX_BIF_DIR_LIST_INDEX_EDM     15
-#define SGX_BIF_DIR_LIST_REG_EDM       EUR_CR_BIF_DIR_LIST_BASE15
-#else
 #define SGX_BIF_DIR_LIST_REG_EDM       EUR_CR_BIF_DIR_LIST_BASE0
-#endif
 
 static IMG_VOID SGXResetSoftReset(PVRSRV_SGXDEV_INFO * psDevInfo,
                                  IMG_BOOL bResetBIF,
                                  IMG_UINT32 ui32PDUMPFlags, IMG_BOOL bPDump)
 {
-#if !defined(SGX540)
        IMG_UINT32 ui32SoftResetRegVal =
 #ifdef EUR_CR_SOFT_RESET_TWOD_RESET_MASK
            EUR_CR_SOFT_RESET_TWOD_RESET_MASK |
@@ -52,26 +46,6 @@ static IMG_VOID SGXResetSoftReset(PVRSRV_SGXDEV_INFO * psDevInfo,
            EUR_CR_SOFT_RESET_TA_RESET_MASK |
            EUR_CR_SOFT_RESET_USE_RESET_MASK |
            EUR_CR_SOFT_RESET_ISP_RESET_MASK | EUR_CR_SOFT_RESET_TSP_RESET_MASK;
-#else
-       IMG_UINT32 ui32SoftResetRegVal =
-           EUR_CR_SOFT_RESET_VDM_RESET_MASK |
-           EUR_CR_SOFT_RESET_DPM_RESET_MASK |
-           EUR_CR_SOFT_RESET_TE_RESET_MASK |
-           EUR_CR_SOFT_RESET_MTE_RESET_MASK |
-           EUR_CR_SOFT_RESET_ISP_RESET_MASK |
-           EUR_CR_SOFT_RESET_ISP2_RESET_MASK |
-           EUR_CR_SOFT_RESET_TSP_RESET_MASK |
-           EUR_CR_SOFT_RESET_PDS_RESET_MASK |
-           EUR_CR_SOFT_RESET_PBE_RESET_MASK |
-           EUR_CR_SOFT_RESET_CACHEL2_RESET_MASK |
-           EUR_CR_SOFT_RESET_UCACHEL2_RESET_MASK |
-           EUR_CR_SOFT_RESET_MADD_RESET_MASK |
-           EUR_CR_SOFT_RESET_ITR_RESET_MASK |
-           EUR_CR_SOFT_RESET_TEX_RESET_MASK |
-           EUR_CR_SOFT_RESET_USE_RESET_MASK |
-           EUR_CR_SOFT_RESET_IDXFIFO_RESET_MASK |
-           EUR_CR_SOFT_RESET_TA_RESET_MASK;
-#endif
 
 #if !defined(PDUMP)
        PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
@@ -125,7 +99,6 @@ static IMG_VOID SGXResetInvalDC(PVRSRV_SGXDEV_INFO * psDevInfo,
        }
        SGXResetSleep(psDevInfo, ui32PDUMPFlags, bPDump);
 
-#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
        {
 
                if (PollForValueKM
@@ -144,7 +117,6 @@ static IMG_VOID SGXResetInvalDC(PVRSRV_SGXDEV_INFO * psDevInfo,
                                             ui32PDUMPFlags);
                }
        }
-#endif
 }
 
 IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO * psDevInfo, IMG_UINT32 ui32PDUMPFlags)
@@ -153,12 +125,6 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO * psDevInfo, IMG_UINT32 ui32PDUMPFlags)
 
        const IMG_UINT32 ui32BifFaultMask = EUR_CR_BIF_INT_STAT_FAULT_MASK;
 
-#if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-       IMG_UINT32 ui32BIFCtrl;
-#if defined(EUR_CR_BIF_MEM_ARB_CONFIG)
-       IMG_UINT32 ui32BIFMemArb;
-#endif
-#endif
 
 #ifndef PDUMP
        PVR_UNREFERENCED_PARAMETER(ui32PDUMPFlags);
@@ -202,24 +168,6 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO * psDevInfo, IMG_UINT32 ui32PDUMPFlags)
 
        SGXResetSleep(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
 
-#if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-       ui32RegVal = 0;
-       OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_BANK_SET, ui32RegVal);
-       PDUMPREGWITHFLAGS(EUR_CR_BIF_BANK_SET, ui32RegVal, ui32PDUMPFlags);
-       OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_BANK0, ui32RegVal);
-       PDUMPREGWITHFLAGS(EUR_CR_BIF_BANK0, ui32RegVal, ui32PDUMPFlags);
-
-#if defined(EUR_CR_BIF_MEM_ARB_CONFIG)
-
-       ui32BIFMemArb = (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,
-                    ui32BIFMemArb);
-       PDUMPREGWITHFLAGS(EUR_CR_BIF_MEM_ARB_CONFIG, ui32BIFMemArb,
-                         ui32PDUMPFlags);
-#endif
-#endif
 
        ui32RegVal = psDevInfo->sBIFResetPDDevPAddr.uiAddr;
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_DIR_LIST_BASE0,
@@ -280,24 +228,6 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO * psDevInfo, IMG_UINT32 ui32PDUMPFlags)
                psDevInfo->pui32BIFResetPT[ui32PTIndex] = 0;
        }
 
-#if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
-
-       ui32BIFCtrl =
-           (SGX_BIF_DIR_LIST_INDEX_EDM << EUR_CR_BIF_BANK0_INDEX_EDM_SHIFT);
-#ifdef SGX_FEATURE_2D_HARDWARE
-
-       ui32BIFCtrl |=
-           (SGX_BIF_DIR_LIST_INDEX_EDM << EUR_CR_BIF_BANK0_INDEX_2D_SHIFT);
-#endif
-#if defined(FIX_HW_BRN_23410)
-
-       ui32BIFCtrl |=
-           (SGX_BIF_DIR_LIST_INDEX_EDM << EUR_CR_BIF_BANK0_INDEX_TA_SHIFT);
-#endif
-
-       OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_BANK0, ui32BIFCtrl);
-       PDUMPREGWITHFLAGS(EUR_CR_BIF_BANK0, ui32BIFCtrl, ui32PDUMPFlags);
-#endif
 
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, SGX_BIF_DIR_LIST_REG_EDM,
                     psDevInfo->sKernelPDDevPAddr.uiAddr);
@@ -305,13 +235,6 @@ IMG_VOID SGXReset(PVRSRV_SGXDEV_INFO * psDevInfo, IMG_UINT32 ui32PDUMPFlags)
                            psDevInfo->sKernelPDDevPAddr.uiAddr, ui32PDUMPFlags,
                            PDUMP_PD_UNIQUETAG);
 
-#ifdef SGX_FEATURE_2D_HARDWARE
-
-       OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_BIF_TWOD_REQ_BASE,
-                    SGX_2D_HEAP_BASE);
-       PDUMPREGWITHFLAGS(EUR_CR_BIF_TWOD_REQ_BASE, SGX_2D_HEAP_BASE,
-                         ui32PDUMPFlags);
-#endif
 
        SGXResetInvalDC(psDevInfo, ui32PDUMPFlags, IMG_TRUE);
 
index cccf28a..130e365 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef __SGXSCRIPT_H__
 #define __SGXSCRIPT_H__
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
 #define        SGX_MAX_INIT_COMMANDS   64
 #define        SGX_MAX_DEINIT_COMMANDS 16
@@ -64,7 +61,4 @@ extern "C" {
                SGX_INIT_COMMAND asDeinitCommands[SGX_MAX_DEINIT_COMMANDS];
        } SGX_INIT_SCRIPTS;
 
-#if defined(__cplusplus)
-}
-#endif
 #endif
index df8d84a..14ea18e 100644 (file)
@@ -24,7 +24,6 @@
  *
  ******************************************************************************/
 
-#if defined(TRANSFER_QUEUE)
 
 #include <stddef.h>
 
@@ -276,239 +275,7 @@ IMG_EXPORT PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle,
            SGXScheduleCCBCommandKM(hDevHandle, PVRSRV_SGX_COMMAND_EDM_KICK,
                                    &sCommand, KERNEL_ID);
 
-#if defined(NO_HARDWARE)
-
-       for (i = 0; i < psKick->ui32NumSrcSync; i++) {
-               psSyncInfo =
-                   (PVRSRV_KERNEL_SYNC_INFO *) psKick->ahSrcSyncInfo[i];
-               psSyncInfo->psSyncData->ui32ReadOpsComplete =
-                   psSyncInfo->psSyncData->ui32ReadOpsPending;
-       }
-
-       for (i = 0; i < psKick->ui32NumDstSync; i++) {
-               psSyncInfo =
-                   (PVRSRV_KERNEL_SYNC_INFO *) psKick->ahDstSyncInfo[i];
-               psSyncInfo->psSyncData->ui32WriteOpsComplete =
-                   psSyncInfo->psSyncData->ui32WriteOpsPending;
-
-       }
-
-       if (psKick->hTASyncInfo != IMG_NULL) {
-               psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psKick->hTASyncInfo;
-
-               psSyncInfo->psSyncData->ui32WriteOpsComplete =
-                   psSyncInfo->psSyncData->ui32WriteOpsPending;
-       }
-
-       if (psKick->h3DSyncInfo != IMG_NULL) {
-               psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psKick->h3DSyncInfo;
-
-               psSyncInfo->psSyncData->ui32WriteOpsComplete =
-                   psSyncInfo->psSyncData->ui32WriteOpsPending;
-       }
-#endif
 
        return eError;
 }
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-IMG_EXPORT PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle,
-                                     PVRSRV_2D_SGX_KICK * psKick)
-{
-       PVRSRV_KERNEL_MEM_INFO *psCCBMemInfo =
-           (PVRSRV_KERNEL_MEM_INFO *) psKick->hCCBMemInfo;
-       PVRSRV_SGX_COMMAND sCommand = { 0 };
-       PVR3DIF4_2DCMD_SHARED *ps2DCmd;
-       PVRSRV_KERNEL_SYNC_INFO *psSyncInfo;
-       PVRSRV_ERROR eError;
-       IMG_UINT32 i;
-
-       if (!CCB_OFFSET_IS_VALID
-           (PVR3DIF4_2DCMD_SHARED, psCCBMemInfo, psKick,
-            ui32SharedCmdCCBOffset)) {
-               PVR_DPF((PVR_DBG_ERROR, "SGXSubmit2DKM: Invalid CCB offset"));
-               return PVRSRV_ERROR_INVALID_PARAMS;
-       }
-       ps2DCmd =
-           CCB_DATA_FROM_OFFSET(PVR3DIF4_2DCMD_SHARED, psCCBMemInfo, psKick,
-                                ui32SharedCmdCCBOffset);
-
-       OSMemSet(ps2DCmd, 0, sizeof(*ps2DCmd));
-
-       if (psKick->hTASyncInfo != IMG_NULL) {
-               psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psKick->hTASyncInfo;
-
-               ps2DCmd->sTASyncData.ui32WriteOpPendingVal =
-                   psSyncInfo->psSyncData->ui32WriteOpsPending++;
-               ps2DCmd->sTASyncData.ui32ReadOpPendingVal =
-                   psSyncInfo->psSyncData->ui32ReadOpsPending;
-
-               ps2DCmd->sTASyncData.sWriteOpsCompleteDevVAddr =
-                   psSyncInfo->sWriteOpsCompleteDevVAddr;
-               ps2DCmd->sTASyncData.sReadOpsCompleteDevVAddr =
-                   psSyncInfo->sReadOpsCompleteDevVAddr;
-       }
-
-       if (psKick->h3DSyncInfo != IMG_NULL) {
-               psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psKick->h3DSyncInfo;
-
-               ps2DCmd->s3DSyncData.ui32WriteOpPendingVal =
-                   psSyncInfo->psSyncData->ui32WriteOpsPending++;
-               ps2DCmd->s3DSyncData.ui32ReadOpPendingVal =
-                   psSyncInfo->psSyncData->ui32ReadOpsPending;
-
-               ps2DCmd->s3DSyncData.sWriteOpsCompleteDevVAddr =
-                   psSyncInfo->sWriteOpsCompleteDevVAddr;
-               ps2DCmd->s3DSyncData.sReadOpsCompleteDevVAddr =
-                   psSyncInfo->sReadOpsCompleteDevVAddr;
-       }
-
-       ps2DCmd->ui32NumSrcSync = psKick->ui32NumSrcSync;
-       for (i = 0; i < psKick->ui32NumSrcSync; i++) {
-               psSyncInfo = psKick->ahSrcSyncInfo[i];
-
-               ps2DCmd->sSrcSyncData[i].ui32WriteOpPendingVal =
-                   psSyncInfo->psSyncData->ui32WriteOpsPending;
-               ps2DCmd->sSrcSyncData[i].ui32ReadOpPendingVal =
-                   psSyncInfo->psSyncData->ui32ReadOpsPending;
-
-               ps2DCmd->sSrcSyncData[i].sWriteOpsCompleteDevVAddr =
-                   psSyncInfo->sWriteOpsCompleteDevVAddr;
-               ps2DCmd->sSrcSyncData[i].sReadOpsCompleteDevVAddr =
-                   psSyncInfo->sReadOpsCompleteDevVAddr;
-       }
-
-       if (psKick->hDstSyncInfo != IMG_NULL) {
-               psSyncInfo = psKick->hDstSyncInfo;
-
-               ps2DCmd->sDstSyncData.ui32WriteOpPendingVal =
-                   psSyncInfo->psSyncData->ui32WriteOpsPending;
-               ps2DCmd->sDstSyncData.ui32ReadOpPendingVal =
-                   psSyncInfo->psSyncData->ui32ReadOpsPending;
-
-               ps2DCmd->sDstSyncData.sWriteOpsCompleteDevVAddr =
-                   psSyncInfo->sWriteOpsCompleteDevVAddr;
-               ps2DCmd->sDstSyncData.sReadOpsCompleteDevVAddr =
-                   psSyncInfo->sReadOpsCompleteDevVAddr;
-       }
-
-       for (i = 0; i < psKick->ui32NumSrcSync; i++) {
-               psSyncInfo = psKick->ahSrcSyncInfo[i];
-               psSyncInfo->psSyncData->ui32ReadOpsPending++;
-       }
-
-       if (psKick->hDstSyncInfo != IMG_NULL) {
-               psSyncInfo = psKick->hDstSyncInfo;
-               psSyncInfo->psSyncData->ui32WriteOpsPending++;
-       }
-#if defined(PDUMP)
-       if (PDumpIsCaptureFrameKM()) {
-
-               PDUMPCOMMENT("Shared part of 2D command\r\n");
-               PDUMPMEM(ps2DCmd,
-                        psCCBMemInfo,
-                        psKick->ui32CCBDumpWOff,
-                        sizeof(PVR3DIF4_2DCMD_SHARED),
-                        0, MAKEUNIQUETAG(psCCBMemInfo));
-
-               for (i = 0; i < psKick->ui32NumSrcSync; i++) {
-                       psSyncInfo = psKick->ahSrcSyncInfo[i];
-
-                       PDUMPCOMMENT("Hack src surface write op in 2D cmd\r\n");
-                       PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
-                                psCCBMemInfo,
-                                psKick->ui32CCBDumpWOff +
-                                offsetof(PVR3DIF4_2DCMD_SHARED,
-                                         sSrcSyncData[i].
-                                         ui32WriteOpPendingVal),
-                                sizeof(psSyncInfo->psSyncData->
-                                       ui32LastOpDumpVal), 0,
-                                MAKEUNIQUETAG(psCCBMemInfo));
-
-                       PDUMPCOMMENT("Hack src surface read op in 2D cmd\r\n");
-                       PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
-                                psCCBMemInfo,
-                                psKick->ui32CCBDumpWOff +
-                                offsetof(PVR3DIF4_2DCMD_SHARED,
-                                         sSrcSyncData[i].ui32ReadOpPendingVal),
-                                sizeof(psSyncInfo->psSyncData->
-                                       ui32LastReadOpDumpVal), 0,
-                                MAKEUNIQUETAG(psCCBMemInfo));
-               }
-
-               if (psKick->hDstSyncInfo != IMG_NULL) {
-                       psSyncInfo = psKick->hDstSyncInfo;
-
-                       PDUMPCOMMENT
-                           ("Hack dest surface write op in 2D cmd\r\n");
-                       PDUMPMEM(&psSyncInfo->psSyncData->ui32LastOpDumpVal,
-                                psCCBMemInfo,
-                                psKick->ui32CCBDumpWOff +
-                                offsetof(PVR3DIF4_2DCMD_SHARED,
-                                         sDstSyncData.ui32WriteOpPendingVal),
-                                sizeof(psSyncInfo->psSyncData->
-                                       ui32LastOpDumpVal), 0,
-                                MAKEUNIQUETAG(psCCBMemInfo));
-
-                       PDUMPCOMMENT("Hack dest surface read op in 2D cmd\r\n");
-                       PDUMPMEM(&psSyncInfo->psSyncData->ui32LastReadOpDumpVal,
-                                psCCBMemInfo,
-                                psKick->ui32CCBDumpWOff +
-                                offsetof(PVR3DIF4_2DCMD_SHARED,
-                                         sDstSyncData.ui32ReadOpPendingVal),
-                                sizeof(psSyncInfo->psSyncData->
-                                       ui32LastReadOpDumpVal), 0,
-                                MAKEUNIQUETAG(psCCBMemInfo));
-               }
-
-               for (i = 0; i < psKick->ui32NumSrcSync; i++) {
-                       psSyncInfo = psKick->ahSrcSyncInfo[i];
-                       psSyncInfo->psSyncData->ui32LastReadOpDumpVal++;
-               }
-
-               if (psKick->hDstSyncInfo != IMG_NULL) {
-                       psSyncInfo = psKick->hDstSyncInfo;
-                       psSyncInfo->psSyncData->ui32LastOpDumpVal++;
-               }
-       }
-#endif
-
-       sCommand.ui32Data[0] = PVRSRV_CCBFLAGS_2DCMD;
-       sCommand.ui32Data[1] = psKick->sHW2DContextDevVAddr.uiAddr;
-
-       eError =
-           SGXScheduleCCBCommandKM(hDevHandle, PVRSRV_SGX_COMMAND_EDM_KICK,
-                                   &sCommand, KERNEL_ID);
-
-#if defined(NO_HARDWARE)
-
-       for (i = 0; i < psKick->ui32NumSrcSync; i++) {
-               psSyncInfo =
-                   (PVRSRV_KERNEL_SYNC_INFO *) psKick->ahSrcSyncInfo[i];
-               psSyncInfo->psSyncData->ui32ReadOpsComplete =
-                   psSyncInfo->psSyncData->ui32ReadOpsPending;
-       }
-
-       psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psKick->hDstSyncInfo;
-       psSyncInfo->psSyncData->ui32WriteOpsComplete =
-           psSyncInfo->psSyncData->ui32WriteOpsPending;
-
-       if (psKick->hTASyncInfo != IMG_NULL) {
-               psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psKick->hTASyncInfo;
-
-               psSyncInfo->psSyncData->ui32WriteOpsComplete =
-                   psSyncInfo->psSyncData->ui32WriteOpsPending;
-       }
-
-       if (psKick->h3DSyncInfo != IMG_NULL) {
-               psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *) psKick->h3DSyncInfo;
-
-               psSyncInfo->psSyncData->ui32WriteOpsComplete =
-                   psSyncInfo->psSyncData->ui32WriteOpsPending;
-       }
-#endif
-
-       return eError;
-}
-#endif
-#endif
index 47ee31e..852d4ef 100644 (file)
 #include "pvr_debug.h"
 #include "sgxutils.h"
 
-#ifdef __linux__
 #include <linux/tty.h>
-#else
-#include <stdio.h>
-#endif
 
-#if defined(SYS_CUSTOM_POWERDOWN)
-PVRSRV_ERROR SysPowerDownMISR(IMG_UINT32 ui32DeviceIndex,
-                             IMG_UINT32 ui32CallerID);
-#endif
 
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
 IMG_BOOL gbPowerUpPDumped = IMG_FALSE;
 
 IMG_VOID SGXTestActivePowerEvent(PVRSRV_DEVICE_NODE * psDeviceNode,
@@ -70,12 +61,6 @@ IMG_VOID SGXTestActivePowerEvent(PVRSRV_DEVICE_NODE * psDeviceNode,
 
                        PDUMPSUSPEND();
 
-#if defined(SYS_CUSTOM_POWERDOWN)
-
-                       eError =
-                           SysPowerDownMISR(psDeviceNode->sDevId.
-                                            ui32DeviceIndex, ui32CallerID);
-#else
                        eError =
                            PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.
                                                        ui32DeviceIndex,
@@ -102,7 +87,6 @@ IMG_VOID SGXTestActivePowerEvent(PVRSRV_DEVICE_NODE * psDeviceNode,
                                        }
                                }
                        }
-#endif
                        if (eError == PVRSRV_ERROR_RETRY) {
 
                                eError = PVRSRV_OK;
@@ -117,11 +101,7 @@ IMG_VOID SGXTestActivePowerEvent(PVRSRV_DEVICE_NODE * psDeviceNode,
                         eError));
        }
 }
-#endif
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGXAcquireKernelCCBSlot)
-#endif
 static INLINE PVRSRV_SGX_COMMAND *SGXAcquireKernelCCBSlot(PVRSRV_SGX_CCB_INFO *
                                                          psCCB)
 {
@@ -160,7 +140,6 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE * psDeviceNode,
        psDevInfo = (PVRSRV_SGXDEV_INFO *) psDeviceNode->pvDevice;
        psKernelCCB = psDevInfo->psKernelCCBInfo;
 
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
        {
                if (ui32CallerID == ISR_ID || gbPowerUpPDumped) {
                        PDUMPSUSPEND();
@@ -178,10 +157,6 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE * psDeviceNode,
                        gbPowerUpPDumped = IMG_TRUE;
                }
        }
-#else
-
-       eError = PVRSRVPowerLock(ui32CallerID, IMG_FALSE);
-#endif
 
        if (eError == PVRSRV_OK) {
                psDeviceNode->bReProcessDeviceCommandComplete = IMG_FALSE;
@@ -313,21 +288,14 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE * psDeviceNode,
        OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_KICK,
                     EUR_CR_EVENT_KICK_NOW_MASK);
 
-#if defined(NO_HARDWARE)
-
-       *psKernelCCB->pui32ReadOffset =
-           (*psKernelCCB->pui32ReadOffset + 1) & 255;
-#endif
 
 Exit:
        PVRSRVPowerUnlock(ui32CallerID);
 
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
        if (ui32CallerID != ISR_ID) {
 
                SGXTestActivePowerEvent(psDeviceNode, ui32CallerID);
        }
-#endif
 
        return eError;
 }
@@ -531,7 +499,6 @@ static IMG_VOID SGXCleanupRequest(PVRSRV_DEVICE_NODE * psDeviceNode,
 
                SGXScheduleProcessQueues(psDeviceNode);
 
-#if !defined(NO_HARDWARE)
                if (PollForValueKM
                    ((volatile IMG_UINT32 *)(&psSGXHostCtl->ui32ResManFlags),
                     PVRSRV_USSE_EDM_RESMAN_CLEANUP_COMPLETE,
@@ -541,7 +508,6 @@ static IMG_VOID SGXCleanupRequest(PVRSRV_DEVICE_NODE * psDeviceNode,
                        PVR_DPF((PVR_DBG_ERROR,
                                 "SGXCleanupRequest: Wait for uKernel to clean up render context failed"));
                }
-#endif
 
 #ifdef PDUMP
 
@@ -737,96 +703,7 @@ IMG_EXPORT
        return eError;
 }
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-typedef struct _SGX_HW_2D_CONTEXT_CLEANUP_ {
-       PVRSRV_DEVICE_NODE *psDeviceNode;
-       IMG_DEV_VIRTADDR sHW2DContextDevVAddr;
-       IMG_HANDLE hBlockAlloc;
-       PRESMAN_ITEM psResItem;
-} SGX_HW_2D_CONTEXT_CLEANUP;
-
-static PVRSRV_ERROR SGXCleanupHW2DContextCallback(IMG_PVOID pvParam,
-                                                 IMG_UINT32 ui32Param)
-{
-       SGX_HW_2D_CONTEXT_CLEANUP *psCleanup =
-           (SGX_HW_2D_CONTEXT_CLEANUP *) pvParam;
-
-       PVR_UNREFERENCED_PARAMETER(ui32Param);
-
-       SGXCleanupRequest(psCleanup->psDeviceNode,
-                         &psCleanup->sHW2DContextDevVAddr,
-                         PVRSRV_USSE_EDM_RESMAN_CLEANUP_2DC_REQUEST);
-
-       OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
-                 sizeof(SGX_HW_2D_CONTEXT_CLEANUP),
-                 psCleanup, psCleanup->hBlockAlloc);
-
-       return PVRSRV_OK;
-}
-
-IMG_EXPORT
-    IMG_HANDLE SGXRegisterHW2DContextKM(IMG_HANDLE psDeviceNode,
-                                       IMG_DEV_VIRTADDR *
-                                       psHW2DContextDevVAddr,
-                                       PVRSRV_PER_PROCESS_DATA * psPerProc)
-{
-       PVRSRV_ERROR eError;
-       IMG_HANDLE hBlockAlloc;
-       SGX_HW_2D_CONTEXT_CLEANUP *psCleanup;
-       PRESMAN_ITEM psResItem;
-
-       eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
-                           sizeof(SGX_HW_2D_CONTEXT_CLEANUP),
-                           (IMG_VOID **) & psCleanup, &hBlockAlloc);
 
-       if (eError != PVRSRV_OK) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGXRegisterHW2DContextKM: Couldn't allocate memory for SGX_HW_2D_CONTEXT_CLEANUP structure"));
-               return IMG_NULL;
-       }
-
-       psCleanup->hBlockAlloc = hBlockAlloc;
-       psCleanup->psDeviceNode = psDeviceNode;
-       psCleanup->sHW2DContextDevVAddr = *psHW2DContextDevVAddr;
-
-       psResItem = ResManRegisterRes(psPerProc->hResManContext,
-                                     RESMAN_TYPE_HW_2D_CONTEXT,
-                                     psCleanup,
-                                     0, &SGXCleanupHW2DContextCallback);
-
-       if (psResItem == IMG_NULL) {
-               PVR_DPF((PVR_DBG_ERROR,
-                        "SGXRegisterHW2DContextKM: ResManRegisterRes failed"));
-               OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
-                         sizeof(SGX_HW_2D_CONTEXT_CLEANUP), psCleanup,
-                         psCleanup->hBlockAlloc);
-
-               return IMG_NULL;
-       }
-
-       psCleanup->psResItem = psResItem;
-
-       return (IMG_HANDLE) psCleanup;
-}
-
-IMG_EXPORT PVRSRV_ERROR SGXUnregisterHW2DContextKM(IMG_HANDLE hHW2DContext)
-{
-       PVRSRV_ERROR eError;
-       SGX_HW_2D_CONTEXT_CLEANUP *psCleanup;
-
-       PVR_ASSERT(hHW2DContext != IMG_NULL);
-
-       psCleanup = (SGX_HW_2D_CONTEXT_CLEANUP *) hHW2DContext;
-
-       eError = ResManFreeResByPtr(psCleanup->psResItem);
-
-       return eError;
-}
-#endif
-
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SGX2DQuerySyncOpsComplete)
-#endif
 static INLINE
     IMG_BOOL SGX2DQuerySyncOpsComplete(PVRSRV_KERNEL_SYNC_INFO * psSyncInfo)
 {
index b66adc3..f731d95 100644 (file)
@@ -76,11 +76,9 @@ IMG_VOID DumpBufferArray(PPVR3DIF4_KICKTA_DUMP_BUFFER psBufferArray,
                         IMG_UINT32 ui32BufferArrayLength, IMG_BOOL bDumpPolls);
 #endif
 
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
 IMG_IMPORT
     IMG_VOID SGXTestActivePowerEvent(PVRSRV_DEVICE_NODE * psDeviceNode,
                                     IMG_UINT32 ui32CallerID);
-#endif
 
 IMG_IMPORT
     PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE * psDeviceNode,
@@ -117,12 +115,3 @@ IMG_IMPORT
     PVRSRV_ERROR SGXUnregisterHWTransferContextKM(IMG_HANDLE
                                                  hHWTransferContext);
 
-#if defined(SGX_FEATURE_2D_HARDWARE)
-IMG_IMPORT
-    IMG_HANDLE SGXRegisterHW2DContextKM(IMG_HANDLE psDeviceNode,
-                                       IMG_DEV_VIRTADDR *
-                                       psHW2DContextDevVAddr,
-                                       PVRSRV_PER_PROCESS_DATA * psPerProc);
-
-IMG_IMPORT PVRSRV_ERROR SGXUnregisterHW2DContextKM(IMG_HANDLE hHW2DContext);
-#endif
index 9cb58dd..3e75ca9 100644 (file)
@@ -27,9 +27,6 @@
 #ifndef SRVKM_H
 #define SRVKM_H
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
 
        IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVProcessConnect(IMG_UINT32
                                                                  ui32PID);
@@ -46,7 +43,4 @@ extern "C" {
                                                                puiBufSize,
                                                                IMG_BOOL bSave);
 
-#if defined (__cplusplus)
-}
-#endif
 #endif
index d12e46e..943bcfd 100644 (file)
 #include "device.h"
 #include "buffer_manager.h"
 
-#if defined(NO_HARDWARE) && defined(__linux__) && defined(__KERNEL__)
-#include <asm/io.h>
-#endif
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
        typedef struct _SYS_DEVICE_ID_TAG {
                IMG_UINT32 uiID;
@@ -131,11 +124,7 @@ extern "C" {
 
        extern SYS_DATA *gpsSysData;
 
-#if !defined(USE_CODE)
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SysAcquireData)
-#endif
        static INLINE PVRSRV_ERROR SysAcquireData(SYS_DATA ** ppsSysData) {
 
                *ppsSysData = gpsSysData;
@@ -147,9 +136,6 @@ extern "C" {
                return PVRSRV_OK;
        }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SysInitialiseCommon)
-#endif
        static INLINE PVRSRV_ERROR SysInitialiseCommon(SYS_DATA * psSysData) {
                PVRSRV_ERROR eError;
 
@@ -158,35 +144,15 @@ extern "C" {
                return eError;
        }
 
-#ifdef INLINE_IS_PRAGMA
-#pragma inline(SysDeinitialiseCommon)
-#endif
        static INLINE IMG_VOID SysDeinitialiseCommon(SYS_DATA * psSysData) {
 
                PVRSRVDeInit(psSysData);
 
                OSDestroyResource(&psSysData->sPowerStateChangeResource);
        }
-#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
-       static inline IMG_UINT32 SysReadHWReg(IMG_PVOID pvLinRegBaseAddr,
-                                             IMG_UINT32 ui32Offset) {
-               return (IMG_UINT32) readl(pvLinRegBaseAddr + ui32Offset);
-       }
-
-       static inline IMG_VOID SysWriteHWReg(IMG_PVOID pvLinRegBaseAddr,
-                                            IMG_UINT32 ui32Offset,
-                                            IMG_UINT32 ui32Value) {
-               writel(ui32Value, pvLinRegBaseAddr + ui32Offset);
-       }
-#endif
 
-#if defined(__cplusplus)
-}
-#endif
 
 #endif
index 3ef2dc4..8190771 100644 (file)
@@ -45,9 +45,6 @@ static PVRSRV_DEVICE_NODE *gpsSGXDevNode;
 
 #define DEVICE_SGX_INTERRUPT (1 << 0)
 
-#if defined(NO_HARDWARE)
-static IMG_CPU_VIRTADDR gsSGXRegsCPUVAddr;
-#endif
 
 IMG_UINT32 PVRSRV_BridgeDispatchKM(IMG_UINT32 Ioctl,
                                   IMG_BYTE * pInBuf,
@@ -58,39 +55,11 @@ IMG_UINT32 PVRSRV_BridgeDispatchKM(IMG_UINT32 Ioctl,
 
 static PVRSRV_ERROR SysLocateDevices(SYS_DATA * psSysData)
 {
-#if defined(NO_HARDWARE)
-       PVRSRV_ERROR eError;
-       IMG_CPU_PHYADDR sCpuPAddr;
-#endif
 
        PVR_UNREFERENCED_PARAMETER(psSysData);
 
        gsSGXDeviceMap.ui32Flags = 0x0;
 
-#if defined(NO_HARDWARE)
-
-       eError = OSBaseAllocContigMemory(SYS_OMAP3430_SGX_REGS_SIZE,
-                                        &gsSGXRegsCPUVAddr, &sCpuPAddr);
-       if (eError != PVRSRV_OK) {
-               return eError;
-       }
-       gsSGXDeviceMap.sRegsCpuPBase = sCpuPAddr;
-       gsSGXDeviceMap.sRegsSysPBase =
-           SysCpuPAddrToSysPAddr(gsSGXDeviceMap.sRegsCpuPBase);
-       gsSGXDeviceMap.ui32RegsSize = SYS_OMAP3430_SGX_REGS_SIZE;
-#if defined(__linux__)
-
-       gsSGXDeviceMap.pvRegsCpuVBase = gsSGXRegsCPUVAddr;
-#else
-
-       gsSGXDeviceMap.pvRegsCpuVBase = IMG_NULL;
-#endif
-
-       OSMemSet(gsSGXRegsCPUVAddr, 0, SYS_OMAP3430_SGX_REGS_SIZE);
-
-       gsSGXDeviceMap.ui32IRQ = 0;
-
-#else
 
        gsSGXDeviceMap.sRegsSysPBase.uiAddr =
            SYS_OMAP3430_SGX_REGS_SYS_PHYS_BASE;
@@ -100,7 +69,6 @@ static PVRSRV_ERROR SysLocateDevices(SYS_DATA * psSysData)
 
        gsSGXDeviceMap.ui32IRQ = SYS_OMAP3430_SGX_IRQ;
 
-#endif
 
        return PVRSRV_OK;
 }
@@ -111,7 +79,6 @@ IMG_CHAR *SysCreateVersionString(IMG_CPU_PHYADDR sRegRegion)
        SYS_DATA *psSysData;
        IMG_UINT32 ui32SGXRevision;
        IMG_INT32 i32Count;
-#if !defined(NO_HARDWARE)
        IMG_VOID *pvRegsLinAddr;
 
        pvRegsLinAddr = OSMapPhysToLin(sRegRegion,
@@ -124,9 +91,6 @@ IMG_CHAR *SysCreateVersionString(IMG_CPU_PHYADDR sRegRegion)
 
        ui32SGXRevision = OSReadHWReg((IMG_PVOID) ((IMG_PBYTE) pvRegsLinAddr),
                                      EUR_CR_CORE_REVISION);
-#else
-       ui32SGXRevision = 0;
-#endif
 
        if (SysAcquireData(&psSysData) != PVRSRV_OK) {
                return IMG_NULL;
@@ -148,12 +112,10 @@ IMG_CHAR *SysCreateVersionString(IMG_CPU_PHYADDR sRegRegion)
                                    >> EUR_CR_CORE_REVISION_MAINTENANCE_SHIFT)
            );
 
-#if !defined(NO_HARDWARE)
        OSUnMapPhysToLin(pvRegsLinAddr,
                         SYS_OMAP3430_SGX_REGS_SIZE,
                         PVRSRV_HAP_UNCACHED | PVRSRV_HAP_KERNEL_ONLY,
                         IMG_NULL);
-#endif
 
        if (i32Count == -1) {
                return IMG_NULL;
@@ -168,9 +130,6 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
        PVRSRV_ERROR eError;
        PVRSRV_DEVICE_NODE *psDeviceNode;
        IMG_CPU_PHYADDR TimerRegPhysBase;
-#if !defined(SGX_DYNAMIC_TIMING_INFO)
-       SGX_TIMING_INFORMATION *psTimingInfo;
-#endif
 
        gpsSysData = &gsSysData;
        OSMemSet(gpsSysData, 0, sizeof(SYS_DATA));
@@ -220,15 +179,6 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
                      (IMG_VOID **) & gpsSysData->pvSOCTimerRegisterKM,
                      &gpsSysData->hSOCTimerRegisterOSMemHandle);
 
-#if !defined(SGX_DYNAMIC_TIMING_INFO)
-
-       psTimingInfo = &gsSGXDeviceMap.sTimingInfo;
-       psTimingInfo->ui32CoreClockSpeed = SYS_SGX_CLOCK_SPEED;
-       psTimingInfo->ui32HWRecoveryFreq = SYS_SGX_HWRECOVERY_TIMEOUT_FREQ;
-       psTimingInfo->ui32ActivePowManLatencyms =
-           SYS_SGX_ACTIVE_POWER_LATENCY_MS;
-       psTimingInfo->ui32uKernelFreq = SYS_SGX_PDS_TIMER_FREQ;
-#endif
 
        eError = SysLocateDevices(gpsSysData);
        if (eError != PVRSRV_OK) {
@@ -322,7 +272,6 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
                gpsSysData = IMG_NULL;
                return eError;
        }
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
        eError = EnableSGXClocks(gpsSysData);
        if (eError != PVRSRV_OK) {
                PVR_DPF((PVR_DBG_ERROR,
@@ -332,7 +281,6 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
                gpsSysData = IMG_NULL;
                return eError;
        }
-#endif
 
        eError = PVRSRVInitialiseDevice(gui32SGXDeviceID);
        if (eError != PVRSRV_OK) {
@@ -345,10 +293,8 @@ PVRSRV_ERROR SysInitialise(IMG_VOID)
        SYS_SPECIFIC_DATA_SET(&gsSysSpecificData,
                              SYS_SPECIFIC_DATA_ENABLE_INITDEV);
 
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
 
        DisableSGXClocks(gpsSysData);
-#endif
 
        return PVRSRV_OK;
 }
@@ -357,7 +303,6 @@ PVRSRV_ERROR SysFinalise(IMG_VOID)
 {
        PVRSRV_ERROR eError = PVRSRV_OK;
 
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
        eError = EnableSGXClocks(gpsSysData);
        if (eError != PVRSRV_OK) {
                PVR_DPF((PVR_DBG_ERROR,
@@ -367,9 +312,7 @@ PVRSRV_ERROR SysFinalise(IMG_VOID)
                gpsSysData = IMG_NULL;
                return eError;
        }
-#endif
 
-#if defined(SYS_USING_INTERRUPTS)
 
        eError = OSInstallMISR(gpsSysData);
        if (eError != PVRSRV_OK) {
@@ -392,7 +335,6 @@ PVRSRV_ERROR SysFinalise(IMG_VOID)
        }
        SYS_SPECIFIC_DATA_SET(&gsSysSpecificData,
                              SYS_SPECIFIC_DATA_ENABLE_LISR);
-#endif
 
        gpsSysData->pszVersionString =
            SysCreateVersionString(gsSGXDeviceMap.sRegsCpuPBase);
@@ -404,10 +346,8 @@ PVRSRV_ERROR SysFinalise(IMG_VOID)
                         gpsSysData->pszVersionString));
        }
 
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
 
        DisableSGXClocks(gpsSysData);
-#endif
 
        gpsSysSpecificData->bSGXInitComplete = IMG_TRUE;
 
@@ -420,7 +360,6 @@ PVRSRV_ERROR SysDeinitialise(SYS_DATA * psSysData)
 
        PVR_UNREFERENCED_PARAMETER(psSysData);
 
-#if defined(SYS_USING_INTERRUPTS)
        if (SYS_SPECIFIC_DATA_TEST
            (gpsSysSpecificData, SYS_SPECIFIC_DATA_ENABLE_LISR)) {
                eError = OSUninstallDeviceLISR(psSysData);
@@ -440,9 +379,8 @@ PVRSRV_ERROR SysDeinitialise(SYS_DATA * psSysData)
                        return eError;
                }
        }
-#endif
 
-       eError = OSCleanupPerf(gpsSysSpecificData);
+       eError = OSCleanupPerf(psSysData);
        if (eError != PVRSRV_OK) {
                PVR_DPF((PVR_DBG_ERROR,
                         "SysDeinitialise: OSCleanupDvfs failed"));
@@ -451,7 +389,6 @@ PVRSRV_ERROR SysDeinitialise(SYS_DATA * psSysData)
 
        if (SYS_SPECIFIC_DATA_TEST
            (gpsSysSpecificData, SYS_SPECIFIC_DATA_ENABLE_INITDEV)) {
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
                PVR_ASSERT(SYS_SPECIFIC_DATA_TEST
                           (gpsSysSpecificData,
                            SYS_SPECIFIC_DATA_ENABLE_SYSCLOCKS));
@@ -462,7 +399,6 @@ PVRSRV_ERROR SysDeinitialise(SYS_DATA * psSysData)
                                 "SysDeinitialise: EnableSGXClocks failed"));
                        return eError;
                }
-#endif
 
                eError = PVRSRVDeinitialiseDevice(gui32SGXDeviceID);
                if (eError != PVRSRV_OK) {
@@ -498,15 +434,6 @@ PVRSRV_ERROR SysDeinitialise(SYS_DATA * psSysData)
 
        SysDeinitialiseCommon(gpsSysData);
 
-#if defined(NO_HARDWARE)
-       if (SYS_SPECIFIC_DATA_TEST
-           (gpsSysSpecificData, SYS_SPECIFIC_DATA_ENABLE_LOCATEDEV)) {
-
-               OSBaseFreeContigMemory(SYS_OMAP3430_SGX_REGS_SIZE,
-                                      gsSGXRegsCPUVAddr,
-                                      gsSGXDeviceMap.sRegsCpuPBase);
-       }
-#endif
 
        if (SYS_SPECIFIC_DATA_TEST
            (gpsSysSpecificData, SYS_SPECIFIC_DATA_ENABLE_PDUMPINIT)) {
@@ -608,13 +535,8 @@ IMG_UINT32 SysGetInterruptSource(SYS_DATA * psSysData,
                                 PVRSRV_DEVICE_NODE * psDeviceNode)
 {
        PVR_UNREFERENCED_PARAMETER(psSysData);
-#if defined(NO_HARDWARE)
-
-       return 0xFFFFFFFF;
-#else
 
        return psDeviceNode->ui32SOCInterruptBit;
-#endif
 }
 
 IMG_VOID SysClearInterrupts(SYS_DATA * psSysData, IMG_UINT32 ui32ClearBits)
@@ -634,7 +556,6 @@ PVRSRV_ERROR SysSystemPrePowerState(PVR_POWER_STATE eNewPowerState)
        if (eNewPowerState == PVRSRV_POWER_STATE_D3) {
                PVR_TRACE(("SysSystemPrePowerState: Entering state D3"));
 
-#if defined(SYS_USING_INTERRUPTS)
                if (SYS_SPECIFIC_DATA_TEST
                    (&gsSysSpecificData, SYS_SPECIFIC_DATA_ENABLE_LISR)) {
                        eError = OSUninstallDeviceLISR(gpsSysData);
@@ -649,7 +570,6 @@ PVRSRV_ERROR SysSystemPrePowerState(PVR_POWER_STATE eNewPowerState)
                        SYS_SPECIFIC_DATA_CLEAR(&gsSysSpecificData,
                                                SYS_SPECIFIC_DATA_ENABLE_LISR);
                }
-#endif
 
                if (SYS_SPECIFIC_DATA_TEST
                    (&gsSysSpecificData, SYS_SPECIFIC_DATA_ENABLE_SYSCLOCKS)) {
@@ -687,7 +607,6 @@ PVRSRV_ERROR SysSystemPostPowerState(PVR_POWER_STATE eNewPowerState)
                        SYS_SPECIFIC_DATA_CLEAR(&gsSysSpecificData,
                                                SYS_SPECIFIC_DATA_PM_DISABLE_SYSCLOCKS);
                }
-#if defined(SYS_USING_INTERRUPTS)
                if (SYS_SPECIFIC_DATA_TEST
                    (&gsSysSpecificData, SYS_SPECIFIC_DATA_PM_UNINSTALL_LISR)) {
                        eError =
@@ -705,7 +624,6 @@ PVRSRV_ERROR SysSystemPostPowerState(PVR_POWER_STATE eNewPowerState)
                        SYS_SPECIFIC_DATA_CLEAR(&gsSysSpecificData,
                                                SYS_SPECIFIC_DATA_PM_UNINSTALL_LISR);
                }
-#endif
        }
        return eError;
 }
@@ -719,14 +637,10 @@ PVRSRV_ERROR SysDevicePrePowerState(IMG_UINT32 ui32DeviceIndex,
        if (ui32DeviceIndex != gui32SGXDeviceID) {
                return PVRSRV_OK;
        }
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
        if (eNewPowerState == PVRSRV_POWER_STATE_D3) {
                PVR_TRACE(("SysDevicePrePowerState: SGX Entering state D3"));
                DisableSGXClocks(gpsSysData);
        }
-#else
-       PVR_UNREFERENCED_PARAMETER(eNewPowerState);
-#endif
        return PVRSRV_OK;
 }
 
@@ -741,14 +655,10 @@ PVRSRV_ERROR SysDevicePostPowerState(IMG_UINT32 ui32DeviceIndex,
        if (ui32DeviceIndex != gui32SGXDeviceID) {
                return eError;
        }
-#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
        if (eCurrentPowerState == PVRSRV_POWER_STATE_D3) {
                PVR_TRACE(("SysDevicePostPowerState: SGX Leaving state D3"));
                eError = EnableSGXClocks(gpsSysData);
        }
-#else
-       PVR_UNREFERENCED_PARAMETER(eCurrentPowerState);
-#endif
 
        return eError;
 }
index e12406a..118f667 100644 (file)
 #if !defined(__SYSLOCAL_H__)
 #define __SYSLOCAL_H__
 
-#if defined(__linux__)
 #include <linux/version.h>
 #include <linux/clk.h>
 #include <linux/semaphore.h>
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22))
 /*#include <asm/arch/resource.h>*/
-#endif
-#endif
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
 
        IMG_CHAR *SysCreateVersionString(IMG_CPU_PHYADDR sRegRegion);
 
@@ -74,7 +67,6 @@ extern "C" {
                PVRSRV_DEVICE_NODE *psSGXDevNode;
                IMG_BOOL bSGXInitComplete;
                IMG_BOOL bSGXClocksEnabled;
-#if defined(__linux__)
                struct clk *psCORE_CK;
                struct clk *psSGX_FCK;
                struct clk *psSGX_ICK;
@@ -84,15 +76,9 @@ extern "C" {
                struct clk *psGPT11_ICK;
                void __iomem *gpt_base;
 #endif
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22))
                struct constraint_handle *pVdd2Handle;
-#endif
-#endif
        } SYS_SPECIFIC_DATA;
 
        extern SYS_SPECIFIC_DATA *gpsSysSpecificData;
 
-#if defined(__cplusplus)
-}
-#endif
 #endif
diff --git a/pvr/sysutils.c b/pvr/sysutils.c
deleted file mode 100644 (file)
index 02c9831..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/**********************************************************************
- *
- * 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. 
- * 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(__linux__)
-#include "sysutils_linux.c"
-#endif
index 0dee22f..7a3efa4 100644 (file)
@@ -30,7 +30,8 @@
 #include <linux/hardirq.h>
 #include <mach/omap-pm.h>
 #include <asm/bug.h>
-#include <clock.h>
+#include <mach/clock.h>
+
 #include "sgxdefs.h"
 #include "services_headers.h"
 #include "sysinfo.h"
@@ -42,7 +43,6 @@
 
 #define        HZ_TO_MHZ(m) ((m) / 1000000)
 
-#if defined(SGX_DYNAMIC_TIMING_INFO)
 static inline unsigned long scale_by_rate(unsigned long val,
                                          unsigned long rate1,
                                          unsigned long rate2)
@@ -70,14 +70,10 @@ IMG_VOID SysGetSGXTimingInformation(SGX_TIMING_INFORMATION * psTimingInfo)
 {
        unsigned long rate;
 
-#if defined(NO_HARDWARE)
-       rate = SYS_SGX_CLOCK_SPEED;
-#else
        PVR_ASSERT(gpsSysSpecificData->bSGXClocksEnabled);
 
        rate = clk_get_rate(gpsSysSpecificData->psSGX_FCK);
        PVR_ASSERT(rate != 0);
-#endif
        psTimingInfo->ui32CoreClockSpeed = rate;
        psTimingInfo->ui32HWRecoveryFreq =
            scale_prop_to_SGX_clock(SYS_SGX_HWRECOVERY_TIMEOUT_FREQ, rate);
@@ -86,12 +82,7 @@ IMG_VOID SysGetSGXTimingInformation(SGX_TIMING_INFORMATION * psTimingInfo)
        psTimingInfo->ui32ActivePowManLatencyms =
            SYS_SGX_ACTIVE_POWER_LATENCY_MS;
 }
-#endif
 
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
-#if !defined(SGX_DYNAMIC_TIMING_INFO)
-#error "SGX_DYNAMIC_TIMING_INFO must be defined for this platform"
-#endif
 
 static int vdd2_post_func(struct notifier_block *n, unsigned long event,
                          void *ptr)
@@ -192,7 +183,6 @@ static IMG_VOID UnRegisterConstraintNotifications(SYS_SPECIFIC_DATA *
 
        clk_notifier_unregister(psSysSpecData->psSGX_FCK, &vdd2_pre_post);
 }
-#endif
 
 static struct device sgx_dev;
 static int sgx_clock_enabled;
@@ -216,7 +206,6 @@ static unsigned int sgx_current_load(void)
        psSysSpecData = (SYS_SPECIFIC_DATA *) psSysData->pvSysSpecificData;
        if ((!psSysSpecData) || (!psSysSpecData->bSGXClocksEnabled))
                return 0;
-#if defined(SUPPORT_SGX_HWPERF)
        psDeviceNode = psSysData->psDeviceNodeList;
        while (psDeviceNode) {
                if ((psDeviceNode->sDevId.eDeviceType == PVRSRV_DEVICE_TYPE_SGX)
@@ -255,9 +244,6 @@ static unsigned int sgx_current_load(void)
                psDeviceNode = psDeviceNode->psNext;
        }
        return 0;
-#else
-       return 100;
-#endif
 }
 
 static void sgx_lock_perf(struct work_struct *work)
@@ -338,7 +324,6 @@ PVRSRV_ERROR OSCleanupPerf(IMG_VOID * pvSysData)
 
 PVRSRV_ERROR EnableSGXClocks(SYS_DATA * psSysData)
 {
-#if !defined(NO_HARDWARE)
        SYS_SPECIFIC_DATA *psSysSpecData =
            (SYS_SPECIFIC_DATA *) psSysData->pvSysSpecificData;
 #if defined(DEBUG)
@@ -374,37 +359,14 @@ PVRSRV_ERROR EnableSGXClocks(SYS_DATA * psSysData)
                clk_disable(psSysSpecData->psSGX_FCK);
                return PVRSRV_ERROR_GENERIC;
        }
-#if 0
-       /* Code section removed for Fremnatle -
-        * call to clk_set_rate was causing crash */
-
-       rate = clk_get_rate(psSysSpecData->psSGX_FCK);
-       if (rate < SYS_SGX_CLOCK_SPEED) {
-               PVR_TRACE(("SGX Functional Clock rate is %dMhz. Attempting to set to %dMhz", HZ_TO_MHZ(rate), HZ_TO_MHZ(SYS_SGX_CLOCK_SPEED)));
-               res =
-                   clk_set_rate(psSysSpecData->psSGX_FCK, SYS_SGX_CLOCK_SPEED);
-               if (res < 0) {
-                       PVR_DPF((PVR_DBG_WARNING,
-                                "EnableSGXClocks: Couldn't set SGX Functional Clock rate (%d)",
-                                res));
-               }
-       }
-       PVR_TRACE(("SGX Functional Clock rate is %dMhz",
-                  HZ_TO_MHZ(clk_get_rate(psSysSpecData->psSGX_FCK))));
-       BUG_ON(in_irq());
-#endif
 
        psSysSpecData->bSGXClocksEnabled = IMG_TRUE;
-#else
-       PVR_UNREFERENCED_PARAMETER(psSysData);
-#endif
        sgx_need_perf(psSysData, 1);
        return PVRSRV_OK;
 }
 
 IMG_VOID DisableSGXClocks(SYS_DATA * psSysData)
 {
-#if !defined(NO_HARDWARE)
        SYS_SPECIFIC_DATA *psSysSpecData =
            (SYS_SPECIFIC_DATA *) psSysData->pvSysSpecificData;
 
@@ -423,9 +385,6 @@ IMG_VOID DisableSGXClocks(SYS_DATA * psSysData)
        }
 
        psSysSpecData->bSGXClocksEnabled = IMG_FALSE;
-#else
-       PVR_UNREFERENCED_PARAMETER(psSysData);
-#endif
        sgx_need_perf(psSysData, 0);
 }
 
@@ -675,10 +634,6 @@ PVRSRV_ERROR EnableSystemClocks(SYS_DATA * psSysData)
 {
        PVR_TRACE(("EnableSystemClocks: Enabling System Clocks"));
 
-#if !defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
-       if (EnableSGXClocks(psSysData) != PVRSRV_OK)
-               goto err0;
-#endif
 
        if (EnableDebugClocks(psSysData) != PVRSRV_OK)
                goto err1;
@@ -686,10 +641,6 @@ PVRSRV_ERROR EnableSystemClocks(SYS_DATA * psSysData)
        return PVRSRV_OK;
 
 err1:
-#if !defined(SUPPORT_ACTIVE_POWER_MANAGEMENT)
-       DisableSGXClocks(psSysData);
-err0:
-#endif
        return PVRSRV_ERROR_GENERIC;
 }
 
diff --git a/pvr/tools/Makefile b/pvr/tools/Makefile
new file mode 100644 (file)
index 0000000..c8156a4
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# 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. 
+# 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 
+
+
+objs-$(CONFIG_PVR_TOOLS)       += dbgdrv
+
+dbgdrv-objs                    := main.c dbgdriv.c ioctl.c hostfunc.c \
+                                  hotkey.c
+
index 4004609..addc296 100644 (file)
@@ -24,9 +24,7 @@
  *
  ******************************************************************************/
 
-#ifdef LINUX
 #include <linux/string.h>
-#endif
 
 #include "img_types.h"
 #include "pvr_debug.h"
index 036f649..f4e70d8 100644 (file)
@@ -47,7 +47,6 @@ void PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel,
     )
 {
        IMG_BOOL bTrace, bDebug;
-#if !defined(__sh__)
        IMG_CHAR *pszLeafName;
 
        pszLeafName = (char *)strrchr(pszFileName, '\\');
@@ -55,7 +54,6 @@ void PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel,
        if (pszLeafName) {
                pszFileName = pszLeafName;
        }
-#endif
 
        bTrace = gPVRDebugLevel & ui32DebugLevel & DBGPRIV_CALLTRACE;
        bDebug = ((gPVRDebugLevel & DBGPRIV_ALLLEVELS) >= ui32DebugLevel);
@@ -124,18 +122,7 @@ IMG_VOID HostMemSet(IMG_VOID * pvDest, IMG_UINT8 ui8Value, IMG_UINT32 ui32Size)
 
 IMG_VOID HostMemCopy(IMG_VOID * pvDst, IMG_VOID * pvSrc, IMG_UINT32 ui32Size)
 {
-#if defined(USE_UNOPTIMISED_MEMCPY)
-       unsigned char *src, *dst;
-       int i;
-
-       src = (unsigned char *)pvSrc;
-       dst = (unsigned char *)pvDst;
-       for (i = 0; i < ui32Size; i++) {
-               dst[i] = src[i];
-       }
-#else
        memcpy(pvDst, pvSrc, ui32Size);
-#endif
 }
 
 IMG_UINT32 HostReadRegistryDWORDFromString(char *pcKey, char *pcValueName,
index 4319020..f4193e0 100644 (file)
  *
  ******************************************************************************/
 
-#if !defined(LINUX)
-#include <ntddk.h>
-#include <windef.h>
-#endif
-
 #include "img_types.h"
 #include "pvr_debug.h"
 #include "dbgdrvif.h"
@@ -47,20 +42,10 @@ IMG_VOID ReadInHotKeys(IMG_VOID)
        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);
-       }
-#else
        HostReadRegistryDWORDFromString("DEBUG\\Streams", "ui32ScanCode",
                                        &g_PrivateHotKeyData.ui32ScanCode);
        HostReadRegistryDWORDFromString("DEBUG\\Streams", "ui32ShiftState",
                                        &g_PrivateHotKeyData.ui32ShiftState);
-#endif
 }
 
 IMG_VOID RegisterKeyPressed(IMG_UINT32 dwui32ScanCode, PHOTKEYINFO pInfo)
index 2ff9af9..c74edb7 100644 (file)
@@ -24,9 +24,7 @@
  *
  ******************************************************************************/
 
-#ifdef LINUX
 #include <asm/uaccess.h>
-#endif
 
 #include "img_types.h"
 #include "dbgdrvif.h"
@@ -38,14 +36,11 @@ IMG_UINT32 DBGDIOCDrivCreateStream(IMG_VOID * pvInBuffer,
 {
        PDBG_IN_CREATESTREAM psIn;
        IMG_VOID **ppvOut;
-#ifdef LINUX
        static char name[32];
-#endif
 
        psIn = (PDBG_IN_CREATESTREAM) pvInBuffer;
        ppvOut = (IMG_VOID * *)pvOutBuffer;
 
-#ifdef LINUX
 
        if (copy_from_user(name, psIn->pszName, 32) != 0)
                return IMG_FALSE;
@@ -53,13 +48,6 @@ IMG_UINT32 DBGDIOCDrivCreateStream(IMG_VOID * pvInBuffer,
            ExtDBGDrivCreateStream(name, psIn->ui32CapMode, psIn->ui32OutMode,
                                   0, psIn->ui32Pages);
 
-#else
-       *ppvOut =
-           ExtDBGDrivCreateStream(psIn->pszName, psIn->ui32CapMode,
-                                  psIn->ui32OutMode,
-                                  DEBUG_FLAGS_NO_BUF_EXPANDSION,
-                                  psIn->ui32Pages);
-#endif
 
        return (IMG_TRUE);
 }