[oe-commits] Koen Kooi : libgles-omap3: abstract ES handling and share it across all targets

git version control git at git.openembedded.org
Mon Apr 25 16:48:26 UTC 2011


Module: openembedded.git
Branch: 2011.03-maintenance
Commit: b666832ccfb8c71fc6e79cdb58625af0c1b2524b
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=b666832ccfb8c71fc6e79cdb58625af0c1b2524b

Author: Koen Kooi <koen at openembedded.org>
Date:   Wed Apr 20 13:52:53 2011 +0200

libgles-omap3: abstract ES handling and share it across all targets

Signed-off-by: Koen Kooi <koen at openembedded.org>

---

 recipes/powervr-drivers/libgles-omap3.inc    |    2 +-
 recipes/powervr-drivers/libgles-omap3/rc.pvr |   57 +++++++++----------------
 2 files changed, 22 insertions(+), 37 deletions(-)

diff --git a/recipes/powervr-drivers/libgles-omap3.inc b/recipes/powervr-drivers/libgles-omap3.inc
index 61d7f3d..ac21631 100644
--- a/recipes/powervr-drivers/libgles-omap3.inc
+++ b/recipes/powervr-drivers/libgles-omap3.inc
@@ -1,7 +1,7 @@
 DESCRIPTION = "libGLES for the omap3"
 LICENSE = "proprietary-binary"
 
-PR = "r12"
+PR = "r13"
 
 COMPATIBLE_MACHINE = "(omap3|ti816x)"
 
diff --git a/recipes/powervr-drivers/libgles-omap3/rc.pvr b/recipes/powervr-drivers/libgles-omap3/rc.pvr
index b854852..0a4f11b 100755
--- a/recipes/powervr-drivers/libgles-omap3/rc.pvr
+++ b/recipes/powervr-drivers/libgles-omap3/rc.pvr
@@ -30,8 +30,7 @@ fi
 # Try to enable triple buffering when there's enough VRAM
 fbset -vyres $(expr $YRES \* 3) 
 
-case $CPUTYPE in
-"OMAP3530")
+function sgxprepare {
 	echo Starting PVR
 	insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko")
 	modprobe omaplfb
@@ -50,13 +49,9 @@ case $CPUTYPE in
 	touch /etc/powervr-esrev
 
 	SAVED_ESREVISION="$(cat /etc/powervr-esrev)"
+}
 
-	devmem2 0x48004B48 w 0x2 > /dev/null
-	devmem2 0x48004B10 w 0x1 > /dev/null
-	devmem2 0x48004B00 w 0x2 > /dev/null
-
-	ES_REVISION="$(devmem2 0x50000014 | sed -e s:0x00010205:5: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')"
-
+function sgxfinish {
 	if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then
 		echo -n "Starting SGX fixup for"
 		echo " ES${ES_REVISION}.x"
@@ -65,44 +60,34 @@ case $CPUTYPE in
 		echo "${ES_REVISION}" > /etc/powervr-esrev
 	fi
 	/usr/bin/pvrsrvinit
-	;;
-"TI816x")
-	echo Starting PVR
-	insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko")
-	modprobe omaplfb
-	modprobe bufferclass_ti
-
-	pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3`
-        bc_maj=`grep "bc" /proc/devices | cut -b1,2,3`
+}
 
-	if [ -e /dev/pvrsrvkm ] ; then 
-		rm -f /dev/pvrsrvkm
-	fi
+case $CPUTYPE in
+"OMAP3530")
+	sgxprepare
 
-	mknod /dev/pvrsrvkm c $pvr_maj 0 
-	chmod 666 /dev/pvrsrvkm
+	devmem2 0x48004B48 w 0x2 > /dev/null
+	devmem2 0x48004B10 w 0x1 > /dev/null
+	devmem2 0x48004B00 w 0x2 > /dev/null
 
-	touch /etc/powervr-esrev
+	ES_REVISION="$(devmem2 0x50000014 | sed -e s:0x00010205:5: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')"
 
-	SAVED_ESREVISION="$(cat /etc/powervr-esrev)"
+	sgxfinish
+	;;
+"TI816x")
+	sgxprepare
 
-	devmem2 0x48180F04 w 0x0
-	devmem2 0x48180900 w 0x2
-	devmem2 0x48180920 w 0x2
+	devmem2 0x48180F04 w 0x0 > /dev/null
+	devmem2 0x48180900 w 0x2 > /dev/null
+	devmem2 0x48180920 w 0x2 > /dev/null
 
 	ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:6: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')"
 
-	if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then
-		echo -n "Starting SGX fixup for"
-		echo " ES${ES_REVISION}.x"
-		cp -a /usr/lib/ES${ES_REVISION}.0/* /usr/lib
-		cp -a /usr/bin/ES${ES_REVISION}.0/* /usr/bin	
-		echo "${ES_REVISION}" > /etc/powervr-esrev
-	fi
-	/usr/bin/pvrsrvinit
-
+	sgxfinish
 	;;
 *)
 	echo No SGX hardware, not starting PVR
 	;;
 esac
+
+





More information about the Openembedded-commits mailing list