diff options
Diffstat (limited to 'recipes-graphics/libgles/libgles-omap3')
4 files changed, 119 insertions, 0 deletions
diff --git a/recipes-graphics/libgles/libgles-omap3/99-bufferclass.rules b/recipes-graphics/libgles/libgles-omap3/99-bufferclass.rules new file mode 100644 index 0000000000..780423b961 --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3/99-bufferclass.rules @@ -0,0 +1,7 @@ +# Give everyone access to bufferclass nodes and make a compatibility symlink for the first one +SUBSYSTEM=="bccat", MODE="0666" +KERNEL=="bccat0", SYMLINK+="bc_cat", MODE="0666" + +# Give everyone access to v4l nodes +SUBSYSTEM=="video4linux", MODE="0666" + diff --git a/recipes-graphics/libgles/libgles-omap3/cputype b/recipes-graphics/libgles/libgles-omap3/cputype new file mode 100755 index 0000000000..27f411d0a6 --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3/cputype @@ -0,0 +1,11 @@ +#!/bin/sh +. /etc/init.d/functions + +if [ "$(machine_id)" = "ti8168evm" ] ; then + echo TI816x +else + devmem2 0x4800244c | \ + grep 'Read at address' | \ + sed -e 's/.*): //' | \ + sed -e 's/0x00005C00/OMAP3503/' -e 's/0x00001C00/OMAP3515/' -e 's/0x00004C00/OMAP3525/' -e 's/0x00000C00/OMAP3530/' +fi diff --git a/recipes-graphics/libgles/libgles-omap3/rc.pvr b/recipes-graphics/libgles/libgles-omap3/rc.pvr new file mode 100755 index 0000000000..d32f9e4c9b --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3/rc.pvr @@ -0,0 +1,93 @@ +#!/bin/sh +PATH=$PATH:/usr/sbin + +BITSPERPIXEL="$(fbset | grep geom | awk '{print $6}')" +YRES="$(fbset | grep geom | awk '{print $3}')" + +CPUTYPE="$(cputype)" + +if [ "$1" = "" ]; then + echo PVR-INIT: Please use start, stop, or restart. + exit 1 +fi + +if [ "$1" = "stop" -o "$1" = "restart" ]; then + echo Stopping PVR + rmmod bufferclass_ti + rmmod omaplfb 2>/dev/null + rmmod pvrsrvkm 2>/dev/null +fi + +if [ "$1" = "stop" ]; then + exit 0 +fi + +# Set RGBA ordering to something the drivers like +if [ "$BITSPERPIXEL" = "32" ] ; then + fbset -rgba 8/16,8/8,8/0,8/24 +fi + +# Try to enable triple buffering when there's enough VRAM +fbset -vyres $(expr $YRES \* 3) + +sgxprepare () { + 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 + + mknod /dev/pvrsrvkm c $pvr_maj 0 + chmod 666 /dev/pvrsrvkm + + touch /etc/powervr-esrev + + SAVED_ESREVISION="$(cat /etc/powervr-esrev)" +} + +sgxfinish () { + 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 +} + +case $CPUTYPE in +"OMAP3530") + sgxprepare + + 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}')" + + sgxfinish + ;; +"TI816x") + sgxprepare + + 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}')" + + sgxfinish + ;; +*) + echo No SGX hardware, not starting PVR + ;; +esac + + diff --git a/recipes-graphics/libgles/libgles-omap3/sample.desktop b/recipes-graphics/libgles/libgles-omap3/sample.desktop new file mode 100644 index 0000000000..6bacac9277 --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3/sample.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=NAME Demo +Comment=OGLES Demo +Exec=EXEC +Icon=star +Type=Application +Categories=Graphics; + |