--- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/Makefile +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/Makefile @@ -0,0 +1,47 @@ +#/usr/bin/make + +# We rely on the following variables: +# DESTDIR +# NAME +# VERSION +# +# We honour $PREFIX (but don't use it normally). +# +# We generate two trees, one for release and one for debug. +# They are both generated under $(DESTDIR) (and as a special +# case are not DESTDIR themselves). + +.PHONY: all clean install install-release install-debug + +# Supply default values. +NAME := name +VERSION := 0.0.0 + +install-release : FLAVOUR := release +install-release : SUFFIX := + +install-debug : FLAVOUR := debug +install-debug : SUFFIX := -debug + +# The following variables definitions rely on $(SUFFIX) being defined, +# so make sure to use '=' to define them, +# for as late an evaluation as possible. +DST = $(DESTDIR)/$(NAME)$(SUFFIX)-dkms/usr/src/$(NAME)$(SUFFIX)-$(VERSION) +SHARE = $(DESTDIR)/$(NAME)$(SUFFIX)-dkms/usr/share/$(NAME)$(SUFFIX)-dkms + +all: + +clean: + +install: install-release install-debug + +install-release install-debug: + @set -e; \ + install -d "`dirname $(DST)`"; \ + cp -a sgx "$(DST)"; \ + find "$(DST)" -type f -exec chmod u=rw,go=r "{}" \; ; \ + find "$(DST)" -type d -exec chmod u=rwx,go=rx "{}" \; ; \ + sed -i 's/__VERSION__/$(VERSION)/g; s/__SUFFIX__/$(SUFFIX)/g' "$(DST)/dkms.conf"; \ + sed -i 's/__FLAVOUR__/$(FLAVOUR)/g' "$(DST)/Makefile"; \ + install -d "$(SHARE)"; \ + install -m 755 "$(PREFIX)/usr/lib/dkms/common.postinst" "$(SHARE)/postinst" --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/.gbp.conf +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/.gbp.conf @@ -0,0 +1,3 @@ +[git-import-orig] +# Keep pristine-tar (allows to re-create 'orig'). +pristine-tar = True --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/copyright +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/copyright @@ -0,0 +1,39 @@ +This work was packaged for Debian by: + + Vincent Stehle on Fri, 28 May 2010 14:11:56 +0200 + + (It was inspired from similar work for OMAP3, + by Ricardo Salveti de Araujo ) + +Upstream Author(s): + + Imagination Technologies Ltd. + Texas Instruments Incorporated + +Copyright: + + Copyright (C) 2008 Imagination Technologies Ltd. + Copyright (C) 2010 Texas Instruments Incorporated + +License: + + This program is free software; you can redistribute it and/or modify it + under the terms and conditions of the GNU General Public License, + version 2, as published by the Free Software Foundation. + + This program is distributed in the hope it will be useful but, except + as otherwise stated in writing, without any warranty; without even the + implied warranty of merchantability or fitness for a particular purpose. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., + + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + +The Debian packaging is: + + Copyright (C) 2010 Texas Instruments Incorporated + +and is licensed under the GPL version 2, +see `/usr/share/common-licenses/GPL-2'. --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/rules +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/makefile.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + +NAME=pvr-omap4-kernel +VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p') + +DEB_MAKE_CLEAN_TARGET := clean +DEB_MAKE_BUILD_TARGET := all + +# We generate two trees, one for release and one for debug. +# They are both generated under $(DESTDIR) (and as a special +# case are not DESTDIR themselves). +DEB_MAKE_INSTALL_TARGET := install DESTDIR=$(CURDIR)/debian NAME=$(NAME) VERSION=$(VERSION) --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/pvr-omap4-kernel-debug-dkms.prerm +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/pvr-omap4-kernel-debug-dkms.prerm @@ -0,0 +1,27 @@ +#!/bin/sh + +NAME=pvr-omap4-kernel-debug +PACKAGE_NAME=$NAME-dkms +VERSION=`dpkg-query -W -f='${Version}' $PACKAGE_NAME | awk -F "-" '{print $1}' | cut -d\: -f2` + +set -e + +case "$1" in + remove|upgrade|deconfigure) + if [ "`dkms status -m $NAME`" ]; then + dkms remove -m $NAME -v $VERSION --all + fi + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/docs +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/docs @@ -0,0 +1 @@ +sgx/README --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/pvr-omap4-kernel-dkms.prerm +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/pvr-omap4-kernel-dkms.prerm @@ -0,0 +1,27 @@ +#!/bin/sh + +NAME=pvr-omap4-kernel +PACKAGE_NAME=$NAME-dkms +VERSION=`dpkg-query -W -f='${Version}' $PACKAGE_NAME | awk -F "-" '{print $1}' | cut -d\: -f2` + +set -e + +case "$1" in + remove|upgrade|deconfigure) + if [ "`dkms status -m $NAME`" ]; then + dkms remove -m $NAME -v $VERSION --all + fi + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/changelog +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/changelog @@ -0,0 +1,146 @@ +pvr-omap4-kernel (1.7.5.2+git20110610+9696932c-1) natty; urgency=low + + * Imported Upstream version 1.7.5.2+git20110610+9696932c + * debian/patches/0008-The-IMG-DRM-module-can-become-a-plugin-sub-module-of.patch: + - Make the PVR kernel module a plugin of omap_gpu when it's available + * debian/patches/0009-IMG-DRM-make-SUPPORT_DRI_DRM_EXTERNAL-depends-on-DRM.patch: + - Only build it as a sub-plugin when CONFIG_DRM_OMAP is enabled + + -- Ricardo Salveti de Araujo Mon, 13 Jun 2011 01:13:28 -0300 + +pvr-omap4-kernel (1.7.5.0+git20110520+95685747-1) natty; urgency=low + + * Imported Upstream version 1.7.5.0+git20110520+95685747 + + -- Ricardo Salveti de Araujo Sun, 22 May 2011 22:01:12 -0300 + +pvr-omap4-kernel (1.7.5.0+git20110506+05ede8c5-1) natty; urgency=low + + * Imported Upstream version 1.7.5.0+git20110506+05ede8c5 + + -- Ricardo Salveti de Araujo Wed, 18 May 2011 02:06:50 -0300 + +pvr-omap4-kernel (1.7.5.0~gitc77b84a-2) natty; urgency=low + + * debian/patches/0007-Removing-Werror-from-osfunc-to-build-file-for-1207-a.patch: + - Make it also build with 1207 + + -- Ricardo Salveti de Araujo Sat, 23 Apr 2011 17:42:50 -0300 + +pvr-omap4-kernel (1.7.5.0~gitc77b84a-1) natty; urgency=low + + * Imported Upstream version 1.7.5.0~gitc77b84a + * debian/patches/0001-Avoid-calling-set_max_mpu_wakeup_lat-as-it-s-not-ava.patch: + - Avoid using set_max_mpu_wakeup_lat function as it's not yet available for 38 + * debian/patches/0002-SGX-Porting-kernel-module-to-2.6.38.patch: + - Rebased on top of 1.7.5.0~gitc77b84a + * debian/patches/0003-Changing-module-name-back-to-pvrsrvkm.patch: + - Move module name back to pvrsrvkm (platform device name at current kernel) + * debian/patches/0004-Display-controller-should-depend-on-the-xorg-support.patch: + - The display controller driver should depend on the xorg support + * debian/patches/0005-Provide-a-proper-build-date-for-the-pvr-module.patch: + - Needed as libdrm uses the driver's build date + * debian/patches/0006-Fixing-OuterCache-definition-to-be-compatible-with-t.patch + - Compatible with the new outer_flush_range API (introduced at .39) + + -- Ricardo Salveti de Araujo Fri, 15 Apr 2011 01:31:00 -0300 + +pvr-omap4-kernel (1.7~git0f0b25f-2natty2) natty; urgency=low + + * Changes to be compatible with 2.6.38: + - Disabling gfx_vout_mod as the V4L1 interface is removed at 2.6.38. + - Changing module name back to pvrsrvkm + * debian/patches/0001-Function-profiling-via-new-GP-timer-kernel-API.patch: + - Updating the API with newer kernel + * debian/patches/0002-SGX-Porting-kernel-module-to-2.6.38.patch: + - Build fixes to be compatible with kernel 2.6.38 API + * debian/patches/0003-Disabling-PVR_NO_OMAP_TIMER-again-for-38.patch: + - Not yet ready for 2.6.38 + + -- Ricardo Salveti de Araujo Mon, 21 Mar 2011 19:41:21 -0300 + +pvr-omap4-kernel (1.7~git0f0b25f-2natty1) natty; urgency=low + + * Build for Natty + + -- Ricardo Salveti de Araujo Sun, 20 Feb 2011 01:51:02 -0300 + +pvr-omap4-kernel (1.7~git0f0b25f-2) maverick; urgency=low + + * Do not force pb grow shrink in Makefile any more + * Handle new gfx_vout_mod + + -- Vincent Stehlé Tue, 15 Feb 2011 17:25:56 +0100 + +pvr-omap4-kernel (1.7~git0f0b25f-1) maverick; urgency=low + + * Imported Upstream version 1.7~git0f0b25f + + -- Vincent Stehlé Thu, 10 Feb 2011 17:03:46 +0100 + +pvr-omap4-kernel (1.6.4.1-1) maverick; urgency=low + + * Imported Upstream version 1.6.4.1 + + -- Vincent Stehlé Wed, 26 Jan 2011 09:30:09 +0100 + +pvr-omap4-kernel (1.6.4.0-1) maverick; urgency=low + + * Imported Upstream version 1.6.4.0 + + -- Vincent Stehlé Mon, 13 Dec 2010 18:53:50 +0100 + +pvr-omap4-kernel (0.24.11-5) maverick; urgency=low + + * Rework makefile + * DISABLE_SGX_PB_GROW_SHRINK to workaround fullscreen issue + + -- Vincent Stehlé Wed, 24 Nov 2010 18:08:32 +0100 + +pvr-omap4-kernel (0.24.11-4) maverick; urgency=low + + * Enable EDM trace in debug + + -- Vincent Stehlé Mon, 22 Nov 2010 18:10:41 +0100 + +pvr-omap4-kernel (0.24.11-3) maverick; urgency=low + + * Debug version + + -- Vincent Stehlé Fri, 05 Nov 2010 15:32:55 +0100 + +pvr-omap4-kernel (0.24.11-2) maverick; urgency=low + + * Parallel make. + + -- Vincent Stehlé Fri, 05 Nov 2010 11:17:50 +0100 + +pvr-omap4-kernel (0.24.11-1) maverick; urgency=low + + * Bump revision for L24.11. + + -- Vincent Stehlé Thu, 04 Nov 2010 14:20:41 +0100 + +pvr-omap4-kernel (0.24.10-3) maverick; urgency=low + + * Fix and update dkms.conf + + -- Vincent Stehlé Wed, 20 Oct 2010 19:21:29 +0200 + +pvr-omap4-kernel (0.24.10-2) maverick; urgency=low + + * Drop patch hack-add-omapfb-h + + -- Vincent Stehlé Mon, 18 Oct 2010 15:17:06 +0200 + +pvr-omap4-kernel (0.24.10-1) maverick; urgency=low + + * Update "upstream". + + -- Vincent Stehlé Mon, 18 Oct 2010 15:09:35 +0200 + +pvr-omap4-kernel (0.24.9-1) maverick; urgency=low + + * Initial public release. + + -- Vincent Stehlé Tue, 12 Oct 2010 16:54:59 +0200 --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/pvr-omap4-kernel-debug-dkms.postinst +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/pvr-omap4-kernel-debug-dkms.postinst @@ -0,0 +1,48 @@ +#!/bin/sh +# Copyright (C) 2002-2005 Flavio Stanchina +# Copyright (C) 2005-2006 Aric Cyr +# Copyright (C) 2007 Mario Limonciello +# Copyright (C) 2009 Alberto Milone + +set -e + +NAME=pvr-omap4-kernel-debug +PACKAGE_NAME=$NAME-dkms +CVERSION=`dpkg-query -W -f='${Version}' $PACKAGE_NAME | awk -F "-" '{print $1}' | cut -d\: -f2` +ARCH=`dpkg --print-architecture` + +dkms_configure () { + for POSTINST in /usr/lib/dkms/common.postinst "/usr/share/$PACKAGE_NAME/postinst"; do + if [ -f "$POSTINST" ]; then + "$POSTINST" "$NAME" "$CVERSION" "/usr/share/$PACKAGE_NAME" "$ARCH" "$2" + return $? + fi + echo "WARNING: $POSTINST does not exist." >&2 + done + echo "ERROR: DKMS version is too old and $PACKAGE_NAME was not" >&2 + echo "built with legacy DKMS support." >&2 + echo "You must either rebuild $PACKAGE_NAME with legacy postinst" >&2 + echo "support or upgrade DKMS to a more current version." >&2 + return 1 +} + +case "$1" in + configure) + dkms_configure + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/pvr-omap4-kernel-dkms.postinst +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/pvr-omap4-kernel-dkms.postinst @@ -0,0 +1,48 @@ +#!/bin/sh +# Copyright (C) 2002-2005 Flavio Stanchina +# Copyright (C) 2005-2006 Aric Cyr +# Copyright (C) 2007 Mario Limonciello +# Copyright (C) 2009 Alberto Milone + +set -e + +NAME=pvr-omap4-kernel +PACKAGE_NAME=$NAME-dkms +CVERSION=`dpkg-query -W -f='${Version}' $PACKAGE_NAME | awk -F "-" '{print $1}' | cut -d\: -f2` +ARCH=`dpkg --print-architecture` + +dkms_configure () { + for POSTINST in /usr/lib/dkms/common.postinst "/usr/share/$PACKAGE_NAME/postinst"; do + if [ -f "$POSTINST" ]; then + "$POSTINST" "$NAME" "$CVERSION" "/usr/share/$PACKAGE_NAME" "$ARCH" "$2" + return $? + fi + echo "WARNING: $POSTINST does not exist." >&2 + done + echo "ERROR: DKMS version is too old and $PACKAGE_NAME was not" >&2 + echo "built with legacy DKMS support." >&2 + echo "You must either rebuild $PACKAGE_NAME with legacy postinst" >&2 + echo "support or upgrade DKMS to a more current version." >&2 + return 1 +} + +case "$1" in + configure) + dkms_configure + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/control +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/control @@ -0,0 +1,39 @@ +Source: pvr-omap4-kernel +Section: graphics +Priority: optional +Maintainer: TI OMAP Developers +Build-Depends: cdbs, debhelper (>= 7), quilt, dkms +Standards-Version: 3.9.1 +Homepage: https://gforge01.dal.design.ti.com/gf/project/gfx_l24_ddk2/ + +Package: pvr-omap4-kernel-dkms +Architecture: armel +Section: kernel +Depends: dkms (>= 1.95), make, ${misc:Depends}, linux-headers-omap4, coreutils, grep, bash, dos2unix +Conflicts: sgx-kernel-module, sgx-dkms +Replaces: sgx-kernel-module, sgx-dkms +Description: PowerVR SGX540 kernel driver for OMAP4 in DKMS format. + This package provides the source code for the PowerVR SGX540 OMAP4 + kernel module. + . + This driver will allow usage of the OpenGLES SGX libraries, providing + 3D acceleration. Kernel source or headers are required to compile these + modules. + . + This package contains the source to be built with dkms. + +Package: pvr-omap4-kernel-debug-dkms +Architecture: armel +Section: kernel +Depends: dkms (>= 1.95), make, ${misc:Depends}, linux-headers-omap4, coreutils, grep, bash, dos2unix +Conflicts: sgx-kernel-module, sgx-dkms +Replaces: sgx-kernel-module, sgx-dkms +Description: PowerVR SGX540 kernel driver for OMAP4 in DKMS format, in debug mode. + This package provides the source code for the PowerVR SGX540 OMAP4 + kernel module. + . + This driver will allow usage of the OpenGLES SGX libraries, providing + 3D acceleration. Kernel source or headers are required to compile these + modules. + . + This package contains the source to be built with dkms in debug mode. --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/compat +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/compat @@ -0,0 +1 @@ +7 --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/0001-Avoid-calling-set_max_mpu_wakeup_lat-as-it-s-not-ava.patch +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/0001-Avoid-calling-set_max_mpu_wakeup_lat-as-it-s-not-ava.patch @@ -0,0 +1,63 @@ +From 1fa2bcfb8dbdb4bc8199d0ef1701a101857d4361 Mon Sep 17 00:00:00 2001 +From: ubuntu +Date: Thu, 14 Apr 2011 23:35:26 -0300 +Subject: [PATCH] Avoid calling set_max_mpu_wakeup_lat as it's not available at .38 + +Signed-off-by: Ricardo Salveti de Araujo +--- + sgx/services4/system/omap4/sysutils_linux.c | 13 ++----------- + 1 files changed, 2 insertions(+), 11 deletions(-) + +diff --git a/sgx/services4/system/omap4/sysutils_linux.c b/sgx/services4/system/omap4/sysutils_linux.c +index bc02e0d..13a478a 100755 +--- a/sgx/services4/system/omap4/sysutils_linux.c ++++ b/sgx/services4/system/omap4/sysutils_linux.c +@@ -40,8 +40,6 @@ + + #include + #include +-#include +-#include + + #define ONE_MHZ 1000000 + #define HZ_TO_MHZ(m) ((m) / ONE_MHZ) +@@ -54,7 +52,6 @@ + + #if defined(LDM_PLATFORM) && !defined(PVR_DRI_DRM_NOT_PCI) + extern struct platform_device *gpsPVRLDMDev; +-static struct pm_qos_request_list *qos_request; + #endif + + static IMG_VOID PowerLockWrap(SYS_SPECIFIC_DATA *psSysSpecData) +@@ -157,12 +154,8 @@ PVRSRV_ERROR EnableSGXClocks(SYS_DATA *psSysData) + + #if defined(LDM_PLATFORM) && !defined(PVR_DRI_DRM_NOT_PCI) + { +- int res; + +- ((struct gpu_platform_data*)gpsPVRLDMDev->dev.platform_data)->set_max_mpu_wakeup_lat(&qos_request, 0); +- omap_device_set_rate(&gpsPVRLDMDev->dev, &gpsPVRLDMDev->dev, +- SYS_SGX_CLOCK_SPEED); +- res = pm_runtime_get_sync(&gpsPVRLDMDev->dev); ++ int res = pm_runtime_get_sync(&gpsPVRLDMDev->dev); + if (res < 0) + { + PVR_DPF((PVR_DBG_ERROR, "EnableSGXClocks: pm_runtime_get_sync failed (%d)", -res)); +@@ -199,13 +192,11 @@ IMG_VOID DisableSGXClocks(SYS_DATA *psSysData) + + #if defined(LDM_PLATFORM) && !defined(PVR_DRI_DRM_NOT_PCI) + { +- int res = pm_runtime_put_sync(&gpsPVRLDMDev->dev); ++ int res = 0; // XXX TL .38 pm_runtime_put_sync(&gpsPVRLDMDev->dev); + if (res < 0) + { + PVR_DPF((PVR_DBG_ERROR, "DisableSGXClocks: pm_runtime_put_sync failed (%d)", -res)); + } +- ((struct gpu_platform_data*)gpsPVRLDMDev->dev.platform_data)->set_max_mpu_wakeup_lat(&qos_request, -1); +- omap_device_set_rate(&gpsPVRLDMDev->dev, &gpsPVRLDMDev->dev, 0); + } + #endif + +-- +1.7.4.1 + --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/0002-SGX-Porting-kernel-module-to-2.6.38.patch +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/0002-SGX-Porting-kernel-module-to-2.6.38.patch @@ -0,0 +1,781 @@ +From 02a81ad3509494fbdba20e89e4ee5672ca366040 Mon Sep 17 00:00:00 2001 +From: ubuntu +Date: Thu, 14 Apr 2011 23:03:25 -0300 +Subject: [PATCH] SGX: Porting kernel module to 2.6.38 + +Signed-off-by: Ricardo Salveti de Araujo +--- + .../3rdparty/dc_omap_linux/omaplfb_displayclass.c | 64 ++++++++++++++++++++ + .../3rdparty/dc_omap_linux/omaplfb_linux.c | 5 +- + .../dc_omapfb3_linux/omaplfb_displayclass.c | 16 +++++ + .../3rdparty/dc_omapfb3_linux/omaplfb_linux.c | 42 ++++++++++++- + sgx/services4/include/env/linux/pvr_drm_shared.h | 24 ++++---- + sgx/services4/srvkm/common/resman.c | 9 +++- + sgx/services4/srvkm/env/linux/event.c | 5 +- + sgx/services4/srvkm/env/linux/mm.c | 5 +- + sgx/services4/srvkm/env/linux/mm.h | 5 +- + sgx/services4/srvkm/env/linux/mmap.c | 5 +- + sgx/services4/srvkm/env/linux/module.c | 5 +- + sgx/services4/srvkm/env/linux/mutils.c | 5 +- + sgx/services4/srvkm/env/linux/mutils.h | 6 +- + sgx/services4/srvkm/env/linux/osfunc.c | 5 +- + sgx/services4/srvkm/env/linux/proc.c | 5 +- + sgx/services4/srvkm/env/linux/pvr_debug.c | 4 + + sgx/services4/srvkm/env/linux/pvr_drm.c | 19 ++++++- + sgx/services4/srvkm/env/linux/pvr_drm.h | 20 +++++-- + sgx/services4/srvkm/env/linux/pvr_uaccess.h | 5 +- + 19 files changed, 221 insertions(+), 33 deletions(-) + +diff --git a/sgx/services4/3rdparty/dc_omap_linux/omaplfb_displayclass.c b/sgx/services4/3rdparty/dc_omap_linux/omaplfb_displayclass.c +index e5eba51..97c43f5 100644 +--- a/sgx/services4/3rdparty/dc_omap_linux/omaplfb_displayclass.c ++++ b/sgx/services4/3rdparty/dc_omap_linux/omaplfb_displayclass.c +@@ -302,14 +302,27 @@ OMAP_ERROR UnBlankDisplay(OMAPLFB_DEVINFO *psDevInfo) + DEBUG_PRINTK("Executing for display %u", + psDevInfo->uDeviceID); + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + if (fb_blank(psDevInfo->psLINFBInfo, FB_BLANK_UNBLANK)) + { ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + WARNING_PRINTK("fb_blank FB_BLANK_UNBLANK failed"); + return OMAP_ERROR_GENERIC; + } ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + + return OMAP_OK; + } +@@ -324,13 +337,26 @@ static OMAP_ERROR BlankDisplay(OMAPLFB_DEVINFO *psDevInfo, int blank_cmd) + DEBUG_PRINTK("Executing for display %u", + psDevInfo->uDeviceID); + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + if (fb_blank(psDevInfo->psLINFBInfo, blank_cmd)) { ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + WARNING_PRINTK("fb_blank %i failed", blank_cmd); + return OMAP_ERROR_GENERIC; + } ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + + return OMAP_OK; + } +@@ -537,7 +563,11 @@ static OMAP_ERROR ReInitDev(OMAPLFB_DEVINFO *psDevInfo) + WARNING_PRINTK("Unknown bits per pixel format %i", + DESIRED_BPP); + } ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + psLINFBInfo->var.activate = FB_ACTIVATE_FORCE; + fb_set_var(psLINFBInfo, &psLINFBInfo->var); + buffers_available = +@@ -633,7 +663,11 @@ static OMAP_ERROR ReInitDev(OMAPLFB_DEVINFO *psDevInfo) + } else + WARNING_PRINTK("*Format: Unknown framebuffer format"); + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + return OMAP_OK; + } + +@@ -994,8 +1028,14 @@ static PVRSRV_ERROR CreateDCSwapChain(IMG_HANDLE hDevice, + * and its own work for this display + */ + INIT_WORK(&psDevInfo->sync_display_work, OMAPLFBSyncIHandler); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + psDevInfo->sync_display_wq = + __create_workqueue("pvr_display_sync_wq", 1, 1, 1); ++#else ++ psDevInfo->sync_display_wq = ++ alloc_ordered_workqueue("pvr_display_sync_wq", ++ WQ_NON_REENTRANT | WQ_FREEZABLE | WQ_HIGHPRI); ++#endif + + DEBUG_PRINTK("Swap chain will have %u buffers for display %u", + (unsigned int)ui32BufferCount, psDevInfo->uDeviceID); +@@ -1614,7 +1654,11 @@ static void DeInitDev(OMAPLFB_DEVINFO *psDevInfo) + struct fb_info *psLINFBInfo = psDevInfo->psLINFBInfo; + struct module *psLINFBOwner; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + psLINFBOwner = psLINFBInfo->fbops->owner; + + if (psLINFBInfo->fbops->fb_release != NULL) +@@ -1622,7 +1666,11 @@ static void DeInitDev(OMAPLFB_DEVINFO *psDevInfo) + + module_put(psLINFBOwner); + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + } + + /* +@@ -1741,7 +1789,11 @@ static OMAP_ERROR InitDev(OMAPLFB_DEVINFO *psDevInfo, int fb_idx) + WARNING_PRINTK("Unknown bits per pixel format %i", + DESIRED_BPP); + } ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + psLINFBInfo->var.activate = FB_ACTIVATE_FORCE; + fb_set_var(psLINFBInfo, &psLINFBInfo->var); + buffers_available = +@@ -1764,7 +1816,11 @@ static OMAP_ERROR InitDev(OMAPLFB_DEVINFO *psDevInfo, int fb_idx) + if (!try_module_get(psLINFBOwner)) + { + ERROR_PRINTK("Couldn't get framebuffer module"); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + return OMAP_ERROR_GENERIC; + } + +@@ -1775,7 +1831,11 @@ static OMAP_ERROR InitDev(OMAPLFB_DEVINFO *psDevInfo, int fb_idx) + ERROR_PRINTK("Couldn't open framebuffer with" + " index %d", fb_idx); + module_put(psLINFBOwner); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + return OMAP_ERROR_GENERIC; + } + } +@@ -1869,7 +1929,11 @@ static OMAP_ERROR InitDev(OMAPLFB_DEVINFO *psDevInfo, int fb_idx) + else + WARNING_PRINTK("*Format: Unknown framebuffer format"); + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + return OMAP_OK; + } + +diff --git a/sgx/services4/3rdparty/dc_omap_linux/omaplfb_linux.c b/sgx/services4/3rdparty/dc_omap_linux/omaplfb_linux.c +index 36c94d4..4c34257 100644 +--- a/sgx/services4/3rdparty/dc_omap_linux/omaplfb_linux.c ++++ b/sgx/services4/3rdparty/dc_omap_linux/omaplfb_linux.c +@@ -24,9 +24,13 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + + #if defined(SUPPORT_DRI_DRM) + #include +@@ -34,7 +38,6 @@ + #include + #endif + +-#include + #include + #include + +diff --git a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c +index 2d96aa7..0ed53cf 100755 +--- a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c ++++ b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c +@@ -831,7 +831,11 @@ static OMAPLFB_ERROR OMAPLFBInitFBDev(OMAPLFB_DEVINFO *psDevInfo) + unsigned long ulLCM; + unsigned uiFBDevID = psDevInfo->uiFBDevID; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + + psLINFBInfo = registered_fb[uiFBDevID]; + if (psLINFBInfo == NULL) +@@ -973,7 +977,11 @@ static OMAPLFB_ERROR OMAPLFBInitFBDev(OMAPLFB_DEVINFO *psDevInfo) + ErrorModPut: + module_put(psLINFBOwner); + ErrorRelSem: ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + + return eError; + } +@@ -983,7 +991,11 @@ static void OMAPLFBDeInitFBDev(OMAPLFB_DEVINFO *psDevInfo) + struct fb_info *psLINFBInfo = psDevInfo->psLINFBInfo; + struct module *psLINFBOwner; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + + psLINFBOwner = psLINFBInfo->fbops->owner; + +@@ -994,7 +1006,11 @@ static void OMAPLFBDeInitFBDev(OMAPLFB_DEVINFO *psDevInfo) + + module_put(psLINFBOwner); + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + } + + static OMAPLFB_DEVINFO *OMAPLFBInitDev(unsigned uiFBDevID) +diff --git a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c +index e6289c3..6a0257b 100755 +--- a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c ++++ b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c +@@ -24,11 +24,13 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif +- +-#include ++#endif + + #include + +@@ -194,7 +196,11 @@ static void WorkQueueHandler(struct work_struct *psWork) + OMAPLFB_ERROR OMAPLFBCreateSwapQueue(OMAPLFB_SWAPCHAIN *psSwapChain) + { + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + psSwapChain->psWorkQueue = __create_workqueue(DEVNAME, 1, 1, 1); ++#else ++ psSwapChain->psWorkQueue = alloc_ordered_workqueue(DEVNAME, WQ_NON_REENTRANT | WQ_FREEZABLE | WQ_HIGHPRI); ++#endif + if (psSwapChain->psWorkQueue == NULL) + { + printk(KERN_WARNING DRIVER_PREFIX ": %s: Device %u: create_singlethreaded_workqueue failed\n", __FUNCTION__, psSwapChain->uiFBDevID); +@@ -221,7 +227,11 @@ void OMAPLFBFlip(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_BUFFER *psBuffer) + int res; + unsigned long ulYResVirtual; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + + sFBVar = psDevInfo->psLINFBInfo->var; + +@@ -253,7 +263,11 @@ void OMAPLFBFlip(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_BUFFER *psBuffer) + } + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + } + + OMAPLFB_UPDATE_MODE OMAPLFBGetUpdateMode(OMAPLFB_DEVINFO *psDevInfo) +@@ -435,9 +449,17 @@ OMAPLFB_ERROR OMAPLFBUnblankDisplay(OMAPLFB_DEVINFO *psDevInfo) + { + int res; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + res = fb_blank(psDevInfo->psLINFBInfo, 0); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + if (res != 0 && res != -EINVAL) + { + printk(KERN_WARNING DRIVER_PREFIX +@@ -452,9 +474,17 @@ OMAPLFB_ERROR OMAPLFBUnblankDisplay(OMAPLFB_DEVINFO *psDevInfo) + + static void OMAPLFBBlankDisplay(OMAPLFB_DEVINFO *psDevInfo) + { ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + fb_blank(psDevInfo->psLINFBInfo, 1); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + } + + static void OMAPLFBEarlySuspendHandler(struct early_suspend *h) +@@ -685,9 +715,17 @@ int PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Ioctl)(struct drm_device unref__ *dev, + flush_workqueue(psDevInfo->psSwapChain->psWorkQueue); + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + acquire_console_sem(); ++#else ++ console_lock(); ++#endif + ret = fb_blank(psDevInfo->psLINFBInfo, iFBMode); ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + release_console_sem(); ++#else ++ console_unlock(); ++#endif + + OMAPLFBCreateSwapChainUnLock(psDevInfo); + +diff --git a/sgx/services4/include/env/linux/pvr_drm_shared.h b/sgx/services4/include/env/linux/pvr_drm_shared.h +index a7e9060..786592c 100755 +--- a/sgx/services4/include/env/linux/pvr_drm_shared.h ++++ b/sgx/services4/include/env/linux/pvr_drm_shared.h +@@ -30,19 +30,19 @@ + #if defined(SUPPORT_DRI_DRM) + + #if defined(SUPPORT_DRI_DRM_EXT) +-#define PVR_DRM_SRVKM_CMD DRM_PVR_RESERVED1 +-#define PVR_DRM_DISP_CMD DRM_PVR_RESERVED2 +-#define PVR_DRM_BC_CMD DRM_PVR_RESERVED3 +-#define PVR_DRM_IS_MASTER_CMD DRM_PVR_RESERVED4 +-#define PVR_DRM_UNPRIV_CMD DRM_PVR_RESERVED5 +-#define PVR_DRM_DBGDRV_CMD DRM_PVR_RESERVED6 ++#define DRM_PVR_SRVKM DRM_PVR_RESERVED1 ++#define DRM_PVR_DISP DRM_PVR_RESERVED2 ++#define DRM_PVR_BC DRM_PVR_RESERVED3 ++#define DRM_PVR_IS_MASTER DRM_PVR_RESERVED4 ++#define DRM_PVR_UNPRIV DRM_PVR_RESERVED5 ++#define DRM_PVR_DBGDRV DRM_PVR_RESERVED6 + #else +-#define PVR_DRM_SRVKM_CMD 0 +-#define PVR_DRM_DISP_CMD 1 +-#define PVR_DRM_BC_CMD 2 +-#define PVR_DRM_IS_MASTER_CMD 3 +-#define PVR_DRM_UNPRIV_CMD 4 +-#define PVR_DRM_DBGDRV_CMD 5 ++#define DRM_PVR_SRVKM 0x00 ++#define DRM_PVR_DISP 0x01 ++#define DRM_PVR_BC 0x02 ++#define DRM_PVR_IS_MASTER 0x03 ++#define DRM_PVR_UNPRIV 0x04 ++#define DRM_PVR_DBGDRV 0x05 + #endif + + #define PVR_DRM_UNPRIV_INIT_SUCCESFUL 0 +diff --git a/sgx/services4/srvkm/common/resman.c b/sgx/services4/srvkm/common/resman.c +index b3a4534..96823c5 100755 +--- a/sgx/services4/srvkm/common/resman.c ++++ b/sgx/services4/srvkm/common/resman.c +@@ -27,12 +27,15 @@ + #include "services_headers.h" + #include "resman.h" + ++#include ++ + #ifdef __linux__ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + +-#include + #include + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9) + #include +@@ -46,7 +49,11 @@ + #include + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ++static DEFINE_SEMAPHORE(lock); ++#else + static DECLARE_MUTEX(lock); ++#endif + + #define ACQUIRE_SYNC_OBJ do { \ + if (in_interrupt()) { \ +diff --git a/sgx/services4/srvkm/env/linux/event.c b/sgx/services4/srvkm/env/linux/event.c +index c53e02d..01da99c 100755 +--- a/sgx/services4/srvkm/env/linux/event.c ++++ b/sgx/services4/srvkm/env/linux/event.c +@@ -24,11 +24,14 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + +-#include + #include + #include + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) +diff --git a/sgx/services4/srvkm/env/linux/mm.c b/sgx/services4/srvkm/env/linux/mm.c +index 8ae9fb6..058a2cb 100755 +--- a/sgx/services4/srvkm/env/linux/mm.c ++++ b/sgx/services4/srvkm/env/linux/mm.c +@@ -24,11 +24,14 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + +-#include + #include + #include + #include +diff --git a/sgx/services4/srvkm/env/linux/mm.h b/sgx/services4/srvkm/env/linux/mm.h +index 9f91186..235ed21 100755 +--- a/sgx/services4/srvkm/env/linux/mm.h ++++ b/sgx/services4/srvkm/env/linux/mm.h +@@ -27,11 +27,14 @@ + #ifndef __IMG_LINUX_MM_H__ + #define __IMG_LINUX_MM_H__ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + +-#include + #include + #include + #include +diff --git a/sgx/services4/srvkm/env/linux/mmap.c b/sgx/services4/srvkm/env/linux/mmap.c +index 6379eb0..47bfcd4 100755 +--- a/sgx/services4/srvkm/env/linux/mmap.c ++++ b/sgx/services4/srvkm/env/linux/mmap.c +@@ -24,11 +24,14 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + +-#include + #include + #include + #include +diff --git a/sgx/services4/srvkm/env/linux/module.c b/sgx/services4/srvkm/env/linux/module.c +index f4a15f1..1685045 100755 +--- a/sgx/services4/srvkm/env/linux/module.c ++++ b/sgx/services4/srvkm/env/linux/module.c +@@ -24,9 +24,13 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + + #if defined(SUPPORT_DRI_DRM) + #define PVR_MOD_STATIC +@@ -53,7 +57,6 @@ + #include + #include + #include +-#include + #include + #include + +diff --git a/sgx/services4/srvkm/env/linux/mutils.c b/sgx/services4/srvkm/env/linux/mutils.c +index 884635e..761ba22 100755 +--- a/sgx/services4/srvkm/env/linux/mutils.c ++++ b/sgx/services4/srvkm/env/linux/mutils.c +@@ -24,10 +24,13 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif +-#include ++#endif + + #include + #include +diff --git a/sgx/services4/srvkm/env/linux/mutils.h b/sgx/services4/srvkm/env/linux/mutils.h +index 92d8e7b..415938f 100755 +--- a/sgx/services4/srvkm/env/linux/mutils.h ++++ b/sgx/services4/srvkm/env/linux/mutils.h +@@ -27,11 +27,13 @@ + #ifndef __IMG_LINUX_MUTILS_H__ + #define __IMG_LINUX_MUTILS_H__ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif +- +-#include ++#endif + + #if !(defined(__i386__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))) + #if defined(SUPPORT_LINUX_X86_PAT) +diff --git a/sgx/services4/srvkm/env/linux/osfunc.c b/sgx/services4/srvkm/env/linux/osfunc.c +index f3e02ed..281f048 100755 +--- a/sgx/services4/srvkm/env/linux/osfunc.c ++++ b/sgx/services4/srvkm/env/linux/osfunc.c +@@ -24,11 +24,14 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + +-#include + #include + #include + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) +diff --git a/sgx/services4/srvkm/env/linux/proc.c b/sgx/services4/srvkm/env/linux/proc.c +index a080938..c2372f6 100755 +--- a/sgx/services4/srvkm/env/linux/proc.c ++++ b/sgx/services4/srvkm/env/linux/proc.c +@@ -24,13 +24,16 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + + #include + #include +-#include + #include + #include + #include +diff --git a/sgx/services4/srvkm/env/linux/pvr_debug.c b/sgx/services4/srvkm/env/linux/pvr_debug.c +index 2e64fe6..5b6325e 100755 +--- a/sgx/services4/srvkm/env/linux/pvr_debug.c ++++ b/sgx/services4/srvkm/env/linux/pvr_debug.c +@@ -24,9 +24,13 @@ + * + ******************************************************************************/ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + + #include + #include +diff --git a/sgx/services4/srvkm/env/linux/pvr_drm.c b/sgx/services4/srvkm/env/linux/pvr_drm.c +index ed5a0ba..3cd7a63 100755 +--- a/sgx/services4/srvkm/env/linux/pvr_drm.c ++++ b/sgx/services4/srvkm/env/linux/pvr_drm.c +@@ -26,14 +26,17 @@ + + #if defined(SUPPORT_DRI_DRM) + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + + #include + #include + #include +-#include + #include + #include + #include +@@ -329,6 +332,7 @@ PVRDRM_Display_ioctl(struct drm_device *dev, void *arg, struct drm_file *pFile) + + #if !defined(SUPPORT_DRI_DRM_EXT) + struct drm_ioctl_desc sPVRDrmIoctls[] = { ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35)) + DRM_IOCTL_DEF(PVR_DRM_SRVKM_IOCTL, PVRSRV_BridgeDispatchKM, PVR_DRM_UNLOCKED), + DRM_IOCTL_DEF(PVR_DRM_IS_MASTER_IOCTL, PVRDRMIsMaster, DRM_MASTER | PVR_DRM_UNLOCKED), + DRM_IOCTL_DEF(PVR_DRM_UNPRIV_IOCTL, PVRDRMUnprivCmd, PVR_DRM_UNLOCKED), +@@ -338,6 +342,17 @@ struct drm_ioctl_desc sPVRDrmIoctls[] = { + #if defined(DISPLAY_CONTROLLER) && defined(PVR_DISPLAY_CONTROLLER_DRM_IOCTL) + DRM_IOCTL_DEF(PVR_DRM_DISP_IOCTL, PVRDRM_Display_ioctl, DRM_MASTER | PVR_DRM_UNLOCKED) + #endif ++#else ++ DRM_IOCTL_DEF_DRV(PVR_SRVKM, PVRSRV_BridgeDispatchKM, PVR_DRM_UNLOCKED), ++ DRM_IOCTL_DEF_DRV(PVR_IS_MASTER, PVRDRMIsMaster, DRM_MASTER | PVR_DRM_UNLOCKED), ++ DRM_IOCTL_DEF_DRV(PVR_UNPRIV, PVRDRMUnprivCmd, PVR_DRM_UNLOCKED), ++#if defined(PDUMP) ++ DRM_IOCTL_DEF_DRV(PVR_DBGDRV, dbgdrv_ioctl, PVR_DRM_UNLOCKED), ++#endif ++#if defined(DISPLAY_CONTROLLER) && defined(PVR_DISPLAY_CONTROLLER_DRM_IOCTL) ++ DRM_IOCTL_DEF_DRV(PVR_DISP, PVRDRM_Display_ioctl, DRM_MASTER | PVR_DRM_UNLOCKED) ++#endif ++#endif + }; + + static int pvr_max_ioctl = DRM_ARRAY_SIZE(sPVRDrmIoctls); +@@ -362,8 +377,10 @@ static struct drm_driver sPVRDrmDriver = + .suspend = PVRSRVDriverSuspend, + .resume = PVRSRVDriverResume, + #endif ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36)) + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, ++#endif + .ioctls = sPVRDrmIoctls, + .fops = + { +diff --git a/sgx/services4/srvkm/env/linux/pvr_drm.h b/sgx/services4/srvkm/env/linux/pvr_drm.h +index 4212faf..e0276df 100755 +--- a/sgx/services4/srvkm/env/linux/pvr_drm.h ++++ b/sgx/services4/srvkm/env/linux/pvr_drm.h +@@ -33,6 +33,8 @@ + #define PVR_DRM_MAKENAME_HELPER(x, y) x ## y + #define PVR_DRM_MAKENAME(x, y) PVR_DRM_MAKENAME_HELPER(x, y) + ++#include ++ + #if defined(PVR_DRI_DRM_PLATFORM_DEV) + #define LDM_DEV struct platform_device + #endif +@@ -87,11 +89,19 @@ IMG_INT dbgdrv_ioctl(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFi + #endif + + #if !defined(SUPPORT_DRI_DRM_EXT) +-#define PVR_DRM_SRVKM_IOCTL _IO(0, PVR_DRM_SRVKM_CMD) +-#define PVR_DRM_IS_MASTER_IOCTL _IO(0, PVR_DRM_IS_MASTER_CMD) +-#define PVR_DRM_UNPRIV_IOCTL _IO(0, PVR_DRM_UNPRIV_CMD) +-#define PVR_DRM_DBGDRV_IOCTL _IO(0, PVR_DRM_DBGDRV_CMD) +-#define PVR_DRM_DISP_IOCTL _IO(0, PVR_DRM_DISP_CMD) ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35)) ++#define PVR_DRM_SRVKM_IOCTL _IO(0, DRM_PVR_SRVKM) ++#define PVR_DRM_IS_MASTER_IOCTL _IO(0, DRM_PVR_IS_MASTER) ++#define PVR_DRM_UNPRIV_IOCTL _IO(0, DRM_PVR_UNPRIV) ++#define PVR_DRM_DBGDRV_IOCTL _IO(0, DRM_PVR_DBGDRV) ++#define PVR_DRM_DISP_IOCTL _IO(0, DRM_PVR_DISP) ++#else ++#define DRM_IOCTL_PVR_SRVKM DRM_IO(DRM_COMMAND_BASE + DRM_PVR_SRVKM) ++#define DRM_IOCTL_PVR_DISP DRM_IO(DRM_COMMAND_BASE + DRM_PVR_DISP) ++#define DRM_IOCTL_PVR_IS_MASTER DRM_IO(DRM_COMMAND_BASE + DRM_PVR_IS_MASTER) ++#define DRM_IOCTL_PVR_UNPRIV DRM_IO(DRM_COMMAND_BASE + DRM_PVR_UNPRIV) ++#define DRM_IOCTL_PVR_DBGDRV DRM_IO(DRM_COMMAND_BASE + DRM_PVR_DBGDRV) ++#endif + #endif + + #endif +diff --git a/sgx/services4/srvkm/env/linux/pvr_uaccess.h b/sgx/services4/srvkm/env/linux/pvr_uaccess.h +index 3db3caf..5c28134 100755 +--- a/sgx/services4/srvkm/env/linux/pvr_uaccess.h ++++ b/sgx/services4/srvkm/env/linux/pvr_uaccess.h +@@ -27,11 +27,14 @@ + #ifndef __PVR_UACCESS_H__ + #define __PVR_UACCESS_H__ + ++#include ++ ++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37)) + #ifndef AUTOCONF_INCLUDED + #include + #endif ++#endif + +-#include + #include + + static inline unsigned long pvr_copy_to_user(void __user *pvTo, const void *pvFrom, unsigned long ulBytes) +-- +1.7.4.1 + --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/0008-The-IMG-DRM-module-can-become-a-plugin-sub-module-of.patch +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/0008-The-IMG-DRM-module-can-become-a-plugin-sub-module-of.patch @@ -0,0 +1,628 @@ +From 503105af2034a76200e1f85c8bc26cbd66d7c850 Mon Sep 17 00:00:00 2001 +From: Ian Elliott +Date: Thu, 5 May 2011 17:18:34 -0600 +Subject: [PATCH 1/2] The IMG DRM module can become a plugin sub-module of a TI DRM module. + +This is part of Rob Clark's work to start supporting KMS/XRandR, and set +the stage for other features that TI wants, but IMG won't want to support. +As a part of this, we want a TI DRM module (initially to provide +KMS/XRandR support). The IMG DRM code currently thinks that it is "in +charge" as the DRM module for OMAP, using the 3rd-party display driver +(3PDD) as a sub-module. As such, the IMG DRM registers with the main DRM +part of the kernel, and it use the 3rd-party display driver (3PDD) as a +sub-module (e.g. 3PDD ioctl's are tunneled through IMG ioctl's). + +This change allows for a TI DRM module, that Rob created, to be "in charge" +(e.g. be registered with the main DRM part of the kernel). When enabled +(with the SUPPORT_DRI_DRM_EXTERNAL macro), the IMG DRM code will register +itself as a plugin of the TI DRM module. + +This is a newer version of Rob's patch set (change 108): +- v1: Original patch. +- v2: Fix problem calculating # of flip-chain buffers. +- v3: The SUPPORT_DRI_DRM_EXTERNAL macro was been turned off. +- v4: The SUPPORT_DRI_DRM_EXTERNAL macro was been turned off. +- v4: Re-based to the 1.7.2.0 DDK (with SUPPORT_DRI_DRM_EXTERNAL turned + on). +- v5: Re-based to the latest ti_1.7 HEAD (1.7.5 4403 DDK). This is based + on a re-base that Rob did for the webtop repository, with the + 2.6.38 kernel. +- rsalveti's changes: removed code that touches eurasia + +Signed-off-by: Ian Elliott +Signed-off-by: Ricardo Salveti de Araujo +--- + sgx/eurasiacon/build/linux2/common/dridrm.mk | 2 + + .../build/linux2/omap4430_linux/Makefile | 4 + + .../dc_omapfb3_linux/3rdparty_dc_drm_shared.h | 2 + + sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb.h | 2 + + .../dc_omapfb3_linux/omaplfb_displayclass.c | 87 +++++++++++++------- + .../3rdparty/dc_omapfb3_linux/omaplfb_linux.c | 10 ++- + sgx/services4/srvkm/env/linux/module.c | 37 +++++---- + sgx/services4/srvkm/env/linux/pvr_drm.c | 62 +++++++++++++- + sgx/services4/srvkm/env/linux/pvr_drm.h | 6 +- + 9 files changed, 161 insertions(+), 51 deletions(-) + +diff --git a/sgx/eurasiacon/build/linux2/common/dridrm.mk b/sgx/eurasiacon/build/linux2/common/dridrm.mk +index 5979012..86b2f08 100755 +--- a/sgx/eurasiacon/build/linux2/common/dridrm.mk ++++ b/sgx/eurasiacon/build/linux2/common/dridrm.mk +@@ -25,9 +25,11 @@ + + $(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM,)) + $(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM_EXT,)) ++$(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM_EXTERNAL,)) + + + $(eval $(call TunableBothConfigMake,SUPPORT_DRI_DRM,)) ++$(eval $(call TunableBothConfigMake,SUPPORT_DRI_DRM_EXTERNAL,)) + + ifeq ($(SUPPORT_DRI_DRM),1) + ifeq ($(SUPPORT_DRI_DRM_NO_LIBDRM),1) +diff --git a/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile b/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile +index e2eaab3..9f4e066 100755 +--- a/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile ++++ b/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile +@@ -43,6 +43,8 @@ include ../common/xorg_test.mk + ifeq ($(want_xorg),1) + SUPPORT_DRI_DRM := 1 + SUPPORT_BC_EXAMPLE ?= 0 ++# support for registering as plugin into external DRM driver ++SUPPORT_DRI_DRM_EXTERNAL := 1 + else + SUPPORT_BC_EXAMPLE ?= 1 + endif +@@ -100,9 +102,11 @@ SYS_CUSTOM_POWERLOCK_WRAP := 1 + + ifeq ($(OMAP_KERNEL_AT_LEAST_2_6_35),1) + ifeq ($(LDM_PLATFORM),1) ++ifneq ($(SUPPORT_DRI_DRM_EXTERNAL),1) + PVR_LDM_PLATFORM_PRE_REGISTERED := 1 + endif + endif ++endif + + BUILD_OPENCL ?= 0 + ifneq ($(BUILD_OPENCL),1) +diff --git a/sgx/services4/3rdparty/dc_omapfb3_linux/3rdparty_dc_drm_shared.h b/sgx/services4/3rdparty/dc_omapfb3_linux/3rdparty_dc_drm_shared.h +index 0dee80a..d1f1966 100755 +--- a/sgx/services4/3rdparty/dc_omapfb3_linux/3rdparty_dc_drm_shared.h ++++ b/sgx/services4/3rdparty/dc_omapfb3_linux/3rdparty_dc_drm_shared.h +@@ -36,6 +36,8 @@ + #define PVR_DRM_DISP_CMD_SUSPEND 5 + #define PVR_DRM_DISP_CMD_OFF 6 + ++#define PVR_DRM_DISP_CMD_RESYNC 7 ++ + #define PVR_DRM_DISP_ARG_CMD 0 + #define PVR_DRM_DISP_ARG_DEV 1 + #define PVR_DRM_DISP_NUM_ARGS 2 +diff --git a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb.h b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb.h +index 1c92220..c1817a6 100755 +--- a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb.h ++++ b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb.h +@@ -348,5 +348,7 @@ void OMAPLFBAtomicIntSet(OMAPLFB_ATOMIC_INT *psAtomic, int iVal); + int OMAPLFBAtomicIntRead(OMAPLFB_ATOMIC_INT *psAtomic); + void OMAPLFBAtomicIntInc(OMAPLFB_ATOMIC_INT *psAtomic); + ++OMAPLFB_ERROR OMAPLFBReInitFBDev(OMAPLFB_DEVINFO *psDevInfo); ++ + #endif + +diff --git a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c +index 0ed53cf..43eedc1 100755 +--- a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c ++++ b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c +@@ -918,7 +918,9 @@ static OMAPLFB_ERROR OMAPLFBInitFBDev(OMAPLFB_DEVINFO *psDevInfo) + psPVRFBInfo->ulHeight = psLINFBInfo->var.yres; + psPVRFBInfo->ulByteStride = psLINFBInfo->fix.line_length; + psPVRFBInfo->ulFBSize = FBSize; +- psPVRFBInfo->ulBufferSize = psPVRFBInfo->ulHeight * psPVRFBInfo->ulByteStride; ++ // map entire framebuffer, in case resolution is later changed upwards: ++ //psPVRFBInfo->ulBufferSize = psPVRFBInfo->ulHeight * psPVRFBInfo->ulByteStride; ++ psPVRFBInfo->ulBufferSize = FBSize; + + psPVRFBInfo->ulRoundedBufferSize = RoundUpToMultiple(psPVRFBInfo->ulBufferSize, ulLCM); + +@@ -986,6 +988,59 @@ ErrorRelSem: + return eError; + } + ++/* perform the minimal setup that is re-performed when fb dimensions change, ++ * such as calculation of # of flip chain buffers ++ */ ++OMAPLFB_ERROR OMAPLFBReInitFBDev(OMAPLFB_DEVINFO *psDevInfo) ++{ ++ OMAPLFB_FBINFO *psPVRFBInfo = &psDevInfo->sFBInfo; ++ struct fb_info *psLINFBInfo = registered_fb[psDevInfo->uiFBDevID]; ++ unsigned long ulRoundedBufferSize, ulLCM; ++ OMAPLFB_ERROR err; ++ ++ err = OMAPLFBInitFBDev(psDevInfo); ++ if (err != OMAPLFB_OK) ++ { ++ printk(KERN_INFO DRIVER_PREFIX ": %s: Could not reinit device\n", __FUNCTION__); ++ return err; ++ } ++ ++ /* note: psDevInfo->sFBInfo.ulRoundedBufferSize includes entire fb size, so that ++ * we map entire fb memory (in case screen resolution changes).. so re-calculate ++ * the individual buffer size: ++ */ ++ ulLCM = LCM(psLINFBInfo->fix.line_length, OMAPLFB_PAGE_SIZE); ++ ulRoundedBufferSize = RoundUpToMultiple(psPVRFBInfo->ulHeight * psPVRFBInfo->ulByteStride, ulLCM); ++ ++ psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers = (IMG_UINT32)(psDevInfo->sFBInfo.ulFBSize / ulRoundedBufferSize); ++ if (psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers != 0) ++ { ++ psDevInfo->sDisplayInfo.ui32MaxSwapChains = 1; ++ psDevInfo->sDisplayInfo.ui32MaxSwapInterval = 1; ++ } ++ ++ psDevInfo->sDisplayInfo.ui32PhysicalWidthmm = psDevInfo->sFBInfo.ulPhysicalWidthmm; ++ psDevInfo->sDisplayInfo.ui32PhysicalHeightmm = psDevInfo->sFBInfo.ulPhysicalHeightmm; ++ ++ strncpy(psDevInfo->sDisplayInfo.szDisplayName, DISPLAY_DEVICE_NAME, MAX_DISPLAY_NAME_SIZE); ++ ++ psDevInfo->sDisplayFormat.pixelformat = psDevInfo->sFBInfo.ePixelFormat; ++ psDevInfo->sDisplayDim.ui32Width = (IMG_UINT32)psDevInfo->sFBInfo.ulWidth; ++ psDevInfo->sDisplayDim.ui32Height = (IMG_UINT32)psDevInfo->sFBInfo.ulHeight; ++ psDevInfo->sDisplayDim.ui32ByteStride = (IMG_UINT32)psDevInfo->sFBInfo.ulByteStride; ++ ++ DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ++ ": Device %u: Maximum number of swap chain buffers: %u\n", ++ psDevInfo->uiFBDevID, psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers)); ++ ++ ++ psDevInfo->sSystemBuffer.sSysAddr = psDevInfo->sFBInfo.sSysAddr; ++ psDevInfo->sSystemBuffer.sCPUVAddr = psDevInfo->sFBInfo.sCPUVAddr; ++ psDevInfo->sSystemBuffer.psDevInfo = psDevInfo; ++ ++ return OMAPLFB_OK; ++} ++ + static void OMAPLFBDeInitFBDev(OMAPLFB_DEVINFO *psDevInfo) + { + struct fb_info *psLINFBInfo = psDevInfo->psLINFBInfo; +@@ -1042,42 +1097,14 @@ static OMAPLFB_DEVINFO *OMAPLFBInitDev(unsigned uiFBDevID) + } + + +- if(OMAPLFBInitFBDev(psDevInfo) != OMAPLFB_OK) ++ if(OMAPLFBReInitFBDev(psDevInfo) != OMAPLFB_OK) + { + + goto ErrorFreeDevInfo; + } + +- psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers = (IMG_UINT32)(psDevInfo->sFBInfo.ulFBSize / psDevInfo->sFBInfo.ulRoundedBufferSize); +- if (psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers != 0) +- { +- psDevInfo->sDisplayInfo.ui32MaxSwapChains = 1; +- psDevInfo->sDisplayInfo.ui32MaxSwapInterval = 1; +- } +- +- psDevInfo->sDisplayInfo.ui32PhysicalWidthmm = psDevInfo->sFBInfo.ulPhysicalWidthmm; +- psDevInfo->sDisplayInfo.ui32PhysicalHeightmm = psDevInfo->sFBInfo.ulPhysicalHeightmm; +- +- strncpy(psDevInfo->sDisplayInfo.szDisplayName, DISPLAY_DEVICE_NAME, MAX_DISPLAY_NAME_SIZE); +- +- psDevInfo->sDisplayFormat.pixelformat = psDevInfo->sFBInfo.ePixelFormat; +- psDevInfo->sDisplayDim.ui32Width = (IMG_UINT32)psDevInfo->sFBInfo.ulWidth; +- psDevInfo->sDisplayDim.ui32Height = (IMG_UINT32)psDevInfo->sFBInfo.ulHeight; +- psDevInfo->sDisplayDim.ui32ByteStride = (IMG_UINT32)psDevInfo->sFBInfo.ulByteStride; +- +- DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX +- ": Device %u: Maximum number of swap chain buffers: %u\n", +- psDevInfo->uiFBDevID, psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers)); +- +- +- psDevInfo->sSystemBuffer.sSysAddr = psDevInfo->sFBInfo.sSysAddr; +- psDevInfo->sSystemBuffer.sCPUVAddr = psDevInfo->sFBInfo.sCPUVAddr; +- psDevInfo->sSystemBuffer.psDevInfo = psDevInfo; +- + OMAPLFBInitBufferForSwap(&psDevInfo->sSystemBuffer); + +- +- + psDevInfo->sDCJTable.ui32TableSize = sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE); + psDevInfo->sDCJTable.pfnOpenDCDevice = OpenDCDevice; + psDevInfo->sDCJTable.pfnCloseDCDevice = CloseDCDevice; +diff --git a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c +index 6a0257b..312d49f 100755 +--- a/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c ++++ b/sgx/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c +@@ -47,7 +47,6 @@ + #include + #include + #include +-#include + #include + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) +@@ -659,6 +658,15 @@ int PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Ioctl)(struct drm_device unref__ *dev, + (void) OMAPLFBUnblankDisplay(psDevInfo); + break; + } ++ case PVR_DRM_DISP_CMD_RESYNC: ++ if (OMAPLFBReInitFBDev(psDevInfo) != OMAPLFB_OK) ++ { ++ printk(KERN_WARNING DRIVER_PREFIX ": %s: ReInit failed\n", __FUNCTION__); ++ ret = -EINVAL; ++ break; ++ } ++ ++ break; + case PVR_DRM_DISP_CMD_ON: + case PVR_DRM_DISP_CMD_STANDBY: + case PVR_DRM_DISP_CMD_SUSPEND: +diff --git a/sgx/services4/srvkm/env/linux/module.c b/sgx/services4/srvkm/env/linux/module.c +index 1685045..c8bd27a 100755 +--- a/sgx/services4/srvkm/env/linux/module.c ++++ b/sgx/services4/srvkm/env/linux/module.c +@@ -32,10 +32,9 @@ + #endif + #endif + +-#if defined(SUPPORT_DRI_DRM) ++#if defined(SUPPORT_DRI_DRM) && !defined(SUPPORT_DRI_DRM_EXTERNAL) + #define PVR_MOD_STATIC + #else +- + #if defined(LDM_PLATFORM) + #define PVR_LDM_PLATFORM_MODULE + #define PVR_LDM_MODULE +@@ -45,8 +44,12 @@ + #define PVR_LDM_MODULE + #endif + #endif ++#if defined(SUPPORT_DRI_DRM_EXTERNAL) ++#define PVR_MOD_STATIC ++#else + #define PVR_MOD_STATIC static + #endif ++#endif + + #if defined(PVR_LDM_PLATFORM_PRE_REGISTERED) + #if !defined(NO_HARDWARE) +@@ -105,6 +108,9 @@ + #endif + #define DRVNAME PVRSRV_MODNAME + #define DEVNAME PVRSRV_MODNAME ++#if !defined(SUPPORT_DRI_DRM_EXTERNAL) ++MODULE_SUPPORTED_DEVICE(DEVNAME); ++#endif + + #if defined(SUPPORT_DRI_DRM) + #define PRIVATE_DATA(pFile) ((pFile)->driver_priv) +@@ -112,8 +118,6 @@ + #define PRIVATE_DATA(pFile) ((pFile)->private_data) + #endif + +-MODULE_SUPPORTED_DEVICE(DEVNAME); +- + #if defined(PVRSRV_NEED_PVR_DPF) + #include + extern IMG_UINT32 gPVRDebugLevel; +@@ -125,13 +129,15 @@ MODULE_PARM_DESC(gPVRDebugLevel, "Sets the level of debug output (default 0x7)") + EXPORT_SYMBOL(PVRGetDisplayClassJTable); + EXPORT_SYMBOL(PVRGetBufferClassJTable); + +-#if defined(PVR_LDM_MODULE) ++#if defined(PVR_LDM_MODULE) && !defined(SUPPORT_DRI_DRM_EXTERNAL) + static struct class *psPvrClass; + #endif + + #if !defined(SUPPORT_DRI_DRM) + static int AssignedMajorNumber; ++#endif + ++#if !defined(SUPPORT_DRI_DRM) + static int PVRSRVOpen(struct inode* pInode, struct file* pFile); + static int PVRSRVRelease(struct inode* pInode, struct file* pFile); + +@@ -164,7 +170,7 @@ static IMG_UINT32 gPVRPowerLevel; + #define LDM_DEV struct pci_dev + #define LDM_DRV struct pci_driver + #endif +-#if defined(PVR_LDM_PLATFORM_MODULE) ++#if defined(PVR_LDM_PLATFORM_MODULE) && !defined(SUPPORT_DRI_DRM_EXTERNAL) + static int PVRSRVDriverRemove(LDM_DEV *device); + static int PVRSRVDriverProbe(LDM_DEV *device); + #endif +@@ -172,9 +178,6 @@ static int PVRSRVDriverProbe(LDM_DEV *device); + static void PVRSRVDriverRemove(LDM_DEV *device); + static int PVRSRVDriverProbe(LDM_DEV *device, const struct pci_device_id *id); + #endif +-static int PVRSRVDriverSuspend(LDM_DEV *device, pm_message_t state); +-static void PVRSRVDriverShutdown(LDM_DEV *device); +-static int PVRSRVDriverResume(LDM_DEV *device); + + #if defined(PVR_LDM_PCI_MODULE) + struct pci_device_id powervr_id_table[] __devinitdata = { +@@ -195,6 +198,7 @@ static struct platform_device_id powervr_id_table[] __devinitdata = { + }; + #endif + ++#if defined(SUPPORT_DRI_DRM_EXTERNAL) || !defined(SUPPORT_DRI_DRM) + static LDM_DRV powervr_driver = { + #if defined(PVR_LDM_PLATFORM_MODULE) + .driver = { +@@ -218,6 +222,7 @@ static LDM_DRV powervr_driver = { + .resume = PVRSRVDriverResume, + .shutdown = PVRSRVDriverShutdown, + }; ++#endif + + LDM_DEV *gpsPVRLDMDev; + +@@ -237,7 +242,7 @@ static struct platform_device powervr_device = { + #endif + + #if defined(PVR_LDM_PLATFORM_MODULE) +-static int PVRSRVDriverProbe(LDM_DEV *pDevice) ++PVR_MOD_STATIC int PVRSRVDriverProbe(LDM_DEV *pDevice) + #endif + #if defined(PVR_LDM_PCI_MODULE) + static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device_id *id) +@@ -278,7 +283,7 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device + + + #if defined (PVR_LDM_PLATFORM_MODULE) +-static int PVRSRVDriverRemove(LDM_DEV *pDevice) ++PVR_MOD_STATIC int PVRSRVDriverRemove(LDM_DEV *pDevice) + #endif + #if defined(PVR_LDM_PCI_MODULE) + static void __devexit PVRSRVDriverRemove(LDM_DEV *pDevice) +@@ -317,7 +322,7 @@ static void __devexit PVRSRVDriverRemove(LDM_DEV *pDevice) + return; + #endif + } +-#endif ++#endif + + + #if defined(PVR_LDM_MODULE) || defined(PVR_DRI_DRM_PLATFORM_DEV) +@@ -526,11 +531,13 @@ static int __init PVRCore_Init(void) + #endif + { + int error; ++#if !defined(SUPPORT_DRI_DRM_EXTERNAL) + #if !defined(PVR_LDM_MODULE) + PVRSRV_ERROR eError; + #else + struct device *psDev; + #endif ++#endif + + #if !defined(SUPPORT_DRI_DRM) + +@@ -623,7 +630,6 @@ static int __init PVRCore_Init(void) + } + + PVR_TRACE(("PVRCore_Init: major device %d", AssignedMajorNumber)); +-#endif + + #if defined(PVR_LDM_MODULE) + +@@ -648,10 +654,11 @@ static int __init PVRCore_Init(void) + goto destroy_class; + } + #endif ++#endif + + return 0; + +-#if defined(PVR_LDM_MODULE) ++#if defined(PVR_LDM_MODULE) && !defined(SUPPORT_DRI_DRM_EXTERNAL) + destroy_class: + class_destroy(psPvrClass); + unregister_device: +@@ -711,7 +718,7 @@ static void __exit PVRCore_Cleanup(void) + SysAcquireData(&psSysData); + #endif + +-#if defined(PVR_LDM_MODULE) ++#if defined(PVR_LDM_MODULE) && !defined(SUPPORT_DRI_DRM_EXTERNAL) + device_destroy(psPvrClass, MKDEV(AssignedMajorNumber, 0)); + class_destroy(psPvrClass); + #endif +diff --git a/sgx/services4/srvkm/env/linux/pvr_drm.c b/sgx/services4/srvkm/env/linux/pvr_drm.c +index 3cd7a63..7aa26ba 100755 +--- a/sgx/services4/srvkm/env/linux/pvr_drm.c ++++ b/sgx/services4/srvkm/env/linux/pvr_drm.c +@@ -44,6 +44,10 @@ + #include + #include + ++#if defined(SUPPORT_DRI_DRM_EXTERNAL) ++# include ++#endif ++ + #include "img_defs.h" + #include "services.h" + #include "kerneldisplay.h" +@@ -78,6 +82,7 @@ DECLARE_WAIT_QUEUE_HEAD(sWaitForInit); + IMG_BOOL bInitComplete; + IMG_BOOL bInitFailed; + ++#if !defined(SUPPORT_DRI_DRM_EXTERNAL) + #if !defined(PVR_DRI_DRM_NOT_PCI) + #if defined(PVR_DRI_DRM_PLATFORM_DEV) + struct platform_device *gpsPVRLDMDev; +@@ -85,6 +90,7 @@ struct platform_device *gpsPVRLDMDev; + struct pci_dev *gpsPVRLDMDev; + #endif + #endif ++#endif + + struct drm_device *gpsPVRDRMDev; + +@@ -125,6 +131,7 @@ PVRSRVDrmLoad(struct drm_device *dev, unsigned long flags) + PVR_TRACE(("PVRSRVDrmLoad")); + + gpsPVRDRMDev = dev; ++#if !defined(SUPPORT_DRI_DRM_EXTERNAL) + #if !defined(PVR_DRI_DRM_NOT_PCI) + #if defined(PVR_DRI_DRM_PLATFORM_DEV) + gpsPVRLDMDev = dev->platformdev; +@@ -132,6 +139,7 @@ PVRSRVDrmLoad(struct drm_device *dev, unsigned long flags) + gpsPVRLDMDev = dev->pdev; + #endif + #endif ++#endif + + #if defined(PDUMP) + iRes = dbgdrv_init(); +@@ -197,6 +205,8 @@ PVRSRVDrmUnload(struct drm_device *dev) + DRI_DRM_STATIC int + PVRSRVDrmOpen(struct drm_device *dev, struct drm_file *file) + { ++ PVR_TRACE(("PVRSRVDrmOpen")); ++ + while (!bInitComplete) + { + DEFINE_WAIT(sWait); +@@ -235,6 +245,21 @@ PVRSRVDrmPostClose(struct drm_device *dev, struct drm_file *file) + + file->driver_priv = NULL; + } ++#elif defined(SUPPORT_DRI_DRM_EXTERNAL) ++DRI_DRM_STATIC int ++PVRSRVDrmRelease(struct drm_device *dev, struct drm_file *file) ++{ ++ void *psDriverPriv = file->driver_priv; ++ ++ PVR_TRACE(("PVRSRVDrmRelease: psDriverPriv=%p", psDriverPriv)); ++ ++ if (psDriverPriv) ++ { ++ PVRSRVRelease(psDriverPriv); ++ } ++ ++ return 0; ++} + #else + DRI_DRM_STATIC int + PVRSRVDrmRelease(struct inode *inode, struct file *filp) +@@ -247,9 +272,9 @@ PVRSRVDrmRelease(struct inode *inode, struct file *filp) + + if (ret != 0) + { +- ++ + PVR_DPF((PVR_DBG_ERROR, "%s : drm_release failed: %d", +- __FUNCTION__, ret)); ++ __FUNCTION__, ret)); + } + + PVRSRVRelease(psDriverPriv); +@@ -355,13 +380,31 @@ struct drm_ioctl_desc sPVRDrmIoctls[] = { + #endif + }; + ++#if !defined(SUPPORT_DRI_DRM_EXTERNAL) + static int pvr_max_ioctl = DRM_ARRAY_SIZE(sPVRDrmIoctls); + + #if defined(PVR_DRI_DRM_PLATFORM_DEV) && !defined(SUPPORT_DRI_DRM_EXT) + static int PVRSRVDrmProbe(struct platform_device *pDevice); + static int PVRSRVDrmRemove(struct platform_device *pDevice); + #endif ++#endif + ++#if defined(SUPPORT_DRI_DRM_EXTERNAL) ++static struct omap_gpu_plugin plugin = { ++ .name = PVR_DRM_NAME, ++ ++ .open = PVRSRVDrmOpen, ++ .load = PVRSRVDrmLoad, ++ .unload = PVRSRVDrmUnload, ++ ++ .release = PVRSRVDrmRelease, ++ .mmap = PVRMMap, ++ ++ .ioctls = sPVRDrmIoctls, ++ .num_ioctls = ARRAY_SIZE(sPVRDrmIoctls), ++ .ioctl_start = 0, ++}; ++#else + static struct drm_driver sPVRDrmDriver = + { + #if defined(PVR_DRI_DRM_PLATFORM_DEV) +@@ -420,7 +463,9 @@ static struct drm_driver sPVRDrmDriver = + .minor = PVRVERSION_MIN, + .patchlevel = PVRVERSION_BUILD, + }; ++#endif + ++#if !defined(SUPPORT_DRI_DRM_EXTERNAL) + #if defined(PVR_DRI_DRM_PLATFORM_DEV) && !defined(SUPPORT_DRI_DRM_EXT) + static int + PVRSRVDrmProbe(struct platform_device *pDevice) +@@ -439,12 +484,15 @@ PVRSRVDrmRemove(struct platform_device *pDevice) + + return 0; + } +- ++#endif + #endif ++ + static int __init PVRSRVDrmInit(void) + { + int iRes; ++#if !defined(SUPPORT_DRI_DRM_EXTERNAL) + sPVRDrmDriver.num_ioctls = pvr_max_ioctl; ++#endif + + + PVRDPFInit(); +@@ -457,7 +505,11 @@ static int __init PVRSRVDrmInit(void) + } + #endif + ++#if defined(SUPPORT_DRI_DRM_EXTERNAL) ++ iRes = omap_gpu_register_plugin(&plugin); ++#else + iRes = drm_init(&sPVRDrmDriver); ++#endif + #if defined(PVR_DRI_DRM_NOT_PCI) + if (iRes != 0) + { +@@ -469,11 +521,15 @@ static int __init PVRSRVDrmInit(void) + + static void __exit PVRSRVDrmExit(void) + { ++#if defined(SUPPORT_DRI_DRM_EXTERNAL) ++ omap_gpu_unregister_plugin(&plugin); ++#else + drm_exit(&sPVRDrmDriver); + + #if defined(PVR_DRI_DRM_NOT_PCI) + drm_pvr_dev_remove(); + #endif ++#endif + } + + module_init(PVRSRVDrmInit); +diff --git a/sgx/services4/srvkm/env/linux/pvr_drm.h b/sgx/services4/srvkm/env/linux/pvr_drm.h +index e0276df..f26403f 100755 +--- a/sgx/services4/srvkm/env/linux/pvr_drm.h ++++ b/sgx/services4/srvkm/env/linux/pvr_drm.h +@@ -44,10 +44,12 @@ void PVRCore_Cleanup(void); + int PVRSRVOpen(struct drm_device *dev, struct drm_file *pFile); + void PVRSRVRelease(void *pvPrivData); + +-#if defined(PVR_DRI_DRM_PLATFORM_DEV) +-void PVRSRVDriverShutdown(LDM_DEV *pDevice); ++#if defined(SUPPORT_DRI_DRM_EXTERNAL) || defined(PVR_DRI_DRM_PLATFORM_DEV) ++int PVRSRVDriverProbe(LDM_DEV *pDevice); ++int PVRSRVDriverRemove(LDM_DEV *pDevice); + int PVRSRVDriverSuspend(LDM_DEV *pDevice, pm_message_t state); + int PVRSRVDriverResume(LDM_DEV *pDevice); ++void PVRSRVDriverShutdown(LDM_DEV *pDevice); + #else + int PVRSRVDriverSuspend(struct drm_device *pDevice, pm_message_t state); + int PVRSRVDriverResume(struct drm_device *pDevice); +-- +1.7.4.1 + --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/0003-Changing-module-name-back-to-pvrsrvkm.patch +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/0003-Changing-module-name-back-to-pvrsrvkm.patch @@ -0,0 +1,40 @@ +From d89988e44bb87680e4ce0b4efd6651063e2c08f3 Mon Sep 17 00:00:00 2001 +From: Ricardo Salveti de Araujo +Date: Thu, 14 Apr 2011 22:29:02 -0300 +Subject: [PATCH] Changing module name back to pvrsrvkm + +Signed-off-by: Ricardo Salveti de Araujo +--- + .../build/linux2/omap4430_linux/Makefile | 2 +- + sgx/services4/system/omap4/sysconfig.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile b/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile +index 881414b..e2eaab3 100755 +--- a/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile ++++ b/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile +@@ -166,7 +166,7 @@ ifeq ($(SUPPORT_BC_EXAMPLE),1) + KERNEL_COMPONENTS += bufferclass_example + endif + +-PVRSRV_MODNAME := omap_gpu ++PVRSRV_MODNAME := pvrsrvkm + + PVRSRV_BUSID := platform:omap_gpu + +diff --git a/sgx/services4/system/omap4/sysconfig.h b/sgx/services4/system/omap4/sysconfig.h +index 3494493..eecc0de 100755 +--- a/sgx/services4/system/omap4/sysconfig.h ++++ b/sgx/services4/system/omap4/sysconfig.h +@@ -54,7 +54,7 @@ + #define SYS_OMAP4430_GP11TIMER_TSICR_SYS_PHYS_BASE 0x48088054 + + #if defined(__linux__) +-#define SYS_SGX_DEV_NAME "omap_gpu" ++#define SYS_SGX_DEV_NAME "pvrsrvkm" + #endif + + +-- +1.7.4.1 + --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/0007-Removing-Werror-from-osfunc-to-build-file-for-1207-a.patch +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/0007-Removing-Werror-from-osfunc-to-build-file-for-1207-a.patch @@ -0,0 +1,26 @@ +From e94176be96bf3937433520d47486c69ca0bfe0a1 Mon Sep 17 00:00:00 2001 +From: Ricardo Salveti de Araujo +Date: Sat, 23 Apr 2011 17:24:29 -0300 +Subject: [PATCH] Removing -Werror from osfunc to build file for 1207 and 1208 + +Signed-off-by: Ricardo Salveti de Araujo +--- + sgx/services4/srvkm/env/linux/Kbuild.mk | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/sgx/services4/srvkm/env/linux/Kbuild.mk b/sgx/services4/srvkm/env/linux/Kbuild.mk +index 702eadf..8ccda7e 100755 +--- a/sgx/services4/srvkm/env/linux/Kbuild.mk ++++ b/sgx/services4/srvkm/env/linux/Kbuild.mk +@@ -58,7 +58,7 @@ $(PVRSRV_MODNAME)-y += \ + services4/srvkm/common/osfunc_common.o + + ifneq ($(W),1) +-CFLAGS_osfunc.o := -Werror ++# CFLAGS_osfunc.o := -Werror + CFLAGS_mutils.o := -Werror + CFLAGS_mmap.o := -Werror + CFLAGS_module.o := -Werror +-- +1.7.4.1 + --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/0005-Provide-a-proper-build-date-for-the-pvr-module.patch +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/0005-Provide-a-proper-build-date-for-the-pvr-module.patch @@ -0,0 +1,36 @@ +From 2b3ca93c5d54a1303bd1b3932ca8ef9399aebcea Mon Sep 17 00:00:00 2001 +From: Ricardo Salveti de Araujo +Date: Fri, 15 Apr 2011 04:53:47 -0300 +Subject: [PATCH] Provide a proper build date for the pvr module + +Signed-off-by: Ricardo Salveti de Araujo +--- + sgx/eurasiacon/build/linux2/config/core.mk | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/sgx/eurasiacon/build/linux2/config/core.mk b/sgx/eurasiacon/build/linux2/config/core.mk +index 1e5b0e2..39b8d7e 100755 +--- a/sgx/eurasiacon/build/linux2/config/core.mk ++++ b/sgx/eurasiacon/build/linux2/config/core.mk +@@ -158,6 +158,9 @@ $(call directory-must-exist,$(TOP)/eurasiacon/build/linux2/$(PVR_BUILD_DIR)) + BUILD ?= release + OUT ?= $(TOP)/eurasiacon/binary2_$(PVR_BUILD_DIR)_$(BUILD) + ++# Without a build date drm fails to load ++DATE := $(shell date +%Y-%m-%d) ++ + CONFIG_MK := $(OUT)/config.mk + CONFIG_H := $(OUT)/config.h + CONFIG_KERNEL_MK := $(OUT)/config_kernel.mk +@@ -346,7 +349,7 @@ endif + $(eval $(call BothConfigC,LINUX,)) + + $(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\"")) +-$(eval $(call BothConfigC,PVR_BUILD_DATE,"\"\"")) ++$(eval $(call BothConfigC,PVR_BUILD_DATE,"\"$(DATE)\"")) + $(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\"")) + $(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\"")) + $(eval $(call BothConfigMake,PVRSRV_MODNAME,$(PVRSRV_MODNAME))) +-- +1.7.4.1 + --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/0009-IMG-DRM-make-SUPPORT_DRI_DRM_EXTERNAL-depends-on-DRM.patch +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/0009-IMG-DRM-make-SUPPORT_DRI_DRM_EXTERNAL-depends-on-DRM.patch @@ -0,0 +1,172 @@ +From 8a297eb79e82955c561811b24919c501a17ac1d2 Mon Sep 17 00:00:00 2001 +From: Ricardo Salveti de Araujo +Date: Sun, 5 Jun 2011 04:11:07 -0300 +Subject: [PATCH 2/2] IMG DRM: make SUPPORT_DRI_DRM_EXTERNAL depends on DRM_OMAP + +It only makes sense to enable SUPPORT_DRI_DRM_EXTERNAL when DRM_OMAP is +enable at the kernel, otherwise the PVR module will not work. + +Signed-off-by: Ricardo Salveti de Araujo +--- + sgx/eurasiacon/build/linux2/common/dridrm.mk | 4 +- + .../build/linux2/omap4430_linux/Makefile | 7 ++--- + sgx/services4/srvkm/env/linux/module.c | 23 ++++++++++--------- + sgx/services4/srvkm/env/linux/pvr_drm.c | 10 ++++---- + sgx/services4/srvkm/env/linux/pvr_drm.h | 5 ++++ + 5 files changed, 27 insertions(+), 22 deletions(-) + +diff --git a/sgx/eurasiacon/build/linux2/common/dridrm.mk b/sgx/eurasiacon/build/linux2/common/dridrm.mk +index 86b2f08..f751bee 100755 +--- a/sgx/eurasiacon/build/linux2/common/dridrm.mk ++++ b/sgx/eurasiacon/build/linux2/common/dridrm.mk +@@ -25,11 +25,11 @@ + + $(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM,)) + $(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM_EXT,)) +-$(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM_EXTERNAL,)) ++$(eval $(call TunableBothConfigC,SUPPORT_DRI_TRY_DRM_EXTERNAL,)) + + + $(eval $(call TunableBothConfigMake,SUPPORT_DRI_DRM,)) +-$(eval $(call TunableBothConfigMake,SUPPORT_DRI_DRM_EXTERNAL,)) ++$(eval $(call TunableBothConfigMake,SUPPORT_DRI_TRY_DRM_EXTERNAL,)) + + ifeq ($(SUPPORT_DRI_DRM),1) + ifeq ($(SUPPORT_DRI_DRM_NO_LIBDRM),1) +diff --git a/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile b/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile +index 9f4e066..f7cd1c0 100755 +--- a/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile ++++ b/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile +@@ -43,8 +43,9 @@ include ../common/xorg_test.mk + ifeq ($(want_xorg),1) + SUPPORT_DRI_DRM := 1 + SUPPORT_BC_EXAMPLE ?= 0 +-# support for registering as plugin into external DRM driver +-SUPPORT_DRI_DRM_EXTERNAL := 1 ++# try support for registering as plugin into external DRM driver ++# only support if CONFIG_DRM_OMAP is set ++SUPPORT_DRI_TRY_DRM_EXTERNAL := 1 + else + SUPPORT_BC_EXAMPLE ?= 1 + endif +@@ -102,11 +103,9 @@ SYS_CUSTOM_POWERLOCK_WRAP := 1 + + ifeq ($(OMAP_KERNEL_AT_LEAST_2_6_35),1) + ifeq ($(LDM_PLATFORM),1) +-ifneq ($(SUPPORT_DRI_DRM_EXTERNAL),1) + PVR_LDM_PLATFORM_PRE_REGISTERED := 1 + endif + endif +-endif + + BUILD_OPENCL ?= 0 + ifneq ($(BUILD_OPENCL),1) +diff --git a/sgx/services4/srvkm/env/linux/module.c b/sgx/services4/srvkm/env/linux/module.c +index c8bd27a..9850eb0 100755 +--- a/sgx/services4/srvkm/env/linux/module.c ++++ b/sgx/services4/srvkm/env/linux/module.c +@@ -32,6 +32,17 @@ + #endif + #endif + ++#if defined(SUPPORT_DRI_DRM) ++#include ++#if defined(PVR_SECURE_DRM_AUTH_EXPORT) ++#include "env_perproc.h" ++#endif ++#endif ++ ++#if defined(SUPPORT_DRI_DRM) ++#include "pvr_drm.h" ++#endif ++ + #if defined(SUPPORT_DRI_DRM) && !defined(SUPPORT_DRI_DRM_EXTERNAL) + #define PVR_MOD_STATIC + #else +@@ -51,7 +62,7 @@ + #endif + #endif + +-#if defined(PVR_LDM_PLATFORM_PRE_REGISTERED) ++#if defined(PVR_LDM_PLATFORM_PRE_REGISTERED) && !defined(SUPPORT_DRI_DRM_EXTERNAL) + #if !defined(NO_HARDWARE) + #define PVR_USE_PRE_REGISTERED_PLATFORM_DEV + #endif +@@ -63,13 +74,6 @@ + #include + #include + +-#if defined(SUPPORT_DRI_DRM) +-#include +-#if defined(PVR_SECURE_DRM_AUTH_EXPORT) +-#include "env_perproc.h" +-#endif +-#endif +- + #if defined(PVR_LDM_PLATFORM_MODULE) + #include + #endif +@@ -103,9 +107,6 @@ + #include "lock.h" + #include "linkage.h" + +-#if defined(SUPPORT_DRI_DRM) +-#include "pvr_drm.h" +-#endif + #define DRVNAME PVRSRV_MODNAME + #define DEVNAME PVRSRV_MODNAME + #if !defined(SUPPORT_DRI_DRM_EXTERNAL) +diff --git a/sgx/services4/srvkm/env/linux/pvr_drm.c b/sgx/services4/srvkm/env/linux/pvr_drm.c +index 7aa26ba..f89e29b 100755 +--- a/sgx/services4/srvkm/env/linux/pvr_drm.c ++++ b/sgx/services4/srvkm/env/linux/pvr_drm.c +@@ -44,10 +44,6 @@ + #include + #include + +-#if defined(SUPPORT_DRI_DRM_EXTERNAL) +-# include +-#endif +- + #include "img_defs.h" + #include "services.h" + #include "kerneldisplay.h" +@@ -70,6 +66,10 @@ + #include "linkage.h" + #include "pvr_drm.h" + ++#if defined(SUPPORT_DRI_DRM_EXTERNAL) ++# include ++#endif ++ + #if defined(PVR_DRI_DRM_NOT_PCI) + #include "pvr_drm_mod.h" + #endif +@@ -102,7 +102,7 @@ struct drm_device *gpsPVRDRMDev; + + #if !defined(SUPPORT_DRI_DRM_EXT) + #if defined(PVR_DRI_DRM_PLATFORM_DEV) +-#if defined(PVR_LDM_PLATFORM_PRE_REGISTERED) ++#if defined(PVR_LDM_PLATFORM_PRE_REGISTERED) && !defined(SUPPORT_DRI_DRM_EXTERNAL) + static struct platform_device_id asPlatIdList[] = { + {SYS_SGX_DEV_NAME, 0}, + {} +diff --git a/sgx/services4/srvkm/env/linux/pvr_drm.h b/sgx/services4/srvkm/env/linux/pvr_drm.h +index f26403f..ce0e913 100755 +--- a/sgx/services4/srvkm/env/linux/pvr_drm.h ++++ b/sgx/services4/srvkm/env/linux/pvr_drm.h +@@ -35,6 +35,11 @@ + + #include + ++/* only defines DRM_EXTERNAL if DRM_OMAP is enabled at the kernel */ ++#if defined (SUPPORT_DRI_TRY_DRM_EXTERNAL) && defined(CONFIG_DRM_OMAP) ++#define SUPPORT_DRI_DRM_EXTERNAL ++#endif ++ + #if defined(PVR_DRI_DRM_PLATFORM_DEV) + #define LDM_DEV struct platform_device + #endif +-- +1.7.4.1 + --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/0006-Fixing-OuterCache-definition-to-be-compatible-with-t.patch +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/0006-Fixing-OuterCache-definition-to-be-compatible-with-t.patch @@ -0,0 +1,34 @@ +From a49eae59d512e0027eb0ef03d25e2a570670288d Mon Sep 17 00:00:00 2001 +From: Ricardo Salveti de Araujo +Date: Tue, 19 Apr 2011 23:09:04 -0300 +Subject: [PATCH] Fixing OuterCache definition to be compatible with the new outer_flush_range API + +Signed-off-by: Ricardo Salveti de Araujo +--- + sgx/services4/srvkm/env/linux/osfunc.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/sgx/services4/srvkm/env/linux/osfunc.c b/sgx/services4/srvkm/env/linux/osfunc.c +index f3e02ed..b7b495e 100755 +--- a/sgx/services4/srvkm/env/linux/osfunc.c ++++ b/sgx/services4/srvkm/env/linux/osfunc.c +@@ -43,6 +43,7 @@ + #include + #include + ++#include + #include + #include + #include +@@ -2632,7 +2633,7 @@ error: + } + + typedef void (*InnerCacheOp_t)(const void *pvStart, const void *pvEnd); +-typedef void (*OuterCacheOp_t)(unsigned long ulStart, unsigned long ulEnd); ++typedef void (*OuterCacheOp_t)(phys_addr_t ulStart, phys_addr_t ulEnd); + + #if defined(CONFIG_OUTER_CACHE) + +-- +1.7.4.1 + --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/0004-Display-controller-should-depend-on-the-xorg-support.patch +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/0004-Display-controller-should-depend-on-the-xorg-support.patch @@ -0,0 +1,29 @@ +From f1cdbf3c3dbe6c791e7707d275efe444f5eeec08 Mon Sep 17 00:00:00 2001 +From: Ricardo Salveti de Araujo +Date: Fri, 15 Apr 2011 03:19:53 -0300 +Subject: [PATCH] Display controller should depend on the xorg support, like before + +Signed-off-by: Ricardo Salveti de Araujo +--- + .../build/linux2/omap4430_linux/Makefile | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile b/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile +index a9f3e24..881414b 100755 +--- a/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile ++++ b/sgx/eurasiacon/build/linux2/omap4430_linux/Makefile +@@ -57,7 +57,11 @@ LDM_PLATFORM ?= 1 + + ifeq ($(LDM_PLATFORM),1) + SUPPORT_LINUX_USING_WORKQUEUES := 1 ++ifeq ($(want_xorg),1) ++DISPLAY_CONTROLLER_COMPONENT += dc_omapfb3_linux ++else + DISPLAY_CONTROLLER_COMPONENT += dc_omap_linux ++endif + DISPLAY_CONTROLLER := omaplfb + else + SUPPORT_LINUX_USING_SHARED_WORKQUEUES := 1 +-- +1.7.4.1 + --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/debian/patches/series +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/debian/patches/series @@ -0,0 +1,9 @@ +0001-Avoid-calling-set_max_mpu_wakeup_lat-as-it-s-not-ava.patch +0002-SGX-Porting-kernel-module-to-2.6.38.patch +0003-Changing-module-name-back-to-pvrsrvkm.patch +0004-Display-controller-should-depend-on-the-xorg-support.patch +0005-Provide-a-proper-build-date-for-the-pvr-module.patch +0006-Fixing-OuterCache-definition-to-be-compatible-with-t.patch +0007-Removing-Werror-from-osfunc-to-build-file-for-1207-a.patch +0008-The-IMG-DRM-module-can-become-a-plugin-sub-module-of.patch +0009-IMG-DRM-make-SUPPORT_DRI_DRM_EXTERNAL-depends-on-DRM.patch --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/sgx/Makefile +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/sgx/Makefile @@ -0,0 +1,48 @@ +# This top-level makefile is called by DKMS. +# It must provide targets: 'all' and 'clean'. +# Making 'all' the default target is nice to have. +# This makefile must take the $KVERSION variable into account. + +.PHONY: all clean + +# Set to 'release' for "normal" build. +# Set to 'debug' for debug build. +# (Note that you will need libraries & apps compiled in +# 'debug' too for this to be usable.) +FLAVOUR := __FLAVOUR__ + +# This suffix is appended to module name. +SUFFIX-debug := -debug +SUFFIX-release := +SUFFIX := $(SUFFIX-$(FLAVOUR)) + +# Define for verbose build. +#export V := 1 + +KVERSION := $(shell uname -r) +export CROSS_COMPILE := +export DISCIMAGE := $(PWD) +export KERNELDIR := /usr/src/linux-headers-$(KVERSION) +DIR := eurasiacon/build/linux2/omap4430_linux + +# We want to compile with two jobs per cpu. +JOBS := $(shell bash -c 'cpu=`egrep "^processor" /proc/cpuinfo |wc -l`; [ $$cpu == 0 ] && cpu=1; echo $$(($$cpu * 2))') + +MAKE_OPTS-debug := PVRSRV_DUMP_MK_TRACE=1 PVRSRV_USSE_EDM_STATUS_DEBUG=1 BUILD=debug +MAKE_OPTS-release := +MAKE_OPTS := -j$(JOBS) SUPPORT_V4L2_GFX=0 $(MAKE_OPTS-$(FLAVOUR)) + +MODULES := pvrsrvkm # gfx_vout_mod + +all: + @set -e; \ + $(MAKE) -C $(DIR) $(MAKE_OPTS); \ + \ + for m in $(MODULES); do \ + cp -v "eurasiacon/binary2_omap4430_linux_$(FLAVOUR)/target/kbuild/$$m.ko" "$${m}$(SUFFIX).ko"; \ + done +# Note: we replace the 'make install' step by our cp for now. + +clean: + $(MAKE) -C $(DIR) $(MAKE_OPTS) clean \ + && rm -f *.ko --- pvr-omap4-kernel-1.7.5.2+git20110610+9696932c.orig/sgx/dkms.conf +++ pvr-omap4-kernel-1.7.5.2+git20110610+9696932c/sgx/dkms.conf @@ -0,0 +1,9 @@ +PACKAGE_NAME="pvr-omap4-kernel__SUFFIX__" +PACKAGE_VERSION="__VERSION__" +CLEAN="make clean" + +MAKE[0]="make all KVERSION=$kernelver" +BUILT_MODULE_NAME[0]="pvrsrvkm__SUFFIX__" +DEST_MODULE_LOCATION[0]="/extra" + +AUTOINSTALL="yes"