jacinto6: sgx: update DDK version to 1.12/2701748
authorVishal Mahaveer <vishalm@ti.com>
Wed, 5 Feb 2014 15:33:26 +0000 (09:33 -0600)
committerVishal Mahaveer <vishalm@ti.com>
Thu, 6 Feb 2014 17:50:10 +0000 (11:50 -0600)
Initial DDK 1.12 content

Change-Id: I7159467651bf4db8cc92563f7309e4191a448e48
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
172 files changed:
jacinto6/README.SGX
jacinto6/sgx.tgz
jacinto6/sgx/Android.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/armv7-a.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/apis/xorg.mk [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/omap4.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/xorg.mk [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/xorg_test.mk [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_linux/Makefile [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/prepare_tree.mk
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/sunxi_android/Makefile [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/tools/cc-check.sh
jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk
jacinto6/sgx_src/eurasia_km/include4/img_defs.h
jacinto6/sgx_src/eurasia_km/include4/img_types.h
jacinto6/sgx_src/eurasia_km/include4/pdumpdefs.h
jacinto6/sgx_src/eurasia_km/include4/pvr_debug.h
jacinto6/sgx_src/eurasia_km/include4/pvr_sync_user.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/include4/pvrversion.h
jacinto6/sgx_src/eurasia_km/include4/services.h
jacinto6/sgx_src/eurasia_km/include4/servicesext.h
jacinto6/sgx_src/eurasia_km/include4/sgx_options.h
jacinto6/sgx_src/eurasia_km/include4/sgxapi_km.h
jacinto6/sgx_src/eurasia_km/include4/sgxscript.h
jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/Kbuild.mk [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/Linux.mk [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_linux.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_linux.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_private.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_private.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_displayclass.c
jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/3rdparty_dc_drm_shared.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Kbuild.mk
jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb.h
jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c
jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c
jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_sunxi/Kbuild.mk [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_sunxi/Linux.mk [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_sunxi/dc_sunxi_displayclass.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/linux_drm/Kbuild.mk [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/linux_drm/Linux.mk [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/linux_drm/pvr_drm_mod.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/3rdparty/linux_drm/pvr_drm_stubs.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/include/env/linux/pvr_drm_shared.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/include/kerneldisplay.h
jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge.h
jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge_km.h
jacinto6/sgx_src/eurasia_km/services4/include/pvrmmap.h
jacinto6/sgx_src/eurasia_km/services4/include/servicesint.h
jacinto6/sgx_src/eurasia_km/services4/include/sgx_bridge.h
jacinto6/sgx_src/eurasia_km/services4/include/sgx_mkif_km.h
jacinto6/sgx_src/eurasia_km/services4/include/sgx_ukernel_status_codes.h
jacinto6/sgx_src/eurasia_km/services4/include/sgxinfo.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_support.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_support.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/sgx/bridged_sgx_bridge.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/buffer_manager.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/deviceclass.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/devicemem.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/handle.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/hash.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/lists.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/mem_debug.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pdump_common.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/queue.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/ra.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/refcount.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/resman.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/common/ttrace.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/mmu.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/pb.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgx_bridge_km.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxconfig.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinfokm.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinit.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxkick.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxreset.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxtransfer.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxutils.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Kbuild.mk
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Linux.mk
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/env_perproc.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/event.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutex.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osperproc.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pdump.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/private_data.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/proc.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/proc.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_bridge_k.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_debug.c
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_drm.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_drm.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_sync.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_sync.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/systrace.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/systrace.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgxerrata.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgxfeaturedefs.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgxmpdefs.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/buffer_manager.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/devicemem.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/handle.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/ion_sync.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/lists.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/osfunc.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/pdump_km.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/pdump_osfunc.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/perproc.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/queue.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/ra.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/refcount.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/srvkm.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/ttrace_common.h
jacinto6/sgx_src/eurasia_km/services4/srvkm/include/ttrace_tokens.h
jacinto6/sgx_src/eurasia_km/services4/system/include/syscommon.h
jacinto6/sgx_src/eurasia_km/services4/system/omap/oemfuncs.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq_activeidle.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq_cool.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq_on3demand.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq_onoff.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq_userspace.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sysconfig.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sysconfig.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sysinfo.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/syslocal.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sysutils.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap/sysutils_linux.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysconfig.h
jacinto6/sgx_src/eurasia_km/services4/system/sunxi/oemfuncs.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/sunxi/sysconfig.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/sunxi/sysconfig.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/sunxi/sysinfo.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/sunxi/syslocal.h [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/sunxi/sysutils.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/services4/system/sunxi/sysutils_linux.c [new file with mode: 0644]
jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv.c
jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv.h
jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/linux/main.c

index 17f1f79c9e30ea80f005d5426d650ce84bc9fd59..54df572061429296e4816bba9bd4b0d65338e5b1 100644 (file)
 #==========================================================================
 
 sgx.tgz a set of binaries built for SGX544.
-The SGXCORE and SGC_CORE_REV is appended to the end of each file. pvrsrvinit is
-now a wrapper which detects the current processor and loads the corresponding
-core specific pvrsrvinit.
 
 [DDK Version]
-    1.9/2291151
+    1.12/2701748
 [DDK commit ID]
-    e7405ce SGX-UM-Fix for graphics init race condition.
+    03b9484 build: Set correct load directory for kernel modules.
 [Branch]
-    origin/1.9/2291151_k3.8
+    android/1.12/2701748
 [Kernel modules built against]
     Kernel Version: 3.8.y with CONFIG_MODVERSIONS=y
 
@@ -32,11 +29,11 @@ SGX kernel modules source is located in sgx_src/eurasia_km/
 
 Make sure kernel is built before building modules
 
-# cd ANDROID_ROOT/device/ti/proprietary-open/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/
+# cd ANDROID_ROOT/device/ti/proprietary-open/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/
 # export KERNELDIR=path_to_kernel
 
 To build for OMAP5 (SGX 544 multi core):
-# make ARCH=arm CROSS_COMPILE=arm-eabi- TARGET_PRODUCT="omap5sevm" BUILD=release TARGET_SGX=544es2
+# make ARCH=arm CROSS_COMPILE=arm-eabi- TARGET_PRODUCT="jacinto6evm" BUILD=release
 
 Once the .ko is built, install it onto device (/system/lib/modules)
 
index 9d1683bebeb51a06db5570d00162675d2abea608..abe7a53c54997f15aeca6a672c4fbc77a141eaa5 100644 (file)
Binary files a/jacinto6/sgx.tgz and b/jacinto6/sgx.tgz differ
index 128a06dcd64bff55e3d09e4995a65154082680c1..aa082fa6cb12f21958e65e2364aed19d1230b1d9 100644 (file)
@@ -94,28 +94,28 @@ $$(LOCAL_BUILT_MODULE) : $$(img-sgx.untarred_timestamp) | $$(ACP)
 endef
 
 prebuilt_sgx_vendor_libs := \
-       lib/libIMGegl_SGX544_116.so \
-       lib/libglslcompiler_SGX544_116.so \
-       lib/libusc_SGX544_116.so \
-       lib/libPVRScopeServices_SGX544_116.so \
-       lib/libsrv_um_SGX544_116.so \
+       lib/libIMGegl.so \
+       lib/libglslcompiler.so \
+       lib/libusc.so \
+       lib/libPVRScopeServices.so \
+       lib/libsrv_um.so \
        lib/hw/gralloc.jacinto6.so \
-       lib/libpvrANDROID_WSEGL_SGX544_116.so \
-       lib/libpvr2d_SGX544_116.so \
-       lib/libsrv_init_SGX544_116.so \
+       lib/libpvrANDROID_WSEGL.so \
+       lib/libpvr2d.so \
+       lib/libsrv_init.so \
        lib/egl/libGLESv1_CM_POWERVR_SGX544_116.so \
        lib/egl/libGLESv2_POWERVR_SGX544_116.so \
        lib/egl/libEGL_POWERVR_SGX544_116.so
 
 prebuilt_sgx_vendor_bins := \
        bin/pvrsrvinit \
-       bin/pvrsrvctl_SGX544_116
+       bin/pvrsrvctl
 
-prebuilt_sgx_vendor_etc := \
-       etc/powervr.ini
+#prebuilt_sgx_vendor_etc := \
+#      etc/powervr.ini
 
 prebuilt_sgx_vendor_km := \
-       modules/pvrsrvkm_sgx544_116.ko
+       modules/pvrsrvkm.ko
 
 prebuilt_sgx_modules := \
   $(foreach _file,$(prebuilt_sgx_vendor_libs) $(prebuilt_sgx_vendor_bins) $(prebuilt_sgx_vendor_etc) $(prebuilt_sgx_vendor_km),\
index a1a7eef8e6e29770eb11d1601c7f154559aec51e..d04aa7b34d0b7ed362f88295a8bede9439f09e6f 100644 (file)
@@ -79,6 +79,7 @@ help:
        @echo '  make, make build       Build all components of the build'
        @echo '  make components        Build only the user-mode components'
        @echo '  make kbuild            Build only the kernel-mode components'
+       @echo '  make docs              Build the build's supporting documentation'
        @echo '  make MODULE            Build the module MODULE and all of its dependencies'
        @echo '  make eurasiacon/binary2_.../target/libsomething.so'
        @echo '                         Build a particular file (including intermediates)'
@@ -104,9 +105,11 @@ ifneq ($(filter help,$(D)),)
 empty :=
 space := $(empty) $(empty) 
 $(info Debug options)
-$(info $(space)D=modules                  dump module info)
-$(info $(space)D=freeze-config            prevent config changes)
-$(info $(space)D=config-changes           dump diffs when config changes)
-$(info Options may be combined: make D=freeze-config,config-changes)
+$(info $(space)D=modules            dump module info)
+$(info $(space)D=config             dump all config options + type and origin)
+$(info $(space)D=freeze-config      prevent config changes)
+$(info $(space)D=config-changes     dump diffs when config changes)
+$(info $(space)D=nobuild            stop before running the main build)
+$(info Options can be combined: make D=freeze-config,config-changes)
 $(error D=help given)
 endif
index 24fa82998a9ed9e923a0484dd9ebb6bafc38dde0..ce0608c4d95d72ab37806fd0b2eb057b656c97a7 100644 (file)
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ### ###########################################################################
 
+# NOTE: You must *not* use the cc-option et al macros in COMMON_FLAGS,
+# COMMON_CFLAGS or COMMON_USER_FLAGS. These flags are shared between
+# host and target, which might use compilers with different capabilities.
+
+# These flags are used for kernel, User C and User C++
+#
+COMMON_FLAGS := -W -Wall
+
+# Some GCC warnings are C only, so we must mask them from C++
+#
+COMMON_CFLAGS := $(COMMON_FLAGS) \
+ -Wdeclaration-after-statement -Wno-format-zero-length \
+ -Wstrict-prototypes
+
+# User C and User C++ optimization control. Does not affect kernel.
+#
 ifeq ($(BUILD),debug)
 COMMON_USER_FLAGS := -O0
 else
 OPTIM ?= -O2
+ifeq ($(USE_LTO),1)
+COMMON_USER_FLAGS := $(OPTIM) -flto
+else
 COMMON_USER_FLAGS := $(OPTIM)
 endif
+endif
 
 # FIXME: We should probably audit the driver for aliasing
 #
@@ -58,26 +78,40 @@ COMMON_USER_FLAGS += -fno-strict-aliasing
 #
 COMMON_USER_FLAGS += -g
 
-# These flags are used for kernel, User C and User C++
-#
-COMMON_FLAGS = -W -Wall
-
-# Some GCC warnings are C only, so we must mask them from C++
+# User C and User C++ warning flags
 #
-COMMON_CFLAGS := $(COMMON_FLAGS) \
- -Wdeclaration-after-statement -Wno-format-zero-length \
- -Wmissing-prototypes -Wstrict-prototypes
+COMMON_USER_FLAGS += \
+ -Wpointer-arith -Wunused-parameter \
+ -Wmissing-format-attribute
 
 # Additional warnings, and optional warnings.
 #
-WARNING_CFLAGS := \
- -Wpointer-arith -Wunused-parameter \
- -Wmissing-format-attribute \
+TESTED_TARGET_USER_FLAGS := \
  $(call cc-option,-Wno-missing-field-initializers) \
- $(call cc-option,-fdiagnostics-show-option)
+ $(call cc-option,-fdiagnostics-show-option) \
+ $(call cc-option,-Wno-self-assign) \
+ $(call cc-option,-Wno-parentheses-equality)
+TESTED_HOST_USER_FLAGS := \
+ $(call host-cc-option,-Wno-missing-field-initializers) \
+ $(call host-cc-option,-fdiagnostics-show-option) \
+ $(call host-cc-option,-Wno-self-assign) \
+ $(call host-cc-option,-Wno-parentheses-equality)
+
+# These flags are clang-specific.
+# -Wno-unused-command-line-argument works around a buggy interaction
+# with ccache, see https://bugzilla.samba.org/show_bug.cgi?id=8118
+# -fcolor-diagnostics force-enables colored error messages which
+# get disabled when ccache is piped through ccache.
+#
+TESTED_TARGET_USER_FLAGS += \
+ $(call cc-option,-Qunused-arguments) \
+ $(call cc-option,-fcolor-diagnostics)
+TESTED_HOST_USER_FLAGS += \
+ $(call host-cc-option,-Qunused-arguments) \
+ $(call host-cc-option,-fcolor-diagnostics)
 
 ifeq ($(W),1)
-WARNING_CFLAGS += \
+TESTED_TARGET_USER_FLAGS += \
  $(call cc-option,-Wbad-function-cast) \
  $(call cc-option,-Wcast-qual) \
  $(call cc-option,-Wcast-align) \
@@ -97,19 +131,7 @@ WARNING_CFLAGS += \
  $(call cc-option,-Wswitch-default) \
  $(call cc-option,-Wvla) \
  $(call cc-option,-Wwrite-strings)
-endif
-
-WARNING_CFLAGS += \
- $(call cc-optional-warning,-Wunused-but-set-variable)
-
-HOST_WARNING_CFLAGS := \
- -Wpointer-arith -Wunused-parameter \
- -Wmissing-format-attribute \
- $(call host-cc-option,-Wno-missing-field-initializers) \
- $(call host-cc-option,-fdiagnostics-show-option)
-
-ifeq ($(W),1)
-HOST_WARNING_CFLAGS += \
+TESTED_HOST_USER_FLAGS += \
  $(call host-cc-option,-Wbad-function-cast) \
  $(call host-cc-option,-Wcast-qual) \
  $(call host-cc-option,-Wcast-align) \
@@ -131,12 +153,20 @@ HOST_WARNING_CFLAGS += \
  $(call host-cc-option,-Wwrite-strings)
 endif
 
-HOST_WARNING_CFLAGS += \
+TESTED_TARGET_USER_FLAGS += \
+ $(call cc-optional-warning,-Wunused-but-set-variable)
+TESTED_HOST_USER_FLAGS += \
  $(call host-cc-optional-warning,-Wunused-but-set-variable)
 
-KBUILD_WARNING_CFLAGS := \
+KBUILD_FLAGS := \
  -Wno-unused-parameter -Wno-sign-compare
-KBUILD_WARNING_CFLAGS += \
+
+TESTED_KBUILD_FLAGS := \
+ $(call kernel-cc-option,-Wmissing-include-dirs) \
+ $(call kernel-cc-option,-Wno-type-limits) \
+ $(call kernel-cc-option,-Wno-pointer-arith) \
+ $(call kernel-cc-option,-Wno-aggregate-return) \
+ $(call kernel-cc-option,-Wno-unused-but-set-variable) \
  $(call kernel-cc-optional-warning,-Wbad-function-cast) \
  $(call kernel-cc-optional-warning,-Wcast-qual) \
  $(call kernel-cc-optional-warning,-Wcast-align) \
@@ -161,22 +191,31 @@ KBUILD_WARNING_CFLAGS += \
 # User C only
 #
 ALL_CFLAGS := \
- $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(WARNING_CFLAGS) \
+ $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_TARGET_USER_FLAGS) \
  $(SYS_CFLAGS)
-
 ALL_HOST_CFLAGS := \
- $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(HOST_WARNING_CFLAGS)
+ $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_HOST_USER_FLAGS)
 
 # User C++ only
 #
 ALL_CXXFLAGS := \
- $(COMMON_USER_FLAGS) $(COMMON_FLAGS) \
  -fno-rtti -fno-exceptions \
-Wpointer-arith -Wunused-parameter \
$(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_TARGET_USER_FLAGS) \
  $(SYS_CXXFLAGS)
-
 ALL_HOST_CXXFLAGS := \
- $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) -Wall
+ -fno-rtti -fno-exceptions \
+ $(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_HOST_USER_FLAGS)
+
+# Workaround for some target clangs that don't support -O0 w/ PIC.
+#
+ifeq ($(cc-is-clang),true)
+ALL_CFLAGS := $(patsubst -O0,-O1,$(ALL_CFLAGS))
+ALL_CXXFLAGS := $(patsubst -O0,-O1,$(ALL_CXXFLAGS))
+endif
+
+# Kernel C only
+#
+ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_FLAGS) $(TESTED_KBUILD_FLAGS)
 
 # User C and C++
 #
@@ -186,27 +225,28 @@ ALL_HOST_CXXFLAGS := \
 # We can't use it right now because we want to support non-GNU-compatible
 # linkers like the Darwin 'ld' which doesn't support -rpath-link.
 #
+# For the same reason (Darwin 'ld') don't bother checking for text
+# relocations in host binaries.
+#
 ALL_HOST_LDFLAGS := -L$(HOST_OUT)
-ALL_LDFLAGS := -L$(TARGET_OUT) -Xlinker -rpath-link=$(TARGET_OUT)
+ALL_LDFLAGS := \
+ -Wl,--warn-shared-textrel \
+ -L$(TARGET_OUT) -Xlinker -rpath-link=$(TARGET_OUT)
 
 ifneq ($(strip $(TOOLCHAIN)),)
 ALL_LDFLAGS += -L$(TOOLCHAIN)/lib -Xlinker -rpath-link=$(TOOLCHAIN)/lib
 endif
 
+ifneq ($(strip $(TOOLCHAIN2)),)
+ALL_LDFLAGS += -L$(TOOLCHAIN2)/lib -Xlinker -rpath-link=$(TOOLCHAIN2)/lib
+endif
+
 ifneq ($(strip $(LINKER_RPATH)),)
 ALL_LDFLAGS += $(addprefix -Xlinker -rpath=,$(LINKER_RPATH))
 endif
 
 ALL_LDFLAGS += $(SYS_LDFLAGS)
 
-# Kernel C only
-#
-ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_WARNING_CFLAGS) \
- $(call kernel-cc-option,-Wno-type-limits) \
- $(call kernel-cc-option,-Wno-pointer-arith) \
- $(call kernel-cc-option,-Wno-aggregate-return) \
- $(call kernel-cc-option,-Wno-unused-but-set-variable)
-
 # This variable contains a list of all modules built by kbuild
 ALL_KBUILD_MODULES :=
 
index 25e5ed1adf419f4da8a0bc2336b22724a1159235..093bb1c247a3f2c0e8203d7cde8cd550eb7faa9b 100644 (file)
@@ -55,22 +55,20 @@ endef
 
 define target-o-from-one-c
 $(if $(V),,@echo "  CC      " $(call relative-to-top,$<))
-$(CC) -MD -c $(MODULE_CFLAGS) $(MODULE_INCLUDE_FLAGS) \
+$(CC) -MD -c $(MODULE_CFLAGS) $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) \
         -include $(CONFIG_H) $< -o $@
 endef
 
-# We use $(CC) to compile C++ files, and expect it to detect that it's
-# compiling C++
 define host-o-from-one-cxx
-$(if $(V),,@echo "  HOST_C" $(call relative-to-top,$<))
-$(HOST_CC) -MD -c $(MODULE_HOST_CXXFLAGS) $(MODULE_INCLUDE_FLAGS) \
-        -include $(CONFIG_H) $< -o $@
+$(if $(V),,@echo "  HOST_CXX" $(call relative-to-top,$<))
+$(HOST_CXX) -MD -c $(MODULE_HOST_CXXFLAGS) $(MODULE_INCLUDE_FLAGS) \
+       -include $(CONFIG_H) $< -o $@
 endef
 
 define target-o-from-one-cxx
-$(if $(V),,@echo "  C     " $(call relative-to-top,$<))
-$(CC) -MD -c $(MODULE_CXXFLAGS) $(MODULE_INCLUDE_FLAGS) \
-        -include $(CONFIG_H) $< -o $@
+$(if $(V),,@echo "  CXX     " $(call relative-to-top,$<))
+$(CXX) -MD -c $(MODULE_CXXFLAGS) $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) \
+       -include $(CONFIG_H) $< -o $@
 endef
 
 define host-executable-from-o
@@ -98,7 +96,7 @@ endef
 define target-executable-cxx-from-o
 $(if $(V),,@echo "  LD      " $(call relative-to-top,$@))
 $(CXX) \
-       $(SYS_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
+       $(SYS_EXE_LDFLAGS_CXX) $(SYS_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
        $(SYS_EXE_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_EXE_CRTEND) \
        $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC)
 endef
@@ -116,11 +114,29 @@ endef
 define target-shared-library-cxx-from-o
 $(if $(V),,@echo "  LD      " $(call relative-to-top,$@))
 $(CXX) -shared -Wl,-Bsymbolic \
-       $(SYS_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
+       $(SYS_LIB_LDFLAGS_CXX) $(SYS_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
        $(SYS_LIB_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_LIB_CRTEND) \
        $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC)
 endef
 
+define host-shared-library-from-o
+$(if $(V),,@echo "  HOST_LD " $(call relative-to-top,$@))
+$(HOST_CC) -shared -Wl,-Bsymbolic \
+       $(MODULE_HOST_LDFLAGS) -o $@ \
+       $(sort $(MODULE_ALL_OBJECTS)) \
+       $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS)
+endef
+
+# If there were any C++ source files in a shared library, we use this recipe,
+# which runs the C++ compiler to link the final library
+define host-shared-library-cxx-from-o
+$(if $(V),,@echo "  HOST_LD " $(call relative-to-top,$@))
+$(HOST_CXX) -shared -Wl,-Bsymbolic \
+       $(MODULE_HOST_LDFLAGS) -o $@ \
+       $(sort $(MODULE_ALL_OBJECTS)) \
+       $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS)
+endef
+
 define target-copy-debug-information
 $(OBJCOPY) --only-keep-debug $@ $(basename $@).dbg
 endef
@@ -182,38 +198,64 @@ JAVA ?= java
 JAVAC ?= javac
 ZIP ?= zip
 
-override AR                    := $(if $(V),,@)$(CROSS_COMPILE)ar
-override BISON         := $(if $(V),,@)$(BISON)
-override BZIP2         := $(if $(V),,@)bzip2 -9
-override CC                    := $(if $(V),,@)$(CROSS_COMPILE)$(CC)
-override CC_CHECK      := $(if $(V),,@)$(MAKE_TOP)/tools/cc-check.sh
-override CXX           := $(if $(V),,@)$(CROSS_COMPILE)$(CXX)
+ifeq ($(USE_CCACHE),1)
+CCACHE ?= ccache
+endif
+
+# Define CHMOD and CC_CHECK first so we can use cc-is-clang
+#
 override CHMOD         := $(if $(V),,@)chmod
-override CP                    := $(if $(V),,@)cp
-override ECHO          := $(if $(V),,@)echo
-override FLEX          := $(if $(V),,@)flex
-override GAWK          := $(if $(V),,@)gawk
-override GREP          := $(if $(V),,@)grep
-override HOST_AR       := $(if $(V),,@)ar
-override HOST_CC       := $(if $(V),,@)$(HOST_CC)
-override HOST_CXX      := $(if $(V),,@)$(HOST_CXX)
-override HOST_STRIP := $(if $(V),,@)strip
-override INSTALL       := $(if $(V),,@)install
-override JAR           := $(if $(V),,@)$(JAR)
-override JAVA          := $(if $(V),,@)$(JAVA)
-override JAVAC         := $(if $(V),,@)$(JAVAC)
-override M4                    := $(if $(V),,@)m4
-override MKDIR         := $(if $(V),,@)mkdir
-override MV                    := $(if $(V),,@)mv
-override OBJCOPY       := $(if $(V),,@)$(CROSS_COMPILE)objcopy
-override PDSASM                := $(if $(V),,@)$(HOST_OUT)/pdsasm
-override RANLIB                := $(if $(V),,@)$(CROSS_COMPILE)ranlib
-override RM                    := $(if $(V),,@)rm -f
-override SED           := $(if $(V),,@)sed
-override STRIP         := $(if $(V),,@)$(CROSS_COMPILE)strip
-override TAR           := $(if $(V),,@)tar
-override TOUCH         := $(if $(V),,@)touch
-override USEASM                := $(if $(V),,@)$(HOST_OUT)/useasm
-override USELINK       := $(if $(V),,@)$(HOST_OUT)/uselink
-override VHD2INC       := $(if $(V),,@)$(HOST_OUT)/vhd2inc
-override ZIP           := $(if $(V),,@)$(ZIP)
+override CC_CHECK      := $(if $(V),,@)$(MAKE_TOP)/tools/cc-check.sh
+
+# If clang is detected, the compiler name is invariant but CROSS_COMPILE
+# is reflected in the use of -target. For GCC this is always encoded into
+# the binary. If CROSS_COMPILE is not set we can skip this.
+#
+ifneq ($(CROSS_COMPILE),)
+ifeq ($(cc-is-clang),true)
+override CC  := $(if $(V),,@)$(CCACHE) $(CC) \
+ -target $(patsubst %-,%,$(CROSS_COMPILE)) \
+ -B$(dir $(shell which $(CROSS_COMPILE)gcc))
+override CXX := $(if $(V),,@)$(CCACHE) $(CXX) \
+ -target $(patsubst %-,%,$(CROSS_COMPILE)) \
+ -B$(dir $(shell which $(CROSS_COMPILE)gcc))
+else
+override CC  := $(if $(V),,@)$(CCACHE) $(CROSS_COMPILE)$(CC)
+override CXX := $(if $(V),,@)$(CCACHE) $(CROSS_COMPILE)$(CXX)
+endif
+else
+override CC  := $(if $(V),,@)$(CCACHE) $(CC)
+override CXX := $(if $(V),,@)$(CCACHE) $(CXX)
+endif
+
+override AR                            := $(if $(V),,@)$(CROSS_COMPILE)ar
+override BISON                 := $(if $(V),,@)$(BISON)
+override BZIP2                 := $(if $(V),,@)bzip2 -9
+override CP                            := $(if $(V),,@)cp
+override ECHO                  := $(if $(V),,@)echo
+override FLEX                  := $(if $(V),,@)flex
+override GAWK                  := $(if $(V),,@)gawk
+override GREP                  := $(if $(V),,@)grep
+override HOST_AR               := $(if $(V),,@)ar
+override HOST_CC               := $(if $(V),,@)$(CCACHE) $(HOST_CC)
+override HOST_CXX              := $(if $(V),,@)$(CCACHE) $(HOST_CXX)
+override HOST_STRIP            := $(if $(V),,@)strip
+override INSTALL               := $(if $(V),,@)install
+override JAR                   := $(if $(V),,@)$(JAR)
+override JAVA                  := $(if $(V),,@)$(JAVA)
+override JAVAC                 := $(if $(V),,@)$(JAVAC)
+override M4                            := $(if $(V),,@)m4
+override MKDIR                 := $(if $(V),,@)mkdir
+override MV                            := $(if $(V),,@)mv
+override OBJCOPY               := $(if $(V),,@)$(CROSS_COMPILE)objcopy
+override PDSASM                        := $(if $(V),,@)$(HOST_OUT)/pdsasm
+override RANLIB                        := $(if $(V),,@)$(CROSS_COMPILE)ranlib
+override RM                            := $(if $(V),,@)rm -f
+override SED                   := $(if $(V),,@)sed
+override STRIP                 := $(if $(V),,@)$(CROSS_COMPILE)strip
+override TAR                   := $(if $(V),,@)tar
+override TOUCH                 := $(if $(V),,@)touch
+override USEASM                        := $(if $(V),,@)$(HOST_OUT)/useasm
+override USELINK               := $(if $(V),,@)$(HOST_OUT)/uselink
+override VHD2INC               := $(if $(V),,@)$(HOST_OUT)/vhd2inc
+override ZIP                   := $(if $(V),,@)$(ZIP)
index 23f9175e71c8b6fe4f35e95e37a9edf2d413ec07..d658679506fbbd4330d20c386ebc851b20fad9ce 100644 (file)
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ### ###########################################################################
 
+ifeq ($(USE_CLANG),1)
+export CC  := $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/bin/clang
+export CXX := $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/bin/clang++
+endif
+
+# FIXME: We need to run this early because config/core.mk hasn't been
+# included yet. Use the same variable names as in that makefile.
+#
+_CC            := $(if $(filter default,$(origin CC)),gcc,$(CC))
+_CLANG := $(shell ../tools/cc-check.sh --clang --cc $(_CC))
+
 SYS_CFLAGS := \
  -fno-short-enums \
  -funwind-tables \
- -D__linux__ \
- -I$(ANDROID_ROOT)/bionic/libc/arch-$(ANDROID_ARCH)/include \
- -I$(ANDROID_ROOT)/bionic/libc/include \
- -I$(ANDROID_ROOT)/bionic/libc/kernel/common \
- -I$(ANDROID_ROOT)/bionic/libc/kernel/arch-$(ANDROID_ARCH) \
- -I$(ANDROID_ROOT)/bionic/libm/include \
- -I$(ANDROID_ROOT)/bionic/libm/include/$(ANDROID_ARCH) \
- -I$(ANDROID_ROOT)/bionic/libthread_db/include \
- -I$(ANDROID_ROOT)/frameworks/base/include \
+ -D__linux__
+SYS_INCLUDES := \
+ -isystem $(ANDROID_ROOT)/bionic/libc/arch-$(ANDROID_ARCH)/include \
+ -isystem $(ANDROID_ROOT)/bionic/libc/include \
+ -isystem $(ANDROID_ROOT)/bionic/libc/kernel/common \
+ -isystem $(ANDROID_ROOT)/bionic/libc/kernel/arch-$(ANDROID_ARCH) \
+ -isystem $(ANDROID_ROOT)/bionic/libm/include \
+ -isystem $(ANDROID_ROOT)/bionic/libm/include/$(ANDROID_ARCH) \
+ -isystem $(ANDROID_ROOT)/bionic/libthread_db/include \
+ -isystem $(ANDROID_ROOT)/frameworks/base/include \
  -isystem $(ANDROID_ROOT)/system/core/include \
- -I$(ANDROID_ROOT)/hardware/libhardware/include \
- -I$(ANDROID_ROOT)/external/openssl/include
+ -isystem $(ANDROID_ROOT)/hardware/libhardware/include \
+ -isystem $(ANDROID_ROOT)/external/openssl/include \
+ -isystem $(ANDROID_ROOT)/system/media/camera/include \
+ -isystem $(ANDROID_ROOT)/hardware/libhardware_legacy/include
+
+# This is comparing PVR_BUILD_DIR to see if it is omap and adding 
+# includes required for it's HWC
+ifeq ($(notdir $(abspath .)),omap_android)
+SYS_INCLUDES += \
+ -isystem $(ANDROID_ROOT)/hardware/ti/omap4xxx/kernel-headers
+endif
+
+ifeq ($(_CLANG),true)
+SYS_INCLUDES := \
+ -nostdinc $(SYS_INCLUDES) \
+ -isystem $(ANDROID_ROOT)/external/clang/lib/include
+endif
 
 SYS_EXE_LDFLAGS := \
  -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker \
  -lc -ldl -lcutils
 
 SYS_LIB_LDFLAGS := $(SYS_EXE_LDFLAGS)
+
+SYS_EXE_LDFLAGS_CXX := -lstdc++
+
+SYS_LIB_LDFLAGS_CXX := $(SYS_EXE_LDFLAGS_CXX)
index 8c3f93743853c7421f578f1d55ed9886bf29fcd2..7718aa9e1d128d47df0bd965d393d7c897a9416a 100644 (file)
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ### ###########################################################################
 
-OPTIM := -Os
+OPTIM := -O2
 
 ANDROID_ARCH := arm
 include ../common/android/arch_common.mk
 
 SYS_CFLAGS += -march=armv7-a
 
+ifneq ($(BUILD),debug)
+SYS_CFLAGS += -mthumb
+endif
+
 SYS_EXE_CRTBEGIN := $(TOOLCHAIN)/lib/crtbegin_dynamic.o
 SYS_EXE_CRTEND := $(TOOLCHAIN)/lib/crtend_android.o
 
+SYS_LIB_CRTBEGIN := $(TOOLCHAIN)/lib/crtbegin_so.o
+SYS_LIB_CRTEND := $(TOOLCHAIN)/lib/crtend_so.o
+
 # Handle the removal of the armelf.x and armelf.xsc linker scripts.
 ifeq ($(strip $(wildcard $(ANDROID_ROOT)/build/core/armelf.x)),)
 # The linker scripts have been removed. We need to use these options
index 320804ec36964f319fa1d725349b7cade34df37c..b5dd7541caf2d3541a04b3793adaac21afa6d448 100644 (file)
@@ -44,4 +44,9 @@ $(eval $(call BothConfigC,ANDROID,))
 
 
 
+$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_ANDROID_SYSTRACE,))
 
+$(eval $(call TunableBothConfigMake,SUPPORT_PVRSRV_ANDROID_SYSTRACE,))
+
+$(eval $(call TunableBothConfigMake,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,))
+$(eval $(call TunableBothConfigC,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,))
index 8a60fb763c3f7a94228dbe63b8c0cf5d634d61ab..3de22059ca8b453122fb5d6a4535d4d5d44ce22b 100644 (file)
@@ -49,6 +49,10 @@ SUPPORT_OPENGLES1_V1_ONLY := 1
 #
 SUPPORT_MEMINFO_IDS := 1
 
+# Enable services ion support by default
+#
+#SUPPORT_ION ?= 1
+
 # Need multi-process support in PDUMP
 #
 SUPPORT_PDUMP_MULTI_PROCESS := 1
@@ -65,9 +69,6 @@ OPK_DEFAULT := libpvrANDROID_WSEGL.so
 # before EGL_image_external was generally available.
 #
 KERNEL_COMPONENTS := srvkm
-ifeq ($(is_at_least_honeycomb),0)
-KERNEL_COMPONENTS += bufferclass_example
-endif
 
 # Kernel modules are always installed here under Android
 #
@@ -100,52 +101,27 @@ SUPPORT_LARGE_GENERAL_HEAP := 1
 PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 5400
 
 ##############################################################################
-# EGL connect/disconnect hooks only available since Froyo
-# Obsolete in future versions
-#
-ifeq ($(is_at_least_froyo),1)
-ifeq ($(is_at_least_icecream_sandwich),0)
-PVR_ANDROID_HAS_CONNECT_DISCONNECT := 1
-endif
-endif
-
-##############################################################################
-# Override surface field name for older versions
+# Framebuffer target extension is used to find configs compatible with
+# the framebuffer (added in JB MR1).
 #
-ifeq ($(is_at_least_gingerbread),0)
-PVR_ANDROID_SURFACE_FIELD_NAME := \"mSurface\"
-endif
-
-##############################################################################
-# Provide ANativeWindow{Buffer,} typedefs for older versions
-#
-ifeq ($(is_at_least_gingerbread),0)
-PVR_ANDROID_NEEDS_ANATIVEWINDOW_TYPEDEF := 1
-endif
-ifeq ($(is_at_least_icecream_sandwich),0)
-PVR_ANDROID_NEEDS_ANATIVEWINDOWBUFFER_TYPEDEF := 1
-endif
+EGL_EXTENSION_ANDROID_FRAMEBUFFER_TARGET := 1
 
 ##############################################################################
 # Handle various platform includes for unittests
 #
-UNITTEST_INCLUDES := eurasiacon/android
-
-ifeq ($(is_at_least_gingerbread),1)
-UNITTEST_INCLUDES += $(ANDROID_ROOT)/frameworks/base/native/include
-endif
+UNITTEST_INCLUDES := \
+ eurasiacon/android \
+ $(ANDROID_ROOT)/frameworks/base/native/include
 
 ifeq ($(is_at_least_jellybean),1)
 UNITTEST_INCLUDES += \
  $(ANDROID_ROOT)/frameworks/native/include \
  $(ANDROID_ROOT)/frameworks/native/opengl/include \
- $(ANDROID_ROOT)/libnativehelper/include
-# FIXME: This is the old location for the JNI header.
-UNITTEST_INCLUDES += $(ANDROID_ROOT)/dalvik/libnativehelper/include
+ $(ANDROID_ROOT)/libnativehelper/include/nativehelper
 else
 UNITTEST_INCLUDES += \
  $(ANDROID_ROOT)/frameworks/base/opengl/include \
- $(ANDROID_ROOT)/dalvik/libnativehelper/include
+ $(ANDROID_ROOT)/dalvik/libnativehelper/include/nativehelper
 endif
 
 # But it doesn't have OpenVG headers
@@ -155,13 +131,8 @@ UNITTEST_INCLUDES += eurasiacon/unittests/include
 ##############################################################################
 # Future versions moved proprietary libraries to a vendor directory
 #
-ifeq ($(is_at_least_gingerbread),1)
 SHLIB_DESTDIR := /system/vendor/lib
 DEMO_DESTDIR := /system/vendor/bin
-else
-SHLIB_DESTDIR := /system/lib
-DEMO_DESTDIR := /system/bin
-endif
 
 # EGL libraries go in a special place
 #
@@ -170,153 +141,154 @@ EGL_DESTDIR := $(SHLIB_DESTDIR)/egl
 ##############################################################################
 # We can support OpenCL in the build since Froyo (stlport was added in 2.2)
 #
-ifeq ($(is_at_least_froyo),1)
-SYS_CXXFLAGS := \
- -fuse-cxa-atexit \
- $(SYS_CFLAGS) \
- -I$(ANDROID_ROOT)/bionic \
- -I$(ANDROID_ROOT)/external/stlport/stlport
-else
-SYS_CXXFLAGS := \
- $(SYS_CFLAGS) \
- -I$(ANDROID_ROOT)/bionic/libstdc++/include
-endif
+SYS_CXXFLAGS := -fuse-cxa-atexit $(SYS_CFLAGS)
+SYS_INCLUDES += \
+ -isystem $(ANDROID_ROOT)/bionic \
+ -isystem $(ANDROID_ROOT)/external/stlport/stlport
 
 ##############################################################################
-# Composition bypass feature, supported since Froyo.
-# In ICS, hardware composer (HWC) should be used instead.
+# Support the OES_EGL_image_external extensions in the client drivers.
 #
-ifeq ($(is_at_least_froyo),1)
-ifeq ($(is_at_least_honeycomb),0)
-PVR_ANDROID_HAS_NATIVE_BUFFER_TRANSFORM := 1
-SUPPORT_ANDROID_COMPOSITION_BYPASS := 1
-endif
-endif
+GLES1_EXTENSION_EGL_IMAGE_EXTERNAL := 1
+GLES2_EXTENSION_EGL_IMAGE_EXTERNAL := 1
 
 ##############################################################################
-# In ICS, we have hardware composer (HWC) support.
+# ICS requires that at least one driver EGLConfig advertises the
+# EGL_RECORDABLE_ANDROID attribute. The platform requires that surfaces
+# rendered with this config can be consumed by an OMX video encoder.
 #
-# SUPPORT_ANDROID_COMPOSER_HAL adds Post2() to the framebuffer HAL interface
-# and is intended for inter-op with external HWC modules. It is always
-# enabled (but we allow it to be compiled out just in case).
+EGL_EXTENSION_ANDROID_RECORDABLE := 1
+
+##############################################################################
+# ICS added the EGL_ANDROID_blob_cache extension. Enable support for this
+# extension in EGL/GLESv2.
 #
-# SUPPORT_ANDROID_COMPOSITION_BYPASS adds a new buffer type (client buffers
-# allocated from the framebuffer pool) which maximizes compatibility with
-# most 3rdparty display controllers. It is orthogonal to HWC support.
+EGL_EXTENSION_ANDROID_BLOB_CACHE := 1
+
+##############################################################################
+# ICS and earlier should rate-limit composition by waiting for 3D renders
+# to complete in the compositor's eglSwapBuffers().
 #
-ifeq ($(is_at_least_honeycomb),1)
-SUPPORT_ANDROID_COMPOSER_HAL := 1
+ifeq ($(is_at_least_jellybean),0)
+PVR_ANDROID_COMPOSITOR_WAIT_FOR_RENDER := 1
 endif
 
 ##############################################################################
-# We have some extra GRALLOC_USAGE bits we need to handle in ICS
+# JB added a new corkscrew API for userland backtracing.
 #
-ifeq ($(is_at_least_honeycomb),1)
-PVR_ANDROID_HAS_GRALLOC_USAGE_EXTERNAL_DISP := 1
-PVR_ANDROID_HAS_GRALLOC_USAGE_PROTECTED := 1
-PVR_ANDROID_HAS_GRALLOC_USAGE_PRIVATE := 1
+ifeq ($(is_at_least_jellybean),1)
+PVR_ANDROID_HAS_CORKSCREW_API := 1
 endif
 
 ##############################################################################
-# Support the new OES_EGL_image_external extension + YV12 buffers
+# JB MR1 makes the framebuffer HAL obsolete.
 #
-ifeq ($(is_at_least_honeycomb),1)
-PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_YV12 := 1
-GLES1_EXTENSION_EGL_IMAGE_EXTERNAL := 1
-GLES2_EXTENSION_EGL_IMAGE_EXTERNAL := 1
+# We also need to support IMPLEMENTATION_DEFINED so gralloc allocates
+# framebuffers and GPU buffers in a 'preferred' format.
+#
+ifeq ($(is_at_least_jellybean_mr1),0)
+SUPPORT_ANDROID_FRAMEBUFFER_HAL := 1
+else
+PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED := 1
 endif
 
 ##############################################################################
-# Gingerbread adds the native window cancelBuffer operation
+# JB MR1 introduces cross-process syncs associated with a fd.
+# This requires a new enough kernel version to have the base/sync driver.
 #
-ifeq ($(is_at_least_gingerbread),1)
-PVR_ANDROID_HAS_CANCELBUFFER := 1
+ifeq ($(is_at_least_jellybean_mr1),1)
+EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC := 0
+PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC := 0
 endif
 
 ##############################################################################
-# Versions prior to ICS have another header we must include
+# JB MR1 introduces new usage bits for the camera HAL and some new formats.
 #
-ifeq ($(is_at_least_icecream_sandwich),0)
-PVR_ANDROID_HAS_ANDROID_NATIVE_BUFFER_H := 1
+ifeq ($(is_at_least_jellybean_mr1),1)
+PVR_ANDROID_HAS_GRALLOC_USAGE_HW_CAMERA := 1
+PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_RAW_SENSOR := 1
+PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_BLOB := 1
 endif
 
 ##############################################################################
-# ICS added dump() hook to gralloc alloc_device_t API
+# JB MR2 adds a new graphics HAL (gralloc) API function, lock_ycbcr(), and
+# a so-called "flexible" YUV format enum.
 #
-ifeq ($(is_at_least_honeycomb),1)
-PVR_ANDROID_HAS_GRALLOC_DUMP := 1
+ifeq ($(is_at_least_jellybean_mr2),1)
+PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_YCbCr_420_888 := 1
+PVR_ANDROID_GRALLOC_HAS_0_2_FEATURES := 1
 endif
 
 ##############################################################################
-# ICS added support for the BGRX pixel format, and allows drivers to advertise
-# configs in this format instead of RGBX.
+# In JB MR2 we can use a native helper library for the unittest wrapper.
+# In earlier versions, we must use a less ideal approach.
 #
-# The DDK provides a private definition of HAL_PIXEL_FORMAT_BGRX_8888. This
-# option exposes it as the native visual for 8888 configs with alpha ignored
+ifeq ($(is_at_least_jellybean_mr2),0)
+PVR_ANDROID_SURFACE_FIELD_NAME := \"mNativeSurface\"
+endif
+
+##############################################################################
+# JB MR2 introduces two new camera HAL formats (Y8, Y16)
 #
-ifeq ($(is_at_least_icecream_sandwich),1)
-SUPPORT_HAL_PIXEL_FORMAT_BGRX := 1
+ifeq ($(is_at_least_jellybean_mr2),1)
+PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_Y8 := 1
+PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_Y16 := 1
 endif
 
 ##############################################################################
-# ICS added the ability for GL clients to pre-rotate their rendering to the
-# orientation desired by the compositor. The SGX DDK can use TRANSFORM_HINT
-# to access this functionality.
+# KK's EGL wrapper remaps EGLConfigs in the BGRA and BGRX formats to RGBA and
+# RGBX respectively, for CpuConsumer compatibility. It does this because the
+# usage bits for the gralloc allocation are not available to EGL.
 #
-# This is required by some HWC implementations that cannot use the display
-# to rotate buffers, otherwise the HWC optimization cannot be used when
-# rotating the device.
+# In this newer platform version, gralloc has been redefined to allow the
+# 'format' parameter to gralloc->alloc() to be ignored for non-USAGE_SW
+# allocations, so long as the bits per channel and sRGB-ness are preserved.
 #
-ifeq ($(is_at_least_icecream_sandwich),1)
-PVR_ANDROID_HAS_WINDOW_TRANSFORM_HINT := 1
+ifeq ($(is_at_least_kitkat),1)
+PVR_ANDROID_REMAP_HW_ONLY_PIXEL_FORMATS := 1
 endif
 
 ##############################################################################
-# ICS requires that at least one driver EGLConfig advertises the
-# EGL_RECORDABLE_ANDROID attribute. The platform requires that surfaces
-# rendered with this config can be consumed by an OMX video encoder.
+# Workaround for texture atlas "double registerBuffer" issue in KK
 #
-ifeq ($(is_at_least_icecream_sandwich),1)
-EGL_EXTENSION_ANDROID_RECORDABLE := 1
+ifeq ($(is_at_least_kitkat),1)
+PVR_ANDROID_DONT_ENFORCE_SINGLE_REGISTER := 1
 endif
 
 ##############################################################################
-# ICS added a new usage bit. USAGE_HW_COMPOSER indicates that a buffer might
-# be used with HWComposer. In practice this is all non-MM buffers.
+# Support newer HWC features in KK
 #
-ifeq ($(is_at_least_icecream_sandwich),1)
-PVR_ANDROID_HAS_GRALLOC_USAGE_HW_COMPOSER := 1
+ifeq ($(is_at_least_kitkat),1)
+PVR_ANDROID_HWC_HAS_1_3_FEATURES := 1
 endif
 
 ##############################################################################
-# ICS added the EGL_ANDROID_blob_cache extension. Enable support for this
-# extension in EGL/GLESv2.
+# KK eliminated egl.cfg. Only create for older versions.
 #
-ifeq ($(is_at_least_icecream_sandwich),1)
-EGL_EXTENSION_ANDROID_BLOB_CACHE := 1
+ifeq ($(is_at_least_kitkat),0)
+PVR_ANDROID_HAS_EGL_CFG := 1
 endif
 
 ##############################################################################
-# ICS MR1 added a new usage bit. USAGE_HW_VIDEO_ENCODER indicates that a
-# buffer might be used with the video encoder.
+# KK has a bug in its browser that we need to work around.
 #
-ifeq ($(is_at_least_icecream_sandwich_mr1),1)
-PVR_ANDROID_HAS_GRALLOC_USAGE_HW_VIDEO_ENCODER := 1
+ifeq ($(is_at_least_kitkat),1)
+PVR_ANDROID_RELAX_GRALLOC_MODULE_MAP_CHECKS := 1
 endif
 
 ##############################################################################
-# ICS and earlier should rate-limit composition by waiting for 3D renders
-# to complete in the compositor's eglSwapBuffers().
+# KK's Camera HAL requires that ACTIVE_ARRAY_SIZE specify xmin/ymin first
 #
-ifeq ($(is_at_least_jellybean),0)
-PVR_ANDROID_COMPOSITOR_WAIT_FOR_RENDER := 1
+ifeq ($(is_at_least_kitkat),1)
+PVR_ANDROID_CAMERA_ACTIVE_ARRAY_SIZE_HAS_XMIN_YMIN := 1
 endif
 
 ##############################################################################
-# JB added a new corkscrew API for userland backtracing.
+# KitKat added a new memory tracking HAL. This enables gralloc support for
+# the GRAPHICS/GL memtrack types.
 #
-ifeq ($(is_at_least_jellybean),1)
-PVR_ANDROID_HAS_CORKSCREW_API := 1
+ifeq ($(is_at_least_kitkat),1)
+SUPPORT_ANDROID_MEMTRACK_HAL := 1
 endif
 
 # Placeholder for future version handling
index 5c8f0002c80f99db50485a599bbe83a52f6f589b..9717ca98afed13d364e5fbc6b16fff173b30f93a 100644 (file)
@@ -40,6 +40,9 @@
 
 TARGET_BUILD_TYPE ?= release
 
+HOST_OS ?= linux
+HOST_ARCH ?= x86
+
 OUT_DIR ?= $(ANDROID_ROOT)/out
 
 ifeq ($(TARGET_BUILD_TYPE),debug)
@@ -48,6 +51,7 @@ else
 TARGET_ROOT := $(OUT_DIR)/target
 endif
 
-TOOLCHAIN ?= $(TARGET_ROOT)/product/$(TARGET_PRODUCT)/obj
+TOOLCHAIN ?= $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj
+TOOLCHAIN2 ?= $(TARGET_ROOT)/product/$(TARGET_DEVICE)/system
 
 LIBGCC := $(shell $(CROSS_COMPILE)gcc -print-libgcc-file-name)
index 698efa3072c49f3f67890bffc0dc532f0537d030..482fd196b05435836a1248f5437c3ccd1983903e 100644 (file)
 # Figure out the version of Android we're building against.
 #
 PLATFORM_VERSION := $(shell \
-       if [ -f $(TARGET_ROOT)/product/$(TARGET_PRODUCT)/system/build.prop ]; then \
-               cat $(TARGET_ROOT)/product/$(TARGET_PRODUCT)/system/build.prop | \
+       if [ -f $(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/build.prop ]; then \
+               cat $(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/build.prop | \
                        grep ^ro.build.version.release | cut -f2 -d'=' | cut -f1 -d'-'; \
        else \
-               echo 4.0.3; \
+               echo 1.6; \
        fi)
 
 define version-starts-with
@@ -59,20 +59,22 @@ endef
 # final release of that version, so we set PLATFORM_VERSION to the
 # corresponding release number.
 #
-ifeq ($(call version-starts-with,Eclair),1)
-PLATFORM_VERSION := 2.0
-else ifeq ($(call version-starts-with,Froyo),1)
-PLATFORM_VERSION := 2.2
-else ifeq ($(call version-starts-with,Gingerbread),1)
-PLATFORM_VERSION := 2.3
-else ifeq ($(call version-starts-with,Honeycomb),1)
-PLATFORM_VERSION := 3.0
-else ifeq ($(call version-starts-with,IceCreamSandwichMR),1)
-PLATFORM_VERSION := 4.0.3
-else ifeq ($(call version-starts-with,IceCreamSandwich),1)
-PLATFORM_VERSION := 4.0
+# NOTE: It's the _string_ ordering that matters here, not the version number
+# ordering. You need to make sure that strings that are sub-strings of other
+# checked strings appear _later_ in this list.
+#
+# e.g. 'JellyBeanMR' starts with 'JellyBean', but it is not JellyBean.
+#
+ifeq ($(call version-starts-with,JellyBeanMR1),1)
+PLATFORM_VERSION := 4.2
+else ifeq ($(call version-starts-with,JellyBeanMR),1)
+PLATFORM_VERSION := 4.3
 else ifeq ($(call version-starts-with,JellyBean),1)
 PLATFORM_VERSION := 4.1
+else ifeq ($(call version-starts-with,KeyLimePie),1)
+PLATFORM_VERSION := 4.4
+else ifeq ($(call version-starts-with,KitKat),1)
+PLATFORM_VERSION := 4.4
 else ifeq ($(shell echo $(PLATFORM_VERSION) | grep -qE "[A-Za-z]+"; echo $$?),0)
 PLATFORM_VERSION := 5.0
 endif
@@ -89,31 +91,22 @@ endif
 
 # Macros to help categorize support for features and API_LEVEL for tests.
 #
-is_at_least_eclair := \
-       $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 2 || \
-                               ( test $(PLATFORM_VERSION_MAJ) -eq 2 && \
-                                 test $(PLATFORM_VERSION_MIN) -ge 0 ) ) && echo 1 || echo 0)
-is_at_least_froyo := \
-       $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 2 || \
-                               ( test $(PLATFORM_VERSION_MAJ) -eq 2 && \
+is_at_least_jellybean := \
+       $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 4 || \
+                               ( test $(PLATFORM_VERSION_MAJ) -eq 4 && \
+                                 test $(PLATFORM_VERSION_MIN) -ge 1 ) ) && echo 1 || echo 0)
+is_at_least_jellybean_mr1 := \
+       $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 4 || \
+                               ( test $(PLATFORM_VERSION_MAJ) -eq 4 && \
                                  test $(PLATFORM_VERSION_MIN) -ge 2 ) ) && echo 1 || echo 0)
-is_at_least_gingerbread := \
-       $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 2 || \
-                               ( test $(PLATFORM_VERSION_MAJ) -eq 2 && \
-                                 test $(PLATFORM_VERSION_MIN) -ge 3 ) ) && echo 1 || echo 0)
-is_at_least_honeycomb := \
-       $(shell test $(PLATFORM_VERSION_MAJ) -ge 3 && echo 1 || echo 0)
-is_at_least_icecream_sandwich := \
-       $(shell test $(PLATFORM_VERSION_MAJ) -ge 4 && echo 1 || echo 0)
-is_at_least_icecream_sandwich_mr1 := \
+is_at_least_jellybean_mr2 := \
        $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 4 || \
                                ( test $(PLATFORM_VERSION_MAJ) -eq 4 && \
-                                       ( test $(PLATFORM_VERSION_MIN) -ge 1 || \
-                                         test $(PLATFORM_VERSION_PATCH) -ge 3 ) ) ) && echo 1 || echo 0)
-is_at_least_jellybean := \
+                                 test $(PLATFORM_VERSION_MIN) -ge 3 ) ) && echo 1 || echo 0)
+is_at_least_kitkat := \
        $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 4 || \
                                ( test $(PLATFORM_VERSION_MAJ) -eq 4 && \
-                                 test $(PLATFORM_VERSION_MIN) -ge 1 ) ) && echo 1 || echo 0)
+                                 test $(PLATFORM_VERSION_MIN) -ge 4 ) ) && echo 1 || echo 0)
 
 # FIXME: Assume "future versions" are >=5.0, but we don't really know
 is_future_version := \
@@ -123,27 +116,17 @@ is_future_version := \
 # against can avoid compatibility theming and affords better integration.
 #
 ifeq ($(is_future_version),1)
+API_LEVEL := 20
+else ifeq ($(is_at_least_kitkat),1)
+API_LEVEL := 19
+else ifeq ($(is_at_least_jellybean_mr2),1)
+API_LEVEL := 18
+else ifeq ($(is_at_least_jellybean_mr1),1)
 API_LEVEL := 17
 else ifeq ($(is_at_least_jellybean),1)
 API_LEVEL := 16
-else ifeq ($(is_at_least_icecream_sandwich),1)
-# MR1        15
-API_LEVEL := 14
-else ifeq ($(is_at_least_honeycomb),1)
-# MR2        13
-# MR1        12
-API_LEVEL := 11
-else ifeq ($(is_at_least_gingerbread),1)
-# MR1        10
-API_LEVEL := 9
-else ifeq ($(is_at_least_froyo),1)
-API_LEVEL := 8
-else ifeq ($(is_at_least_eclair),1)
-# MR1        7
-# 2.0.1      6
-API_LEVEL := 5
 else
-$(error Must build against Android >= 2.0)
+$(error Must build against Android >= 4.1)
 endif
 
 # Each DDK is tested against only a single version of the platform.
@@ -151,6 +134,6 @@ endif
 #
 ifeq ($(is_future_version),1)
 $(info WARNING: Android version is newer than this DDK supports)
-else ifneq ($(is_at_least_icecream_sandwich),1)
+else ifneq ($(is_at_least_jellybean_mr2),1)
 $(info WARNING: Android version is older than this DDK supports)
 endif
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/apis/xorg.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/apis/xorg.mk
new file mode 100644 (file)
index 0000000..c779e9d
--- /dev/null
@@ -0,0 +1,48 @@
+########################################################################### ###
+#@Title         XOrg root makefile
+#@Copyright     Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+#@License       Dual MIT/GPLv2
+# 
+# The contents of this file are subject to the MIT license as set out below.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# Alternatively, the contents of this file may be used under the terms of
+# the GNU General Public License Version 2 ("GPL") in which case the provisions
+# of GPL are applicable instead of those above.
+# 
+# If you wish to allow use of your version of this file only under the terms of
+# GPL, and not to allow others to use your version of this file under the terms
+# of the MIT license, indicate your decision by deleting the provisions above
+# and replace them with the notice and other provisions required by GPL as set
+# out in the file called "GPL-COPYING" included in this distribution. If you do
+# not delete the provisions above, a recipient may use your version of this file
+# under the terms of either the MIT license or GPL.
+# 
+# This License is also included in this distribution in the file called
+# "MIT-COPYING".
+# 
+# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+### ###########################################################################
+
+ifeq ($(filter xorg,$(EXCLUDED_APIS)),)
+ COMPONENTS += xorg pvr_conf pvr_video wsegl_dri2_linux
+ -include ../common/apis/xorg_opengl.mk
+ifeq ($(SUPPORT_PVR_REMOTE),1)
+ COMPONENTS += pvr_input
+endif
+endif
index 5d0289fda5a95ef5513579f70c84c53bf8effe13..4097e7aa682c40bb9242561acf2c964d2f902f76 100644 (file)
@@ -59,5 +59,3 @@ $(eval $(call TunableBothConfigMake,PVR_DRI_DRM_NOT_PCI))
 
 $(eval $(call TunableKernelConfigC,PVR_DRI_DRM_PLATFORM_DEV,))
 
-
-export EXTERNAL_3PDD_TARBALL
index 153159adecc47133f49a4e4e8af3ee593228082c..9a2cdd5016d3ce4127d6f9c59c9ea5311af014d2 100644 (file)
@@ -41,3 +41,4 @@
 $(eval $(call TunableKernelConfigC,PVR_NO_OMAP_TIMER,))
 $(eval $(call TunableKernelConfigC,PVR_OMAPLFB_DONT_USE_FB_PAN_DISPLAY,))
 $(eval $(call TunableKernelConfigC,PVR_OMAPLFB_DRM_FB,))
+$(eval $(call TunableKernelConfigC,VS_PRODUCT_VERSION,))
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/xorg.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/xorg.mk
new file mode 100644 (file)
index 0000000..27c77a3
--- /dev/null
@@ -0,0 +1,48 @@
+########################################################################### ###
+#@Copyright     Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+#@License       Dual MIT/GPLv2
+# 
+# The contents of this file are subject to the MIT license as set out below.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# Alternatively, the contents of this file may be used under the terms of
+# the GNU General Public License Version 2 ("GPL") in which case the provisions
+# of GPL are applicable instead of those above.
+# 
+# If you wish to allow use of your version of this file only under the terms of
+# GPL, and not to allow others to use your version of this file under the terms
+# of the MIT license, indicate your decision by deleting the provisions above
+# and replace them with the notice and other provisions required by GPL as set
+# out in the file called "GPL-COPYING" included in this distribution. If you do
+# not delete the provisions above, a recipient may use your version of this file
+# under the terms of either the MIT license or GPL.
+# 
+# This License is also included in this distribution in the file called
+# "MIT-COPYING".
+# 
+# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+### ###########################################################################
+
+PVR_SECURE_DRM_AUTH_EXPORT := 1
+
+$(eval $(call TunableKernelConfigC,XPROC_WORKAROUND_NUM_SHAREABLES,4095))
+
+ifeq ($(SUPPORT_PVR_REMOTE),1)
+else
+endif
+
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/xorg_test.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/xorg_test.mk
new file mode 100644 (file)
index 0000000..fe10742
--- /dev/null
@@ -0,0 +1,51 @@
+########################################################################### ###
+#@Copyright     Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+#@License       Dual MIT/GPLv2
+# 
+# The contents of this file are subject to the MIT license as set out below.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# Alternatively, the contents of this file may be used under the terms of
+# the GNU General Public License Version 2 ("GPL") in which case the provisions
+# of GPL are applicable instead of those above.
+# 
+# If you wish to allow use of your version of this file only under the terms of
+# GPL, and not to allow others to use your version of this file under the terms
+# of the MIT license, indicate your decision by deleting the provisions above
+# and replace them with the notice and other provisions required by GPL as set
+# out in the file called "GPL-COPYING" included in this distribution. If you do
+# not delete the provisions above, a recipient may use your version of this file
+# under the terms of either the MIT license or GPL.
+# 
+# This License is also included in this distribution in the file called
+# "MIT-COPYING".
+# 
+# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+### ###########################################################################
+
+# FIXME: Will go away when SUPPORT_DRI_DRM is untangled from
+#        the old meaning of SUPPORT_XORG=1.
+
+ifeq ($(filter xorg,$(EXCLUDED_APIS)),)
+ifneq ($(wildcard ../common/apis/xorg.mk),)
+SUPPORT_BUILD_XORG := 1
+ifeq ($(PDUMP),1)
+SUPPORT_PDUMP_MULTI_PROCESS := 1
+endif
+endif
+endif
index 247d1e16625ed3720d5ff4c3ec4febcab2368c6f..3f761cf22731e5f3e09bb5b54b2f5a6ecade019c 100644 (file)
@@ -56,6 +56,7 @@
 #
 define KernelConfigMake
 $$(shell echo "override $(1) := $(2)" >>$(CONFIG_KERNEL_MK).new)
+$(if $(filter config,$(D)),$(info KernelConfigMake $(1) := $(2)        # $(if $($(1)),$(origin $(1)),default)))
 endef
 
 # Write out a GNU make option for both user & kernel
@@ -88,6 +89,7 @@ endef
 #
 define KernelConfigC
 $$(shell echo "#define $(1) $(2)" >>$(CONFIG_KERNEL_H).new)
+$(if $(filter config,$(D)),$(info KernelConfigC    #define $(1) $(2)   /* $(if $($(1)),$(origin $(1)),default) */),)
 endef
 
 # Write out an option for both user & kernel
@@ -176,9 +178,7 @@ $(call directory-must-exist,$(TOP)/eurasiacon/build/linux2/$(PVR_BUILD_DIR))
 # final programs/libraries, and install/rc scripts.
 #
 BUILD  ?= release
-# TI: Added SGX type to binary build location so builds for different GPUs
-#     with the same build directory are put in different places
-OUT            ?= $(TOP)/eurasiacon/binary2_$(SGXCORE)_$(SGX_CORE_REV)_$(PVR_BUILD_DIR)_$(BUILD)
+OUT            ?= $(TOP)/eurasiacon/binary2_$(PVR_BUILD_DIR)_$(BUILD)
 override OUT := $(if $(filter /%,$(OUT)),$(OUT),$(TOP)/$(OUT))
 
 CONFIG_MK                      := $(OUT)/config.mk
@@ -186,6 +186,14 @@ CONFIG_H                   := $(OUT)/config.h
 CONFIG_KERNEL_MK       := $(OUT)/config_kernel.mk
 CONFIG_KERNEL_H                := $(OUT)/config_kernel.h
 
+# Convert commas to spaces in $(D). This is so you can say "make
+# D=config-changes,freeze-config" and have $(filter config-changes,$(D))
+# still work.
+comma := ,
+empty :=
+space := $(empty) $(empty)
+override D := $(subst $(comma),$(space),$(D))
+
 # Create the OUT directory and delete any previous intermediary files
 #
 $(shell mkdir -p $(OUT))
@@ -211,6 +219,19 @@ endif
 # require things like SGXCORE to be set
 ifneq ($(INTERNAL_CLOBBER_ONLY),true)
 
+# These are defined by the core build system, but we might need them
+# earlier to feature-check the compilers
+#
+_CC            := $(if $(filter default,$(origin CC)),gcc,$(CC))
+_CLANG := \
+ $(shell $(TOP)/eurasiacon/build/linux2/tools/cc-check.sh --clang --cc $(_CC))
+ifeq ($(_CLANG),true)
+_CC            := $(_CC) -target $(patsubst %-,%,$(CROSS_COMPILE))
+else
+_CC            := $(CROSS_COMPILE)$(_CC)
+endif
+HOST_CC        ?= gcc
+
 -include ../config/user-defs.mk
 
 # FIXME: Backwards compatibility remaps.
@@ -273,21 +294,10 @@ override SUPPORT_HW_RECOVERY := 0
 override SUPPORT_ACTIVE_POWER_MANAGEMENT := 0
 endif
 
-# We're bumping against USSE limits on older cores because the ukernel
-# is too large when building both SGX_DISABLE_VISTEST_SUPPORT=0 and
-# PVRSRV_USSE_EDM_STATUS_DEBUG=1.
-#
-# Automatically disable vistest support if debugging the ukernel to
-# prevent build failures.
-#
-ifneq ($(filter 520 530 531 535 540,$(SGXCORE)),)
-ifneq ($(SGX_DISABLE_VISTEST_SUPPORT),1)
-SGX_DISABLE_VISTEST_SUPPORT ?= not-overridden
-ifeq ($(SGX_DISABLE_VISTEST_SUPPORT),not-overridden)
-$(warning Setting SGX_DISABLE_VISTEST_SUPPORT=1 because PVRSRV_USSE_EDM_STATUS_DEBUG=1)
-SGX_DISABLE_VISTEST_SUPPORT := 1
-endif
-endif
+ifeq ($(SGX_FEATURE_36BIT_MMU),1)
+override IMG_ADDRSPACE_PHYSADDR_BITS := 64
+else
+override IMG_ADDRSPACE_PHYSADDR_BITS := 32
 endif
 
 ifeq ($(SGXCORE),535)
@@ -327,6 +337,11 @@ endif
 #
 PVRSRV_MODNAME ?= pvrsrvkm
 
+# Normally builds don't touch this, but we use it to influence the components
+# list. Make sure it is defined early enough to make this possible.
+#
+SUPPORT_PVRSRV_DEVICE_CLASS ?= 1
+
 # The user didn't set CROSS_COMPILE. There's probably nothing wrong
 # with that, but we'll let them know anyway.
 #
@@ -345,19 +360,22 @@ $$(warning *** Setting $(1) via $$(origin $(1)) is deprecated)
 $$(error If you are trying to disable a component, use e.g. EXCLUDED_APIS="opengles1 opengl")
 endif
 endef
-$(foreach _o,SYS_CFLAGS SYS_CXXFLAGS SYS_EXE_LDFLAGS SYS_LIB_LDFLAGS SUPPORT_EWS SUPPORT_OPENGLES1 SUPPORT_OPENGLES2 SUPPORT_OPENVG SUPPORT_OPENCL SUPPORT_OPENGL SUPPORT_UNITTESTS SUPPORT_XORG,$(eval $(call sanity-check-support-option-origin,$(_o))))
+$(foreach _o,SYS_CFLAGS SYS_CXXFLAGS SYS_INCLUDES SYS_EXE_LDFLAGS SYS_LIB_LDFLAGS SYS_EXE_LDFLAGS_CXX SYS_LIB_LDFLAGS_CXX SUPPORT_EWS SUPPORT_OPENGLES1 SUPPORT_OPENGLES2 SUPPORT_OPENCL SUPPORT_RSCOMPUTE SUPPORT_OPENGL SUPPORT_UNITTESTS SUPPORT_XORG,$(eval $(call sanity-check-support-option-origin,$(_o))))
 
 # Check for words in EXCLUDED_APIS that aren't understood by the
 # common/apis/*.mk files. This should be kept in sync with all the tests on
 # EXCLUDED_APIS in those files
-_excludable_apis := opencl opengl opengles1 opengles2 openvg ews unittests xorg xorg_unittests scripts
-_unrecognised := $(strip $(filter-out $(_excludable_apis),$(EXCLUDED_APIS)))
+_excludable_apis := rscompute opencl opengl opengles1 opengles2 openvg ews unittests xorg xorg_unittests scripts composerhal camerahal memtrackhal
+_excluded_apis := $(subst $(comma),$(space),$(EXCLUDED_APIS))
+_unrecognised := $(strip $(filter-out $(_excludable_apis),$(_excluded_apis)))
 ifneq ($(_unrecognised),)
 $(warning *** Unrecognised entries in EXCLUDED_APIS: $(_unrecognised))
 $(warning *** EXCLUDED_APIS was set via: $(origin EXCLUDED_APIS))
 $(error Excludable APIs are: $(_excludable_apis))
 endif
 
+override EXCLUDED_APIS := $(filter $(_excludable_apis), $(_excluded_apis))
+
 # Build's selected list of components
 #
 -include components.mk
@@ -380,8 +398,13 @@ ifneq ($(filter pvr2d,$(COMPONENTS)),)
 COMPONENTS += null_pvr2d_remote
 endif
 COMPONENTS += pvrvncsrv
+COMPONENTS += pvrvncinput
 endif
 
+$(if $(filter config,$(D)),$(info Build configuration:))
+
+################################# CONFIG ####################################
+
 # If KERNELDIR is set, write it out to the config.mk, with
 # KERNEL_COMPONENTS and KERNEL_ID
 #
@@ -402,19 +425,54 @@ KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE)
 $(eval $(call TunableBothConfigMake,KERNEL_CROSS_COMPILE,))
 endif
 
-# Check the KERNELDIR has a kernel built and also check that it is
-# not 64-bit, which we do not support.
+# Check the KERNELDIR has a kernel built.
 VMLINUX := $(strip $(wildcard $(KERNELDIR)/vmlinux))
+LINUXCFG := $(strip $(wildcard $(KERNELDIR)/.config))
+
 ifneq ($(VMLINUX),)
-VMLINUX_IS_64BIT := $(shell file $(VMLINUX) | grep -q 64-bit || echo false)
+ifneq ($(shell file $(KERNELDIR)/vmlinux | grep 64-bit >/dev/null && echo 1),$(shell $(_CC) -dM -E - </dev/null | grep __x86_64__ >/dev/null && echo 1))
+$(error Attempting to build 64-bit DDK against 32-bit kernel, or 32-bit DDK against 64-bit kernel. This is not allowed.)
+endif
+VMLINUX_IS_64BIT := $(shell file $(VMLINUX) | grep 64-bit >/dev/null || echo false)
+VMLINUX_HAS_PAE36 := $(shell cat $(LINUXCFG) | grep CONFIG_X86_PAE=y >/dev/null || echo false)
+VMLINUX_HAS_PAE40 := $(shell cat $(LINUXCFG) | grep CONFIG_ARM_LPAE=y >/dev/null || echo false)
+VMLINUX_HAS_DMA32 := $(shell cat $(LINUXCFG) | grep CONFIG_ZONE_DMA32=y >/dev/null || echo false)
+
+# $(error 64BIT=$(VMLINUX_IS_64BIT) PAE36=$(VMLINUX_HAS_PAE36) PAE40=$(VMLINUX_HAS_PAE40) DMA32=$(VMLINUX_HAS_DMA32) MMU36=$(SGX_FEATURE_36BIT_MMU))
+
 ifneq ($(VMLINUX_IS_64BIT),false)
-$(warning $$(KERNELDIR)/vmlinux is 64-bit, which is not supported. Kbuild may fail.)
+$(warning $$(KERNELDIR)/vmlinux: Note: vmlinux is 64-bit, which is supported but currently experimental.)
 endif
 else
 $(warning $$(KERNELDIR)/vmlinux does not exist. Kbuild may fail.)
 endif
 endif
 
+ifneq ($(VMLINUX_HAS_PAE40),false)
+ifeq ($(VMLINUX_HAS_DMA32),false)
+$(warning SGX MMUs are currently supported up to only 36 bits max. Your Kernel is built with 40-bit PAE but does not have CONFIG_ZONE_DMA32.)
+$(warning This means you must ensure the runtime system has <= 4GB of RAM, or there will be BIG problems...)
+endif 
+endif
+
+ifneq ($(SGX_FEATURE_36BIT_MMU),1)
+ifneq ($(VMLINUX_IS_64BIT),false)
+# Kernel is 64-bit
+ifeq ($(VMLINUX_HAS_DMA32),false)
+$(warning SGX is configured with 32-bit MMU. Your Kernel is 64-bit but does not have CONFIG_ZONE_DMA32.)
+$(warning This means you must ensure the runtime system has <= 4GB of RAM, or there will be BIG problems...)
+endif
+else
+ # Kernel is 32-bit
+ifneq ($(VMLINUX_HAS_PAE36),false)
+ifeq ($(VMLINUX_HAS_DMA32),false)
+$(warning SGX is configured with 32-bit MMU. Your Kernel is 32-bit PAE, but does not have CONFIG_ZONE_DMA32. )
+$(warning This means you must ensure the runtime system has <= 4GB of RAM, or there will be BIG problems...)
+endif
+endif
+endif
+endif
+
 
 # Ideally configured by platform Makefiles, as necessary
 #
@@ -438,10 +496,17 @@ $(eval $(call TunableBothConfigC,USE_SGX_CORE_REV_HEAD,))
 $(eval $(call BothConfigC,TRANSFER_QUEUE,))
 $(eval $(call BothConfigC,PVR_SECURE_HANDLES,))
 
+# Support syncing LISR & MISR. This is required for OS's where
+# on SPM platforms the LISR and MISR can run at the same time and
+# thus during powerdown we need to drain all pending LISRs before
+# proceeding to do the actual powerdown
+$(eval $(call KernelConfigC,SUPPORT_LISR_MISR_SYNC))
+
 ifneq ($(DISPLAY_CONTROLLER),)
 $(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER)))
 endif
 
+ifneq ($(strip $(KERNELDIR)),)
 PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 0
 ifneq ($(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES),0)
 PVR_LINUX_MEM_AREA_USE_VMAP ?= 1
@@ -453,6 +518,7 @@ endif
 $(eval $(call KernelConfigC,PVR_LINUX_MEM_AREA_POOL_MAX_PAGES,$(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES)))
 $(eval $(call TunableKernelConfigC,PVR_LINUX_MEM_AREA_USE_VMAP,))
 $(eval $(call TunableKernelConfigC,PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK,))
+endif
 
 
 $(eval $(call BothConfigMake,PVR_SYSTEM,$(PVR_SYSTEM)))
@@ -499,10 +565,10 @@ $(eval $(call TunableBothConfigC,SGX_FEATURE_MP,))
 $(eval $(call TunableBothConfigC,SGX_FEATURE_MP_PLUS,))
 $(eval $(call TunableBothConfigC,FPGA,))
 $(eval $(call TunableBothConfigC,PDUMP,))
+$(eval $(call TunableBothConfigC,MEM_TRACK_INFO_DEBUG,))
 $(eval $(call TunableBothConfigC,NO_HARDWARE,))
 $(eval $(call TunableBothConfigC,PDUMP_DEBUG_OUTFILES,))
 $(eval $(call TunableBothConfigC,PVRSRV_USSE_EDM_STATUS_DEBUG,))
-$(eval $(call TunableBothConfigC,SGX_DISABLE_VISTEST_SUPPORT,))
 $(eval $(call TunableBothConfigC,PVRSRV_RESET_ON_HWTIMEOUT,))
 $(eval $(call TunableBothConfigC,SYS_USING_INTERRUPTS,1))
 $(eval $(call TunableBothConfigC,SUPPORT_EXTERNAL_SYSTEM_CACHE,))
@@ -513,8 +579,13 @@ $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,))
 $(eval $(call TunableBothConfigC,SUPPORT_SECURE_33657_FIX,))
 $(eval $(call TunableBothConfigC,SUPPORT_ION,))
 $(eval $(call TunableBothConfigC,SUPPORT_HWRECOVERY_TRACE_LIMIT,))
+$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_DEVICE_CLASS,))
 $(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER,1))
 $(eval $(call TunableBothConfigC,SUPPORT_NV12_FROM_2_HWADDRS,))
+$(eval $(call TunableBothConfigC,SGX_FEATURE_36BIT_MMU,))
+$(eval $(call TunableBothConfigC,IMG_ADDRSPACE_PHYSADDR_BITS,))
+$(eval $(call TunableBothConfigC,PVRSRV_EXTRA_PB_DEBUG,))
+$(eval $(call TunableBothConfigC,PVRSRV_DEBUG_CCB_MAX,))
 
 $(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_WRITECOMBINE,1))
 $(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_PAT,1))
@@ -537,20 +608,18 @@ $(eval $(call TunableKernelConfigC,PVRSRV_REFCOUNT_DEBUG,))
 $(eval $(call TunableKernelConfigC,PVRSRV_MMU_MAKE_READWRITE_ON_DEMAND,))
 $(eval $(call TunableKernelConfigC,HYBRID_SHARED_PB_SIZE,))
 $(eval $(call TunableKernelConfigC,SUPPORT_LARGE_GENERAL_HEAP,))
+$(eval $(call TunableKernelConfigC,SUPPORT_OLD_ION_API,))
 $(eval $(call TunableKernelConfigC,TTRACE,))
+$(eval $(call TunableKernelConfigC,TTRACE_LARGE_BUFFER,))
+$(eval $(call TunableKernelConfigC,SUPPORT_PDUMP_SYNC_DEBUG,))
+$(eval $(call TunableKernelConfigC,SUPPORT_PER_SYNC_DEBUG,))
+$(eval $(call TunableKernelConfigC,SUPPORT_FORCE_SYNC_DUMP,))
 
-ifeq ($(BUILD),debug)
-$(eval $(call TunableKernelConfigC,CONFIG_PVR_PROC_FS,1))
-else
-$(eval $(call TunableKernelConfigC,CONFIG_PVR_PROC_FS,))
-endif
-
-$(eval $(call TunableKernelConfigC,CONFIG_PVR_PROC_FS_HEAP_ALLOC_DEBUG,))
-
-$(eval $(call TunableBothConfigMake,SUPPORT_ION,))
 
 
 $(eval $(call TunableBothConfigMake,OPTIM,))
+$(eval $(call TunableBothConfigMake,SUPPORT_ION,))
+$(eval $(call TunableBothConfigMake,SUPPORT_PVRSRV_DEVICE_CLASS,))
 
 
 $(eval $(call TunableKernelConfigMake,TTRACE,))
index 621e03e87096ceee69615d79722384ef658020f6..dee740f89d0ee0d3e436298ab29038ea066b7933 100644 (file)
@@ -104,6 +104,10 @@ define cc-is-64bit
 $(call cc-check,$(1),$(OUT),--64)
 endef
 
+define cc-is-clang
+$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),--clang)
+endef
+
 define cc-option
 $(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),$(1))
 endef
@@ -116,6 +120,10 @@ define host-cc-option
 $(call cc-check,$(patsubst @%,%,$(HOST_CC)),$(OUT),$(1))
 endef
 
+define host-cxx-option
+$(call cc-check,$(patsubst @%,%,$(HOST_CXX)),$(OUT),$(1))
+endef
+
 define kernel-cc-option
 $(call cc-check,$(KERNEL_CROSS_COMPILE)gcc,$(OUT),$(1))
 endef
index 9d8894163da39aa82809b42f94c3f2b1c306b00a..2b49f50b608d567c6b9ae9de26646d74b5c12dd3 100644 (file)
@@ -65,7 +65,6 @@ $(OUT)/target/kbuild/%.c: $(TOP)/%.c
        @if [ ! -h $@ ]; then ln -sf $< $@; fi
 
 ccflags-y += -D__linux__ -include $(OUT)/config_kernel.h \
- -DDEBUG_LOG_PATH_TRUNCATE="\"$(OUT)/target/kbuild\"" \
  -I$(OUT)/include \
  -I$(TOP)/include4 \
  -I$(TOP)/services4/include \
@@ -86,7 +85,7 @@ endif
 
 include $(INTERNAL_KBUILD_MAKEFILES)
 
-$(if $(pvrsrvkm_sgx$(SGXCORE)_$(SGX_CORE_REV)-y),,$(error pvrsrvkm_sgx$(SGXCORE)_$(SGX_CORE_REV)-y was empty, which could mean that srvkm is missing from $$(KERNEL_COMPONENTS)))
+$(if $(pvrsrvkm-y),,$(error pvrsrvkm-y was empty, which could mean that srvkm is missing from $$(KERNEL_COMPONENTS)))
 pvrsrvkm-y += $(foreach _m,$(INTERNAL_EXTRA_KBUILD_OBJECTS:.o=),$($(_m)-y))
 
 obj-m += $(INTERNAL_KBUILD_OBJECTS)
index 94e2100945c09e327a63b9f03d0b8ed9d6f989f1..63542f055e28fac69e81584f3f579d339efc442b 100644 (file)
@@ -58,7 +58,7 @@ kbuild: $(TARGET_OUT)/kbuild/Makefile
                INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
                INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
                EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \
-               CROSS_COMPILE="$(KERNEL_CROSS_COMPILE)" \
+               CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
                EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
                V=$(V) W=$(W) \
                TOP=$(TOP)
@@ -72,7 +72,7 @@ kbuild_clean: $(TARGET_OUT)/kbuild/Makefile
                INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
                INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
                EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \
-               CROSS_COMPILE="$(KERNEL_CROSS_COMPILE)" \
+               CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
                EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
                V=$(V) W=$(W) \
                TOP=$(TOP) clean
@@ -84,7 +84,7 @@ kbuild_install: $(TARGET_OUT)/kbuild/Makefile
                INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
                INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
                EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \
-               CROSS_COMPILE="$(KERNEL_CROSS_COMPILE)" \
+               CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
                EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
                INSTALL_MOD_PATH="$(DISCIMAGE)" \
                V=$(V) W=$(W) \
index 869026f3411d9d9e7ff6d4c3e941b583dfe537ce..ef4596ccdacf65374625c49013b989286cc4a578 100644 (file)
@@ -48,20 +48,47 @@ MODULE_HOST_LDFLAGS := $(ALL_HOST_LDFLAGS) $($(THIS_MODULE)_ldflags)
 MODULE_BISON_FLAGS := $(ALL_BISON_FLAGS) $($(THIS_MODULE)_bisonflags)
 MODULE_FLEX_FLAGS := $(ALL_FLEX_FLAGS) $($(THIS_MODULE)_flexflags)
 
-# -L flags for library search dirs
+ifneq ($(BUILD),debug)
+ifeq ($(USE_LTO),1)
+MODULE_HOST_LDFLAGS := \
+ $(sort $(filter-out -W% -D%,$(ALL_HOST_CFLAGS) $(ALL_HOST_CXXFLAGS))) \
+ $(MODULE_HOST_LDFLAGS)
+MODULE_LDFLAGS := \
+ $(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \
+ $(MODULE_LDFLAGS)
+endif
+endif
+
+# Only allow cflags that do not affect code generation. This is to ensure
+# proper binary compatibility when LTO (Link-Time Optimization) is enabled.
+# We make exceptions for -fPIC, -fPIE and -m32 which will all fail linkage
+# in non-LTO mode if incorrectly specified.
+#
+# NOTE: Only used by static_library and objects right now. Other module
+# types should not be affected by complex code generation flags w/ LTO.
+MODULE_ALLOWED_CFLAGS := -W% -D% -std=% -fPIC -fPIE -m32
+
+# -L flags for library search dirs: these are relative to $(TOP), unless
+# they're absolute paths
 MODULE_LIBRARY_DIR_FLAGS := $(foreach _path,$($(THIS_MODULE)_libpaths),$(if $(filter /%,$(_path)),-L$(call relative-to-top,$(_path)),-L$(_path)))
-# -I flags for header search dirs
+# -I flags for header search dirs (same rules as for -L)
 MODULE_INCLUDE_FLAGS := $(foreach _path,$($(THIS_MODULE)_includes),$(if $(filter /%,$(_path)),-I$(call relative-to-top,$(_path)),-I$(_path)))
 
 # Variables used to differentiate between host/target builds
 MODULE_OUT := $(if $(MODULE_HOST_BUILD),$(HOST_OUT),$(TARGET_OUT))
+# For documentation modules, this variable is overridden by the module type
+# makefile to place the intermediates in $(DOCS_OUT)/intermediates.
 MODULE_INTERMEDIATES_DIR := $(if $(MODULE_HOST_BUILD),$(HOST_INTERMEDIATES)/$(THIS_MODULE),$(TARGET_INTERMEDIATES)/$(THIS_MODULE))
 
 .SECONDARY: $(MODULE_INTERMEDIATES_DIR)
 $(MODULE_INTERMEDIATES_DIR):
        $(make-directory)
 
+# These are used for messages and variable names where we need to say "host"
+# or "target" according to the module build type.
 Host_or_target := $(if $(MODULE_HOST_BUILD),Host,Target)
+host_or_target := $(if $(MODULE_HOST_BUILD),host,target)
+HOST_OR_TARGET := $(if $(MODULE_HOST_BUILD),HOST,TARGET)
 
 # These define the rules for finding source files.
 # - If a name begins with a slash, we strip $(TOP) off the front if it begins
@@ -77,18 +104,26 @@ _SOURCES_WITHOUT_SLASH := $(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(find
 _SOURCES_WITH_SLASH := $(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(findstring /,$(_s)),$(_s),)))
 MODULE_SOURCES := $(addprefix $(THIS_DIR)/,$(_SOURCES_WITHOUT_SLASH))
 MODULE_SOURCES += $(call relative-to-top,$(filter /%,$(_SOURCES_WITH_SLASH)))
+
 _RELATIVE_SOURCES_WITH_SLASH := $(filter-out /%,$(_SOURCES_WITH_SLASH))
 _OUTDIR_RELATIVE_SOURCES_WITH_SLASH := $(filter $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH))
 _THISDIR_RELATIVE_SOURCES_WITH_SLASH := $(filter-out $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH))
 MODULE_SOURCES += $(_OUTDIR_RELATIVE_SOURCES_WITH_SLASH)
 MODULE_SOURCES += $(addprefix $(THIS_DIR)/,$(_THISDIR_RELATIVE_SOURCES_WITH_SLASH))
+
+# Generated sources and headers. We use $(MODULE_OUT) because it encourages
+# correctly marking modules which generate headers as host/target.
 MODULE_SOURCES += $(addprefix $(MODULE_OUT)/intermediates/,$($(THIS_MODULE)_gensrc))
 MODULE_GENERATED_HEADERS := $(addprefix $(MODULE_OUT)/intermediates/,$($(THIS_MODULE)_genheaders))
 
-# -l flags for each library
+# -l flags for each library. The rules are:
+#  - for all static libs, use -lfoo
+#  - for all in-tree or external libs, use $(libfoo_ldflags) if that
+#    variable is defined (empty counts as defined). Otherwise use
+#    -lfoo.
 MODULE_LIBRARY_FLAGS := $(addprefix -l, $($(THIS_MODULE)_staticlibs)) $(addprefix -l,$($(THIS_MODULE)_libs)) $(foreach _lib,$($(THIS_MODULE)_extlibs),$(if $(filter undefined,$(origin lib$(_lib)_ldflags)),-l$(_lib),$(lib$(_lib)_ldflags)))
 
-# pkg-config integration; primarily used by X.org
+# pkg-config integration; primarily used by X.Org
 # FIXME: We don't support arbitrary CFLAGS yet (just includes)
 $(foreach _package,$($(THIS_MODULE)_packages),\
  $(eval MODULE_INCLUDE_FLAGS     += `pkg-config --cflags-only-I $(_package)`)\
index 45cdb6f474959304e03041a415c1873ba35a8826..0d9ba11faad35d2e84e39031cf645f92cdf0eeea 100644 (file)
@@ -67,7 +67,7 @@ endif
 export SGXCORE
 export SGX_CORE_REV
 
-SUPPORT_ACTIVE_POWER_MANAGEMENT := 1
+SUPPORT_ACTIVE_POWER_MANAGEMENT := 0
 
 SGX_DYNAMIC_TIMING_INFO := 1
 
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile
new file mode 100644 (file)
index 0000000..35d9fd1
--- /dev/null
@@ -0,0 +1,221 @@
+########################################################################### ###
+#@Title         Root makefile for omap4430 Android.  Builds everything else.
+#@Copyright     Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+#@License       Dual MIT/GPLv2
+# 
+# The contents of this file are subject to the MIT license as set out below.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# Alternatively, the contents of this file may be used under the terms of
+# the GNU General Public License Version 2 ("GPL") in which case the provisions
+# of GPL are applicable instead of those above.
+# 
+# If you wish to allow use of your version of this file only under the terms of
+# GPL, and not to allow others to use your version of this file under the terms
+# of the MIT license, indicate your decision by deleting the provisions above
+# and replace them with the notice and other provisions required by GPL as set
+# out in the file called "GPL-COPYING" included in this distribution. If you do
+# not delete the provisions above, a recipient may use your version of this file
+# under the terms of either the MIT license or GPL.
+# 
+# This License is also included in this distribution in the file called
+# "MIT-COPYING".
+# 
+# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+### ###########################################################################
+
+# If a TARGET_PRODUCT is specified but not a TARGET_DEVICE, try to
+# derive the TARGET_DEVICE from TARGET_PRODUCT.
+#
+ifeq ($(TARGET_DEVICE),)
+override TARGET_DEVICE := \
+ $(patsubst mini_%,%,$(patsubst full_%,%,$(TARGET_PRODUCT)))
+endif
+
+ifeq ($(TARGET_DEVICE),)
+override TARGET_DEVICE := jacinto6evm
+endif
+
+# Customize this build as per the TARGET_DEVICE setting
+#
+ifneq ($(filter blaze blaze_tablet panda tuna maguro toro mysid yakju,$(TARGET_DEVICE)),)
+SGXCORE                                                := 540
+SGX_CORE_REV                           := 120
+HAL_VARIANT                                    := omap4
+endif
+ifneq ($(filter blaze.4470 blaze_tablet.4470,$(TARGET_DEVICE)),)
+SGXCORE                                                := 544
+SGX_CORE_REV                           := 112
+HAL_VARIANT                                    := omap4
+endif
+ifneq ($(filter jacinto6evm omap5sevm panda5,$(TARGET_DEVICE)),)
+SGXCORE                                                := 544
+SGX_CORE_REV                           := 116
+SGX_FEATURE_MP                         := 1
+SGX_FEATURE_SYSTEM_CACHE       := 1
+SGX_FEATURE_MP_CORE_COUNT      := 2
+HAL_VARIANT                                    := jacinto6
+
+# OMAP Product Version
+VS_PRODUCT_VERSION                     := 5
+
+# FIXME: Re-enable this ASAP
+SUPPORT_ACTIVE_POWER_MANAGEMENT := 0
+endif
+
+# Handle any TARGET_DEVICE remapping. Not all DDK TARGET_DEVICEs
+# require new Android TARGET_DEVICE builds.
+#
+ifeq ($(TARGET_DEVICE),blaze.4470)
+override TARGET_DEVICE := blaze
+endif
+ifeq ($(TARGET_DEVICE),blaze_tablet.4470)
+override TARGET_DEVICE := blaze_tablet
+endif
+
+SGX_DYNAMIC_TIMING_INFO := 1
+
+SUPPORT_LINUX_USING_WORKQUEUES := 1
+
+SUPPORT_PVRSRV_ANDROID_SYSTRACE := 0
+
+ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0)
+#DISPLAY_CONTROLLER := omaplfb
+endif
+
+PVR_SYSTEM := omap
+
+KERNEL_CROSS_COMPILE ?= arm-none-linux-gnueabi-
+
+# We have more memory on OMAP platforms, so we can spare to make the
+# pool larger, and have higher resolutions which benefit from it.
+#
+PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 10800
+
+include ../common/android/paths.mk
+include ../common/android/armv7-a.mk
+include ../common/android/features.mk
+
+ifneq ($(strip $(KERNELDIR)),)
+ include ../kernel_version.mk
+ ifeq ($(call kernel-version-at-least,2,6,35),true)
+  PVR_NO_OMAP_TIMER := 1
+ endif
+ ifeq ($(call kernel-version-at-least,2,6,39),true)
+  ifeq ($(LDM_PLATFORM),1)
+   PVR_LDM_PLATFORM_PRE_REGISTERED := 1
+   PVR_LDM_PLATFORM_PRE_REGISTERED_DEV := "\"pvrsrvkm\""
+  endif
+ endif
+ ifeq ($(call kernel-version-at-least,3,0),true)
+  SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 1
+  SYS_OMAP_HAS_DVFS_FRAMEWORK := 1
+ endif
+else
+ $(warning "KERNELDIR is not set, so can't feature check DVFS or dsscomp.")
+ $(warning "Assuming we want DVFS and dsscomp support.")
+ SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 1
+ SYS_OMAP_HAS_DVFS_FRAMEWORK := 1
+endif
+
+ifneq ($(LDM_PLATFORM),1)
+SUPPORT_LINUX_USING_WORKQUEUES := 0
+SUPPORT_LINUX_USING_SHARED_WORKQUEUES := 1
+SUPPORT_ACTIVE_POWER_MANAGEMENT := 0
+ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0)
+DISPLAY_CONTROLLER := pvrlfb
+DISPLAY_CONTROLLER_COMPONENT := linux_framebuffer
+OMAP_NON_FLIP_DISPLAY := 1
+endif
+else # LDM_PLATFORM != 1
+ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0)
+#DISPLAY_CONTROLLER_COMPONENT := dc_omapfb3_linux
+endif
+endif # LDM_PLATFORM != 1
+
+ifeq ($(SUPPORT_DRI_DRM),1)
+ifeq ($(PVR_LDM_PLATFORM_PRE_REGISTERED),1)
+PVR_DRI_DRM_PLATFORM_DEV := 1
+PVR_DRI_DRM_STATIC_BUS_ID := 1
+PVR_DRI_DRM_DEV_BUS_ID := "\"platform:pvrsrvkm"\"
+else
+PVR_DRI_DRM_NOT_PCI := 1
+KERNEL_COMPONENTS += linux_drm
+endif
+ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0)
+EXTRA_PVRSRVKM_COMPONENTS += $(DISPLAY_CONTROLLER_COMPONENT)
+endif
+EXTRA_KBUILD_SOURCE := $(KERNELDIR)
+# FIXME: Only required for comparison with X's KM
+PVR_SECURE_DRM_AUTH_EXPORT := 1
+ifneq ($(OMAP_NON_FLIP_DISPLAY),1)
+PVR_DISPLAY_CONTROLLER_DRM_IOCTL := 1
+endif
+else # SUPPORT_DRI_DRM == 1
+ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0)
+KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER_COMPONENT)
+endif
+endif # SUPPORT_DRI_DRM == 1
+
+SUPPORT_ANDROID_OMAP_NV12 := 1
+
+PVR_ANDROID_USE_WINDOW_TRANSFORM_HINT := 1
+
+PVR_ANDROID_PLATFORM_HAS_LINUX_FBDEV := 1
+
+# Handle Google's OMAP-based products
+#
+ifneq ($(filter tuna maguro toro mysid yakju,$(TARGET_DEVICE)),)
+# These default on in tuna_defconfig
+PVRSRV_USSE_EDM_STATUS_DEBUG ?= 1
+PVRSRV_DUMP_MK_TRACE ?= 1
+# Go back to the old compiler for tuna kernel modules
+KERNEL_CROSS_COMPILE := arm-eabi-
+endif
+
+ifeq ($(NO_HARDWARE),1)
+ifeq ($(SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED),1)
+$(info WARNING: SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED=1 is incompatible with NO_HARDWARE=1)
+$(info WARNING: Setting SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED=0 and switching to dc_nohw)
+override SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 0
+ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0)
+override DISPLAY_CONTROLLER := dcnohw
+KERNEL_COMPONENTS += dc_nohw
+endif
+endif # SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED == 1
+endif # NO_HARDWARE == 1
+
+include ../config/core.mk
+include ../common/android/extra_config.mk
+include ../common/dridrm.mk
+include ../common/opencl.mk
+include ../common/omap4.mk
+
+# Not all OMAP kernels have a compatible DVFS framework
+#
+$(eval $(call TunableKernelConfigC,SYS_OMAP_HAS_DVFS_FRAMEWORK,))
+
+# If set, services allows two flips to enter the processing queue,
+# and does not add read dependencies to the set of buffers last
+# flipped to. This is necessary for DSS composition on OMAP.
+# 
+$(eval $(call TunableKernelConfigC,SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED,))
+
+# On OMAP a TILER-specific NV12 format is supported.
+#
+$(eval $(call TunableUserConfigMake,SUPPORT_ANDROID_OMAP_NV12,))
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_linux/Makefile b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_linux/Makefile
new file mode 100644 (file)
index 0000000..8a65e7d
--- /dev/null
@@ -0,0 +1,261 @@
+########################################################################### ###
+#@Title         Root makefile for OMAP4430 Linux.  Builds everything else.
+#@Copyright     Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+#@License       Dual MIT/GPLv2
+# 
+# The contents of this file are subject to the MIT license as set out below.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# Alternatively, the contents of this file may be used under the terms of
+# the GNU General Public License Version 2 ("GPL") in which case the provisions
+# of GPL are applicable instead of those above.
+# 
+# If you wish to allow use of your version of this file only under the terms of
+# GPL, and not to allow others to use your version of this file under the terms
+# of the MIT license, indicate your decision by deleting the provisions above
+# and replace them with the notice and other provisions required by GPL as set
+# out in the file called "GPL-COPYING" included in this distribution. If you do
+# not delete the provisions above, a recipient may use your version of this file
+# under the terms of either the MIT license or GPL.
+# 
+# This License is also included in this distribution in the file called
+# "MIT-COPYING".
+# 
+# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+### ###########################################################################
+
+# If a product wasn't specified, we're an OMAP4430 blaze.
+#
+TARGET_PRODUCT ?= jacinto6evm
+
+# Customize this build as per the TARGET_PRODUCT setting
+#
+ifneq ($(filter blaze blaze_tablet panda,$(TARGET_PRODUCT)),)
+SGXCORE                                        := 540
+SGX_CORE_REV                           := 120
+endif
+ifneq ($(filter blaze.4470 blaze_tablet.4470,$(TARGET_PRODUCT)),)
+SGXCORE                                        := 544
+SGX_CORE_REV                           := 112
+endif
+ifneq ($(filter omap5sevm panda5,$(TARGET_PRODUCT)),)
+SGXCORE                                        := 544
+SGX_CORE_REV                           := 105
+SGX_FEATURE_MP                         := 1
+SGX_FEATURE_SYSTEM_CACHE               := 1
+SGX_FEATURE_MP_CORE_COUNT              := 2
+PVR_OMAPLFB_DRM_FB                     := 0
+SYS_OMAP_HAS_DVFS_FRAMEWORK            := 1
+
+# OMAP Product Version
+VS_PRODUCT_VERSION                     := 5
+
+# FIXME: Re-enable this ASAP
+SUPPORT_ACTIVE_POWER_MANAGEMENT        := 0
+endif
+ifneq ($(filter jacinto6evm omap5uevm,$(TARGET_PRODUCT)),)
+SGXCORE                                        := 544
+SGX_CORE_REV                           := 116
+SGX_FEATURE_MP                         := 1
+SGX_FEATURE_SYSTEM_CACHE               := 1
+SGX_FEATURE_MP_CORE_COUNT              := 2
+
+SYS_OMAP5_UEVM                         := 1
+
+# OMAP Product Version
+VS_PRODUCT_VERSION                     := 5
+endif
+
+PVR_SYSTEM             := omap
+
+KERNEL_COMPONENTS := srvkm bufferclass_example
+
+SUPPORT_OLD_ION_API := 1
+
+include ../kernel_version.mk
+
+# 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.
+LDM_PLATFORM ?= 1
+
+ifeq ($(LDM_PLATFORM),1)
+SUPPORT_LINUX_USING_WORKQUEUES := 1
+DISPLAY_CONTROLLER_COMPONENT += dc_omapfb3_linux
+DISPLAY_CONTROLLER := omaplfb
+else
+SUPPORT_LINUX_USING_SHARED_WORKQUEUES := 1
+OMAP_NON_FLIP_DISPLAY := 1
+DISPLAY_CONTROLLER_COMPONENT += linux_framebuffer
+DISPLAY_CONTROLLER := pvrlfb
+endif
+
+SYS_CFLAGS := -march=armv7-a
+
+UBUNTU_TOOLCHAIN :=
+ifeq ($(CROSS_COMPILE),)
+UBUNTU_TOOLCHAIN = 1
+endif
+ifeq ($(CROSS_COMPILE),arm-linux-gnueabi-)
+UBUNTU_TOOLCHAIN = 1
+endif
+ifeq ($(CROSS_COMPILE),arm-linux-gnueabihf-)
+UBUNTU_TOOLCHAIN = 1
+endif
+
+ifeq ($(UBUNTU_TOOLCHAIN),)
+OPTIM := -Os
+
+ifneq ($(CROSS_COMPILE),)
+SYS_CFLAGS += -mtls-dialect=arm
+endif
+
+SUPPORT_OMAP4430_NEON ?= 1
+
+ifeq ($(SUPPORT_OMAP4430_NEON),1)
+SYS_CFLAGS += -ftree-vectorize -mfpu=neon -mfloat-abi=softfp
+endif
+endif  # UBUNTU_TOOLCHAIN
+
+LIBGCC := $(shell $(CROSS_COMPILE)gcc -print-libgcc-file-name)
+
+SGX_DYNAMIC_TIMING_INFO := 1
+SYS_CUSTOM_POWERLOCK_WRAP := 1
+
+ifeq ($(OMAP_NON_FLIP_DISPLAY),1)
+OPK_DEFAULT := libpvrPVR2D_BLITWSEGL.so
+else
+OPK_DEFAULT := libpvrPVR2D_FLIPWSEGL.so
+endif
+
+ifeq ($(SYS_OMAP5_UEVM),1)
+PVR_LDM_PLATFORM_PRE_REGISTERED := 1
+PVR_LDM_PLATFORM_PRE_REGISTERED_DEV := "\"omapdrm_pvr\""
+XORG_EXPLICIT_PVR_SERVICES_LOAD := 1
+PVR_OMAPLFB_DRM_FB := 0
+PVR_OMAPLFB_DONT_USE_FB_PAN_DISPLAY := 1
+else
+ifeq ($(call kernel-version-at-least,2,6,35),true)
+# Work around flipping problems seen with the Taal LCDs on Blaze.
+# The work around is safe to use with other types of screen on Blaze
+# (e.g. HDMI) and on other platforms (e.g. Panda board).
+PVR_OMAPLFB_DONT_USE_FB_PAN_DISPLAY := 1
+ifeq ($(LDM_PLATFORM),1)
+PVR_LDM_PLATFORM_PRE_REGISTERED := 1
+ifeq ($(call kernel-version-at-least,2,6,35,7),true)
+# Not all variants of the OMAP4 kernel have a DRM based framebuffer.
+# Note that a non-X.Org version of the driver does not have to be built
+# with DRM support if the kernel has a DRM based framebuffer.
+PVR_OMAPLFB_DRM_FB ?= 1
+ifeq ($(PVR_OMAPLFB_DRM_FB),1)
+PVR_LDM_PLATFORM_PRE_REGISTERED_DEV := "\"pvrsrvkm_pvr\""
+# There is already a "pvrsrvkm" driver (part of the DRM framebuffer code),
+# so use the pre-registered device name instead.
+PVR_LDM_DRIVER_REGISTRATION_NAME := "\"pvrsrvkm_pvr"\"
+# The DRM library will not load the Services module on behalf of the X Server,
+# as a DRM module has already been loaded (the DRM based framebuffer), so
+# load the Services module before starting the X Server.
+XORG_EXPLICIT_PVR_SERVICES_LOAD := 1
+else
+PVR_LDM_PLATFORM_PRE_REGISTERED_DEV := "\"pvrsrvkm\""
+endif
+endif
+endif
+endif
+endif
+
+include ../common/xorg_test.mk
+ifeq ($(SUPPORT_BUILD_XORG),1)
+SUPPORT_DRI_DRM := 1
+endif
+
+ifeq ($(SUPPORT_DRI_DRM),1)
+ifeq ($(SYS_OMAP5_UEVM),1)
+PVR_DRI_DRM_PLATFORM_DEV := 1
+PVR_DRI_DRM_STATIC_BUS_ID := 1
+PVR_DRI_DRM_DEV_BUS_ID := "\"platform:omapdrm_pvr:00"\"
+else
+ifeq ($(call kernel-version-at-least,2,6,35),true)
+PVR_DRI_DRM_PLATFORM_DEV := 1
+PVR_DRI_DRM_STATIC_BUS_ID := 1
+ifeq ($(call kernel-version-at-least,2,6,35,7),true)
+ifeq ($(PVR_OMAPLFB_DRM_FB),1)
+SUPPORT_DRI_DRM_PLUGIN := 1
+endif
+ifeq ($(call kernel-version-at-least,2,6,36),true)
+PVR_DRI_DRM_DEV_BUS_ID := "\"platform:pvrsrvkm"\"
+else
+PVR_DRI_DRM_DEV_BUS_ID := "\"platform:pvrsrvkm:00"\"
+endif  # kernel-version-at-least,2,6,36
+endif  # kernel-version-at-least,2,6,35,7
+else   # kernel-version-at-least,2,6,35
+PVR_DRI_DRM_NOT_PCI := 1
+endif  # kernel-version-at-least,2,6,35
+endif  # ($(SYS_OMAP5_UEVM),1)
+endif  # SUPPORT_DRI_DRM
+
+ifeq ($(SUPPORT_BUILD_XORG),1)
+ifeq ($(call kernel-version-at-least,2,6,35,7),true)
+# A client DRI authorisation failure, whilst switched away from the X Server
+# VT, prevents all other attempts at DRI authorisation, even after
+# switching back to the X server VT, so don't perform a DRM drop master
+# call.
+PVR_XORG_DONT_DROP_MASTER_IN_LEAVE_VT := 1
+endif
+XORG_PVR_VIDEO ?= omap4
+
+OPK_FALLBACK := libpvrPVR2D_DRIWSEGL.so
+
+ifneq ($(OMAP_NON_FLIP_DISPLAY),1)
+PVR_DISPLAY_CONTROLLER_DRM_IOCTL := 1
+endif
+
+else  # xorg isn't excluded
+
+OPK_FALLBACK := libpvrPVR2D_BLITWSEGL.so
+
+endif # xorg isn't excluded
+
+ifeq ($(SUPPORT_DRI_DRM),1)
+ifeq ($(PVR_DRI_DRM_NOT_PCI),1)
+KERNEL_COMPONENTS += linux_drm
+EXTRA_KBUILD_SOURCE := $(KERNELDIR)
+endif
+EXTRA_PVRSRVKM_COMPONENTS += $(DISPLAY_CONTROLLER_COMPONENT)
+else
+KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER_COMPONENT)
+endif
+
+include ../config/core.mk
+include ../common/xorg.mk
+include ../common/dridrm.mk
+include ../common/opencl.mk
+include ../common/omap4.mk
+
+# We only need this for pvr_video's includes, which should
+# really be done differently, as DISPLAY_CONTROLLER_DIR is
+# now obsolete..
+#
+$(eval $(call UserConfigMake,DISPLAY_CONTROLLER_DIR,3rdparty/$(DISPLAY_CONTROLLER_COMPONENT)))
+
+$(eval $(call TunableKernelConfigC,SYS_OMAP5_UEVM,))
+
+$(eval $(call TunableKernelConfigC,SYS_OMAP_HAS_DVFS_FRAMEWORK,))
index 05e4fe3b17121eedbb7dca91a0dae821f6bd82a2..75dcca6b6ae6da6cca8cd416a7ba8f5944ae7d22 100644 (file)
 
 .PHONY: prepare_tree
 
--include eurasiacon/build/linux2/kbuild/external_tarball.mk
-
-# If there's no external tarball, there's nothing to do
-#
 prepare_tree:
 
 INTERNAL_INCLUDED_PREPARE_HEADERS :=
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/sunxi_android/Makefile b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/sunxi_android/Makefile
new file mode 100644 (file)
index 0000000..4473d62
--- /dev/null
@@ -0,0 +1,123 @@
+########################################################################### ###
+#@Copyright     Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+#@License       Dual MIT/GPLv2
+# 
+# The contents of this file are subject to the MIT license as set out below.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# Alternatively, the contents of this file may be used under the terms of
+# the GNU General Public License Version 2 ("GPL") in which case the provisions
+# of GPL are applicable instead of those above.
+# 
+# If you wish to allow use of your version of this file only under the terms of
+# GPL, and not to allow others to use your version of this file under the terms
+# of the MIT license, indicate your decision by deleting the provisions above
+# and replace them with the notice and other provisions required by GPL as set
+# out in the file called "GPL-COPYING" included in this distribution. If you do
+# not delete the provisions above, a recipient may use your version of this file
+# under the terms of either the MIT license or GPL.
+# 
+# This License is also included in this distribution in the file called
+# "MIT-COPYING".
+# 
+# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+### ###########################################################################
+
+# If a TARGET_PRODUCT is specified but not a TARGET_DEVICE, try to
+# derive the TARGET_DEVICE from TARGET_PRODUCT.
+#
+ifeq ($(TARGET_DEVICE),)
+override TARGET_DEVICE := \
+ $(patsubst mini_%,%,$(patsubst full_%,%,$(TARGET_PRODUCT)))
+ifneq ($(filter fiber_w02 v972v1 v972v2 novo9spark,$(TARGET_DEVICE)),)
+override TARGET_DEVICE := sun6i
+endif
+endif
+
+ifeq ($(TARGET_DEVICE),)
+override TARGET_DEVICE := sun6i
+endif
+
+SGXCORE := 544
+SGX_CORE_REV := 115
+SUPPORT_SLC := 1
+SGX_FEATURE_MP := 1
+SGX_FEATURE_MP_CORE_COUNT := 2
+
+PVR_SYSTEM := sunxi
+HAL_VARIANT := sun6i
+DISPLAY_CONTROLLER := dc_sunxi
+
+LDM_PLATFORM := 1
+
+SUPPORT_LINUX_USING_WORKQUEUES := 1
+SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 1
+
+PVR_ANDROID_USE_WINDOW_TRANSFORM_HINT ?= 1
+PVR_ANDROID_PLATFORM_HAS_LINUX_FBDEV := 1
+
+PVRSRV_USSE_EDM_STATUS_DEBUG ?= 1
+PVRSRV_DUMP_MK_TRACE ?= 1
+
+SUPPORT_ANDROID_SUNXI ?= 1
+
+ION_DEFAULT_HEAP_MASK := ION_HEAP_CARVEOUT_MASK
+
+# We have more memory on the sun6i platform, so we can spare to make
+# the pool larger, and have higher resolutions which benefit from it.
+#
+PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 10800
+
+SGX_DYNAMIC_TIMING_INFO := 1
+
+SUPPORT_PVRSRV_ANDROID_SYSTRACE := 1
+
+KERNEL_CROSS_COMPILE ?= arm-eabi-
+
+include ../common/android/paths.mk
+include ../common/android/armv7-a.mk
+include ../common/android/features.mk
+
+ifneq ($(strip $(KERNELDIR)),)
+ include ../kernel_version.mk
+ KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER)
+endif
+
+ifeq ($(NO_HARDWARE),1)
+ifeq ($(SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED),1)
+$(info WARNING: SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED=1 is incompatible with NO_HARDWARE=1)
+$(info WARNING: Setting SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED=0 and switching to dc_nohw)
+override SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 0
+override DISPLAY_CONTROLLER := dcnohw
+KERNEL_COMPONENTS += dc_nohw
+endif
+endif
+
+include ../config/core.mk
+include ../common/android/extra_config.mk
+include ../common/opencl.mk
+
+# If set, services allows two flips to enter the processing queue,
+# and does not add read dependencies to the set of buffers last
+# flipped to.
+# 
+$(eval $(call TunableKernelConfigC,SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED,))
+
+# On sun6i, A31-specific NV12 and NV21 formats are supported.
+#
+$(eval $(call TunableUserConfigMake,SUPPORT_ANDROID_SUNXI,))
index 6cef8faf44396f136f9f9e5dd69e7824a600d5ba..9566c737e7c3b335aa87160649cd6522ba4b4b87 100755 (executable)
@@ -44,24 +44,36 @@ LANG=C
 export LANG
 
 usage() {
-       echo "usage: $0 [--64] --cc CC --out OUT [cflag]"
+       echo "usage: $0 [--64] [--clang] --cc CC [--out OUT] [cflag]"
        exit 1
 }
 
-# NOTE: The program passed to the compiler is deliberately incorrect
-# (`return;' should be `return 0;') but we do this to emit a warning.
-#
-# Emitting a warning is necessary to get GCC to print out additional
-# warnings about any unsupported -Wno options, so we can handle these
-# as unsupported by the build.
-#
+check_clang() {
+       $CC -dM -E - </dev/null | grep __clang__ >/dev/null 2>&1
+       if [ "$?" = "0" ]; then
+               # Clang must be passed a program with a main() that returns 0.
+               # It will produce an error if main() is improperly specified.
+               IS_CLANG=1
+               TEST_PROGRAM="int main(void){return 0;}"
+       else
+               # If we're not clang, assume we're GCC. GCC needs to be passed
+               # a program with a faulty return in main() so that another
+               # warning (unrelated to the flag being tested) is emitted.
+               # This will cause GCC to warn about the unsupported warning flag.
+               IS_CLANG=0
+               TEST_PROGRAM="int main(void){return;}"
+       fi
+}
+
 do_cc() {
-       echo "int main(void){return;}" | $CC -W -Wall $3 -xc -c - -o $1 >$2 2>&1
+       echo "$TEST_PROGRAM" | $CC -W -Wall $3 -xc -c - -o $1 >$2 2>&1
 }
 
 while [ 1 ]; do
        if [ "$1" = "--64" ]; then
-               BIT_CHECK=1
+               [ -z $CLANG ] && BIT_CHECK=1
+       elif [ "$1" = "--clang" ]; then
+               [ -z $BIT_CHECK ] && CLANG=1
        elif [ "$1" = "--cc" ]; then
                [ "x$2" = "x" ] && usage
                CC="$2" && shift
@@ -77,20 +89,28 @@ while [ 1 ]; do
 done
 
 [ "x$CC" = "x" ] && usage
-[ "x$OUT" = "x" ] && usage
+[ "x$CLANG" = "x" -a "x$OUT" = "x" ] && usage
 ccof=$OUT/cc-sanity-check
 log=${ccof}.log
 
+check_clang
+
 if [ "x$BIT_CHECK" = "x1" ]; then
        do_cc $ccof $log ""
        file $ccof | grep 64-bit >/dev/null 2>&1
        [ "$?" = "0" ] && echo true || echo false
+elif [ "x$CLANG" = "x1" ]; then
+       [ "x$IS_CLANG" = "x1" ] && echo true || echo false
 else
        [ "x$1" = "x" ] && usage
        do_cc $ccof $log $1
        if [ "$?" = "0" ]; then
                # compile passed, but was the warning unrecognized?
-               grep -q "^cc1: warning: unrecognized command line option \"$1\"" $log
+               if [ "x$IS_CLANG" = "x1" ]; then
+                       grep "^warning: unknown warning option '$1'" $log >/dev/null 2>&1
+               else
+                       grep "^cc1: warning: unrecognized command line option \"$1\"" $log >/dev/null 2>&1
+               fi
                [ "$?" = "1" ] && echo $1
        fi
 fi
index 26b1198bf93325b56b3fae2c89e0f56b19849ddf..81ecb9e4bc49b44e521373d6e442f2e98abfb61d 100644 (file)
@@ -60,6 +60,7 @@ $(call directory-must-exist,$(TOP))
 RELATIVE_OUT           := $(patsubst $(TOP)/%,%,$(OUT))
 HOST_OUT                       := $(RELATIVE_OUT)/host
 TARGET_OUT                     := $(RELATIVE_OUT)/target
+DOCS_OUT                       := $(RELATIVE_OUT)/docs
 CONFIG_MK                      := $(RELATIVE_OUT)/config.mk
 CONFIG_H                       := $(RELATIVE_OUT)/config.h
 CONFIG_KERNEL_MK       := $(RELATIVE_OUT)/config_kernel.mk
@@ -82,9 +83,9 @@ ifneq ($(INTERNAL_CLOBBER_ONLY),true)
 #
 $(shell mkdir -p $(OUT))
 
-# Provide rules to create $(HOST_OUT) and $(TARGET_OUT)
-.SECONDARY: $(HOST_OUT) $(TARGET_OUT)
-$(HOST_OUT) $(TARGET_OUT):
+# Provide rules to create the directories for binaries and documentation
+.SECONDARY: $(HOST_OUT) $(TARGET_OUT) $(DOCS_OUT)
+$(HOST_OUT) $(TARGET_OUT) $(DOCS_OUT):
        $(make-directory)
 
 # If these generated files differ from any pre-existing ones,
@@ -201,13 +202,15 @@ endif
 # You can say 'make all_modules' to attempt to make everything, or 'make
 # components' to only make the things which are listed (in the per-build
 # makefiles) as components of the build.
-.PHONY: all_modules components
+.PHONY: all_modules all_docs components
 all_modules: $(ALL_MODULES)
+all_docs: ;
 components: $(COMPONENTS)
+docs: $(DOCS)
 
 # Cleaning
 .PHONY: clean clobber
-clean: MODULE_DIRS_TO_REMOVE := $(OUT)/host/intermediates $(OUT)/target/intermediates $(OUT)/target/kbuild
+clean: MODULE_DIRS_TO_REMOVE := $(HOST_OUT) $(TARGET_OUT) $(DOCS_OUT)
 clean:
        $(clean-dirs)
 clobber: MODULE_DIRS_TO_REMOVE := $(OUT)
@@ -217,10 +220,14 @@ clobber:
 # Saying 'make clean-MODULE' removes the intermediates for MODULE.
 # clobber-MODULE deletes the output files as well
 clean-%:
-       $(if $(V),,@echo "  RM      " $(call relative-to-top,$(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$*))
-       $(RM) -rf $(OUT)/host/intermediates/$*/* $(OUT)/target/intermediates/$*/*
+       $(if $(V),,@echo "  RM      " $(call relative-to-top,$(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$* $(OUT)/docs/intermediates/$*))
+       $(RM) -rf $(OUT)/host/intermediates/$*/* $(OUT)/target/intermediates/$*/* $(OUT)/docs/intermediates/$*/*
 clobber-%:
        $(if $(V),,@echo "  RM      " $(call relative-to-top,$(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$* $(INTERNAL_TARGETS_FOR_$*)))
-       $(RM) -rf $(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$* $(INTERNAL_TARGETS_FOR_$*)
+       $(RM) -rf $(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$* $(OUT)/docs/intermediates/$* $(INTERNAL_TARGETS_FOR_$*)
 
 include $(MAKE_TOP)/bits.mk
+
+# D=nobuild stops the build before any recipes are run. This line should
+# come at the end of this makefile.
+$(if $(filter nobuild,$(D)),$(error D=nobuild given),)
index 375ed99510c352c52dc5704693ad6f5478197aca..bf0c36074396b12b2d889f79d70038a6151d6161 100644 (file)
@@ -147,6 +147,71 @@ typedef char                               TCHAR, *PTCHAR, *PTSTR;
 #define IMG_UNDEF      (~0UL)
 #endif
 
+/*
+   Do the right thing when using printf to output cpu addresses,
+   depending on architecture.
+ */
+#if defined (_WIN64)
+    #define UINTPTR_FMT "%016llX"
+#else
+    #if defined (__x86_64__)
+        #define UINTPTR_FMT "%016lX"
+    #else
+        #define UINTPTR_FMT "%08lX"
+    #endif
+#endif
+
+/* 
+   Similarly for DEV_ and SYS_ PHYSADDRs, but this is dependent on 32/36-bit MMU
+   capability, in addition to host architecture.
+ */
+#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
+       #if defined(IMG_UINT32_IS_ULONG)
+               #define CPUPADDR_FMT "%08lX"
+               #define DEVPADDR_FMT "%08lX"
+               #define SYSPADDR_FMT "%08lX"
+       #else
+               #define CPUPADDR_FMT "%08X"
+               #define DEVPADDR_FMT "%08X"
+               #define SYSPADDR_FMT "%08X"
+       #endif
+#else
+       #if defined(__x86_64__)
+                       #define CPUPADDR_FMT "%016lX"
+                       #define DEVPADDR_FMT "%016lX"
+                       #define SYSPADDR_FMT "%016lX"
+       #else
+
+                       #define CPUPADDR_FMT "%016llX"
+                       #define DEVPADDR_FMT "%016llX"
+                       #define SYSPADDR_FMT "%016llX"
+       #endif
+#endif
+
+/*
+   Define a printf format macro for the length property of the format-specifier
+   for size_t, that allows avoidance of C99 dependency on compilers that don't
+   support this, while still ensuring that whatever the size of size_t (eg 32, 
+   64 bit Linux builds, or Win32/64 builds), a size_t (or IMG_SIZE_T) can be
+   passed to printf-type functions without a cast.
+*/
+#if defined LINUX
+       /* Use C99 format specifier where possible */
+       #define SIZE_T_FMT_LEN "z"
+#elif  defined _WIN64
+       #define SIZE_T_FMT_LEN "I"
+#else
+       #define SIZE_T_FMT_LEN "l" /* May need to be updated as required, for other OSs */
+#endif
+
+
+#if defined (__x86_64__)
+       #define IMG_UINT64_FMT "l"
+#else
+       #define IMG_UINT64_FMT "ll" /* May need to be updated as required, for other OSs */
+#endif
+
+
 #endif /* #if !defined (__IMG_DEFS_H__) */
 /*****************************************************************************
  End of file (IMG_DEFS.H)
index 7f5137e798acd7e2d09c458b04a7ddfe4d2714ed..3e04e4a8e213f599ed7e32b16fcaa06578e7f6ab 100644 (file)
@@ -75,17 +75,16 @@ typedef signed long         IMG_INT32,      *IMG_PINT32;
 #endif
 
 #if  defined(USE_CODE)
-
-typedef unsigned __int64       IMG_UINT64, *IMG_PUINT64;
-typedef __int64                                IMG_INT64,  *IMG_PINT64;
-
+       typedef unsigned __int64        IMG_UINT64, *IMG_PUINT64;
+       typedef __int64                         IMG_INT64,  *IMG_PINT64;
+#elif defined(LINUX) && defined (__x86_64)
+       typedef unsigned long           IMG_UINT64,     *IMG_PUINT64;
+       typedef long                            IMG_INT64,      *IMG_PINT64;
+#elif defined(LINUX) || defined(__METAG) || defined (__QNXNTO__)
+       typedef unsigned long long              IMG_UINT64,     *IMG_PUINT64;
+       typedef long long                               IMG_INT64,      *IMG_PINT64;
 #else
- #if defined(LINUX) || defined(__METAG) || defined (__QNXNTO__)
-               typedef unsigned long long              IMG_UINT64,     *IMG_PUINT64;
-               typedef long long                               IMG_INT64,      *IMG_PINT64;
-       #else
-               #error("define an OS")
-       #endif
+       #error("define an OS")
 #endif
 
 #if !(defined(LINUX) && defined (__KERNEL__))
@@ -107,11 +106,19 @@ typedef IMG_INT32       IMG_RESULT;
 
 #if defined(_WIN64)
        typedef unsigned __int64        IMG_UINTPTR_T;
+    typedef signed   __int64    IMG_INTPTR_T;
        typedef signed __int64          IMG_PTRDIFF_T;
        typedef IMG_UINT64                      IMG_SIZE_T;
 #else
-       typedef unsigned int    IMG_UINTPTR_T;
-       typedef IMG_UINT32              IMG_SIZE_T;
+    #if defined (__x86_64__)
+       typedef IMG_UINT64              IMG_SIZE_T;
+        typedef unsigned long   IMG_UINTPTR_T;
+        typedef signed long     IMG_INTPTR_T;
+    #else
+       typedef IMG_UINT32              IMG_SIZE_T;
+        typedef unsigned long  IMG_UINTPTR_T;
+        typedef signed long     IMG_INTPTR_T;
+    #endif
 #endif
 
 typedef IMG_PVOID       IMG_HANDLE;
@@ -121,9 +128,9 @@ typedef void**          IMG_HVOID,  * IMG_PHVOID;
 #define IMG_NULL        0 
 
 /* services/stream ID */
-typedef IMG_UINT32      IMG_SID;
+typedef IMG_UINTPTR_T      IMG_SID;
 
-typedef IMG_UINT32      IMG_EVENTSID;
+typedef IMG_UINTPTR_T      IMG_EVENTSID;
 
 /*
  * Address types.
@@ -184,7 +191,12 @@ typedef IMG_UINT32 IMG_DEVMEM_SIZE_T;
 typedef struct _IMG_CPU_PHYADDR
 {
        /* variable sized type (32,64) */
-       IMG_UINTPTR_T uiAddr;
+#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
+       /* variable sized type (32,64) */
+       IMG_UINT32 uiAddr;
+#else
+       IMG_UINT64 uiAddr;
+#endif
 } IMG_CPU_PHYADDR;
 
 /* device physical address */
@@ -192,10 +204,9 @@ typedef struct _IMG_DEV_PHYADDR
 {
 #if IMG_ADDRSPACE_PHYSADDR_BITS == 32
        /* variable sized type (32,64) */
-       IMG_UINTPTR_T uiAddr;
-#else
        IMG_UINT32 uiAddr;
-       IMG_UINT32 uiHighAddr;
+#else
+       IMG_UINT64 uiAddr;
 #endif
 } IMG_DEV_PHYADDR;
 
@@ -203,7 +214,12 @@ typedef struct _IMG_DEV_PHYADDR
 typedef struct _IMG_SYS_PHYADDR
 {
        /* variable sized type (32,64) */
-       IMG_UINTPTR_T uiAddr;
+#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
+       /* variable sized type (32,64) */
+       IMG_UINT32 uiAddr;
+#else
+       IMG_UINT64 uiAddr;
+#endif
 } IMG_SYS_PHYADDR;
 
 #include "img_defs.h"
index 112e9ee58de8a160cfa5b2b056cc31ac02f38ecb..989488bea29805f68c6eee66ac2e4a0c59e92e2b 100644 (file)
@@ -115,7 +115,7 @@ typedef enum _PDUMP_POLL_OPERATOR
        PDUMP_POLL_OPERATOR_LESSEQUAL = 2,
        PDUMP_POLL_OPERATOR_GREATER = 3,
        PDUMP_POLL_OPERATOR_GREATEREQUAL = 4,
-       PDUMP_POLL_OPERATOR_NOTEQUAL = 5,
+       PDUMP_POLL_OPERATOR_NOTEQUAL = 5
 } PDUMP_POLL_OPERATOR;
 
 
index 7e056665f2e09877267fd08e63e3e60ffef0c13e..fcc0275978891c6134b64cfc6be0e15292c2975c 100644 (file)
@@ -53,16 +53,17 @@ extern "C" {
 #define PVR_MAX_DEBUG_MESSAGE_LEN      (512)
 
 /* These are privately used by pvr_debug, use the PVR_DBG_ defines instead */
-#define DBGPRIV_FATAL                  0x01UL
-#define DBGPRIV_ERROR                  0x02UL
-#define DBGPRIV_WARNING                        0x04UL
-#define DBGPRIV_MESSAGE                        0x08UL
-#define DBGPRIV_VERBOSE                        0x10UL
-#define DBGPRIV_CALLTRACE              0x20UL
-#define DBGPRIV_ALLOC                  0x40UL
-#define DBGPRIV_DBGDRV_MESSAGE 0x80UL
-
-#define DBGPRIV_DBGLEVEL_COUNT 8
+#define DBGPRIV_FATAL                  0x001UL
+#define DBGPRIV_ERROR                  0x002UL
+#define DBGPRIV_WARNING                        0x004UL
+#define DBGPRIV_MESSAGE                        0x008UL
+#define DBGPRIV_VERBOSE                        0x010UL
+#define DBGPRIV_CALLTRACE              0x020UL
+#define DBGPRIV_ALLOC                  0x040UL
+#define DBGPRIV_BUFFERED               0x080UL
+#define DBGPRIV_DBGDRV_MESSAGE 0x100UL
+
+#define DBGPRIV_DBGLEVEL_COUNT 9
 
 #if !defined(PVRSRV_NEED_PVR_ASSERT) && defined(DEBUG)
 #define PVRSRV_NEED_PVR_ASSERT
@@ -143,27 +144,29 @@ IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugAssertFail(const IMG_CHAR *pszFile,
        #define PVR_DBG_VERBOSE         DBGPRIV_VERBOSE
        #define PVR_DBG_CALLTRACE       DBGPRIV_CALLTRACE
        #define PVR_DBG_ALLOC           DBGPRIV_ALLOC
+       #define PVR_DBG_BUFFERED        DBGPRIV_BUFFERED
        #define PVR_DBGDRIV_MESSAGE     DBGPRIV_DBGDRV_MESSAGE
 
        /* These levels are always on with PVRSRV_NEED_PVR_DPF */
-       #define __PVR_DPF_0x01UL(x...) PVRSRVDebugPrintf(DBGPRIV_FATAL, x)
-       #define __PVR_DPF_0x02UL(x...) PVRSRVDebugPrintf(DBGPRIV_ERROR, x)
+       #define __PVR_DPF_0x001UL(x...) PVRSRVDebugPrintf(DBGPRIV_FATAL, x)
+       #define __PVR_DPF_0x002UL(x...) PVRSRVDebugPrintf(DBGPRIV_ERROR, x)
+       #define __PVR_DPF_0x080UL(x...) PVRSRVDebugPrintf(DBGPRIV_BUFFERED, x)
 
        /* Some are compiled out completely in release builds */
 #if defined(DEBUG)
-       #define __PVR_DPF_0x04UL(x...) PVRSRVDebugPrintf(DBGPRIV_WARNING, x)
-       #define __PVR_DPF_0x08UL(x...) PVRSRVDebugPrintf(DBGPRIV_MESSAGE, x)
-       #define __PVR_DPF_0x10UL(x...) PVRSRVDebugPrintf(DBGPRIV_VERBOSE, x)
-       #define __PVR_DPF_0x20UL(x...) PVRSRVDebugPrintf(DBGPRIV_CALLTRACE, x)
-       #define __PVR_DPF_0x40UL(x...) PVRSRVDebugPrintf(DBGPRIV_ALLOC, x)
-       #define __PVR_DPF_0x80UL(x...) PVRSRVDebugPrintf(DBGPRIV_DBGDRV_MESSAGE, x)
+       #define __PVR_DPF_0x004UL(x...) PVRSRVDebugPrintf(DBGPRIV_WARNING, x)
+       #define __PVR_DPF_0x008UL(x...) PVRSRVDebugPrintf(DBGPRIV_MESSAGE, x)
+       #define __PVR_DPF_0x010UL(x...) PVRSRVDebugPrintf(DBGPRIV_VERBOSE, x)
+       #define __PVR_DPF_0x020UL(x...) PVRSRVDebugPrintf(DBGPRIV_CALLTRACE, x)
+       #define __PVR_DPF_0x040UL(x...) PVRSRVDebugPrintf(DBGPRIV_ALLOC, x)
+       #define __PVR_DPF_0x100UL(x...) PVRSRVDebugPrintf(DBGPRIV_DBGDRV_MESSAGE, x)
 #else
-       #define __PVR_DPF_0x04UL(x...)
-       #define __PVR_DPF_0x08UL(x...)
-       #define __PVR_DPF_0x10UL(x...)
-       #define __PVR_DPF_0x20UL(x...)
-       #define __PVR_DPF_0x40UL(x...)
-       #define __PVR_DPF_0x80UL(x...)
+       #define __PVR_DPF_0x004UL(x...)
+       #define __PVR_DPF_0x008UL(x...)
+       #define __PVR_DPF_0x010UL(x...)
+       #define __PVR_DPF_0x020UL(x...)
+       #define __PVR_DPF_0x040UL(x...)
+       #define __PVR_DPF_0x100UL(x...)
 #endif
 
        /* Translate the different log levels to separate macros
@@ -188,6 +191,7 @@ IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugAssertFail(const IMG_CHAR *pszFile,
        #define PVR_DBG_VERBOSE         DBGPRIV_VERBOSE,__FILE__, __LINE__
        #define PVR_DBG_CALLTRACE       DBGPRIV_CALLTRACE,__FILE__, __LINE__
        #define PVR_DBG_ALLOC           DBGPRIV_ALLOC,__FILE__, __LINE__
+       #define PVR_DBG_BUFFERED        DBGPRIV_BUFFERED,__FILE__, __LINE__
        #define PVR_DBGDRIV_MESSAGE     DBGPRIV_DBGDRV_MESSAGE, "", 0
 
        #define PVR_DPF(X)                      PVRSRVDebugPrintf X
@@ -200,13 +204,14 @@ IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel,
                                                                                                   const IMG_CHAR *pszFormat,
                                                                                                   ...) IMG_FORMAT_PRINTF(4, 5);
 
+IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintfDumpCCB(void);
+
 #else  /* defined(PVRSRV_NEED_PVR_DPF) */
 
        #define PVR_DPF(X)
 
 #endif /* defined(PVRSRV_NEED_PVR_DPF) */
 
-
 /* PVR_TRACE() handling */
 
 #if defined(PVRSRV_NEED_PVR_TRACE)
diff --git a/jacinto6/sgx_src/eurasia_km/include4/pvr_sync_user.h b/jacinto6/sgx_src/eurasia_km/include4/pvr_sync_user.h
new file mode 100644 (file)
index 0000000..0220098
--- /dev/null
@@ -0,0 +1,125 @@
+/*************************************************************************/ /*!
+@File           pvr_sync_user.h
+@Title          Userspace definitions to use the kernel sync driver
+@Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+@Description    Version numbers and strings for PVR Consumer services
+                               components.
+@License        Dual MIT/GPLv2
+
+The contents of this file are subject to the MIT license as set out below.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+Alternatively, the contents of this file may be used under the terms of
+the GNU General Public License Version 2 ("GPL") in which case the provisions
+of GPL are applicable instead of those above.
+
+If you wish to allow use of your version of this file only under the terms of
+GPL, and not to allow others to use your version of this file under the terms
+of the MIT license, indicate your decision by deleting the provisions above
+and replace them with the notice and other provisions required by GPL as set
+out in the file called "GPL-COPYING" included in this distribution. If you do
+not delete the provisions above, a recipient may use your version of this file
+under the terms of either the MIT license or GPL.
+
+This License is also included in this distribution in the file called
+"MIT-COPYING".
+
+EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/ /**************************************************************************/
+
+#ifndef _PVR_SYNC_USER_H_
+#define _PVR_SYNC_USER_H_
+
+#include <linux/ioctl.h>
+
+#ifdef __KERNEL__
+#include "sgxapi_km.h"
+#else
+#include "sgxapi.h"
+#endif
+
+#include "servicesext.h" // PVRSRV_SYNC_DATA
+#include "img_types.h"
+
+/* This matches the sw_sync create ioctl data */
+struct PVR_SYNC_CREATE_IOCTL_DATA
+{
+       /* Input: Name of this sync pt. Passed to base sync driver. */
+       char    name[32];
+
+       /* Input: An fd from a previous call to ALLOC ioctl. Cannot be <0. */
+       __s32   allocdSyncInfo;
+
+       /* Output: An fd returned from the CREATE ioctl. */
+       __s32   fence;
+};
+
+struct PVR_SYNC_ALLOC_IOCTL_DATA
+{
+       /* Output: An fd returned from the ALLOC ioctl */
+       __s32 fence;
+
+       /* Output: IMG_TRUE if the timeline looked idle at alloc time */
+       __u32 bTimelineIdle;
+};
+
+#define PVR_SYNC_DEBUG_MAX_POINTS 3
+
+typedef struct
+{
+       /* Output: A globally unique stamp/ID for the sync */
+       IMG_UINT64 ui64Stamp;
+
+       /* Output: The WOP snapshot for the sync */
+       IMG_UINT32 ui32WriteOpsPendingSnapshot;
+}
+PVR_SYNC_DEBUG;
+
+struct PVR_SYNC_DEBUG_IOCTL_DATA
+{
+       /* Input: Fence to acquire debug for */
+       int                                             iFenceFD;
+
+       /* Output: Number of points merged into this fence */
+       IMG_UINT32                              ui32NumPoints;
+
+       struct
+       {
+               /* Output: Metadata for sync point */
+               PVR_SYNC_DEBUG          sMetaData;
+
+               /* Output: 'Live' sync information. */
+               PVRSRV_SYNC_DATA        sSyncData;
+       }
+       sSync[PVR_SYNC_DEBUG_MAX_POINTS];
+};
+
+#define PVR_SYNC_IOC_MAGIC     'W'
+
+#define PVR_SYNC_IOC_CREATE_FENCE \
+       _IOWR(PVR_SYNC_IOC_MAGIC, 0, struct PVR_SYNC_CREATE_IOCTL_DATA)
+
+#define PVR_SYNC_IOC_DEBUG_FENCE \
+       _IOWR(PVR_SYNC_IOC_MAGIC, 1, struct PVR_SYNC_DEBUG_IOCTL_DATA)
+
+#define PVR_SYNC_IOC_ALLOC_FENCE \
+       _IOWR(PVR_SYNC_IOC_MAGIC, 2, struct PVR_SYNC_ALLOC_IOCTL_DATA)
+
+#define PVRSYNC_MODNAME "pvr_sync"
+
+#endif /* _PVR_SYNC_USER_H_ */
index 933ed799c7c1924b34c10f8b5d470064c0e299a8..ed4025f88b220483c6366aa9f838f441a9d8f362 100644 (file)
@@ -49,21 +49,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define PVR_STR2(X) PVR_STR(X)
 
 #define PVRVERSION_MAJ               1
-#define PVRVERSION_MIN               9
-#define PVRVERSION_BRANCH            19
+#define PVRVERSION_MIN               12
 
 #define PVRVERSION_FAMILY           "sgxddk"
-#define PVRVERSION_BRANCHNAME       "1.9"
-#define PVRVERSION_BUILD             2291151
-#define PVRVERSION_BSCONTROL        "SGX_DDK_Android"
+#define PVRVERSION_BRANCHNAME       "1.12"
+#define PVRVERSION_BUILD             2701748
+#define PVRVERSION_BSCONTROL        "SGX_DDK"
 
-#define PVRVERSION_STRING           "SGX_DDK_Android sgxddk 19 1.9@" PVR_STR2(PVRVERSION_BUILD)
-#define PVRVERSION_STRING_SHORT     "1.9@" PVR_STR2(PVRVERSION_BUILD)
+#define PVRVERSION_STRING           "SGX_DDK sgxddk 1.12@" PVR_STR2(PVRVERSION_BUILD)
+#define PVRVERSION_STRING_SHORT     "1.12@" PVR_STR2(PVRVERSION_BUILD) ""
 
 #define COPYRIGHT_TXT               "Copyright (c) Imagination Technologies Ltd. All Rights Reserved."
 
-#define PVRVERSION_BUILD_HI          229
-#define PVRVERSION_BUILD_LO          1151
+#define PVRVERSION_BUILD_HI          270
+#define PVRVERSION_BUILD_LO          1748
 #define PVRVERSION_STRING_NUMERIC    PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO)
 
 #endif /* _PVRVERSION_H_ */
index bfa7fb0509734e439b84aacda848f91e7c9d82a2..8828fa98cf32b7eef8ab6498d20c21530fb008de 100644 (file)
@@ -105,17 +105,12 @@ extern "C" {
 #define PVRSRV_HAP_SINGLE_PROCESS                      (1U<<16)
 #define PVRSRV_HAP_MULTI_PROCESS                       (1U<<17)
 #define PVRSRV_HAP_FROM_EXISTING_PROCESS       (1U<<18)
-#define PVRSRV_HAP_NO_CPU_VIRTUAL           (1U<<19)
-#define PVRSRV_MAP_GC_MMU                   (1UL<<20)
-#define PVRSRV_HAP_GPU_PAGEABLE             (1U<<21)
-#define PVRSRV_HAP_NO_GPU_VIRTUAL_ON_ALLOC  (1U<<22)
+#define PVRSRV_HAP_NO_CPU_VIRTUAL                      (1U<<19)
 #define PVRSRV_HAP_MAPTYPE_MASK                                (PVRSRV_HAP_KERNEL_ONLY \
                                             |PVRSRV_HAP_SINGLE_PROCESS \
                                             |PVRSRV_HAP_MULTI_PROCESS \
-                                            |PVRSRV_HAP_FROM_EXISTING_PROCESS)
-#define PVRSRV_HAP_MAPPING_CTRL_MASK           (PVRSRV_HAP_NO_CPU_VIRTUAL\
-                                            |PVRSRV_HAP_GPU_PAGEABLE \
-                                            |PVRSRV_HAP_NO_GPU_VIRTUAL_ON_ALLOC)
+                                            |PVRSRV_HAP_FROM_EXISTING_PROCESS \
+                                            |PVRSRV_HAP_NO_CPU_VIRTUAL)
 
 /*
        Allows user allocations to override heap attributes
@@ -137,7 +132,7 @@ extern "C" {
  */
 #define PVRSRV_MAP_NOUSERVIRTUAL            (1UL<<27)
 #define PVRSRV_MEM_XPROC                                       (1U<<28)
-#define PVRSRV_MEM_ION                                         (1U<<29)
+/* Bit 29 is unused */
 #define PVRSRV_MEM_ALLOCATENONCACHEDMEM                (1UL<<30)
 
 /*
@@ -199,9 +194,11 @@ extern "C" {
        Flags for PVRSRVModifySyncOps
        WO_INC          -       Used to increment "WriteOpsPending/complete of sync info"
        RO_INC          -       Used to increment "ReadOpsPending/complete of sync info"
+       RO2_INC         -       Used to increment "ReadOps2Pending/complete of sync info"
 */
-#define PVRSRV_MODIFYSYNCOPS_FLAGS_WO_INC                      0x00000001
-#define PVRSRV_MODIFYSYNCOPS_FLAGS_RO_INC                      0x00000002
+#define PVRSRV_MODIFYSYNCOPS_FLAGS_WO_INC                              (1U<<0)
+#define PVRSRV_MODIFYSYNCOPS_FLAGS_RO_INC                              (1U<<1)
+#define PVRSRV_MODIFYSYNCOPS_FLAGS_RO2_INC                             (1U<<2)
 
 /*
        Flags for Services connection.
@@ -215,19 +212,6 @@ extern "C" {
 */
 #define PVRSRV_PDUMP_FLAGS_CONTINUOUS          0x1
 
-/* Number of MM planes supported for the meminfo */
-#define PVRSRV_MAX_NUMBER_OF_MM_BUFFER_PLANES  3
-
-/* Invalid Device Virtual Address Value */
-#define PVRSRV_BAD_DEVICE_ADDRESS           0
-
-/* Maximum array size of the meminfo's when invoking
- * PVRSRVMultiManageDevMem() in shared mode */
-#define PVRSRV_MULTI_MANAGE_DEV_MEM_MAX_SIZE 128
-
-/* Maximum array size of the meminfo's when invoking
- * PVRSRVMultiManageDevMem() in direct (copy) mode */
-#define PVRSRV_MULTI_MANAGE_DEV_MEM_MAX_DIRECT_SIZE 8
 
 /******************************************************************************
  * Enums
@@ -294,6 +278,7 @@ typedef enum
        IMG_OPENCL                      = 0x0000000F,
 #endif
 
+       IMG_MODULE_UNDEF        = 0xFFFFFFFF
 } IMG_MODULE_ID;
 
 
@@ -372,11 +357,7 @@ typedef struct _PVRSRV_CONNECTION_
 typedef struct _PVRSRV_DEV_DATA_
 {
        IMG_CONST PVRSRV_CONNECTION      *psConnection; /*!< Services connection info */
-#if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID                 hDevCookie;                             /*!< Dev cookie */
-#else
        IMG_HANDLE                      hDevCookie;                             /*!< Dev cookie */
-#endif
 
 } PVRSRV_DEV_DATA;
 
@@ -445,16 +426,6 @@ typedef struct _PVRSRV_CLIENT_MEM_INFO_
        /* ptr to associated client sync info - NULL if no sync */
        struct _PVRSRV_CLIENT_SYNC_INFO_        *psClientSyncInfo;
 
-#if defined (SUPPORT_SID_INTERFACE)
-       /* handle to client mapping data (OS specific) */
-       IMG_SID                                                         hMappingInfo;
-
-       /* handle to kernel mem info */
-       IMG_SID                                                         hKernelMemInfo;
-
-       /* resman handle for UM mapping clean-up */
-       IMG_SID                                                         hResItem;
-#else
        /* handle to client mapping data (OS specific) */
        IMG_HANDLE                                                      hMappingInfo;
 
@@ -463,7 +434,6 @@ typedef struct _PVRSRV_CLIENT_MEM_INFO_
 
        /* resman handle for UM mapping clean-up */
        IMG_HANDLE                                                      hResItem;
-#endif
 
 #if defined(SUPPORT_MEMINFO_IDS)
        #if !defined(USE_CODE)
@@ -474,9 +444,9 @@ typedef struct _PVRSRV_CLIENT_MEM_INFO_
        IMG_UINT32                                                      dummy2;
        #endif /* !defined(USE_CODE) */
 #endif /* defined(SUPPORT_MEMINFO_IDS) */
-
-    /* Sub-system ID that allocated the buffer */
-       IMG_UINT64              uiSubSystem;
+#if defined(SUPPORT_ION)
+       IMG_SIZE_T                                                      uiIonBufferSize;
+#endif /* defined(SUPPORT_ION) */
 
        /*
                ptr to next mem info
@@ -484,68 +454,8 @@ typedef struct _PVRSRV_CLIENT_MEM_INFO_
        */
        struct _PVRSRV_CLIENT_MEM_INFO_         *psNext;
 
-    /* Device Virtual Addresses for the YUV MM planes */
-       IMG_UINT32 planeOffsets[PVRSRV_MAX_NUMBER_OF_MM_BUFFER_PLANES];
 } PVRSRV_CLIENT_MEM_INFO, *PPVRSRV_CLIENT_MEM_INFO;
 
-/*
-       Multiple buffer device virtual mapping management
-*/
-typedef enum
-{
-       PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_INVALID = 0,
-       /* We may not have GPU virtual address */
-       PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_MAP = 1,
-       PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_LOCK_MAP,
-       PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_SWAP_MAP_FROM_PREV,
-       /* We have GPU virtual address */
-       PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_UNMAP,
-       PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_UNLOCK_MAP,
-       PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_SWAP_MAP_TO_NEXT,
-       PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_LAST = (IMG_UINT32)-1
-} PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_TYPE;
-
-typedef struct _PVRSRV_MANAGE_DEV_MEM_REQUEST
-{
-       PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_TYPE eReqType;
-       IMG_UINT32                              ui32FieldSize;  /* valid if equal to the size of the structure */
-       IMG_HANDLE                              hKernelMemInfo;
-       IMG_HANDLE                              hKernelSyncInfo;
-       PVRSRV_CLIENT_MEM_INFO  *psClientMemInfo;       /* Client side reference */
-       IMG_UINT32                              ui32Hints;
-       IMG_UINT32                              ui32Attribs;
-       IMG_SIZE_T                              uSize;
-       IMG_SIZE_T                              uAlignment;
-       IMG_PVOID                               pvLinAddr;                      /* CPU Virtual Address */
-       IMG_UINT32                              ui32CpuMapRefCount;
-       IMG_DEV_VIRTADDR                sDevVAddr;                      /* Device Virtual Address */
-       IMG_UINT32                              ui32GpuMapRefCount;
-       IMG_UINT32                      ui32TransferFromToReqSlotIndx;  /* Transfer GPU virtual mapping from index */
-       IMG_UINT64                              uiSubSystem;
-       PVRSRV_ERROR                    eError;
-}PVRSRV_MANAGE_DEV_MEM_REQUEST;
-
-typedef PVRSRV_MANAGE_DEV_MEM_REQUEST PVRSRV_MANAGE_DEV_MEM_RESPONSE;
-
-typedef struct _PVRSRV_MULTI_MANAGE_DEV_MEM_REQUESTS
-{
-       IMG_UINT32              ui32BridgeFlags; /* Must be first member of structure */
-       #if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID                 hDevCookie;
-       /* handle to kernel shared memory */
-       IMG_SID                 hKernelMemInfo;
-       #else
-       IMG_HANDLE              hDevCookie;
-       /* handle to kernel shared memory*/
-       IMG_HANDLE              hKernelMemInfo;
-       #endif
-       PVRSRV_CLIENT_MEM_INFO *psSharedMemClientMemInfo;       /* NULL if direct (not through shared) */
-       IMG_UINT32              ui32MaxNumberOfRequests;                        /* Must be <= PVRSRV_MULTI_MANAGE_DEV_MEM_MAX_DIRECT_SIZE for direct */
-       IMG_UINT32              ui32NumberOfValidRequests;                      /* Must be <= ui32MaxNumberOfRequests */
-       IMG_UINT32              ui32CtrlFlags;
-       IMG_UINT32              ui32StatusFlags;
-       PVRSRV_MANAGE_DEV_MEM_REQUEST sMemRequests[PVRSRV_MULTI_MANAGE_DEV_MEM_MAX_DIRECT_SIZE]; /* Memory Requests Array */
-}PVRSRV_MULTI_MANAGE_DEV_MEM_REQUESTS;
 
 /*!
  ******************************************************************************
@@ -555,11 +465,7 @@ typedef struct _PVRSRV_MULTI_MANAGE_DEV_MEM_REQUESTS
 typedef struct _PVRSRV_HEAP_INFO_
 {
        IMG_UINT32                      ui32HeapID;
-#if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID                         hDevMemHeap;
-#else
        IMG_HANDLE                      hDevMemHeap;
-#endif
        IMG_DEV_VIRTADDR        sDevVAddrBase;
        IMG_UINT32                      ui32HeapByteSize;
        IMG_UINT32                      ui32Attribs;
@@ -577,11 +483,7 @@ typedef struct _PVRSRV_EVENTOBJECT_
        /* globally unique name of the event object */
        IMG_CHAR        szName[EVENTOBJNAME_MAXLENGTH];
        /* kernel specific handle for the event object */
-#if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID     hOSEventKM;
-#else
        IMG_HANDLE      hOSEventKM;
-#endif
 
 } PVRSRV_EVENTOBJECT;
 
@@ -607,13 +509,8 @@ typedef struct _PVRSRV_MISC_INFO_
        /*!< SOC Timer register */
        IMG_VOID        *pvSOCTimerRegisterKM;
        IMG_VOID        *pvSOCTimerRegisterUM;
-#if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID         hSOCTimerRegisterOSMemHandle;
-       IMG_SID         hSOCTimerRegisterMappingInfo;
-#else
        IMG_HANDLE      hSOCTimerRegisterOSMemHandle;
        IMG_HANDLE      hSOCTimerRegisterMappingInfo;
-#endif
 
        /*!< SOC Clock Gating registers */
        IMG_VOID        *pvSOCClockGateRegs;
@@ -625,11 +522,7 @@ typedef struct _PVRSRV_MISC_INFO_
 
        /* global event object */
        PVRSRV_EVENTOBJECT      sGlobalEventObject;//FIXME: should be private to services
-#if defined (SUPPORT_SID_INTERFACE)
-       IMG_EVENTSID            hOSGlobalEvent;
-#else
        IMG_HANDLE                      hOSGlobalEvent;
-#endif
 
        /* Note: add misc. items as required */
        IMG_UINT32      aui32DDKVersion[4];
@@ -647,7 +540,6 @@ typedef struct _PVRSRV_MISC_INFO_
                 * directly in the srvclient PVRSRVGetMiscInfo code, and then convert it
                 * to a kernel meminfo if required. Try to not waste space.
                 */
-#if !defined (SUPPORT_SID_INTERFACE)
                union
                {
                        /*!< Input client meminfo (UM side) */
@@ -656,7 +548,6 @@ typedef struct _PVRSRV_MISC_INFO_
                        /*!< Output kernel meminfo (Bridge+KM side) */
                        struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo;
                } u;
-#endif
 
                /*!< Offset in MemInfo to start cache op */
                IMG_VOID *pvBaseVAddr;
@@ -672,7 +563,6 @@ typedef struct _PVRSRV_MISC_INFO_
                 * directly in the srvclient PVRSRVGetMiscInfo code, and then convert it
                 * to a kernel meminfo if required. Try to not waste space.
                 */
-#if !defined(SUPPORT_SID_INTERFACE)
                union
                {
                        /*!< Input client meminfo (UM side) */
@@ -681,7 +571,6 @@ typedef struct _PVRSRV_MISC_INFO_
                        /*!< Output kernel meminfo (Bridge+KM side) */
                        struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo;
                } u;
-#endif
 
                /*!< Resulting refcount */
                IMG_UINT32 ui32RefCount;
@@ -701,11 +590,7 @@ typedef struct _PVRSRV_SYNC_TOKEN_
           The fields are hidden in sPrivate in order to reinforce this. */
        struct
        {
-#if defined (SUPPORT_SID_INTERFACE)
-               IMG_SID    hKernelSyncInfo;
-#else
                IMG_HANDLE hKernelSyncInfo;
-#endif
                IMG_UINT32 ui32ReadOpsPendingSnapshot;
                IMG_UINT32 ui32WriteOpsPendingSnapshot;
                IMG_UINT32 ui32ReadOps2PendingSnapshot;
@@ -718,7 +603,7 @@ typedef struct _PVRSRV_SYNC_TOKEN_
  *****************************************************************************/
 typedef enum _PVRSRV_CLIENT_EVENT_
 {
-       PVRSRV_CLIENT_EVENT_HWTIMEOUT = 0,
+       PVRSRV_CLIENT_EVENT_HWTIMEOUT = 0
 } PVRSRV_CLIENT_EVENT;
 
 typedef IMG_VOID (*PFN_QUEUE_COMMAND_COMPLETE)(IMG_HANDLE hCallbackData);
@@ -754,11 +639,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVReleaseMiscInfo (IMG_CONST PVRSRV_CONNECTION *ps
 
 IMG_IMPORT
 PVRSRV_ERROR PVRSRVPollForValue ( const PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                       IMG_SID    hOSEvent,
-#else
                                                        IMG_HANDLE hOSEvent,
-#endif
                                                        volatile IMG_UINT32 *pui32LinMemAddr,
                                                        IMG_UINT32 ui32Value,
                                                        IMG_UINT32 ui32Mask,
@@ -768,30 +649,18 @@ PVRSRV_ERROR PVRSRVPollForValue ( const PVRSRV_CONNECTION *psConnection,
 /* memory APIs */
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDeviceMemContext(IMG_CONST PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                       IMG_SID    *phDevMemContext,
-#else
                                                                                        IMG_HANDLE *phDevMemContext,
-#endif
                                                                                        IMG_UINT32 *pui32SharedHeapCount,
                                                                                        PVRSRV_HEAP_INFO *psHeapInfo);
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyDeviceMemContext(IMG_CONST PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                       IMG_SID                         hDevMemContext
-#else
                                                                                        IMG_HANDLE                      hDevMemContext
-#endif
        );
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                       IMG_SID     hDevMemContext,
-#else
                                                                                        IMG_HANDLE hDevMemContext,
-#endif
                                                                                        IMG_UINT32 *pui32SharedHeapCount,
                                                                                        PVRSRV_HEAP_INFO *psHeapInfo);
 
@@ -808,11 +677,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfo(IMG_CONST PVRSRV_DEV_DATA *
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMem2(IMG_CONST PVRSRV_DEV_DATA      *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                       IMG_SID                 hDevMemHeap,
-#else
                                                                        IMG_HANDLE              hDevMemHeap,
-#endif
                                                                        IMG_UINT32              ui32Attribs,
                                                                        IMG_SIZE_T              ui32Size,
                                                                        IMG_SIZE_T              ui32Alignment,
@@ -822,11 +687,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMem2(IMG_CONST PVRSRV_DEV_DATA  *psDev
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMem(IMG_CONST PVRSRV_DEV_DATA       *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                       IMG_SID                 hDevMemHeap,
-#else
                                                                        IMG_HANDLE              hDevMemHeap,
-#endif
                                                                        IMG_UINT32              ui32Attribs,
                                                                        IMG_SIZE_T              ui32Size,
                                                                        IMG_SIZE_T              ui32Alignment,
@@ -836,38 +697,15 @@ IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeDeviceMem(IMG_CONST PVRSRV_DEV_DATA        *psDevData,
                                                                PVRSRV_CLIENT_MEM_INFO          *psMemInfo);
 
-IMG_IMPORT
-PVRSRV_ERROR IMG_CALLCONV PVRSRVMultiManageDevMem(IMG_CONST PVRSRV_DEV_DATA    *psDevData,
-               IMG_UINT32 ui32ControlFlags, PVRSRV_MULTI_MANAGE_DEV_MEM_REQUESTS * psMultiMemDevRequest,
-               IMG_UINT32 *ui32StatusFlags, IMG_UINT32 *ui32IndexError);
-
-IMG_IMPORT
-PVRSRV_ERROR IMG_CALLCONV PVRSRVManageDevMem(IMG_CONST PVRSRV_DEV_DATA *psDevData,
-               PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_TYPE eReq, PVRSRV_CLIENT_MEM_INFO *psMemInfo,
-               IMG_UINT32 *ui32StatusFlags);
-
-IMG_IMPORT
-PVRSRV_ERROR IMG_CALLCONV PVRSRVManageDevMemSwapGpuVirtAddr(IMG_CONST PVRSRV_DEV_DATA  *psDevData,
-               PVRSRV_CLIENT_MEM_INFO *psMemInfoSourceArray, PVRSRV_CLIENT_MEM_INFO *psMemInfoTargetArray,
-               IMG_UINT32 ui32NumBuff, IMG_UINT32 *ui32StatusFlags);
-
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVExportDeviceMem(IMG_CONST PVRSRV_DEV_DATA      *psDevData,
                                                                                                PVRSRV_CLIENT_MEM_INFO          *psMemInfo,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                               IMG_SID                                         *phMemInfo
-#else
                                                                                                IMG_HANDLE                                      *phMemInfo
-#endif
        );
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVReserveDeviceVirtualMem(IMG_CONST PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                       IMG_SID                         hDevMemHeap,
-#else
                                                                                        IMG_HANDLE                      hDevMemHeap,
-#endif
                                                                                        IMG_DEV_VIRTADDR        *psDevVAddr,
                                                                                        IMG_SIZE_T                      ui32Size,
                                                                                        IMG_SIZE_T                      ui32Alignment,
@@ -878,13 +716,8 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeDeviceVirtualMem(IMG_CONST PVRSRV_DEV_DATA *
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                       IMG_SID hKernelMemInfo,
-                                                                       IMG_SID hDstDevMemHeap,
-#else
                                                                        IMG_HANDLE hKernelMemInfo,
                                                                        IMG_HANDLE hDstDevMemHeap,
-#endif
                                                                        PVRSRV_CLIENT_MEM_INFO **ppsDstMemInfo);
 
 IMG_IMPORT
@@ -903,11 +736,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapExtMemory (IMG_CONST PVRSRV_DEV_DATA *psDev
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemory(IMG_CONST PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                               IMG_SID                                 hDevMemContext,
-#else
                                                                                                IMG_HANDLE                              hDevMemContext,
-#endif
                                                                                                IMG_SIZE_T                              ui32ByteSize,
                                                                                                IMG_SIZE_T                              ui32PageOffset,
                                                                                                IMG_BOOL                                bPhysContig,
@@ -923,20 +752,6 @@ PVRSRV_ERROR PVRSRVChangeDeviceMemoryAttributes(IMG_CONST PVRSRV_DEV_DATA                  *psD
                                                                                                PVRSRV_CLIENT_MEM_INFO  *psClientMemInfo,
                                                                                                IMG_UINT32                              ui32Attribs);
 
-IMG_IMPORT
-PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                               IMG_SID hDevMemContext,
-                                                                               IMG_SID hDeviceClassBuffer,
-#else
-                                                                               IMG_HANDLE hDevMemContext,
-                                                                               IMG_HANDLE hDeviceClassBuffer,
-#endif
-                                                                               PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
-IMG_IMPORT
-PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapDeviceClassMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
-                                                                               PVRSRV_CLIENT_MEM_INFO *psMemInfo);
-
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVMapPhysToUserSpace(IMG_CONST PVRSRV_DEV_DATA *psDevData,
                                                                          IMG_SYS_PHYADDR sSysPhysAddr,
@@ -952,9 +767,6 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapPhysToUserSpace(IMG_CONST PVRSRV_DEV_DATA *
 
 #if defined(LINUX)
 IMG_IMPORT
-PVRSRV_ERROR IMG_CALLCONV PVRSRVCloseExportedDeviceMemHanle(const PVRSRV_DEV_DATA      *psDevData,
-                                                                                                IMG_INT i32Fd);
-IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVExportDeviceMem2(IMG_CONST PVRSRV_DEV_DATA     *psDevData,
                                                                                                 PVRSRV_CLIENT_MEM_INFO         *psMemInfo,
                                                                                                 IMG_INT                                        *iFd);
@@ -962,23 +774,18 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVExportDeviceMem2(IMG_CONST PVRSRV_DEV_DATA        *psDe
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemory2(IMG_CONST PVRSRV_DEV_DATA     *psDevData,
                                                                                                 IMG_INT                                        iFd,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                IMG_SID                                        hDstDevMemHeap,
-#else
                                                                                                 IMG_HANDLE                                     hDstDevMemHeap,
-#endif
                                                                                                 PVRSRV_CLIENT_MEM_INFO         **ppsDstMemInfo);
 #endif /* defined(LINUX) */
 
 #if defined(SUPPORT_ION)
 PVRSRV_ERROR PVRSRVMapIonHandle(const PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                IMG_SID    hDevMemContext,
-#else
-                                                                IMG_HANDLE hDevMemContext,
-#endif
-                                                               IMG_INT32 uiFD,
-                                                               IMG_UINT32 uiSize,
+                                                               IMG_HANDLE hDevMemHeap,
+                                                               IMG_UINT32 ui32NumFDs,
+                                                               IMG_INT    *paiBufferFDs,
+                                                               IMG_UINT32 ui32ChunkCount,
+                                                               IMG_SIZE_T *pauiOffset,
+                                                               IMG_SIZE_T *pauiSize,
                                                                IMG_UINT32 ui32Attribs,
                                                                PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
 
@@ -989,11 +796,7 @@ PVRSRV_ERROR PVRSRVUnmapIonHandle(const PVRSRV_DEV_DATA *psDevData,
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMemSparse(const PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                       IMG_SID  hDevMemHeap,
-#else
                                                                                                        IMG_HANDLE hDevMemHeap,
-#endif
                                                                                                        IMG_UINT32 ui32Attribs,
                                                                                                        IMG_SIZE_T uAlignment,
                                                                                                        IMG_UINT32 ui32ChunkSize,
@@ -1009,7 +812,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMemSparse(const PVRSRV_DEV_DATA *psDe
 typedef enum _PVRSRV_SYNCVAL_MODE_
 {
        PVRSRV_SYNCVAL_READ                             = IMG_TRUE,
-       PVRSRV_SYNCVAL_WRITE                    = IMG_FALSE,
+       PVRSRV_SYNCVAL_WRITE                    = IMG_FALSE
 
 } PVRSRV_SYNCVAL_MODE, *PPVRSRV_SYNCVAL_MODE;
 
@@ -1036,6 +839,16 @@ IMG_IMPORT IMG_BOOL PVRSRVTestAllOpsNotComplete(PPVRSRV_CLIENT_MEM_INFO psMemInf
 IMG_IMPORT PVRSRV_SYNCVAL PVRSRVGetPendingOpSyncVal(PPVRSRV_CLIENT_MEM_INFO psMemInfo,
        PVRSRV_SYNCVAL_MODE eMode);
 
+#if defined(SUPPORT_PVRSRV_DEVICE_CLASS)
+
+IMG_IMPORT
+PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
+                                                                               IMG_HANDLE hDevMemContext,
+                                                                               IMG_HANDLE hDeviceClassBuffer,
+                                                                               PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
+IMG_IMPORT
+PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapDeviceClassMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
+                                                                               PVRSRV_CLIENT_MEM_INFO *psMemInfo);
 
 /******************************************************************************
  * Common Device Class Enumeration
@@ -1069,11 +882,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumDCDims (IMG_HANDLE hDevice,
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCSystemBuffer(IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                               IMG_SID *phBuffer
-#else
                                                                                IMG_HANDLE *phBuffer
-#endif
        );
 
 IMG_IMPORT
@@ -1088,117 +897,69 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDCSwapChain (IMG_HANDLE                           hDevice,
                                                                                                        IMG_UINT32                              ui32BufferCount,
                                                                                                        IMG_UINT32                              ui32OEMFlags,
                                                                                                        IMG_UINT32                              *pui32SwapChainID,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                       IMG_SID                                 *phSwapChain
-#else
                                                                                                        IMG_HANDLE                              *phSwapChain
-#endif
        );
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyDCSwapChain (IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                       IMG_SID hSwapChain
-#else
                                                                                        IMG_HANDLE              hSwapChain
-#endif
        );
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCDstRect (IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                               IMG_SID         hSwapChain,
-#else
                                                                                IMG_HANDLE      hSwapChain,
-#endif
                                                                                IMG_RECT        *psDstRect);
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCSrcRect (IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                               IMG_SID         hSwapChain,
-#else
                                                                                IMG_HANDLE      hSwapChain,
-#endif
                                                                                IMG_RECT        *psSrcRect);
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCDstColourKey (IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                       IMG_SID         hSwapChain,
-#else
                                                                                        IMG_HANDLE      hSwapChain,
-#endif
                                                                                        IMG_UINT32      ui32CKColour);
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCSrcColourKey (IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                       IMG_SID         hSwapChain,
-#else
                                                                                        IMG_HANDLE      hSwapChain,
-#endif
                                                                                        IMG_UINT32      ui32CKColour);
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCBuffers(IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                       IMG_SID     hSwapChain,
-                                                                       IMG_SID    *phBuffer
-#else
                                                                        IMG_HANDLE hSwapChain,
                                                                        IMG_HANDLE *phBuffer
-#endif
        );
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCBuffers2(IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                         IMG_SID    hSwapChain,
-                                                                                         IMG_SID   *phBuffer,
-#else
                                                                                          IMG_HANDLE hSwapChain,
                                                                                          IMG_HANDLE *phBuffer,
-#endif
                                                                                          IMG_SYS_PHYADDR *psPhyAddr);
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCBuffer (IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                               IMG_SID    hBuffer,
-#else
                                                                                IMG_HANDLE hBuffer,
-#endif
                                                                                IMG_UINT32 ui32ClipRectCount,
                                                                                IMG_RECT  *psClipRect,
                                                                                IMG_UINT32 ui32SwapInterval,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                               IMG_SID hPrivateTag
-#else
                                                                                IMG_HANDLE hPrivateTag
-#endif
        );
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCBuffer2 (IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                               IMG_SID    hBuffer,
-#else
                                                                                IMG_HANDLE hBuffer,
-#endif
                                                                                IMG_UINT32 ui32SwapInterval,
                                                                                PVRSRV_CLIENT_MEM_INFO **ppsMemInfos,
-                                                                               IMG_UINT32 ui32NumMemInfos,
+                                                                               PVRSRV_CLIENT_SYNC_INFO **ppsSyncInfos,
+                                                                               IMG_UINT32 ui32NumMemSyncInfos,
                                                                                IMG_PVOID  pvPrivData,
-                                                                               IMG_UINT32 ui32PrivDataLength);
+                                                                               IMG_UINT32 ui32PrivDataLength,
+                                                                               IMG_HANDLE *phFence);
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCSystem (IMG_HANDLE hDevice,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                               IMG_SID hSwapChain
-#else
                                                                                IMG_HANDLE hSwapChain
-#endif
        );
 
 /******************************************************************************
@@ -1219,13 +980,10 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetBCBufferInfo(IMG_HANDLE hDevice,
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVGetBCBuffer(IMG_HANDLE hDevice,
                                                                                                IMG_UINT32 ui32BufferIndex,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                               IMG_SID   *phBuffer
-#else
                                                                                                IMG_HANDLE *phBuffer
-#endif
        );
 
+#endif /* #if defined(SUPPORT_PVRSRV_DEVICE_CLASS) */
 
 /******************************************************************************
  * PDUMP Function prototypes...
@@ -1241,11 +999,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpStopInitPhase(IMG_CONST PVRSRV_CONNECTION *
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMemPol(IMG_CONST PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                 IMG_SID    hKernelMemInfo,
-#else
                                                                                  PVRSRV_CLIENT_MEM_INFO *psMemInfo,
-#endif                                                                           
                                                                                  IMG_UINT32 ui32Offset,
                                                                                  IMG_UINT32 ui32Value,
                                                                                  IMG_UINT32 ui32Mask,
@@ -1254,22 +1008,14 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMemPol(IMG_CONST PVRSRV_CONNECTION *psConne
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSyncPol(IMG_CONST PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                        IMG_SID    hKernelSyncInfo,
-#else
                                                                                         PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo,
-#endif
                                                                                         IMG_BOOL   bIsRead,
                                                                                         IMG_UINT32 ui32Value,
                                                                                         IMG_UINT32 ui32Mask);
 
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSyncPol2(IMG_CONST PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                        IMG_SID  hKernelSyncInfo,
-#else
                                                                                         PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo,
-#endif
                                                                                         IMG_BOOL bIsRead);
 
 IMG_IMPORT
@@ -1321,11 +1067,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpPDDevPAddr(IMG_CONST PVRSRV_CONNECTION *psC
 #if !defined(USE_CODE)
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMemPages(IMG_CONST PVRSRV_DEV_DATA *psDevData,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                                  IMG_SID                              hKernelMemInfo,
-#else
                                                                                                                   IMG_HANDLE                   hKernelMemInfo,
-#endif
                                                                                                                   IMG_DEV_PHYADDR              *pPages,
                                                                                                                   IMG_UINT32                   ui32NumPages,
                                                                                                                   IMG_DEV_VIRTADDR             sDevVAddr,
@@ -1378,11 +1120,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpBitmap(IMG_CONST PVRSRV_DEV_DATA *psDevData
                                                                                        IMG_UINT32 ui32Height,
                                                                                        IMG_UINT32 ui32StrideInBytes,
                                                                                        IMG_DEV_VIRTADDR sDevBaseAddr,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                       IMG_SID    hDevMemContext,
-#else
                                                                                        IMG_HANDLE hDevMemContext,
-#endif
                                                                                        IMG_UINT32 ui32Size,
                                                                                        PDUMP_PIXEL_FORMAT ePixelFormat,
                                                                                        PDUMP_MEM_FORMAT eMemFormat,
@@ -1437,12 +1175,12 @@ IMG_IMPORT IMG_BOOL IMG_CALLCONV PVRSRVGetAppHint(IMG_VOID                      *pvHintState,
  *****************************************************************************/
 
 /* Exported APIs */
-IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMem (IMG_SIZE_T ui32Size);
-IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMem (IMG_SIZE_T ui32Size);
-IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMem (IMG_PVOID pvBase, IMG_SIZE_T uNewSize);
+IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMem (IMG_SIZE_T uiSize);
+IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMem (IMG_SIZE_T uiSize);
+IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMem (IMG_PVOID pvBase, IMG_SIZE_T uiNewSize);
 IMG_IMPORT IMG_VOID  IMG_CALLCONV PVRSRVFreeUserModeMem (IMG_PVOID pvMem);
-IMG_IMPORT IMG_VOID PVRSRVMemCopy(IMG_VOID *pvDst, const IMG_VOID *pvSrc, IMG_SIZE_T ui32Size);
-IMG_IMPORT IMG_VOID PVRSRVMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_SIZE_T ui32Size);
+IMG_IMPORT IMG_VOID PVRSRVMemCopy(IMG_VOID *pvDst, const IMG_VOID *pvSrc, IMG_SIZE_T uiSize);
+IMG_IMPORT IMG_VOID PVRSRVMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_SIZE_T uiSize);
 
 struct _PVRSRV_MUTEX_OPAQUE_STRUCT_;
 typedef        struct  _PVRSRV_MUTEX_OPAQUE_STRUCT_ *PVRSRV_MUTEX_HANDLE;
@@ -1591,11 +1329,7 @@ IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvM
  *****************************************************************************/
 
 IMG_IMPORT PVRSRV_ERROR PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                       IMG_EVENTSID hOSEvent
-#else
                                                                        IMG_HANDLE hOSEvent
-#endif
        );
 
 /*!
@@ -1608,11 +1342,7 @@ IMG_IMPORT PVRSRV_ERROR PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnect
  ******************************************************************************/
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateSyncInfoModObj(const PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                        IMG_SID *phKernelSyncInfoModObj
-#else
                                                                                                         IMG_HANDLE *phKernelSyncInfoModObj
-#endif
        );
 
 /*!
@@ -1625,11 +1355,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateSyncInfoModObj(const PVRSRV_CONNECTION *ps
  ******************************************************************************/
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroySyncInfoModObj(const PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                         IMG_SID hKernelSyncInfoModObj
-#else
                                                                                                          IMG_HANDLE hKernelSyncInfoModObj
-#endif
        );
 
 
@@ -1664,11 +1390,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroySyncInfoModObj(const PVRSRV_CONNECTION *p
  ******************************************************************************/
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyPendingSyncOps(const PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                         IMG_SID    hKernelSyncInfoModObj,
-#else
                                                                                                          IMG_HANDLE hKernelSyncInfoModObj,
-#endif
                                                                                                          PVRSRV_CLIENT_SYNC_INFO *psSyncInfo,
                                                                                                          IMG_UINT32 ui32ModifyFlags,
                                                                                                          IMG_UINT32 *pui32ReadOpsPending,
@@ -1689,11 +1411,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyPendingSyncOps(const PVRSRV_CONNECTION *ps
  ******************************************************************************/
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyCompleteSyncOps(const PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                         IMG_SID hKernelSyncInfoModObj
-#else
                                                                                                          IMG_HANDLE hKernelSyncInfoModObj
-#endif
        );
 
 /*!
@@ -1719,11 +1437,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyCompleteSyncOps(const PVRSRV_CONNECTION *p
  ******************************************************************************/
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsTakeToken(const PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                const IMG_SID      hKernelSyncInfo,
-#else
                                                                                                 const PVRSRV_CLIENT_SYNC_INFO *psSyncInfo,
-#endif
                                                                                                 PVRSRV_SYNC_TOKEN *psSyncToken);
 /*!
  ******************************************************************************
@@ -1743,11 +1457,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsTakeToken(const PVRSRV_CONNECTION *psConn
  ******************************************************************************/
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToToken(const PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                       const IMG_SID            hKernelSyncInfo,
-#else
                                                                                                        const PVRSRV_CLIENT_SYNC_INFO *psSyncInfo,
-#endif
                                                                                                        const PVRSRV_SYNC_TOKEN *psSyncToken,
                                                                                                        IMG_BOOL bWait);
 /*!
@@ -1770,11 +1480,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToToken(const PVRSRV_CONNECTION *psC
  ******************************************************************************/
 IMG_IMPORT
 PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToModObj(const PVRSRV_CONNECTION *psConnection,
-#if defined (SUPPORT_SID_INTERFACE)
-                                                                                                        IMG_SID  hKernelSyncInfoModObj,
-#else
                                                                                                         IMG_HANDLE hKernelSyncInfoModObj,
-#endif
                                                                                                         IMG_BOOL bWait);
 
 /*!
index 80df117755809044e1e9b804941c82777d70c776..a0aff8ca86fdfcb060d37dcebfc2735a01208239 100644 (file)
@@ -645,6 +645,9 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ {
        PVRSRV_PIXEL_FORMAT_RAW512                              = 224,
        PVRSRV_PIXEL_FORMAT_RAW1024                             = 225,
 
+       /* Same as NV12 but with interleaved VU rather than interleaved UV */
+       PVRSRV_PIXEL_FORMAT_NV21                                = 226,
+
        PVRSRV_PIXEL_FORMAT_FORCE_I32                   = 0x7fffffff
 
 } PVRSRV_PIXEL_FORMAT;
@@ -657,7 +660,7 @@ typedef enum _PVRSRV_ALPHA_FORMAT_ {
        PVRSRV_ALPHA_FORMAT_UNKNOWN             =  0x00000000,
        PVRSRV_ALPHA_FORMAT_PRE                 =  0x00000001,
        PVRSRV_ALPHA_FORMAT_NONPRE              =  0x00000002,
-       PVRSRV_ALPHA_FORMAT_MASK                =  0x0000000F,
+       PVRSRV_ALPHA_FORMAT_MASK                =  0x0000000F
 } PVRSRV_ALPHA_FORMAT;
 
 /*!
@@ -668,7 +671,7 @@ typedef enum _PVRSRV_COLOURSPACE_FORMAT_ {
        PVRSRV_COLOURSPACE_FORMAT_UNKNOWN               =  0x00000000,
        PVRSRV_COLOURSPACE_FORMAT_LINEAR                =  0x00010000,
        PVRSRV_COLOURSPACE_FORMAT_NONLINEAR             =  0x00020000,
-       PVRSRV_COLOURSPACE_FORMAT_MASK                  =  0x000F0000,
+       PVRSRV_COLOURSPACE_FORMAT_MASK                  =  0x000F0000
 } PVRSRV_COLOURSPACE_FORMAT;
 
 
@@ -744,17 +747,10 @@ typedef struct _PVRSRV_CLIENT_SYNC_INFO_
        IMG_DEV_VIRTADDR                sReadOps2CompleteDevVAddr;
 
        /* handle to client mapping data (OS specific) */
-#if defined (SUPPORT_SID_INTERFACE)
-       IMG_SID                                 hMappingInfo;
-
-       /* handle to kernel sync info */
-       IMG_SID                                 hKernelSyncInfo;
-#else
        IMG_HANDLE                                      hMappingInfo;
 
        /* handle to kernel sync info */
        IMG_HANDLE                                      hKernelSyncInfo;
-#endif
 
 } PVRSRV_CLIENT_SYNC_INFO, *PPVRSRV_CLIENT_SYNC_INFO;
 
@@ -803,7 +799,7 @@ typedef struct _IMG_RECT_16_
 typedef PVRSRV_ERROR (*PFN_GET_BUFFER_ADDR)(IMG_HANDLE,
                                                                                        IMG_HANDLE,
                                                                                        IMG_SYS_PHYADDR**,
-                                                                                       IMG_SIZE_T*,
+                                                                                       IMG_UINT32*,
                                                                                        IMG_VOID**,
                                                                                        IMG_HANDLE*,
                                                                                        IMG_BOOL*,
index b64cd39e6162e4d52f31fd63a8db9df9529efe0b..230e8ada266bf75358b0ee9bdd6bd7799be42e50 100644 (file)
@@ -87,17 +87,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
-#if defined (SUPPORT_SID_INTERFACE)
-#define PVR_SECURE_HANDLES_SET_OFFSET  OPTIONS_BIT4
-#define OPTIONS_BIT4           (0x1U << 4)
-#else
 #if defined(PVR_SECURE_HANDLES) || defined (INTERNAL_TEST)
 #define PVR_SECURE_HANDLES_SET_OFFSET  OPTIONS_BIT4
 #define OPTIONS_BIT4           (0x1U << 4)
 #else
 #define OPTIONS_BIT4           0x0
 #endif /* PVR_SECURE_HANDLES */
-#endif
 
 #if defined(SGX_BYPASS_SYSTEM_CACHE) || defined (INTERNAL_TEST)
 #define SGX_BYPASS_SYSTEM_CACHE_SET_OFFSET     OPTIONS_BIT5
@@ -206,13 +201,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define OPTIONS_BIT21          0x0
 #endif /* SUPPORT_SGX_LOW_LATENCY_SCHEDULING */
 
-#if defined(USE_SUPPORT_NO_TA3D_OVERLAP) || defined (INTERNAL_TEST)
-#define USE_SUPPORT_NO_TA3D_OVERLAP_SET_OFFSET OPTIONS_BIT22
-#define OPTIONS_BIT22          (0x1U << 22)
-#else
-#define OPTIONS_BIT22          0x0
-#endif /* USE_SUPPORT_NO_TA3D_OVERLAP */
-
 #if defined(SGX_FEATURE_MP) || defined (INTERNAL_TEST)
 #if defined(SGX_FEATURE_MP_CORE_COUNT)
 #define OPTIONS_HIGHBYTE ((SGX_FEATURE_MP_CORE_COUNT-1) << SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET)
@@ -253,6 +241,5 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        OPTIONS_BIT19 |\
        OPTIONS_BIT20 |\
        OPTIONS_BIT21 |\
-       OPTIONS_BIT22 |\
        OPTIONS_HIGHBYTE
 
index bb8776a8ec7be4cb71e8178c9dcc0df618179713..d001e6f778cb0005901fce1a78d614e77813b6c5 100644 (file)
@@ -83,11 +83,8 @@ extern "C" {
 #if defined(SUPPORT_MEMORY_TILING)
 #define SGX_VPB_TILED_HEAP_ID                  14
 #endif
-#if defined(SUPPORT_ION)
-#define SGX_ION_HEAP_ID                                                        15
-#endif
 
-#define SGX_MAX_HEAP_ID                                                        16
+#define SGX_MAX_HEAP_ID                                                        15
 
 /*
  * Keep SGX_3DPARAMETERS_HEAP_ID as TQ full custom
@@ -119,9 +116,9 @@ extern "C" {
 /* sync info structure array size */
 #define SGX_MAX_SRC_SYNCS_TA                           32
 #define SGX_MAX_DST_SYNCS_TA                           1
-/* note: there is implicitly 1 3D Dst Sync */
-#define SGX_MAX_SRC_SYNCS_TQ                           8
-#define SGX_MAX_DST_SYNCS_TQ                           1
+/* note: only one dst sync is supported by the 2D paths */
+#define SGX_MAX_SRC_SYNCS_TQ                           6
+#define SGX_MAX_DST_SYNCS_TQ                           2
 #endif
 
 
@@ -142,6 +139,9 @@ extern "C" {
 #define PVRSRV_SGX_HWPERF_POWER                                                0x6
 #define PVRSRV_SGX_HWPERF_PERIODIC                                     0x7
 #define PVRSRV_SGX_HWPERF_3DSPM                                                0x8
+#define PVRSRV_SGX_HWPERF_TA_OCL                                       0x9
+#define PVRSRV_SGX_HWPERF_3D_OCL                                       0xA
+#define PVRSRV_SGX_HWPERF_3DSPM_OCL                                    0xB
 
 #define PVRSRV_SGX_HWPERF_MK_EVENT                                     0x101
 #define PVRSRV_SGX_HWPERF_MK_TA                                                0x102
@@ -154,6 +154,7 @@ extern "C" {
 #define PVRSRV_SGX_HWPERF_MK_TA_LOCKUP                                 0x109
 #define PVRSRV_SGX_HWPERF_MK_3D_LOCKUP                                 0x10A
 #define PVRSRV_SGX_HWPERF_MK_2D_LOCKUP                                 0x10B
+#define PVRSRV_SGX_HWPERF_MK_HK                                                0x10C
 
 #define PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT                    28
 #define PVRSRV_SGX_HWPERF_TYPE_OP_MASK                         ((1UL << PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT) - 1)
@@ -173,6 +174,12 @@ extern "C" {
 #define PVRSRV_SGX_HWPERF_TYPE_PERIODIC                                (PVRSRV_SGX_HWPERF_PERIODIC)
 #define PVRSRV_SGX_HWPERF_TYPE_3DSPM_START                     (PVRSRV_SGX_HWPERF_3DSPM | PVRSRV_SGX_HWPERF_TYPE_OP_START)
 #define PVRSRV_SGX_HWPERF_TYPE_3DSPM_END                       (PVRSRV_SGX_HWPERF_3DSPM | PVRSRV_SGX_HWPERF_TYPE_OP_END)
+#define PVRSRV_SGX_HWPERF_TYPE_3DSPM_OCL_START                 (PVRSRV_SGX_HWPERF_3DSPM_OCL | PVRSRV_SGX_HWPERF_TYPE_OP_START)
+#define PVRSRV_SGX_HWPERF_TYPE_3DSPM_OCL_END                   (PVRSRV_SGX_HWPERF_3DSPM_OCL | PVRSRV_SGX_HWPERF_TYPE_OP_END)
+#define PVRSRV_SGX_HWPERF_TYPE_TA_OCL_START                    (PVRSRV_SGX_HWPERF_TA_OCL | PVRSRV_SGX_HWPERF_TYPE_OP_START)
+#define PVRSRV_SGX_HWPERF_TYPE_TA_OCL_END                      (PVRSRV_SGX_HWPERF_TA_OCL | PVRSRV_SGX_HWPERF_TYPE_OP_END)
+#define PVRSRV_SGX_HWPERF_TYPE_3D_OCL_START                    (PVRSRV_SGX_HWPERF_3D_OCL | PVRSRV_SGX_HWPERF_TYPE_OP_START)
+#define PVRSRV_SGX_HWPERF_TYPE_3D_OCL_END                      (PVRSRV_SGX_HWPERF_3D_OCL | PVRSRV_SGX_HWPERF_TYPE_OP_END)
 #define PVRSRV_SGX_HWPERF_TYPE_MK_TRANSFER_DUMMY_START         (PVRSRV_SGX_HWPERF_MK_TRANSFER_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START)
 #define PVRSRV_SGX_HWPERF_TYPE_MK_TRANSFER_DUMMY_END           (PVRSRV_SGX_HWPERF_MK_TRANSFER_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_END)
 #define PVRSRV_SGX_HWPERF_TYPE_MK_TA_DUMMY_START               (PVRSRV_SGX_HWPERF_MK_TA_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START)
@@ -193,6 +200,9 @@ extern "C" {
 #define PVRSRV_SGX_HWPERF_TYPE_MK_3D_END                       (PVRSRV_SGX_HWPERF_MK_3D | PVRSRV_SGX_HWPERF_TYPE_OP_END)
 #define PVRSRV_SGX_HWPERF_TYPE_MK_2D_START                     (PVRSRV_SGX_HWPERF_MK_2D | PVRSRV_SGX_HWPERF_TYPE_OP_START)
 #define PVRSRV_SGX_HWPERF_TYPE_MK_2D_END                       (PVRSRV_SGX_HWPERF_MK_2D | PVRSRV_SGX_HWPERF_TYPE_OP_END)
+#define PVRSRV_SGX_HWPERF_TYPE_MK_HK_START                     (PVRSRV_SGX_HWPERF_MK_HK | PVRSRV_SGX_HWPERF_TYPE_OP_START)
+#define PVRSRV_SGX_HWPERF_TYPE_MK_HK_END                       (PVRSRV_SGX_HWPERF_MK_HK | PVRSRV_SGX_HWPERF_TYPE_OP_END)
+
 
 #define PVRSRV_SGX_HWPERF_STATUS_OFF                           (0x0)
 #define PVRSRV_SGX_HWPERF_STATUS_RESET_COUNTERS                (1UL << 0)
@@ -236,6 +246,7 @@ typedef struct _CTL_STATUS_
 typedef enum _SGX_MISC_INFO_REQUEST_
 {
        SGX_MISC_INFO_REQUEST_CLOCKSPEED = 0,
+       SGX_MISC_INFO_REQUEST_CLOCKSPEED_SLCSIZE,
        SGX_MISC_INFO_REQUEST_SGXREV,
        SGX_MISC_INFO_REQUEST_DRIVER_SGXREV,
 #if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
@@ -254,6 +265,9 @@ typedef enum _SGX_MISC_INFO_REQUEST_
        SGX_MISC_INFO_REQUEST_SPM,
        SGX_MISC_INFO_REQUEST_ACTIVEPOWER,
        SGX_MISC_INFO_REQUEST_LOCKUPS,
+#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
+       SGX_MISC_INFO_REQUEST_EDM_STATUS_BUFFER_INFO,
+#endif
        SGX_MISC_INFO_REQUEST_FORCE_I16                                 =  0x7fff
 } SGX_MISC_INFO_REQUEST;
 
@@ -275,11 +289,24 @@ typedef struct _PVRSRV_SGX_MISCINFO_FEATURES
 #if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
        IMG_UINT32                      ui32DeviceMemValue;             /*!< device mem value read from ukernel */
 #endif
+} PVRSRV_SGX_MISCINFO_FEATURES;
+
+typedef struct _PVRSRV_SGX_MISCINFO_QUERY_CLOCKSPEED_SLCSIZE
+{
+       IMG_UINT32                      ui32SGXClockSpeed;
+       IMG_UINT32                      ui32SGXSLCSize;
+} PVRSRV_SGX_MISCINFO_QUERY_CLOCKSPEED_SLCSIZE;
+
 #if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
+/******************************************************************************
+ * Struct for getting access to the EDM Status Buffer
+ ******************************************************************************/
+typedef struct _PVRSRV_SGX_MISCINFO_EDM_STATUS_BUFFER_INFO
+{
        IMG_DEV_VIRTADDR        sDevVAEDMStatusBuffer;  /*!< DevVAddr of the EDM status buffer */
        IMG_PVOID                       pvEDMStatusBuffer;              /*!< CPUVAddr of the EDM status buffer */
+} PVRSRV_SGX_MISCINFO_EDM_STATUS_BUFFER_INFO;
 #endif
-} PVRSRV_SGX_MISCINFO_FEATURES;
 
 
 /******************************************************************************
@@ -389,6 +416,7 @@ typedef struct _SGX_MISC_INFO_
                IMG_UINT32      reserved;       /*!< Unused: ensures valid code in the case everything else is compiled out */
                PVRSRV_SGX_MISCINFO_FEATURES                                            sSGXFeatures;
                IMG_UINT32                                                                                      ui32SGXClockSpeed;
+               PVRSRV_SGX_MISCINFO_QUERY_CLOCKSPEED_SLCSIZE                            sQueryClockSpeedSLCSize;
                PVRSRV_SGX_MISCINFO_ACTIVEPOWER                                         sActivePower;
                PVRSRV_SGX_MISCINFO_LOCKUPS                                                     sLockups;
                PVRSRV_SGX_MISCINFO_SPM                                                         sSPM;
@@ -396,6 +424,10 @@ typedef struct _SGX_MISC_INFO_
                SGX_BREAKPOINT_INFO                                                                     sSGXBreakpointInfo;
 #endif
                PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS                           sSetHWPerfStatus;
+
+#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
+               PVRSRV_SGX_MISCINFO_EDM_STATUS_BUFFER_INFO                      sEDMStatusBufferInfo;
+#endif
        } uData;
 } SGX_MISC_INFO;
 
@@ -439,7 +471,6 @@ typedef struct _PVRSRV_SGX_PDUMP_CONTEXT_
 } PVRSRV_SGX_PDUMP_CONTEXT;
 
 
-#if !defined (SUPPORT_SID_INTERFACE)
 typedef struct _SGX_KICKTA_DUMP_ROFF_
 {
        IMG_HANDLE                      hKernelMemInfo;                                         /*< Buffer handle */
@@ -448,13 +479,8 @@ typedef struct _SGX_KICKTA_DUMP_ROFF_
        IMG_UINT32                      ui32Value;                                                      /*< Actual value to dump */
        IMG_PCHAR                       pszName;                                                        /*< Name of buffer */
 } SGX_KICKTA_DUMP_ROFF, *PSGX_KICKTA_DUMP_ROFF;
-#endif
 
-#if defined (SUPPORT_SID_INTERFACE)
-typedef struct _SGX_KICKTA_DUMP_BUFFER_KM_
-#else
 typedef struct _SGX_KICKTA_DUMP_BUFFER_
-#endif
 {
        IMG_UINT32                      ui32SpaceUsed;
        IMG_UINT32                      ui32Start;                                                      /*< Byte offset of start to dump */
@@ -475,13 +501,8 @@ typedef struct _SGX_KICKTA_DUMP_BUFFER_
 #if defined (__QNXNTO__)
        IMG_UINT32          ui32NameLength;                     /*< Number of characters in buffer name */
 #endif
-#if defined (SUPPORT_SID_INTERFACE)
-} SGX_KICKTA_DUMP_BUFFER_KM, *PSGX_KICKTA_DUMP_BUFFER_KM;
-#else
 } SGX_KICKTA_DUMP_BUFFER, *PSGX_KICKTA_DUMP_BUFFER;
-#endif
 
-#if !defined (SUPPORT_SID_INTERFACE)
 #ifdef PDUMP
 /*
        PDUMP version of above kick structure
@@ -501,7 +522,6 @@ typedef struct _SGX_KICKTA_PDUMP_
        IMG_UINT32                                              ui32ROffArraySize;
 } SGX_KICKTA_PDUMP, *PSGX_KICKTA_PDUMP;
 #endif /* PDUMP */
-#endif /* #if !defined (SUPPORT_SID_INTERFACE) */
 
 #if defined(TRANSFER_QUEUE)
 #if defined(SGX_FEATURE_2D_HARDWARE)
index 46b89d2ea7e9a45982566d8c4c9d4c7ad1ea1f97..7e663b1e081d4b50f305f61c21e1bda1b6fe05b9 100644 (file)
@@ -42,11 +42,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #ifndef __SGXSCRIPT_H__
 #define __SGXSCRIPT_H__
 
+#include "sgxfeaturedefs.h"
 #if defined (__cplusplus)
 extern "C" {
 #endif
 
 #define        SGX_MAX_INIT_COMMANDS   64
+#define        SGX_MAX_PRINT_COMMANDS  64
 #define        SGX_MAX_DEINIT_COMMANDS 16
 
 typedef        enum _SGX_INIT_OPERATION
@@ -54,6 +56,7 @@ typedef       enum _SGX_INIT_OPERATION
        SGX_INIT_OP_ILLEGAL = 0,
        SGX_INIT_OP_WRITE_HW_REG,
        SGX_INIT_OP_READ_HW_REG,
+       SGX_INIT_OP_PRINT_HW_REG,
 #if defined(PDUMP)
        SGX_INIT_OP_PDUMP_HW_REG,
 #endif
@@ -71,6 +74,7 @@ typedef union _SGX_INIT_COMMAND
        struct {
                SGX_INIT_OPERATION eOp;
                IMG_UINT32 ui32Offset;
+               IMG_UINT32 ui32Value;
        } sReadHWReg;
 #if defined(PDUMP)
        struct {
@@ -86,6 +90,10 @@ typedef struct _SGX_INIT_SCRIPTS_
        SGX_INIT_COMMAND asInitCommandsPart1[SGX_MAX_INIT_COMMANDS];
        SGX_INIT_COMMAND asInitCommandsPart2[SGX_MAX_INIT_COMMANDS];
        SGX_INIT_COMMAND asDeinitCommands[SGX_MAX_DEINIT_COMMANDS];
+#if defined(SGX_FEATURE_MP)
+       SGX_INIT_COMMAND asSGXREGDebugCommandsMaster[SGX_MAX_PRINT_COMMANDS];
+#endif
+       SGX_INIT_COMMAND asSGXREGDebugCommandsSlave[SGX_MAX_PRINT_COMMANDS];
 } SGX_INIT_SCRIPTS;
 
 #if defined(__cplusplus)
diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/Kbuild.mk b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/Kbuild.mk
new file mode 100644 (file)
index 0000000..8f5720e
--- /dev/null
@@ -0,0 +1,45 @@
+########################################################################### ###
+#@Copyright     Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+#@License       Dual MIT/GPLv2
+# 
+# The contents of this file are subject to the MIT license as set out below.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# Alternatively, the contents of this file may be used under the terms of
+# the GNU General Public License Version 2 ("GPL") in which case the provisions
+# of GPL are applicable instead of those above.
+# 
+# If you wish to allow use of your version of this file only under the terms of
+# GPL, and not to allow others to use your version of this file under the terms
+# of the MIT license, indicate your decision by deleting the provisions above
+# and replace them with the notice and other provisions required by GPL as set
+# out in the file called "GPL-COPYING" included in this distribution. If you do
+# not delete the provisions above, a recipient may use your version of this file
+# under the terms of either the MIT license or GPL.
+# 
+# This License is also included in this distribution in the file called
+# "MIT-COPYING".
+# 
+# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+### ###########################################################################
+ccflags-y += -I$(TOP)/services4/3rdparty/bufferclass_example
+
+bc_example-y += \
+       services4/3rdparty/bufferclass_example/bufferclass_example.o \
+       services4/3rdparty/bufferclass_example/bufferclass_example_linux.o \
+       services4/3rdparty/bufferclass_example/bufferclass_example_private.o
diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/Linux.mk b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/Linux.mk
new file mode 100644 (file)
index 0000000..f2e44a6
--- /dev/null
@@ -0,0 +1,45 @@
+########################################################################### ###
+#@Copyright     Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+#@License       Dual MIT/GPLv2
+# 
+# The contents of this file are subject to the MIT license as set out below.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# Alternatively, the contents of this file may be used under the terms of
+# the GNU General Public License Version 2 ("GPL") in which case the provisions
+# of GPL are applicable instead of those above.
+# 
+# If you wish to allow use of your version of this file only under the terms of
+# GPL, and not to allow others to use your version of this file under the terms
+# of the MIT license, indicate your decision by deleting the provisions above
+# and replace them with the notice and other provisions required by GPL as set
+# out in the file called "GPL-COPYING" included in this distribution. If you do
+# not delete the provisions above, a recipient may use your version of this file
+# under the terms of either the MIT license or GPL.
+# 
+# This License is also included in this distribution in the file called
+# "MIT-COPYING".
+# 
+# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+### ###########################################################################
+
+modules := bufferclass_example
+
+bufferclass_example_type := kernel_module
+bufferclass_example_target := bc_example.ko
+bufferclass_example_makefile := $(THIS_DIR)/Kbuild.mk
diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example.c b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example.c
new file mode 100644 (file)
index 0000000..2669888
--- /dev/null
@@ -0,0 +1,626 @@
+/*************************************************************************/ /*!
+@Title          bufferclass_example kernel driver
+@Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+@License        Dual MIT/GPLv2
+
+The contents of this file are subject to the MIT license as set out below.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+Alternatively, the contents of this file may be used under the terms of
+the GNU General Public License Version 2 ("GPL") in which case the provisions
+of GPL are applicable instead of those above.
+
+If you wish to allow use of your version of this file only under the terms of
+GPL, and not to allow others to use your version of this file under the terms
+of the MIT license, indicate your decision by deleting the provisions above
+and replace them with the notice and other provisions required by GPL as set
+out in the file called "GPL-COPYING" included in this distribution. If you do
+not delete the provisions above, a recipient may use your version of this file
+under the terms of either the MIT license or GPL.
+
+This License is also included in this distribution in the file called
+"MIT-COPYING".
+
+EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/ /**************************************************************************/
+
+/**************************************************************************
+ The 3rd party driver is a specification of an API to integrate the IMG POWERVR
+ Services driver with a 3rd Party 'buffer device'.  It is NOT a specification for
+ a 'buffer device' driver, rather a specification to extend the API for a
+ pre-existing driver for the 'buffer device' hardware.
+
+ The 3rd party driver interface provides IMG POWERVR client drivers (e.g. PVR2D)
+ with an API abstraction of the system's underlying buffer device hardware, 
+ allowing the client drivers to indirectly control the buffer device hardware
+ and access its associated memory.
+ Functions of the API include
+ - query buffer device surface attributes (width, height, stride, pixel format, 
+ CPU physical and virtual address)
+
+ Note: having queried surface attributes the client drivers are able to map the
+ buffer device memory to any IMG POWERVR Services device by calling
+ PVRSRVMapDeviceClassMemory with the buffer device surface handle.
+
+ This code is intended to be an example of how a pre-existing buffer device
+ driver may be extended to support the 3rd Party buffer device interface to 
+ POWERVR Services
+ - IMG is not providing a buffer device driver implementation.
+ **************************************************************************/
+#if defined(__linux__)
+#include <linux/string.h>
+#else
+#include <string.h>
+#endif
+
+#include "bufferclass_example.h"
+
+
+
+#define BUFFERCLASS_DEVICE_NAME "Example Bufferclass Device (SW)"
+
+/* top level 'hook ptr' */
+static void *gpvAnchor = NULL;
+static PFN_BC_GET_PVRJTABLE pfnGetPVRJTable = IMG_NULL;
+
+/*
+       Kernel services is a kernel module and must be loaded first.
+       This driver is also a kernel module and must be loaded after the pvr services module.
+       This driver should be able to retrieve the
+       address of the services PVRGetBufferClassJTable from (the already loaded)
+       kernel services module.
+*/
+
+/* returns anchor pointer */
+BC_EXAMPLE_DEVINFO * GetAnchorPtr(void)
+{
+       return (BC_EXAMPLE_DEVINFO *)gpvAnchor;
+}
+
+/* sets anchor pointer */
+static void SetAnchorPtr(BC_EXAMPLE_DEVINFO *psDevInfo)
+{
+       gpvAnchor = (void *)psDevInfo;
+}
+
+
+/* Open device function, called from services */
+static PVRSRV_ERROR OpenBCDevice(IMG_UINT32 ui32DeviceID, IMG_HANDLE *phDevice)
+{
+       BC_EXAMPLE_DEVINFO *psDevInfo;
+       
+       /*
+               bufferclass_example manages only one BufferClass device
+               therefore there is no need to track ID numbers.
+       */
+       UNREFERENCED_PARAMETER(ui32DeviceID);
+
+       psDevInfo = GetAnchorPtr();
+
+       /* return handle to the devinfo */
+       *phDevice = (IMG_HANDLE)psDevInfo;
+
+       return (PVRSRV_OK);
+}
+
+
+/* Close device function, called from services */
+static PVRSRV_ERROR CloseBCDevice(IMG_UINT32 ui32DeviceID, IMG_HANDLE hDevice)
+{
+       UNREFERENCED_PARAMETER(hDevice);
+
+       return (PVRSRV_OK);
+}
+
+/* Passes in the sync data for a buffer, and returns the handle */
+/* called from services */
+static PVRSRV_ERROR GetBCBuffer(IMG_HANDLE          hDevice,
+                                IMG_UINT32          ui32BufferNumber,
+                                PVRSRV_SYNC_DATA   *psSyncData,
+                                IMG_HANDLE         *phBuffer)
+{
+       BC_EXAMPLE_DEVINFO      *psDevInfo;
+
+       if(!hDevice || !phBuffer)
+       {
+               return (PVRSRV_ERROR_INVALID_PARAMS);
+       }
+
+       psDevInfo = (BC_EXAMPLE_DEVINFO*)hDevice;
+
+       if( ui32BufferNumber < psDevInfo->sBufferInfo.ui32BufferCount )
+       {
+               psDevInfo->psSystemBuffer[ui32BufferNumber].psSyncData = psSyncData;
+               *phBuffer = (IMG_HANDLE)&psDevInfo->psSystemBuffer[ui32BufferNumber];
+       }
+       else
+       {
+               return (PVRSRV_ERROR_INVALID_PARAMS);
+       }
+
+       return (PVRSRV_OK);
+}
+
+
+/* get buffer info function, called from services */
+static PVRSRV_ERROR GetBCInfo(IMG_HANDLE hDevice, BUFFER_INFO *psBCInfo)
+{
+       BC_EXAMPLE_DEVINFO      *psDevInfo;
+
+       if(!hDevice || !psBCInfo)
+       {
+               return (PVRSRV_ERROR_INVALID_PARAMS);
+       }
+
+       psDevInfo = (BC_EXAMPLE_DEVINFO*)hDevice;
+
+       *psBCInfo = psDevInfo->sBufferInfo;
+
+       return (PVRSRV_OK);
+}
+
+
+/* get buffer address function, called from services */
+static PVRSRV_ERROR GetBCBufferAddr(IMG_HANDLE      hDevice,
+                                    IMG_HANDLE      hBuffer,
+                                    IMG_SYS_PHYADDR **ppsSysAddr,
+                                    IMG_UINT32      *pui32ByteSize,
+                                    IMG_VOID        **ppvCpuVAddr,
+                                    IMG_HANDLE      *phOSMapInfo,
+                                    IMG_BOOL        *pbIsContiguous,
+                                    IMG_UINT32      *pui32TilingStride)
+{
+       BC_EXAMPLE_BUFFER *psBuffer;
+
+       PVR_UNREFERENCED_PARAMETER(pui32TilingStride);
+
+       if(!hDevice || !hBuffer || !ppsSysAddr || !pui32ByteSize)
+       {
+               return (PVRSRV_ERROR_INVALID_PARAMS);
+       }
+
+       psBuffer = (BC_EXAMPLE_BUFFER *) hBuffer;
+
+       *ppvCpuVAddr = psBuffer->sCPUVAddr;
+
+       *phOSMapInfo    = IMG_NULL;
+       *pui32ByteSize = (IMG_UINT32)psBuffer->ulSize;
+
+#if defined(BC_DISCONTIG_BUFFERS)
+       *ppsSysAddr = psBuffer->psSysAddr;
+       *pbIsContiguous = IMG_FALSE;
+#else
+       *ppsSysAddr = &psBuffer->sPageAlignSysAddr;
+       *pbIsContiguous = IMG_TRUE;
+#endif
+
+       return (PVRSRV_OK);
+}
+
+
+/* 
+ *  Register the device with services module srvkm.
+ *  This should only be done once at boot time.
+ */
+BCE_ERROR BC_Example_Register(void)
+{
+       BC_EXAMPLE_DEVINFO      *psDevInfo;
+
+       /*
+               - connect to services
+               - register with services
+               - allocate and setup private data structure
+       */
+
+
+       /*
+               in kernel driver, data structures must be anchored to something for subsequent retrieval
+               this may be a single global pointer or TLS or something else - up to you
+               call API to retrieve this ptr
+       */
+
+       /*
+               get the anchor pointer 
+       */
+       psDevInfo = GetAnchorPtr();
+
+       if (psDevInfo == NULL)
+       {
+               /* allocate device info. structure */
+               psDevInfo = (BC_EXAMPLE_DEVINFO *)BCAllocKernelMem(sizeof(BC_EXAMPLE_DEVINFO));
+
+               if(!psDevInfo)
+               {
+                       return (BCE_ERROR_OUT_OF_MEMORY);/* failure */
+               }
+
+               /* set the top-level anchor */
+               SetAnchorPtr((void*)psDevInfo);
+
+               /* set ref count */
+               psDevInfo->ulRefCount = 0;
+
+       
+               if(BCOpenPVRServices(&psDevInfo->hPVRServices) != BCE_OK)
+               {
+                       return (BCE_ERROR_INIT_FAILURE);/* failure */
+               }
+               if(BCGetLibFuncAddr (psDevInfo->hPVRServices, "PVRGetBufferClassJTable", &pfnGetPVRJTable) != BCE_OK)
+               {
+                       return (BCE_ERROR_INIT_FAILURE);/* failure */
+               }
+
+               /* got the kernel services function table */
+               if(!(*pfnGetPVRJTable)(&psDevInfo->sPVRJTable))
+               {
+                       return (BCE_ERROR_INIT_FAILURE);/* failure */
+               }
+
+               /*
+                       Setup the devinfo
+               */
+
+               psDevInfo->ulNumBuffers = 0;
+
+               psDevInfo->psSystemBuffer = BCAllocKernelMem(sizeof(BC_EXAMPLE_BUFFER) * BC_EXAMPLE_NUM_BUFFERS);
+
+               if(!psDevInfo->psSystemBuffer)
+               {
+                       return (BCE_ERROR_OUT_OF_MEMORY);/* failure */
+               }
+
+               /* Setup Buffer Info */
+               psDevInfo->sBufferInfo.pixelformat        = PVRSRV_PIXEL_FORMAT_UNKNOWN;
+               psDevInfo->sBufferInfo.ui32Width          = 0;
+               psDevInfo->sBufferInfo.ui32Height         = 0;
+               psDevInfo->sBufferInfo.ui32ByteStride     = 0;
+               psDevInfo->sBufferInfo.ui32BufferDeviceID = BC_EXAMPLE_DEVICEID;
+               psDevInfo->sBufferInfo.ui32Flags          = 0;
+               psDevInfo->sBufferInfo.ui32BufferCount    = (IMG_UINT32)psDevInfo->ulNumBuffers;
+               
+               strncpy(psDevInfo->sBufferInfo.szDeviceName, BUFFERCLASS_DEVICE_NAME, MAX_BUFFER_DEVICE_NAME_SIZE);
+
+               /*
+                       Bsetup the BC Jtable so SRVKM can call into this driver
+               */
+               psDevInfo->sBCJTable.ui32TableSize    = sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE);
+               psDevInfo->sBCJTable.pfnOpenBCDevice  = OpenBCDevice;
+               psDevInfo->sBCJTable.pfnCloseBCDevice = CloseBCDevice;
+               psDevInfo->sBCJTable.pfnGetBCBuffer   = GetBCBuffer;
+               psDevInfo->sBCJTable.pfnGetBCInfo     = GetBCInfo;
+               psDevInfo->sBCJTable.pfnGetBufferAddr = GetBCBufferAddr;
+
+
+               /* register device with services and retrieve device index */
+               /* This example only registers 1 device, but for multiple buffer streams, register more devices */
+               if(psDevInfo->sPVRJTable.pfnPVRSRVRegisterBCDevice (&psDevInfo->sBCJTable,
+                                                                                                                       (IMG_UINT32*)&psDevInfo->ulDeviceID ) != PVRSRV_OK)
+               {
+                       return (BCE_ERROR_DEVICE_REGISTER_FAILED);/* failure */
+               }
+       }
+
+       /* increment the ref count */
+       psDevInfo->ulRefCount++;
+
+       /* return success */
+       return (BCE_OK);
+}
+
+/* 
+ *  Unregister the device with services module srvkm.
+ */
+BCE_ERROR BC_Example_Unregister(void)
+{
+       BC_EXAMPLE_DEVINFO *psDevInfo;
+
+       psDevInfo = GetAnchorPtr();
+
+       /* check DevInfo has been setup */
+       if (psDevInfo == NULL)
+       {
+               return (BCE_ERROR_GENERIC);/* failure */
+       }
+       /* decrement ref count */
+       psDevInfo->ulRefCount--;
+
+       if (psDevInfo->ulRefCount == 0)
+       {
+               /* all references gone - de-init device information */
+               PVRSRV_BC_BUFFER2SRV_KMJTABLE   *psJTable = &psDevInfo->sPVRJTable;
+
+
+               /* Remove the device from kernel services device register */
+               if (psJTable->pfnPVRSRVRemoveBCDevice(psDevInfo->ulDeviceID) != PVRSRV_OK)
+               {
+                       return (BCE_ERROR_GENERIC);/* failure */
+               }
+
+               if (BCClosePVRServices(psDevInfo->hPVRServices) != BCE_OK)
+               {
+                       psDevInfo->hPVRServices = NULL;
+                       return (BCE_ERROR_GENERIC);/* failure */
+               }
+
+               if (psDevInfo->psSystemBuffer)
+               {
+                       BCFreeKernelMem(psDevInfo->psSystemBuffer);
+               }
+
+               /* de-allocate data structure */
+               BCFreeKernelMem(psDevInfo);
+
+               /* clear the top-level anchor */
+               SetAnchorPtr(NULL);
+       }
+
+       /* return success */
+       return (BCE_OK);
+}
+
+
+/* 
+ * Create shared buffers. 
+ */
+BCE_ERROR BC_Example_Buffers_Create(void)
+{
+       BC_EXAMPLE_DEVINFO  *psDevInfo;
+       unsigned long        i;
+#if !defined(BC_DISCONTIG_BUFFERS)
+       IMG_CPU_PHYADDR      sSystemBufferCPUPAddr;
+#endif
+       PVRSRV_PIXEL_FORMAT  pixelformat    = BC_EXAMPLE_PIXELFORMAT;
+       static IMG_UINT32    ui32Width      = BC_EXAMPLE_WIDTH;
+       static IMG_UINT32    ui32Height     = BC_EXAMPLE_HEIGHT;
+       static IMG_UINT32    ui32ByteStride = BC_EXAMPLE_STRIDE;
+
+       IMG_UINT32 ui32MaxWidth = 320 * 4;
+
+       /*
+               get the anchor pointer 
+       */
+       psDevInfo = GetAnchorPtr();
+       if (psDevInfo == NULL)
+       {
+               /* 
+                * This device was not correctly registered/created. 
+                */
+               return (BCE_ERROR_DEVICE_REGISTER_FAILED);
+       }
+       if (psDevInfo->ulNumBuffers)
+       {
+               /* Buffers already allocated */
+               return (BCE_ERROR_GENERIC);
+       }
+               
+       /* Setup Buffer Info */
+       psDevInfo->sBufferInfo.pixelformat        = BC_EXAMPLE_PIXELFORMAT;
+       psDevInfo->sBufferInfo.ui32Width          = ui32Width;
+       psDevInfo->sBufferInfo.ui32Height         = ui32Height;
+       psDevInfo->sBufferInfo.ui32ByteStride     = ui32ByteStride;
+       psDevInfo->sBufferInfo.ui32BufferDeviceID = BC_EXAMPLE_DEVICEID;
+       psDevInfo->sBufferInfo.ui32Flags          = PVRSRV_BC_FLAGS_YUVCSC_FULL_RANGE | PVRSRV_BC_FLAGS_YUVCSC_BT601;
+
+       for(i=psDevInfo->ulNumBuffers; i < BC_EXAMPLE_NUM_BUFFERS; i++)
+       {
+               unsigned long ulSize = (unsigned long)(ui32Height * ui32ByteStride);
+
+               if(psDevInfo->sBufferInfo.pixelformat == PVRSRV_PIXEL_FORMAT_NV12)
+               {
+                       /* Second plane is quarter size, but 2bytes per pixel */
+                       ulSize += ((ui32ByteStride >> 1) * (ui32Height >> 1) << 1);
+               }
+               else if(psDevInfo->sBufferInfo.pixelformat == PVRSRV_PIXEL_FORMAT_YV12)
+               {
+                       /* Second plane is quarter size, but 1byte per pixel */
+                       ulSize += (ui32ByteStride >> 1) * (ui32Height >> 1);
+                       
+                       /* third plane is quarter size, but 1byte per pixel */
+                       ulSize += (ui32ByteStride >> 1) * (ui32Height >> 1);
+               }
+
+#if defined(BC_DISCONTIG_BUFFERS)
+               if (BCAllocDiscontigMemory(ulSize,
+                                                                  &psDevInfo->psSystemBuffer[i].hMemHandle,
+                                                                  &psDevInfo->psSystemBuffer[i].sCPUVAddr,
+                                                                  &psDevInfo->psSystemBuffer[i].psSysAddr) != BCE_OK)
+               {
+                       break;
+               }
+#else
+               /* Setup system buffer */
+               if (BCAllocContigMemory(ulSize,
+                                       &psDevInfo->psSystemBuffer[i].hMemHandle,
+                                       &psDevInfo->psSystemBuffer[i].sCPUVAddr,
+                                       &sSystemBufferCPUPAddr) != BCE_OK)
+               {
+                       break;
+               }
+               psDevInfo->psSystemBuffer[i].sSysAddr = CpuPAddrToSysPAddrBC(sSystemBufferCPUPAddr);
+               psDevInfo->psSystemBuffer[i].sPageAlignSysAddr.uiAddr = (psDevInfo->psSystemBuffer[i].sSysAddr.uiAddr & 0xFFFFF000);
+#endif
+
+               psDevInfo->ulNumBuffers++;
+
+               psDevInfo->psSystemBuffer[i].ulSize = ulSize;
+               psDevInfo->psSystemBuffer[i].psSyncData = NULL;
+       }
+
+       psDevInfo->sBufferInfo.ui32BufferCount = (IMG_UINT32)psDevInfo->ulNumBuffers;
+
+       /*
+               Bsetup the BC Jtable so SRVKM can call into this driver
+       */
+       psDevInfo->sBCJTable.ui32TableSize    = sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE);
+       psDevInfo->sBCJTable.pfnOpenBCDevice  = OpenBCDevice;
+       psDevInfo->sBCJTable.pfnCloseBCDevice = CloseBCDevice;
+       psDevInfo->sBCJTable.pfnGetBCBuffer   = GetBCBuffer;
+       psDevInfo->sBCJTable.pfnGetBCInfo     = GetBCInfo;
+       psDevInfo->sBCJTable.pfnGetBufferAddr = GetBCBufferAddr;
+       
+
+
+       /* Update buffer's parameters for reconfiguration next time */
+       if (ui32Width < ui32MaxWidth)
+       {
+               switch(pixelformat)
+               {
+                   case PVRSRV_PIXEL_FORMAT_NV12:
+                   case PVRSRV_PIXEL_FORMAT_YV12:
+                       {
+                           ui32Width += 320;
+                               ui32Height += 160;
+                               ui32ByteStride = ui32Width;
+                               break;
+                       }
+                   case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY:
+                   case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY:
+                   case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV:
+                   case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU:
+                       {
+                           ui32Width += 320;
+                               ui32Height += 160;
+                               ui32ByteStride = ui32Width*2;
+                               break;
+                       }
+                   case PVRSRV_PIXEL_FORMAT_RGB565:
+                       {
+                           ui32Width += 320;
+                               ui32Height += 160;
+                               ui32ByteStride = ui32Width*2;
+                               break;
+                       }
+                   default:
+                       {
+                               return (BCE_ERROR_INVALID_PARAMS);
+                       }
+               }
+       }
+       else
+       {
+               ui32Width      = BC_EXAMPLE_WIDTH;
+               ui32Height     = BC_EXAMPLE_HEIGHT;
+               ui32ByteStride = BC_EXAMPLE_STRIDE;
+       }
+
+       /* return success */
+       return (BCE_OK);
+}
+
+
+/*
+ * Destroy shared buffers.
+ */
+BCE_ERROR BC_Example_Buffers_Destroy(void)
+{
+       BC_EXAMPLE_DEVINFO *psDevInfo;
+       unsigned long       i;
+
+       psDevInfo = GetAnchorPtr();
+
+       /* check DevInfo has been setup */
+       if (psDevInfo == NULL)
+       {
+               /* 
+                  This device was not correctly registered/created. 
+                */
+               return (BCE_ERROR_DEVICE_REGISTER_FAILED);
+       }
+
+       /* 
+          Free all allocated surfaces 
+       */
+       for(i = 0; i < psDevInfo->ulNumBuffers; i++)
+       {
+#if defined(BC_DISCONTIG_BUFFERS)
+               BCFreeDiscontigMemory(psDevInfo->psSystemBuffer[i].ulSize,
+                        psDevInfo->psSystemBuffer[i].hMemHandle,
+                        psDevInfo->psSystemBuffer[i].sCPUVAddr,
+                        psDevInfo->psSystemBuffer[i].psSysAddr);
+#else
+               BCFreeContigMemory(psDevInfo->psSystemBuffer[i].ulSize,
+                               psDevInfo->psSystemBuffer[i].hMemHandle,
+                               psDevInfo->psSystemBuffer[i].sCPUVAddr,
+                               SysPAddrToCpuPAddrBC(psDevInfo->psSystemBuffer[i].sSysAddr));
+#endif
+       }
+       psDevInfo->ulNumBuffers = 0;
+
+       /* Reset buffer info */
+       psDevInfo->sBufferInfo.pixelformat        = PVRSRV_PIXEL_FORMAT_UNKNOWN;
+       psDevInfo->sBufferInfo.ui32Width          = 0;
+       psDevInfo->sBufferInfo.ui32Height         = 0;
+       psDevInfo->sBufferInfo.ui32ByteStride     = 0;
+       psDevInfo->sBufferInfo.ui32BufferDeviceID = BC_EXAMPLE_DEVICEID;
+       psDevInfo->sBufferInfo.ui32Flags          = 0;
+       psDevInfo->sBufferInfo.ui32BufferCount    = (IMG_UINT32)psDevInfo->ulNumBuffers;
+
+       /* return success */
+       return (BCE_OK);
+}
+
+
+/* 
+ * This function does both registration and buffer allocation at
+ * boot time.
+ */
+BCE_ERROR  BC_Example_Init(void)
+{
+       BCE_ERROR eError;
+
+       eError = BC_Example_Register();
+       if (eError != BCE_OK)
+       {
+               return eError;
+       }
+
+       eError = BC_Example_Buffers_Create();
+       if (eError != BCE_OK)
+       {
+               return eError;
+       }
+
+       return (BCE_OK);
+}
+
+/* 
+ *     Destroy buffers and unregister device.
+ */
+BCE_ERROR BC_Example_Deinit(void)
+{
+       BCE_ERROR eError;
+
+       eError = BC_Example_Buffers_Destroy();
+       if (eError != BCE_OK)
+       {
+               return eError;
+       }
+
+       eError = BC_Example_Unregister();
+       if (eError != BCE_OK)
+       {
+               return eError;
+       }
+
+       return (BCE_OK);
+}
+
+/******************************************************************************
+ End of file (bufferclass_example.c)
+******************************************************************************/
diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example.h b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example.h
new file mode 100644 (file)
index 0000000..4cdeb39
--- /dev/null
@@ -0,0 +1,238 @@
+/*************************************************************************/ /*!
+@Title          bufferclass_example kernel driver structures and prototypes
+@Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+@License        Dual MIT/GPLv2
+
+The contents of this file are subject to the MIT license as set out below.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+Alternatively, the contents of this file may be used under the terms of
+the GNU General Public License Version 2 ("GPL") in which case the provisions
+of GPL are applicable instead of those above.
+
+If you wish to allow use of your version of this file only under the terms of
+GPL, and not to allow others to use your version of this file under the terms
+of the MIT license, indicate your decision by deleting the provisions above
+and replace them with the notice and other provisions required by GPL as set
+out in the file called "GPL-COPYING" included in this distribution. If you do
+not delete the provisions above, a recipient may use your version of this file
+under the terms of either the MIT license or GPL.
+
+This License is also included in this distribution in the file called
+"MIT-COPYING".
+
+EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/ /**************************************************************************/
+#ifndef __BC_EXAMPLE_H__
+#define __BC_EXAMPLE_H__
+
+/* IMG services headers */
+#include "img_defs.h"
+#include "servicesext.h"
+#include "kernelbuffer.h"
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define BC_EXAMPLE_NUM_BUFFERS  3
+
+#define NV12 1
+//#define YV12 1
+//#define YUV422 1
+
+#ifdef NV12
+
+#define BC_EXAMPLE_WIDTH        (320)
+#define BC_EXAMPLE_HEIGHT       (160)
+#define BC_EXAMPLE_STRIDE       (320)
+#define BC_EXAMPLE_PIXELFORMAT (PVRSRV_PIXEL_FORMAT_NV12)
+
+#else
+#ifdef YV12
+
+#define BC_EXAMPLE_WIDTH        (320)
+#define BC_EXAMPLE_HEIGHT       (160)
+#define BC_EXAMPLE_STRIDE       (320)
+#define BC_EXAMPLE_PIXELFORMAT (PVRSRV_PIXEL_FORMAT_YV12)
+
+#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)
+#define BC_EXAMPLE_HEIGHT       (160)
+#define BC_EXAMPLE_STRIDE       (320*2)
+#define BC_EXAMPLE_PIXELFORMAT  (PVRSRV_PIXEL_FORMAT_RGB565)
+
+#endif
+#endif
+#endif
+
+#define BC_EXAMPLE_DEVICEID      0
+
+typedef void *       BCE_HANDLE;
+
+typedef enum tag_bce_bool
+{
+       BCE_FALSE = 0,
+       BCE_TRUE  = 1,
+} BCE_BOOL, *BCE_PBOOL;
+
+/* BC_NOHW buffer structure */
+typedef struct BC_EXAMPLE_BUFFER_TAG
+{
+       unsigned long           ulSize;
+       BCE_HANDLE              hMemHandle;
+
+       /* IMG structures used, to minimise API function code */
+       /* replace with own structures where necessary */
+#if defined(BC_DISCONTIG_BUFFERS)
+       IMG_SYS_PHYADDR                         *psSysAddr;
+#else
+       IMG_SYS_PHYADDR                         sSysAddr;
+       IMG_SYS_PHYADDR         sPageAlignSysAddr;
+#endif
+       IMG_CPU_VIRTADDR        sCPUVAddr;
+       PVRSRV_SYNC_DATA        *psSyncData;
+
+       struct BC_EXAMPLE_BUFFER_TAG *psNext;
+} BC_EXAMPLE_BUFFER;
+
+
+/* kernel device information structure */
+typedef struct BC_EXAMPLE_DEVINFO_TAG
+{
+       unsigned long           ulDeviceID;
+
+       BC_EXAMPLE_BUFFER       *psSystemBuffer;
+
+       /* number of supported buffers */
+       unsigned long           ulNumBuffers;
+
+       /* jump table into PVR services */
+       PVRSRV_BC_BUFFER2SRV_KMJTABLE sPVRJTable;
+
+       /* jump table into BC */
+       PVRSRV_BC_SRV2BUFFER_KMJTABLE sBCJTable;
+
+       /*
+               handle for connection to kernel services
+               - OS specific - may not be required
+       */
+       BCE_HANDLE              hPVRServices;
+
+       /* ref count */
+       unsigned long           ulRefCount;
+
+       /* IMG structures used, to minimise API function code */
+       /* replace with own structures where necessary */
+       BUFFER_INFO             sBufferInfo;
+
+}  BC_EXAMPLE_DEVINFO;
+
+
+/*!
+ *****************************************************************************
+ * Error values
+ *****************************************************************************/
+typedef enum _BCE_ERROR_
+{
+       BCE_OK                             =  0,
+       BCE_ERROR_GENERIC                  =  1,
+       BCE_ERROR_OUT_OF_MEMORY            =  2,
+       BCE_ERROR_TOO_FEW_BUFFERS          =  3,
+       BCE_ERROR_INVALID_PARAMS           =  4,
+       BCE_ERROR_INIT_FAILURE             =  5,
+       BCE_ERROR_CANT_REGISTER_CALLBACK   =  6,
+       BCE_ERROR_INVALID_DEVICE           =  7,
+       BCE_ERROR_DEVICE_REGISTER_FAILED   =  8,
+       BCE_ERROR_NO_PRIMARY               =  9
+} BCE_ERROR;
+
+
+#ifndef UNREFERENCED_PARAMETER
+#define        UNREFERENCED_PARAMETER(param) (param) = (param)
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+BCE_ERROR BC_Example_Register(void);
+BCE_ERROR BC_Example_Unregister(void);
+BCE_ERROR BC_Example_Buffers_Create(void);
+BCE_ERROR BC_Example_Buffers_Destroy(void);
+BCE_ERROR BC_Example_Init(void);
+BCE_ERROR BC_Example_Deinit(void);
+
+/* OS Specific APIs */
+BCE_ERROR BCOpenPVRServices(BCE_HANDLE *phPVRServices);
+BCE_ERROR BCClosePVRServices(BCE_HANDLE hPVRServices);
+
+void *BCAllocKernelMem(unsigned long ulSize);
+void BCFreeKernelMem(void *pvMem);
+#if defined(BC_DISCONTIG_BUFFERS)
+BCE_ERROR BCAllocDiscontigMemory(unsigned long ulSize,
+                              BCE_HANDLE unref__ *phMemHandle,
+                              IMG_CPU_VIRTADDR *pLinAddr,
+                              IMG_SYS_PHYADDR **ppPhysAddr);
+
+void BCFreeDiscontigMemory(unsigned long ulSize,
+                         BCE_HANDLE unref__ hMemHandle,
+                         IMG_CPU_VIRTADDR LinAddr,
+                         IMG_SYS_PHYADDR *pPhysAddr);
+
+#else
+
+BCE_ERROR BCAllocContigMemory(unsigned long    ulSize,
+                              BCE_HANDLE       *phMemHandle,
+                              IMG_CPU_VIRTADDR *pLinAddr,
+                              IMG_CPU_PHYADDR  *pPhysAddr);
+
+void BCFreeContigMemory(unsigned long ulSize,
+                        BCE_HANDLE hMemHandle,
+                        IMG_CPU_VIRTADDR LinAddr,
+                        IMG_CPU_PHYADDR PhysAddr);
+#endif
+
+IMG_SYS_PHYADDR CpuPAddrToSysPAddrBC(IMG_CPU_PHYADDR cpu_paddr);
+IMG_CPU_PHYADDR SysPAddrToCpuPAddrBC(IMG_SYS_PHYADDR sys_paddr);
+
+void *MapPhysAddr(IMG_SYS_PHYADDR sSysAddr, unsigned long ulSize);
+void UnMapPhysAddr(void *pvAddr, unsigned long ulSize);
+
+BCE_ERROR BCGetLibFuncAddr (BCE_HANDLE hExtDrv, char *szFunctionName, PFN_BC_GET_PVRJTABLE *ppfnFuncTable);
+BC_EXAMPLE_DEVINFO * GetAnchorPtr(void);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __BC_EXAMPLE_H__ */
+
+/******************************************************************************
+ End of file (bufferclass_example.h)
+******************************************************************************/
+
diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_linux.c b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_linux.c
new file mode 100644 (file)
index 0000000..fdb8ce3
--- /dev/null
@@ -0,0 +1,610 @@
+/*************************************************************************/ /*!
+@Title          bufferclass example linux specific implementations
+@Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+@License        Dual MIT/GPLv2
+
+The contents of this file are subject to the MIT license as set out below.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+Alternatively, the contents of this file may be used under the terms of
+the GNU General Public License Version 2 ("GPL") in which case the provisions
+of GPL are applicable instead of those above.
+
+If you wish to allow use of your version of this file only under the terms of
+GPL, and not to allow others to use your version of this file under the terms
+of the MIT license, indicate your decision by deleting the provisions above
+and replace them with the notice and other provisions required by GPL as set
+out in the file called "GPL-COPYING" included in this distribution. If you do
+not delete the provisions above, a recipient may use your version of this file
+under the terms of either the MIT license or GPL.
+
+This License is also included in this distribution in the file called
+"MIT-COPYING".
+
+EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/ /**************************************************************************/
+
+/**************************************************************************
+ The 3rd party driver is a specification of an API to integrate the IMG POWERVR
+ Services driver with 3rd Party display hardware.  It is NOT a specification for
+ a display controller driver, rather a specification to extend the API for a
+ pre-existing driver for the display hardware.
+
+ The 3rd party driver interface provides IMG POWERVR client drivers (e.g. PVR2D)
+ with an API abstraction of the system's underlying display hardware, allowing
+ the client drivers to indirectly control the display hardware and access its
+ associated memory.
+ Functions of the API include
+ - query primary surface attributes (width, height, stride, pixel format, CPU
+     physical and virtual address)
+ - swap/flip chain creation and subsequent query of surface attributes
+ - asynchronous display surface flipping, taking account of asynchronous read
+ (flip) and write (render) operations to the display surface
+
+ Note: having queried surface attributes the client drivers are able to map the
+ display memory to any IMG POWERVR Services device by calling
+ PVRSRVMapDeviceClassMemory with the display surface handle.
+
+ This code is intended to be an example of how a pre-existing display driver may
+ be extended to support the 3rd Party Display interface to POWERVR Services
+ - IMG is not providing a display driver implementation.
+ **************************************************************************/
+
+#include <linux/version.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/fs.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#if defined(LMA)
+#include <linux/pci.h>
+#else
+#include <linux/dma-mapping.h>
+#endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
+#include <linux/mutex.h>
+#endif
+
+#if defined(BC_DISCONTIG_BUFFERS)
+#include <linux/vmalloc.h>
+#endif
+
+#include "bufferclass_example.h"
+#include "bufferclass_example_linux.h"
+#include "bufferclass_example_private.h"
+
+#include "pvrmodule.h"
+
+#define DEVNAME        "bc_example"
+#define        DRVNAME DEVNAME
+
+#if defined(BCE_USE_SET_MEMORY)
+#undef BCE_USE_SET_MEMORY
+#endif
+
+#if (defined(__i386__) || defined(__x86_64__)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) && defined(SUPPORT_LINUX_X86_PAT) && defined(SUPPORT_LINUX_X86_WRITECOMBINE)
+#include <asm/cacheflush.h>
+#define        BCE_USE_SET_MEMORY
+#endif
+
+MODULE_SUPPORTED_DEVICE(DEVNAME);
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
+static long BC_Example_Bridge_Unlocked(struct file *file, unsigned int cmd, unsigned long arg);
+#else
+static int BC_Example_Bridge(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
+#endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
+static DEFINE_MUTEX(sBCExampleBridgeMutex);
+#endif
+
+#if defined(LDM_PLATFORM) || defined(LDM_PCI)
+/*
+ * Device class used for /sys entries (and udev device node creation)
+ */
+static struct class *psPvrClass;
+#endif
+
+/*
+ * This is the major number we use for all nodes in /dev.
+ */
+static int AssignedMajorNumber;
+
+static struct file_operations bufferclass_example_fops = {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
+       .unlocked_ioctl = BC_Example_Bridge_Unlocked
+#else
+       .ioctl = BC_Example_Bridge
+#endif
+};
+
+
+#define unref__ __attribute__ ((unused))
+
+#if defined(LMA)
+#define PVR_BUFFERCLASS_MEMOFFSET (220 * 1024 * 1024) /* Must be after services localmem region */
+#define PVR_BUFFERCLASS_MEMSIZE          (4 * 1024 * 1024)       /* Must be before displayclass localmem region */
+
+unsigned long g_ulMemBase = 0;
+unsigned long g_ulMemCurrent = 0;
+
+/* PVR device vendor ID */
+#define VENDOR_ID_PVR               0x1010
+#define DEVICE_ID_PVR               0x1CF1
+
+#define DEVICE_ID1_PVR              0x1CF2
+
+
+/* PDP mem (including HP mapping) on base register 2 */
+#define PVR_MEM_PCI_BASENUM         2
+#endif
+
+
+/*****************************************************************************
+ Function Name:        BC_Example_ModInit
+ Description  :        Insert the driver into the kernel.
+
+                               The device major number is allocated by the kernel dynamically
+                               if AssignedMajorNumber is zero on entry.  This means that the
+                               device node (nominally /dev/bc_example) may need to be re-made if
+                               the kernel varies the major number it assigns.  The number
+                               does seem to stay constant between runs, but I don't think
+                               this is guaranteed. The node is made as root on the shell
+                               with:
+
+                                               mknod /dev/bc_example c ? 0
+
+                               where ? is the major number reported by the printk() - look
+                               at the boot log using `dmesg' to see this).
+
+                               __init places the function in a special memory section that
+                               the kernel frees once the function has been run.  Refer also
+                               to module_init() macro call below.
+
+*****************************************************************************/
+static int __init BC_Example_ModInit(void)
+{
+#if defined(LDM_PLATFORM) || defined(LDM_PCI)
+    struct device *psDev;
+#endif
+
+#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)
+       {
+               /* Try an alternative PCI ID */
+               psPCIDev = pci_get_device(VENDOR_ID_PVR, DEVICE_ID1_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);
+
+       if (AssignedMajorNumber <= 0)
+       {
+               printk(KERN_ERR DRVNAME ": BC_Example_ModInit: unable to get major number\n");
+
+               goto ExitDisable;
+       }
+
+#if defined(DEBUG)
+       printk(KERN_ERR DRVNAME ": BC_Example_ModInit: major device %d\n", AssignedMajorNumber);
+#endif
+
+#if defined(LDM_PLATFORM) || defined(LDM_PCI)
+       /*
+        * This code (using GPL symbols) facilitates automatic device
+        * node creation on platforms with udev (or similar).
+        */
+       psPvrClass = class_create(THIS_MODULE, "bc_example");
+
+       if (IS_ERR(psPvrClass))
+       {
+               printk(KERN_ERR DRVNAME ": BC_Example_ModInit: unable to create class (%ld)", PTR_ERR(psPvrClass));
+               goto ExitUnregister;
+       }
+
+       psDev = device_create(psPvrClass, NULL, MKDEV(AssignedMajorNumber, 0),
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
+                                                 NULL,
+#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)) */
+                                                 DEVNAME);
+       if (IS_ERR(psDev))
+       {
+               printk(KERN_ERR DRVNAME ": BC_Example_ModInit: unable to create device (%ld)", PTR_ERR(psDev));
+               goto ExitDestroyClass;
+       }
+#endif /* defined(LDM_PLATFORM) || defined(LDM_PCI) */
+
+#if defined(LMA)
+       /*
+        * We don't do a pci_request_region for  PVR_MEM_PCI_BASENUM, 
+        * we assume the SGX driver has done this already.
+        */
+       g_ulMemBase =  pci_resource_start(psPCIDev, PVR_MEM_PCI_BASENUM) + PVR_BUFFERCLASS_MEMOFFSET;
+#endif
+
+       if(BC_Example_Init() != BCE_OK)
+       {
+               printk (KERN_ERR DRVNAME ": BC_Example_ModInit: can't init device\n");
+               goto ExitUnregister;
+       }
+
+#if defined(LMA)
+       /*
+        * To prevent possible problems with system suspend/resume, we don't
+        * keep the device enabled, but rely on the fact that the SGX driver
+        * will have done a pci_enable_device.
+        */
+       pci_disable_device(psPCIDev);
+#endif
+
+       return 0;
+
+#if defined(LDM_PLATFORM) || defined(LDM_PCI)
+ExitDestroyClass:
+       class_destroy(psPvrClass);
+#endif
+ExitUnregister:
+       unregister_chrdev(AssignedMajorNumber, DEVNAME);
+ExitDisable:
+#if defined(LMA)
+       pci_disable_device(psPCIDev);
+ExitError:
+#endif
+       return -EBUSY;
+} /*BC_Example_ModInit*/
+
+/*****************************************************************************
+ Function Name:        BC_Example_ModInit
+ Description  :        Remove the driver from the kernel.
+
+                               __exit places the function in a special memory section that
+                               the kernel frees once the function has been run.  Refer also
+                               to module_exit() macro call below.
+
+*****************************************************************************/
+static void __exit BC_Example_ModCleanup(void)
+{
+#if defined(LDM_PLATFORM) || defined(LDM_PCI)
+       device_destroy(psPvrClass, MKDEV(AssignedMajorNumber, 0));
+       class_destroy(psPvrClass);
+#endif
+
+       unregister_chrdev(AssignedMajorNumber, DEVNAME);
+       
+       if(BC_Example_Deinit() != BCE_OK)
+       {
+               printk (KERN_ERR DRVNAME ": BC_Example_ModCleanup: can't deinit device\n");
+       }
+
+} /*BC_Example_ModCleanup*/
+
+
+void *BCAllocKernelMem(unsigned long ulSize)
+{
+       return kmalloc(ulSize, GFP_KERNEL);
+}
+
+void BCFreeKernelMem(void *pvMem)
+{
+       kfree(pvMem);
+}
+
+#if defined(BC_DISCONTIG_BUFFERS)
+
+#define RANGE_TO_PAGES(range) (((range) + (PAGE_SIZE - 1)) >> PAGE_SHIFT)
+#define        VMALLOC_TO_PAGE_PHYS(vAddr) page_to_phys(vmalloc_to_page(vAddr))
+
+BCE_ERROR BCAllocDiscontigMemory(unsigned long ulSize,
+                              BCE_HANDLE unref__ *phMemHandle,
+                              IMG_CPU_VIRTADDR *pLinAddr,
+                              IMG_SYS_PHYADDR **ppPhysAddr)
+{
+       unsigned long ulPages = RANGE_TO_PAGES(ulSize);
+       IMG_SYS_PHYADDR *pPhysAddr;
+       unsigned long ulPage;
+       IMG_CPU_VIRTADDR LinAddr;
+
+       LinAddr = __vmalloc(ulSize, GFP_KERNEL | __GFP_HIGHMEM, pgprot_noncached(PAGE_KERNEL));
+       if (!LinAddr)
+       {
+               return BCE_ERROR_OUT_OF_MEMORY;
+       }
+
+       pPhysAddr = kmalloc(ulPages * sizeof(IMG_SYS_PHYADDR), GFP_KERNEL);
+       if (!pPhysAddr)
+       {
+               vfree(LinAddr);
+               return BCE_ERROR_OUT_OF_MEMORY;
+       }
+
+       *pLinAddr = LinAddr;
+
+       for (ulPage = 0; ulPage < ulPages; ulPage++)
+       {
+               pPhysAddr[ulPage].uiAddr = VMALLOC_TO_PAGE_PHYS(LinAddr);
+
+               LinAddr += PAGE_SIZE;
+       }
+
+       *ppPhysAddr = pPhysAddr;
+
+       return BCE_OK;
+}
+
+void BCFreeDiscontigMemory(unsigned long ulSize,
+                         BCE_HANDLE unref__ hMemHandle,
+                         IMG_CPU_VIRTADDR LinAddr,
+                         IMG_SYS_PHYADDR *pPhysAddr)
+{
+       kfree(pPhysAddr);
+
+       vfree(LinAddr);
+}
+#else  /* defined(BC_DISCONTIG_BUFFERS) */
+
+BCE_ERROR BCAllocContigMemory(unsigned long ulSize,
+                              BCE_HANDLE unref__ *phMemHandle,
+                              IMG_CPU_VIRTADDR *pLinAddr,
+                              IMG_CPU_PHYADDR *pPhysAddr)
+{
+#if defined(LMA)
+       void *pvLinAddr;
+       
+       /* Only allowed a certain amount of memory for bufferclass buffers */
+       if(g_ulMemCurrent + ulSize >= PVR_BUFFERCLASS_MEMSIZE)
+       {
+               return (BCE_ERROR_OUT_OF_MEMORY);
+       }
+
+       pvLinAddr = ioremap(g_ulMemBase + g_ulMemCurrent, ulSize);
+
+       if(pvLinAddr)
+       {
+               pPhysAddr->uiAddr = g_ulMemBase + g_ulMemCurrent;
+               *pLinAddr = pvLinAddr;  
+
+               /* Not a real allocator; just increment the current address */
+               g_ulMemCurrent += ulSize;
+               return (BCE_OK);
+       }
+       return (BCE_ERROR_OUT_OF_MEMORY);
+#else  /* defined(LMA) */
+#if defined(BCE_USE_SET_MEMORY)
+       void *pvLinAddr;
+       unsigned long ulAlignedSize = PAGE_ALIGN(ulSize);
+       int iPages = (int)(ulAlignedSize >> PAGE_SHIFT);
+       int iError;
+
+       pvLinAddr = kmalloc(ulAlignedSize, GFP_KERNEL);
+       BUG_ON(((unsigned long)pvLinAddr)  & ~PAGE_MASK);
+
+       iError = set_memory_wc((unsigned long)pvLinAddr, iPages);
+       if (iError != 0)
+       {
+               printk(KERN_ERR DRVNAME ": BCAllocContigMemory:  set_memory_wc failed (%d)\n", iError);
+               return (BCE_ERROR_OUT_OF_MEMORY);
+       }
+
+       pPhysAddr->uiAddr = virt_to_phys(pvLinAddr);
+       *pLinAddr = pvLinAddr;
+
+       return (BCE_OK);
+#else  /* BCE_USE_SET_MEMORY */
+       dma_addr_t dma;
+       void *pvLinAddr;
+
+       pvLinAddr = dma_alloc_coherent(NULL, ulSize, &dma, GFP_KERNEL);
+       if (pvLinAddr == NULL)
+       {
+               return (BCE_ERROR_OUT_OF_MEMORY);
+       }
+
+       pPhysAddr->uiAddr = dma;
+       *pLinAddr = pvLinAddr;
+
+       return (BCE_OK);
+#endif /* BCE_USE_SET_MEMORY */
+#endif /* defined(LMA) */
+}
+
+void BCFreeContigMemory(unsigned long ulSize,
+                        BCE_HANDLE unref__ hMemHandle,
+                        IMG_CPU_VIRTADDR LinAddr,
+                        IMG_CPU_PHYADDR PhysAddr)
+{
+#if defined(LMA)
+       g_ulMemCurrent -= ulSize;
+       iounmap(LinAddr);
+#else  /* defined(LMA) */
+#if defined(BCE_USE_SET_MEMORY)
+       unsigned long ulAlignedSize = PAGE_ALIGN(ulSize);
+       int iError;
+       int iPages = (int)(ulAlignedSize >> PAGE_SHIFT);
+
+       iError = set_memory_wb((unsigned long)LinAddr, iPages);
+       if (iError != 0)
+       {
+               printk(KERN_ERR DRVNAME ": BCFreeContigMemory:  set_memory_wb failed (%d)\n", iError);
+       }
+       kfree(LinAddr);
+#else  /* BCE_USE_SET_MEMORY */
+       dma_free_coherent(NULL, ulSize, LinAddr, (dma_addr_t)PhysAddr.uiAddr);
+#endif /* BCE_USE_SET_MEMORY */
+#endif /* defined(LMA) */
+}
+#endif /* defined(BC_DISCONTIG_BUFFERS) */
+
+/**************************************************************************
+       FUNCTION:   CpuPAddrToSysPAddrBC
+       PURPOSE:    Compute a system physical address from a cpu physical
+                   address.
+       PARAMETERS:     In:  cpu_paddr - cpu physical address.
+       RETURNS:        system physical address.
+ **************************************************************************/
+IMG_SYS_PHYADDR CpuPAddrToSysPAddrBC(IMG_CPU_PHYADDR cpu_paddr)
+{
+       IMG_SYS_PHYADDR sys_paddr;
+       
+       /* This would only be an inequality if the CPU's MMU did not point to sys address 0, 
+          ie. multi CPU system */
+       sys_paddr.uiAddr = cpu_paddr.uiAddr;
+       return sys_paddr;
+}
+
+/**************************************************************************
+       FUNCTION:   SysPAddrToCpuPAddrBC
+       PURPOSE:    Compute a cpu physical address
+                   from a system physical address.
+       PARAMETERS:     In:  cpu_paddr - system physical address.
+       RETURNS:        cpu physical address.
+ **************************************************************************/
+IMG_CPU_PHYADDR SysPAddrToCpuPAddrBC(IMG_SYS_PHYADDR sys_paddr)
+{
+       
+       IMG_CPU_PHYADDR cpu_paddr;
+       /* This would only be an inequality if the CPU's MMU did not point to sys address 0, 
+          ie. multi CPU system */
+       cpu_paddr.uiAddr = sys_paddr.uiAddr;
+       return cpu_paddr;
+}
+
+BCE_ERROR BCOpenPVRServices (BCE_HANDLE *phPVRServices)
+{
+       /* Nothing to do - we have already checked services module insertion */
+       *phPVRServices = 0;
+       return (BCE_OK);
+}
+
+
+BCE_ERROR BCClosePVRServices (BCE_HANDLE unref__ hPVRServices)
+{
+       /* Nothing to do */
+       return (BCE_OK);
+}
+
+BCE_ERROR BCGetLibFuncAddr (BCE_HANDLE unref__ hExtDrv, char *szFunctionName, PFN_BC_GET_PVRJTABLE *ppfnFuncTable)
+{
+       if(strcmp("PVRGetBufferClassJTable", szFunctionName) != 0)
+       {
+               return (BCE_ERROR_INVALID_PARAMS);
+       }
+
+       /* Nothing to do - should be exported from pvrsrv.ko */
+       *ppfnFuncTable = PVRGetBufferClassJTable;
+
+       return (BCE_OK);
+}
+
+
+static int BC_Example_Bridge(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+{
+       int err = -EFAULT;
+       int command = _IOC_NR(cmd);
+       BC_Example_ioctl_package sBridge;
+
+       PVR_UNREFERENCED_PARAMETER(inode);
+
+       if (copy_from_user(&sBridge, (void *)arg, sizeof(sBridge)) != 0)
+       {
+               return err;
+       }
+
+       switch(command)
+       {
+               case _IOC_NR(BC_Example_ioctl_fill_buffer):
+               {
+                       if(FillBuffer(sBridge.inputparam) == -1)
+                       {
+                               return err;
+                       }
+                       break;
+               }
+               case _IOC_NR(BC_Example_ioctl_get_buffer_count):
+               {
+                       if(GetBufferCount(&sBridge.outputparam) == -1)
+                       {
+                               return err;
+                       }
+                       break;
+               }
+           case _IOC_NR(BC_Example_ioctl_reconfigure_buffer):
+               {
+                       if(ReconfigureBuffer(&sBridge.outputparam) == -1)
+                       {
+                               return err;
+                       }
+                       break;
+               }
+               default:
+                       return err;
+       }
+
+       if (copy_to_user((void *)arg, &sBridge, sizeof(sBridge)) != 0)
+       {
+               return err;
+       }
+
+       return 0;
+}
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
+static long BC_Example_Bridge_Unlocked(struct file *file, unsigned int cmd, unsigned long arg)
+{
+       int res;
+
+       mutex_lock(&sBCExampleBridgeMutex);
+       res = BC_Example_Bridge(NULL, file, cmd, arg);
+       mutex_unlock(&sBCExampleBridgeMutex);
+
+       return res;
+}
+#endif
+
+/*
+ These macro calls define the initialisation and removal functions of the
+ driver.  Although they are prefixed `module_', they apply when compiling
+ statically as well; in both cases they define the function the kernel will
+ run to start/stop the driver.
+*/
+module_init(BC_Example_ModInit);
+module_exit(BC_Example_ModCleanup);
+
diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_linux.h b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_linux.h
new file mode 100644 (file)
index 0000000..65d7860
--- /dev/null
@@ -0,0 +1,67 @@
+/*************************************************************************/ /*!
+@Title          bufferclass_example kernel driver interface
+@Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+@License        Dual MIT/GPLv2
+
+The contents of this file are subject to the MIT license as set out below.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+Alternatively, the contents of this file may be used under the terms of
+the GNU General Public License Version 2 ("GPL") in which case the provisions
+of GPL are applicable instead of those above.
+
+If you wish to allow use of your version of this file only under the terms of
+GPL, and not to allow others to use your version of this file under the terms
+of the MIT license, indicate your decision by deleting the provisions above
+and replace them with the notice and other provisions required by GPL as set
+out in the file called "GPL-COPYING" included in this distribution. If you do
+not delete the provisions above, a recipient may use your version of this file
+under the terms of either the MIT license or GPL.
+
+This License is also included in this distribution in the file called
+"MIT-COPYING".
+
+EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/ /**************************************************************************/
+#ifndef __BC_EXAMPLE_LINUX_H__
+#define __BC_EXAMPLE_LINUX_H__
+
+#include <linux/ioctl.h>
+
+typedef struct BC_Example_ioctl_package_TAG
+{
+       int inputparam;
+       int outputparam;
+
+}BC_Example_ioctl_package;
+
+/*!< Nov 2006: according to ioctl-number.txt 'g' wasn't in use. */
+#define BC_EXAMPLE_IOC_GID      'g'
+
+#define BC_EXAMPLE_IOWR(INDEX)  _IOWR(BC_EXAMPLE_IOC_GID, INDEX, BC_Example_ioctl_package)
+
+#define BC_Example_ioctl_fill_buffer           BC_EXAMPLE_IOWR(0)
+#define BC_Example_ioctl_get_buffer_count      BC_EXAMPLE_IOWR(1)
+#define BC_Example_ioctl_reconfigure_buffer BC_EXAMPLE_IOWR(2)
+
+#endif /* __BC_EXAMPLE_H__ */
+
+/******************************************************************************
+ End of file (bufferclass_example.h)
+******************************************************************************/
+
diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_private.c b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/bufferclass_example/bufferclass_example_private.c
new file mode 100644 (file)
index 0000000..d9dbfde
--- /dev/null
@@ -0,0 +1,432 @@
+/*************************************************************************/ /*!
+@Title          Bufferclass example private functions.
+@Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+@License        Dual MIT/GPLv2
+
+The contents of this file are subject to the MIT license as set out below.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+Alternatively, the contents of this file may be used under the terms of
+the GNU General Public License Version 2 ("GPL") in which case the provisions
+of GPL are applicable instead of those above.
+
+If you wish to allow use of your version of this file only under the terms of
+GPL, and not to allow others to use your version of this file under the terms
+of the MIT license, indicate your decision by deleting the provisions above
+and replace them with the notice and other provisions required by GPL as set
+out in the file called "GPL-COPYING" included in this distribution. If you do
+not delete the provisions above, a recipient may use your version of this file
+under the terms of either the MIT license or GPL.
+
+This License is also included in this distribution in the file called
+"MIT-COPYING".
+
+EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
+PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/ /**************************************************************************/
+
+/**************************************************************************
+ The 3rd party driver is a specification of an API to integrate the IMG POWERVR
+ Services driver with 3rd Party display hardware.  It is NOT a specification for
+ a display controller driver, rather a specification to extend the API for a
+ pre-existing driver for the display hardware.
+
+ The 3rd party driver interface provides IMG POWERVR client drivers (e.g. PVR2D)
+ with an API abstraction of the system's underlying display hardware, allowing
+ the client drivers to indirectly control the display hardware and access its
+ associated memory.
+ Functions of the API include
+ - query primary surface attributes (width, height, stride, pixel format, CPU
+     physical and virtual address)
+ - swap/flip chain creation and subsequent query of surface attributes
+ - asynchronous display surface flipping, taking account of asynchronous read
+ (flip) and write (render) operations to the display surface
+
+ Note: having queried surface attributes the client drivers are able to map the
+ display memory to any IMG POWERVR Services device by calling
+ PVRSRVMapDeviceClassMemory with the display surface handle.
+
+ This code is intended to be an example of how a pre-existing display driver may
+ be extended to support the 3rd Party Display interface to POWERVR Services
+ - IMG is not providing a display driver implementation.
+ **************************************************************************/
+
+#include "bufferclass_example.h"
+#include "bufferclass_example_private.h"
+
+#define MIN(a,b) ((a)<(b)?(a):(b))
+
+static void FillNV12Image(void *pvDest, int width, int height, int bytestride)
+{
+       static int iPhase = 0;
+       int             i, j;
+       unsigned char   u,v,y;
+       unsigned char  *pui8y = (unsigned char *)pvDest;
+       unsigned short *pui16uv;
+       unsigned int    count = 0;
+
+       for(j=0;j<height;j++)
+       {
+               pui8y = (unsigned char *)pvDest + j * bytestride;
+               count = 0;
+
+               for(i=0;i<width;i++)
+               {
+                       y = (((i+iPhase)>>6)%(2)==0)? 0x7f:0x00;
+
+                       pui8y[count++] = y;
+               }
+       }
+
+       for(j=0;j<height;j+=2)
+       {
+               pui16uv = (unsigned short *)((unsigned char *)pvDest + height * bytestride + (j / 2) * bytestride);
+               count = 0;
+
+               for(i=0;i<width;i+=2)
+               {
+                       u = (j<(height/2))? ((i<(width/2))? 0xFF:0x33) : ((i<(width/2))? 0x33:0xAA);
+                       v = (j<(height/2))? ((i<(width/2))? 0xAC:0x0) : ((i<(width/2))? 0x03:0xEE);
+
+                       /* Byte order is VU */
+                       pui16uv[count++] = (v << 8) | u;
+
+               }
+       }
+
+       iPhase++;
+}
+
+static void FillYV12Image(void *pvDest, int width, int height, int bytestride)
+{
+       static int iPhase = 0;
+       int             i, j;
+       unsigned char   u,v,y;
+       unsigned char  *pui8y = (unsigned char *)pvDest;
+       unsigned char *pui8u, *pui8v;
+       unsigned int    count = 0;
+       int uvplanestride = bytestride / 2;
+       int uvplaneheight = height / 2;
+
+       for(j=0;j<height;j++)
+       {
+               pui8y = (unsigned char *)pvDest + j * bytestride;
+               count = 0;
+
+               for(i=0;i<width;i++)
+               {
+                       y = (((i+iPhase)>>6)%(2)==0)? 0x7f:0x00;
+
+                       pui8y[count++] = y;
+               }
+       }
+
+       for(j=0;j<height;j+=2)
+       {
+               pui8v = (unsigned char *)pvDest + (height * bytestride) + ((j / 2) * uvplanestride);
+               count = 0;
+
+               for(i=0;i<width;i+=2)
+               {
+                       v = (j<(height/2))? ((i<(width/2))? 0xAC:0x0) : ((i<(width/2))? 0x03:0xEE);
+
+                       pui8v[count++] = v;
+               }
+       }
+
+       for(j=0;j<height;j+=2)
+       {
+               pui8u = (unsigned char *)pvDest + (height * bytestride) + (uvplaneheight * uvplanestride) + (j / 2) * uvplanestride;
+               count = 0;
+
+               for(i=0;i<width;i+=2)
+               {
+                       u = (j<(height/2))? ((i<(width/2))? 0xFF:0x33) : ((i<(width/2))? 0x33:0xAA);
+
+                       pui8u[count++] = u;
+
+               }
+       }
+
+       iPhase++;
+}
+
+static void FillYUV422Image(void *pvDest, int width, int height, int bytestride, PVRSRV_PIXEL_FORMAT pixelformat)
+{
+       static int iPhase = 0;
+       int           x, y;
+       unsigned char u,v,y0,y1;
+       unsigned long *pui32yuv = (unsigned long *)pvDest;
+       unsigned int  count = 0;
+
+       for(y=0;y<height;y++)
+       {
+               pui32yuv = (unsigned long *)((unsigned char *)pvDest + y * bytestride);
+               count = 0;
+
+               for(x=0;x<width; x+=2)
+               {
+                       u = (y<(height/2))? ((x<(width/2))? 0xFF:0x33) : ((x<(width/2))? 0x33:0xAA);
+                       v = (y<(height/2))? ((x<(width/2))? 0xAA:0x0) : ((x<(width/2))? 0x03:0xEE);
+
+                       y0 = y1 = (((x+iPhase)>>6)%(2)==0)? 0x7f:0x00;
+
+                       switch(pixelformat)
+                       {
+                               case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY:
+                                       pui32yuv[count++] = (y1 << 24) | (u << 16) | (y0 << 8) | v;
+                                       break;
+                               case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY:
+                                       pui32yuv[count++] = (y1 << 24) | (v << 16) | (y0 << 8) | u;
+                                       break;
+                               case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV:
+                                       pui32yuv[count++] = (v << 24) | (y1 << 16) | (u << 8) | y0;
+                                       break;
+                               case PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU:
+                                       pui32yuv[count++] = (u << 24) | (y1 << 16) | (v << 8) | y0;
+                                       break;
+                               
+                               default:
+                                       break;
+
+                       }
+
+               }
+       }
+
+       iPhase++;
+}
+
+static void FillRGB565Image(void *pvDest, int width, int height, int bytestride)
+{
+       int i, Count;
+       unsigned long *pui32Addr  = (unsigned long *)pvDest;
+       unsigned short *pui16Addr = (unsigned short *)pvDest;
+       unsigned long   Colour32;
+       unsigned short  Colour16;
+       static unsigned char Colour8 = 0;//debug colour
+       
+       Colour16 = (Colour8>>3) | ((Colour8>>2)<<5) | ((Colour8>>3)<<11);
+       Colour32 = Colour16 | Colour16 << 16;
+                       
+       Count = (height * bytestride)>>2;
+
+       for(i=0; i<Count; i++)
+       {
+               pui32Addr[i] = Colour32;
+       }
+
+       Count =  height;
+
+       pui16Addr = (unsigned short *)((unsigned char *)pvDest + (2 * Colour8));
+
+       for(i=0; i<Count; i++)
+       {
+               *pui16Addr = 0xF800U;
+
+               pui16Addr = (unsigned short *)((unsigned char *)pui16Addr + bytestride);
+       }
+       Count = bytestride >> 2;
+       
+       pui32Addr = (unsigned long *)((unsigned char *)pvDest + (bytestride * (MIN(height - 1, 0xFF) - Colour8)));
+
+       for(i=0; i<Count; i++)
+       {
+               pui32Addr[i] = 0x001F001FUL;
+       }
+
+       /* advance the colour */
+       Colour8 = (Colour8 + 1) % MIN(height - 1, 0xFFU);
+}
+
+
+/*!
+******************************************************************************
+
+ @Function     FillBuffer
+ @Description 
+ Fills pixels into a buffer specified by index
+ @Input        ui32BufferIndex - buffer index
+ @Return       0 - success, -1 - failure
+
+******************************************************************************/
+int FillBuffer(unsigned int uiBufferIndex)
+{
+       BC_EXAMPLE_DEVINFO  *psDevInfo = GetAnchorPtr();
+       BC_EXAMPLE_BUFFER   *psBuffer;
+       BUFFER_INFO         *psBufferInfo;
+       PVRSRV_SYNC_DATA    *psSyncData;
+
+       /* check DevInfo has been setup */
+       if(psDevInfo == NULL)
+       {
+               return -1;/* failure */
+       }
+
+       psBuffer = &psDevInfo->psSystemBuffer[uiBufferIndex];
+       psBufferInfo = &psDevInfo->sBufferInfo;
+
+       /* This may be NULL, as it is only registered once texture streaming starts. */
+       psSyncData = psBuffer->psSyncData;
+
+       if(psSyncData)
+       {
+               /* ensure all reads have flushed on the buffer */
+               if(psSyncData->ui32ReadOpsPending != psSyncData->ui32ReadOpsComplete)
+               {
+                       return -1;/* failure */
+               }
+
+               /* take a write-lock on the new buffer to capture to */
+               psSyncData->ui32WriteOpsPending++;
+       }
+
+       switch(psBufferInfo->pixelformat)
+       {
+               case PVRSRV_PIXEL_FORMAT_RGB565:
+               default: