aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/powervr-drivers
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/powervr-drivers
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/powervr-drivers')
-rw-r--r--recipes/powervr-drivers/libgles-omap3.inc107
-rwxr-xr-xrecipes/powervr-drivers/libgles-omap3/rc.pvr24
-rw-r--r--recipes/powervr-drivers/libgles-omap3_3.00.00.01.bb10
-rw-r--r--recipes/powervr-drivers/libgles-omap3_3.00.00.05.bb12
-rw-r--r--recipes/powervr-drivers/libgles-omap3_3.00.00.06.bb21
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules/0001-Compile-fixes-for-DSS2.patch96
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules/0001-New-build-system-for-SGX.patch247
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules/spurious-irq-fix.diff11
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules_1.2.12.838.bb19
-rw-r--r--recipes/powervr-drivers/omap3-sgx-modules_1.3.13.1397.bb25
10 files changed, 572 insertions, 0 deletions
diff --git a/recipes/powervr-drivers/libgles-omap3.inc b/recipes/powervr-drivers/libgles-omap3.inc
new file mode 100644
index 0000000000..7e47bbc8ae
--- /dev/null
+++ b/recipes/powervr-drivers/libgles-omap3.inc
@@ -0,0 +1,107 @@
+DESCRIPTION = "libGLES for the omap3"
+LICENCE = "proprietary-binary"
+
+PROVIDES += "virtual/egl"
+
+# some hints to get you going. as this isnt a totally "open" library, you need
+# to do some work. follow the steps below.
+#
+# 1. if you don't already have a ti account get one here. it's free:
+# http://www.ti.com/hdr_my_ti
+# 2. fetch the gl-es bin from here:
+# https://www-a.ti.com/downloads/sds_support/targetcontent/dvsdk/oslinux_dvsdk/v3_00_3530/OMAP35x_Graphics_SDK_setuplinux_3_00_00_06.bin
+# (replace version in .bin file as appropriate)
+# 3. put the OMAP35x_*.bin file in libgles-omap3/
+# mv OMAP35x_Graphics_SDK_setuplinux_3_00_00_06.bin ./libgles-omap3/
+# 4. make it executable:
+# chmod a+x ./libgles-omap3/OMAP35x_Graphics_SDK_setuplinux_3_00_00_06.bin
+#
+# voila!
+
+SRC_URI = "file://OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin \
+ file://rc.pvr \
+ "
+S = "${WORKDIR}/OMAP35x_Graphics_SDK_${SGXPV}"
+
+BINLOCATION ?= "${S}/gfx_rel"
+
+PACKAGES += " xserver-kdrive-powervrsgx ${PN}-tests"
+
+FILES_${PN} = "${sysconfdir} ${libdir}/lib*.so.* ${bindir}/pvrsrvinit"
+FILES_xserver-kdrive-powervrsgx = "${bindir}/Xsgx"
+FILES_${PN}-tests = "${bindir}/*"
+
+RRECOMMENDS_${PN} = "${PN}-tests \
+ omap3-sgx-modules"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "pvr-init"
+INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ."
+
+do_accept_license() {
+ export HOME="${WORKDIR}"
+ echo "Y
+Y
+${S}" | ${WORKDIR}/OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin
+}
+
+addtask accept_license after do_unpack before do_configure
+
+do_compile() {
+ for sofile in $(find ${S} -name "lib*Open*.so") $(find ${S} -name "lib*srv*.so") $(find ${S} -name "lib*gl*.so") $(find ${S} -name "libpvr*.so") $(find ${S} -name "lib*GL*.so"); do
+ if [ "$(readlink -n ${sofile})" = "" ] ; then
+ mv $sofile ${sofile}.${IMGPV}
+ ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}
+ fi
+ done
+}
+
+do_install () {
+
+ install -d ${D}${libdir}
+ cp -pP ${BINLOCATION}/*.so* ${D}${libdir}
+
+ install -d ${D}${bindir}/
+ cp -pP ${BINLOCATION}/*_test ${D}${bindir}/
+ cp -pP ${BINLOCATION}/gl2info ${D}${bindir}/
+ cp -pP ${BINLOCATION}/gles1test1 ${D}${bindir}/
+ cp -pP ${BINLOCATION}/gles1_texture_stream ${D}${bindir}/
+ cp -pP ${BINLOCATION}/gles2test1 ${D}${bindir}/
+ cp -pP ${BINLOCATION}/pvrsrvinit ${D}${bindir}/
+ cp -pP ${BINLOCATION}/xgles1test1 ${D}${bindir}/
+
+ cp -pP ${BINLOCATION}/freedesktop/kdrive/usr/X11R6_SGX/bin/Xsgx || true
+ cp -pP ${BINLOCATION}/freedesktop/usr/X11R6_SGX/bin/Xsgx ${D}${bindir}/ || true
+
+ install -d ${D}${includedir}
+ cp -pPR ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/* ${D}${includedir}/
+ cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${D}${includedir}/
+ cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES/
+ cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES2/
+
+ install -d ${D}${sysconfdir}/init.d/
+ cp -pP ${WORKDIR}/rc.pvr ${D}${sysconfdir}/init.d/pvr-init
+
+ install -d ${D}${sysconfdir}
+ echo "[default]" > ${D}${sysconfdir}/powervr.ini
+ echo "WindowSystem=libpvrPVR2D_FRONTWSEGL.so" >> ${D}${sysconfdir}/powervr.ini
+}
+
+do_stage () {
+ install -d ${STAGING_LIBDIR}/
+ cp -pP ${BINLOCATION}/*.so* ${STAGING_LIBDIR}
+ cp -pP ${BINLOCATION}/*.a ${STAGING_LIBDIR}
+
+ install -d ${STAGING_INCDIR}
+ cp -pPR ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/* ${STAGING_INCDIR}/
+ cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${STAGING_INCDIR}/
+ cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${STAGING_INCDIR}/GLES/
+ cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${STAGING_INCDIR}/GLES2/
+}
+
+pkg_postinst() {
+#!/bin/sh
+ln -sf /usr/lib/libXdmcp.so.6.0.0 /usr/lib/libXdmcp.so.0
+ln -sf /usr/lib/libXau.so.6.0.0 /usr/lib/libXau.so.0
+}
diff --git a/recipes/powervr-drivers/libgles-omap3/rc.pvr b/recipes/powervr-drivers/libgles-omap3/rc.pvr
new file mode 100755
index 0000000000..244f480f2c
--- /dev/null
+++ b/recipes/powervr-drivers/libgles-omap3/rc.pvr
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+#rmmod bc_example
+rmmod omaplfb
+rmmod pvrsrvkm
+
+insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko")
+#modprobe bc_example
+modprobe omaplfb
+
+pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3`
+
+if [ -e /dev/pvrsrvkm ] ; then
+ rm -f /dev/pvrsrvkm
+fi
+
+mknod /dev/pvrsrvkm c $pvr_maj 0
+chmod 666 /dev/pvrsrvkm
+
+/usr/bin/pvrsrvinit
+
+# Set SGX to full speed
+devmem2 0x48004b40 w 0
+
diff --git a/recipes/powervr-drivers/libgles-omap3_3.00.00.01.bb b/recipes/powervr-drivers/libgles-omap3_3.00.00.01.bb
new file mode 100644
index 0000000000..1f7adfe980
--- /dev/null
+++ b/recipes/powervr-drivers/libgles-omap3_3.00.00.01.bb
@@ -0,0 +1,10 @@
+require libgles-omap3.inc
+
+SGXPV = "3_00_00_01"
+
+PR = "r7"
+
+# Quality control is really poor on these SDKs, so hack around the latest madness:
+FILES_${PN} += "${libdir}/*.so"
+FILES_${PN}-dev = "${includedir}"
+
diff --git a/recipes/powervr-drivers/libgles-omap3_3.00.00.05.bb b/recipes/powervr-drivers/libgles-omap3_3.00.00.05.bb
new file mode 100644
index 0000000000..814ca04637
--- /dev/null
+++ b/recipes/powervr-drivers/libgles-omap3_3.00.00.05.bb
@@ -0,0 +1,12 @@
+require libgles-omap3.inc
+
+# Not released yet
+DEFAULT_PREFERENCE = "-1"
+PR = "r3"
+
+SGXPV = "3_00_00_05"
+IMGPV = "1.2.12.838"
+
+# Quality control is really poor on these SDKs, so hack around the latest madness:
+FILES_${PN} += "${libdir}/*.so"
+FILES_${PN}-dev = "${includedir}"
diff --git a/recipes/powervr-drivers/libgles-omap3_3.00.00.06.bb b/recipes/powervr-drivers/libgles-omap3_3.00.00.06.bb
new file mode 100644
index 0000000000..cc8ddca0f5
--- /dev/null
+++ b/recipes/powervr-drivers/libgles-omap3_3.00.00.06.bb
@@ -0,0 +1,21 @@
+require libgles-omap3.inc
+
+# Not released yet
+#DEFAULT_PREFERENCE = "-1"
+PR = "r7"
+
+SGXPV = "3_00_00_06"
+IMGPV = "1.3.13.1397"
+
+do_accept_license() {
+ export HOME="${WORKDIR}"
+ echo "Y
+q
+Y
+${S}" | ${WORKDIR}/OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin
+}
+
+# Quality control is really poor on these SDKs, so hack around the latest madness:
+FILES_${PN} += "${libdir}/*.so"
+FILES_${PN}-dev = "${includedir}"
+
diff --git a/recipes/powervr-drivers/omap3-sgx-modules/0001-Compile-fixes-for-DSS2.patch b/recipes/powervr-drivers/omap3-sgx-modules/0001-Compile-fixes-for-DSS2.patch
new file mode 100644
index 0000000000..7dbf4d9e6e
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules/0001-Compile-fixes-for-DSS2.patch
@@ -0,0 +1,96 @@
+From 8b6a6bb6702ab796ab56dbbd6caa1b271ed4485b Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Fri, 9 Jan 2009 12:40:28 +0200
+Subject: [PATCH] Compile fixes for DSS2
+
+---
+ .../dc_omap3430_linux/omaplfb_displayclass.c | 6 ++++--
+ .../3rdparty/dc_omap3430_linux/omaplfb_linux.c | 14 ++++----------
+ 2 files changed, 8 insertions(+), 12 deletions(-)
+
+diff --git a/services4/3rdparty/dc_omap3430_linux/omaplfb_displayclass.c b/services4/3rdparty/dc_omap3430_linux/omaplfb_displayclass.c
+index 7b8ec37..6fde397 100755
+--- a/services4/3rdparty/dc_omap3430_linux/omaplfb_displayclass.c
++++ b/services4/3rdparty/dc_omap3430_linux/omaplfb_displayclass.c
+@@ -57,8 +57,6 @@ PVRSRV_ERROR OMAPLFBPostPower (IMG_HANDLE hDevHandle,
+ PVR_POWER_STATE eCurrentPowerState);
+ #endif
+
+-extern void omap_dispc_set_plane_base(int plane, IMG_UINT32 phys_addr);
+-
+ static PFN_DC_GET_PVRJTABLE pfnGetPVRJTable = IMG_NULL;
+
+ static OMAPLFB_DEVINFO * GetAnchorPtr(IMG_VOID)
+@@ -124,6 +122,9 @@ static void WorkHandler(
+ static PVRSRV_ERROR Flip(OMAPLFB_SWAPCHAIN *psSwapChain,
+ IMG_UINT32 aPhyAddr)
+ {
++ printk("no flipping\n");
++ return PVRSRV_OK;
++#if 0
+ if (1 /* omap2_disp_get_output_dev(OMAP2_GRAPHICS) == OMAP2_OUTPUT_LCD */)
+ {
+ omap_dispc_set_plane_base(0, aPhyAddr);
+@@ -137,6 +138,7 @@ static PVRSRV_ERROR Flip(OMAPLFB_SWAPCHAIN *psSwapChain,
+ }
+
+ return PVRSRV_ERROR_INVALID_PARAMS;
++#endif
+ }
+
+ static IMG_VOID EnableVSyncInterrupt(OMAPLFB_SWAPCHAIN *psSwapChain)
+diff --git a/services4/3rdparty/dc_omap3430_linux/omaplfb_linux.c b/services4/3rdparty/dc_omap3430_linux/omaplfb_linux.c
+index acf1631..12f3e32 100755
+--- a/services4/3rdparty/dc_omap3430_linux/omaplfb_linux.c
++++ b/services4/3rdparty/dc_omap3430_linux/omaplfb_linux.c
+@@ -37,6 +37,7 @@
+ #include <linux/slab.h>
+ #include <linux/errno.h>
+ #include <linux/interrupt.h>
++#include <mach/display.h>
+
+ #include <asm/io.h>
+
+@@ -52,10 +53,6 @@ MODULE_LICENSE("GPL");
+ MODULE_SUPPORTED_DEVICE(DRVNAME);
+
+
+-extern int omap_dispc_request_irq(unsigned long, void (*)(void *), void *);
+-extern void omap_dispc_free_irq(unsigned long, void (*)(void *), void *);
+-
+-
+ #define unref__ __attribute__ ((unused))
+
+
+@@ -101,17 +98,14 @@ PVRSRV_ERROR OMAPLFBGetLibFuncAddr (IMG_CHAR *szFunctionName, PFN_DC_GET_PVRJTAB
+ }
+
+ static void
+-OMAPLFBVSyncISR(void *arg)
++OMAPLFBVSyncISR(void *arg, u32 mask)
+ {
+ (void) OMAPLFBVSyncIHandler((OMAPLFB_SWAPCHAIN *)arg);
+ }
+
+-#define DISPC_IRQ_VSYNC 0x0002
+-
+ PVRSRV_ERROR OMAPLFBInstallVSyncISR(OMAPLFB_SWAPCHAIN *psSwapChain)
+ {
+-
+- if (omap_dispc_request_irq(DISPC_IRQ_VSYNC, OMAPLFBVSyncISR, psSwapChain) != 0)
++ if (omap_dispc_register_isr(OMAPLFBVSyncISR, psSwapChain, DISPC_IRQ_VSYNC) != 0)
+ return PVRSRV_ERROR_OUT_OF_MEMORY; /* not worth a proper mapping */
+
+ return PVRSRV_OK;
+@@ -120,7 +114,7 @@ PVRSRV_ERROR OMAPLFBInstallVSyncISR(OMAPLFB_SWAPCHAIN *psSwapChain)
+
+ PVRSRV_ERROR OMAPLFBUninstallVSyncISR (OMAPLFB_SWAPCHAIN *psSwapChain)
+ {
+- omap_dispc_free_irq(DISPC_IRQ_VSYNC, OMAPLFBVSyncISR, psSwapChain);
++ omap_dispc_unregister_isr(OMAPLFBVSyncISR);
+
+ return PVRSRV_OK;
+ }
+--
+1.5.6.3
+
diff --git a/recipes/powervr-drivers/omap3-sgx-modules/0001-New-build-system-for-SGX.patch b/recipes/powervr-drivers/omap3-sgx-modules/0001-New-build-system-for-SGX.patch
new file mode 100644
index 0000000000..9751bcd88d
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules/0001-New-build-system-for-SGX.patch
@@ -0,0 +1,247 @@
+From 36065340e13e6888e7399a1e5b5b11045e8474c6 Mon Sep 17 00:00:00 2001
+From: Tomba <tomba@bat.org>
+Date: Sun, 1 Feb 2009 15:39:15 +0200
+Subject: [PATCH] New build system for SGX
+
+---
+ Kbuild | 53 ++++++++++
+ Makefile | 151 +++++++++++++++++++++++++++
+ services4/3rdparty/dc_omap3430_linux/Kbuild | 8 ++
+ 3 files changed, 212 insertions(+), 0 deletions(-)
+ create mode 100644 Kbuild
+ create mode 100644 Makefile
+ create mode 100644 services4/3rdparty/dc_omap3430_linux/Kbuild
+
+diff --git a/Kbuild b/Kbuild
+new file mode 100644
+index 0000000..19f9a24
+--- /dev/null
++++ b/Kbuild
+@@ -0,0 +1,53 @@
++obj-m := pvrsrvkm.o
++
++FILES := \
++services4/srvkm/common/queue.c \
++services4/srvkm/common/hash.c \
++services4/srvkm/common/perproc.c \
++services4/srvkm/common/mem.c \
++services4/srvkm/common/power.c \
++services4/srvkm/common/deviceclass.c \
++services4/srvkm/common/metrics.c \
++services4/srvkm/common/resman.c \
++services4/srvkm/common/buffer_manager.c \
++services4/srvkm/common/pvrsrv.c \
++services4/srvkm/common/handle.c \
++services4/srvkm/common/ra.c \
++services4/srvkm/common/devicemem.c \
++services4/srvkm/env/linux/pvr_debug.c \
++services4/srvkm/env/linux/mm.c \
++services4/srvkm/env/linux/mutex.c \
++services4/srvkm/env/linux/mmap.c \
++services4/srvkm/env/linux/module.c \
++services4/srvkm/env/linux/proc.c \
++services4/srvkm/env/linux/event.c \
++services4/srvkm/env/linux/osfunc.c \
++services4/srvkm/env/linux/pvr_bridge_k.c \
++services4/srvkm/env/linux/pdump.c \
++services4/srvkm/devices/sgx/sgxtransfer.c \
++services4/srvkm/devices/sgx/sgxinit.c \
++services4/srvkm/devices/sgx/sgxutils.c \
++services4/srvkm/devices/sgx/pb.c \
++services4/srvkm/devices/sgx/sgxkick.c \
++services4/srvkm/devices/sgx/mmu.c \
++services4/srvkm/devices/sgx/sgxreset.c \
++services4/srvkm/bridged/bridged_pvr_bridge.c \
++services4/system/omap3430/sysutils_linux.c \
++services4/system/omap3430/sysconfig.c
++
++EXTRA_CFLAGS += -I$(src)/include4
++EXTRA_CFLAGS += -I$(src)/services4/include
++EXTRA_CFLAGS += -I$(src)/services4/srvkm/include
++EXTRA_CFLAGS += -I$(src)/services4/srvkm/hwdefs
++EXTRA_CFLAGS += -I$(src)/services4/srvkm/bridged
++EXTRA_CFLAGS += -I$(src)/services4/srvkm/devices/sgx
++EXTRA_CFLAGS += -I$(src)/services4/srvkm/env/linux
++EXTRA_CFLAGS += -I$(src)/services4/system/include
++EXTRA_CFLAGS += -I$(src)/services4/system/omap3430
++
++EXTRA_CFLAGS += $(ALL_CFLAGS)
++
++pvrsrvkm-y := $(FILES:.c=.o)
++
++obj-y := services4/3rdparty/dc_omap3430_linux/
++
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..74e9761
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,151 @@
++export DISCIMAGE = /tmp/asdada
++export KERNELDIR = /home/tomba/work/linux
++
++export BUILD = debug
++
++export KERNELDIR = /home/tomba/work/linux
++export KBUILD_EXTRA_SYMBOLS = `pwd`/services4/srvkm/env/linux/kbuild/Module.symvers
++
++SGXCORE = 530
++CORE = -DSGX530 -DSUPPORT_SGX530 -DSGX_CORE_REV=103
++
++SUPPORT_SGX = 1
++SUPPORT_HW_RECOVERY = 1
++SUPPORT_SGX_HWPERF = 1
++SYS_USING_INTERRUPTS = 1
++
++PVR2D_ALT_2DHW = 1
++
++LDM_PLATFORM ?= 1
++
++# Only enable active power management if passive power management is
++# enabled, as indicated by LDM_PLATFORM being set to 1. On OMAP,
++# the system can suspend in the case where active power management is
++# enabled in the SGX driver, but passive power management isn't. As
++# passive power management isn't enabled, the driver won't see the
++# system suspend/resume events, and so won't take appropriate action.
++ifeq ($(LDM_PLATFORM),1)
++SUPPORT_ACTIVE_POWER_MANAGEMENT ?= 1
++else
++SUPPORT_ACTIVE_POWER_MANAGEMENT = 0
++endif
++
++export PVR_BUILD_DIR := $(shell pwd)
++
++DATE := $(shell date "+%a %B %d %Z %Y" )
++
++CBUILD = -DPVR_BUILD_DIR="\"$(PVR_BUILD_DIR)\"" \
++ -DPVR_BUILD_DATE="\"$(DATE)\"" \
++ -DPVR_BUILD_TYPE="\"$(BUILD)\""
++
++# Don't support HW recovery on debug builds
++CBUILD.debug = -DDEBUG
++CBUILD.timing = -DTIMING
++CBUILD.release = -DRELEASE
++CFLAGS.debug = -g -O0 -DDLL_METRIC=1
++CFLAGS.timing = $(OPTIM) -g -DDLL_METRIC=1 -DTIMING
++CFLAGS.release = $(OPTIM) -g
++CFLAGS = $(CFLAGS.$(BUILD))
++
++
++ifeq ("$(BUILD)", "debug")
++DEBUG_LINUX_MEMORY_ALLOCATIONS ?= 1
++DEBUG_LINUX_MEM_AREAS ?= 1
++DEBUG_LINUX_MMAP_AREAS ?= 1
++DEBUG_LINUX_XML_PROC_FILES ?= 0
++DEBUG_LINUX_SLAB_ALLOCATIONS ?= 0
++DEBUG_BRIDGE_KM ?= 1
++DEBUG_TRACE_BRIDGE_KM ?= 0
++DEBUG_BRIDGE_KM_DISPATCH_TABLE ?= 0
++endif
++
++TRANSFER_QUEUE ?= 1
++SUPPORT_SGX_EVENT_OBJECT ?= 1
++SUPPORT_SECURE_HANDLES ?= 1
++SUPPORT_SRVINIT = 1
++SUPPORT_PERCONTEXT_PB = 1
++
++SYS_CFLAGS += -DSERVICES4 -D_XOPEN_SOURCE=600 -DPVR2D_VALIDATE_INPUT_PARAMS
++
++# Thread support
++USE_PTHREADS ?= 1
++USE_GCC__thread_KEYWORD ?= 0
++OPTIMISE_NON_NPTL_SINGLE_THREAD_TLS_LOOKUP ?= 0
++DISABLE_THREADS ?= 0
++
++# Automatically define C compiler macros for features possible (or not) in use.
++
++SYS_CFLAGS.$(SUPPORT_SRVINIT) += -DSUPPORT_SRVINIT
++
++SYS_CFLAGS.$(SUPPORT_SGX) += -DSUPPORT_SGX
++SYS_CFLAGS.$(SUPPORT_XWS) += -DSUPPORT_XWS
++SYS_CFLAGS.$(PDUMP) += -DPDUMP
++SYS_CFLAGS.$(SUPPORT_POWER_MANAGEMENT) += -DSUPPORT_POWER_MANAGEMENT
++SYS_CFLAGS.$(SUPPORT_BUFFER_CLASS) += -DSUPPORT_BUFFER_CLASS
++
++SYS_CFLAGS.$(SUPPORT_PERCONTEXT_PB) += -DSUPPORT_PERCONTEXT_PB
++SYS_CFLAGS.$(SUPPORT_DYNAMIC_PBRESIZE) += -DSUPPORT_DYNAMIC_PBRESIZE
++
++SYS_CFLAGS.$(USE_FBDEV) += -DUSE_FBDEV
++SYS_CFLAGS.$(USE_FBDEV) += -DFBDEV_NAME="\"$(FBDEV_NAME)\""
++SYS_CFLAGS.$(SUPPORT_DYNAMIC_3DCLOCKGATING) += -DSUPPORT_DYNAMIC_3DCLOCKGATING
++SYS_CFLAGS.$(REENTRANCY_PROTECTION) += -DREENTRANCY_PROTECTION
++SYS_CFLAGS.$(SCHEDULER_CONTROL_SUPPORT) += -DSCHEDULER_CONTROL_SUPPORT
++SYS_CFLAGS.$(USE_IMG_POWER_DOMAIN_FUNCTION) += -DUSE_IMG_POWER_DOMAIN_FUNCTION
++
++SYS_CFLAGS.$(USE_DMALLOC) += -DDMALLOC
++
++SYS_CFLAGS.$(DEBUG_LINUX_MEMORY_ALLOCATIONS) += -DDEBUG_LINUX_MEMORY_ALLOCATIONS
++SYS_CFLAGS.$(DEBUG_LINUX_MEM_AREAS) += -DDEBUG_LINUX_MEM_AREAS
++SYS_CFLAGS.$(DEBUG_LINUX_MMAP_AREAS) += -DDEBUG_LINUX_MMAP_AREAS
++SYS_CFLAGS.$(DEBUG_LINUX_XML_PROC_FILES) += -DDEBUG_LINUX_XML_PROC_FILES
++SYS_CFLAGS.$(DEBUG_LINUX_SLAB_ALLOCATIONS) += -DDEBUG_LINUX_SLAB_ALLOCATIONS
++SYS_CFLAGS.$(DEBUG_BRIDGE_KM) += -DDEBUG_BRIDGE_KM
++SYS_CFLAGS.$(DEBUG_TRACE_BRIDGE_KM) += -DDEBUG_TRACE_BRIDGE_KM
++SYS_CFLAGS.$(DEBUG_BRIDGE_KM_DISPATCH_TABLE) += -DDEBUG_BRIDGE_KM_DISPATCH_TABLE
++
++SYS_CFLAGS.$(SUPPORT_LINUX_X86_WRITECOMBINE) += -DSUPPORT_LINUX_X86_WRITECOMBINE
++
++SYS_CFLAGS.$(SGX_PDS_EVENTS_DISABLED) += -DSGX_PDS_EVENTS_DISABLED
++SYS_CFLAGS.$(USE_SUPPORT_NO_TA3D_OVERLAP) += -DUSE_SUPPORT_NO_TA3D_OVERLAP
++SYS_CFLAGS.$(SUPPORT_SGX_TILING) += -DSUPPORT_SGX_TILING
++SYS_CFLAGS.$(TRANSFER_QUEUE) += -DTRANSFER_QUEUE
++
++SYS_CFLAGS.$(SUPPORT_SGX_MMU_DUMMY_PAGE) += -DSUPPORT_SGX_MMU_DUMMY_PAGE
++
++SYS_CFLAGS.$(PVRSRV_USSE_EDM_STATUS_DEBUG) += -DPVRSRV_USSE_EDM_STATUS_DEBUG
++
++SYS_CFLAGS.$(SUPPORT_DRI_DRM) += -DSUPPORT_DRI_DRM
++
++SYS_CFLAGS.$(SYS_USING_INTERRUPTS) += -DSYS_USING_INTERRUPTS
++SYS_CFLAGS.$(SUPPORT_HW_RECOVERY) += -DSUPPORT_HW_RECOVERY
++SYS_CFLAGS.$(SUPPORT_ACTIVE_POWER_MANAGEMENT) += -DSUPPORT_ACTIVE_POWER_MANAGEMENT
++
++SYS_CFLAGS.$(SUPPORT_SECURE_HANDLES) += -DPVR_SECURE_HANDLES
++
++SYS_CFLAGS.$(USE_PTHREADS) += -DUSE_PTHREADS
++SYS_CFLAGS.$(USE_GCC__thread_KEYWORD) += -DUSE_GCC__thread_KEYWORD
++SYS_CFLAGS.$(OPTIMISE_NON_NPTL_SINGLE_THREAD_TLS_LOOKUP) += -DOPTIMISE_NON_NPTL_SINGLE_THREAD_TLS_LOOKUP
++SYS_CFLAGS.$(DISABLE_THREADS) += -DDISABLE_THREADS
++SYS_CFLAGS.$(SUPPORT_SGX_EVENT_OBJECT) += -DSUPPORT_SGX_EVENT_OBJECT
++SYS_CFLAGS.$(LDM_PLATFORM) += -DLDM_PLATFORM
++SYS_CFLAGS.$(LDM_PCI) += -DLDM_PCI
++SYS_CFLAGS.$(PVR_MANUAL_POWER_CONTROL) += -DPVR_MANUAL_POWER_CONTROL
++
++SYS_CFLAGS.$(PVR2D_ALT_2DHW) += -DPVR2D_ALT_2DHW
++
++SYS_CFLAGS.$(SUPPORT_SGX_HWPERF) += -DSUPPORT_SGX_HWPERF
++
++export ALL_CFLAGS = -DLINUX \
++ $(CBUILD) $(CBUILD.$(BUILD)) \
++ $(SYS_CFLAGS) $(SYS_CFLAGS.1) \
++ $(MODULE_CFLAGS) $(MODULE_CFLAGS.$(BUILD)) \
++ $(CORE) \
++ $(CFLAGS)
++
++all:
++ $(MAKE) -C $(KERNELDIR) M=`pwd` $*
++
++clean:
++ $(MAKE) -C $(KERNELDIR) M=`pwd` clean
++
+diff --git a/services4/3rdparty/dc_omap3430_linux/Kbuild b/services4/3rdparty/dc_omap3430_linux/Kbuild
+new file mode 100644
+index 0000000..c08b240
+--- /dev/null
++++ b/services4/3rdparty/dc_omap3430_linux/Kbuild
+@@ -0,0 +1,8 @@
++EXTRA_CFLAGS = -DLINUX \
++ -I$(PVR_BUILD_DIR)/include4 \
++ -I$(PVR_BUILD_DIR)/services4/include \
++ -I$(PVR_BUILD_DIR)/services4/system/$(PVR_SYSTEM) \
++ -I$(PVR_BUILD_DIR)/services4/system/include \
++
++obj-m := omaplfb.o
++omaplfb-y := omaplfb_displayclass.o omaplfb_linux.o
+--
+1.5.6.3
+
diff --git a/recipes/powervr-drivers/omap3-sgx-modules/spurious-irq-fix.diff b/recipes/powervr-drivers/omap3-sgx-modules/spurious-irq-fix.diff
new file mode 100644
index 0000000000..c857fe713f
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules/spurious-irq-fix.diff
@@ -0,0 +1,11 @@
+--- /tmp/sgxinit.c 2009-02-20 21:24:01.000000000 +0100
++++ omap3-sgx-modules-1.3.13.1397/services4/srvkm/devices/sgx/sgxinit.c 2009-02-20 21:25:17.000000000 +0100
+@@ -1139,6 +1139,8 @@
+
+
+ OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR, ui32EventClear);
++ //Read back to flush posted write to fix spurious IRQ
++ OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR);
+ }
+ }
+
diff --git a/recipes/powervr-drivers/omap3-sgx-modules_1.2.12.838.bb b/recipes/powervr-drivers/omap3-sgx-modules_1.2.12.838.bb
new file mode 100644
index 0000000000..6f57e532f0
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules_1.2.12.838.bb
@@ -0,0 +1,19 @@
+DESCRIPTION = "Kernel drivers for the PowerVR SGX chipset found in the omap3 SoCs"
+LICENSE = "GPLv2"
+
+inherit module
+
+SRC_URI = "http://dominion.thruhere.net/koen/OE/omap3-sgx-modules-${PV}.tar.bz2 \
+"
+
+MAKE_TARGETS = "BUILD=debug"
+
+do_compile_prepend() {
+ cd ${S}/eurasiacon/build/linux/omap3430_linux/kbuild/
+}
+
+do_install() {
+ cd ${S}/eurasiacon/build/linux/omap3430_linux/kbuild/
+ mkdir -p ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/gpu/pvr
+ cp ${WORKDIR}/${PN}-${PV}/eurasiacon/binary_omap3430_linux_debug/*.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/gpu/pvr
+}
diff --git a/recipes/powervr-drivers/omap3-sgx-modules_1.3.13.1397.bb b/recipes/powervr-drivers/omap3-sgx-modules_1.3.13.1397.bb
new file mode 100644
index 0000000000..985a0c044b
--- /dev/null
+++ b/recipes/powervr-drivers/omap3-sgx-modules_1.3.13.1397.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "Kernel drivers for the PowerVR SGX chipset found in the omap3 SoCs"
+LICENSE = "GPLv2"
+
+PR = "r6"
+
+inherit module
+
+SRC_URI = "http://dominion.thruhere.net/koen/OE/omap3-sgx-modules-${PV}.tar.bz2 \
+ file://0001-Compile-fixes-for-DSS2.patch;patch=1 \
+ file://0001-New-build-system-for-SGX.patch;patch=1 \
+ file://spurious-irq-fix.diff;patch=1 \
+"
+
+PVRBUILD = "release"
+
+MAKE_TARGETS = " BUILD=${PVRBUILD}"
+
+do_compile_prepend() {
+ find ${S} -name "*.*o" | xargs rm
+}
+
+do_install() {
+ mkdir -p ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/gpu/pvr
+ cp ${S}/pvrsrvkm.ko ${S}/services4/3rdparty/dc_omap3430_linux/omaplfb.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/gpu/pvr
+}