1
0
mirror of https://git.yoctoproject.org/meta-ti synced 2026-01-12 01:20:20 +00:00

libgles-omap3: add 4.03.00.02

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This commit is contained in:
Koen Kooi
2011-05-30 09:17:56 +02:00
parent 3fd522b60e
commit 1098ec3263
6 changed files with 429 additions and 0 deletions

View File

@@ -0,0 +1,280 @@
DESCRIPTION = "libGLES for the omap3"
LICENSE = "proprietary-binary"
# 'TSPA.txt' might not be the best file to md5sum
LIC_FILES_CHKSUM = "file://TSPA.txt;md5=c0d5d9c1e38b41677144c4e24d6ddee1"
PR = "r15"
COMPATIBLE_MACHINE = "(omap3|ti816x)"
DEPENDS = "virtual/libx11 libxau libxdmcp"
PROVIDES += "virtual/egl"
SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/${SGXPV}/exports/OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin \
file://cputype \
file://rc.pvr \
file://sample.desktop \
file://99-bufferclass.rules \
"
S = "${WORKDIR}/OMAP35x_Graphics_SDK_${SGXPV}"
# Logic to unpack installjammer file
TI_BIN_UNPK_CMDS="Y: qY:workdir:Y"
require ../../recipes-ti/includes/ti-eula-unpack.inc
BINLOCATION ?= "${S}/gfx_rel"
ES2LOCATION ?= "${S}/gfx_rel_es2.x"
ES3LOCATION ?= "${S}/gfx_rel_es3.x"
ES5LOCATION ?= "${S}/gfx_rel_es5.x"
ES6LOCATION ?= "${S}/gfx_rel_es6.x"
do_configure() {
# Attempt to fix up the worst offenders for file permissions
for i in $(find ${S} -name "*.h") $(find ${S} -name "*.c") $(find ${S} -name "Make*") ; do
chmod 0644 $i
done
# Attempt to create proper library softlinks
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}
ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}$(echo ${IMGPV} | awk -F. '{print "." $1}')
ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}$(echo ${IMGPV} | awk -F. '{print "." $1 "." $2}')
fi
done
# Due to recursive make PLAT_* isn't always passed down correctly, so use sed to fix those
for mak in $(find ${S} -name "*.mak") ; do
sed -i -e s:arm-none-linux-gnueabi-:${TARGET_PREFIX}:g $mak
done
# clear out old stuff
find Binaries/ | xargs rm -f || true
}
# Force in GNU_HASH and paths to libs
TARGET_CC_ARCH += " ${TARGET_LINK_HASH_STYLE} -Wl,-rpath-link,${BINLOCATION} -L${BINLOCATION} \
-L${STAGING_DIR_TARGET}${libdir} -Wl,-rpath-link,${STAGING_DIR_TARGET}${libdir}"
PARALLEL_MAKE = ""
do_compile() {
export X11ROOT="${STAGING_DIR_HOST}/usr"
export TOOLCHAIN="${TOOLCHAIN_PATH}"
export PLATFORM="LinuxOMAP3"
export PLAT_CC="${CC}"
export PLAT_CPP="${CXX}"
export PLAR_AR="${AR}"
mkdir -p ${S}/demos/raw
mkdir -p ${S}/demos/x11
# Rebuild demos for both Raw and X11
for X11BUILD in 0 1 ; do
for demo in ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Demos/* ; do
cd $demo/OGLES/Build/LinuxGeneric
oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD
rm $demo/OGLES/Build/LinuxOMAP3/Release*/*.o
install -m 0755 $demo/OGLES/Build/LinuxOMAP3/ReleaseX11/* ${S}/demos/x11 || true
sed -e s:NAME:$(basename $demo): \
-e s:EXEC:${bindir}/SGX/demos/X11/$(basename $demo/OGLES/Build/LinuxOMAP3/ReleaseX11/*): \
${WORKDIR}/sample.desktop > ${WORKDIR}/$(basename $demo).desktop
install -m 0755 $demo/OGLES/Build/LinuxOMAP3/ReleaseRaw/* ${S}/demos/raw || true
done
for demo in ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Demos/* ; do
cd $demo/OGLES2/Build/LinuxGeneric
oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD
rm -f $demo/OGLES2/Build/LinuxOMAP3/Release*/*.o
install -m 0755 $demo/OGLES2/Build/LinuxOMAP3/ReleaseX11/* ${S}/demos/x11 || true
sed -e s:NAME:$(basename $demo): \
-e s:EXEC:${bindir}/SGX/demos/X11/$(basename $demo/OGLES2/Build/LinuxOMAP3/ReleaseX11/*): \
${WORKDIR}/sample.desktop > ${WORKDIR}/$(basename $demo).desktop
install -m 0755 $demo/OGLES2/Build/LinuxOMAP3/ReleaseRaw/* ${S}/demos/raw || true
done
done
mkdir -p ${S}/trainingcourses/raw
mkdir -p ${S}/trainingcourses/x11
find ${S} -name "*_org" -delete
# Build OGLES2 Trainingcourses for both Raw and X11
for X11BUILD in 0 1 ; do
for training in ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/TrainingCourse/* ; do
if [ -e $training/OGLES2/Build/LinuxGeneric/Makefile ] ; then
cd $training/OGLES2/Build/LinuxGeneric
fi
if [ -e $training/OGLES2/Build/LinuxOMAP3/Makefile ] ; then
cd $training/OGLES2/Build/LinuxOMAP3
fi
oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD
rm -f $training/OGLES2/Build/LinuxOMAP3/Release*/*.o
install -m 0755 $training/OGLES2/Build/LinuxOMAP3/ReleaseX11/* ${S}/trainingcourses/x11 || true
install -m 0755 $training/OGLES2/Build/LinuxOMAP3/ReleaseRaw/* ${S}/trainingcourses/raw || true
done
done
}
do_install () {
install -d ${D}${libdir}
cp -pPR ${BINLOCATION}/*.so* ${D}${libdir}
install -m 0644 ${BINLOCATION}/*.a ${D}${libdir}
install -d ${D}${bindir}/
install -m 0755 ${WORKDIR}/cputype ${D}${bindir}/
install -m 0755 ${BINLOCATION}/*_test ${D}${bindir}/
install -m 0755 ${BINLOCATION}/gl* ${D}${bindir}/
install -m 0755 ${BINLOCATION}/p[dv]* ${D}${bindir}/
install -m 0755 ${BINLOCATION}/xgles1test1 ${D}${bindir}/
install -m 0755 ${BINLOCATION}/freedesktop/kdrive/usr/X11R6_SGX/bin/Xsgx ${D}${bindir}/|| true
install -d ${D}${includedir}
cp -pPR ${S}/GFX_Linux_KM/include4 ${D}${includedir}/
cp -pPR ${S}/GFX_Linux_KM/services4 ${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/ || true
cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES2/ || true
cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/v* ${D}${includedir}/ || true
cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/V* ${D}${includedir}/ || true
cp -pPr ${S}/include/*.h ${D}${includedir} || true
cp -pPr ${S}/include/wsegl/*.h ${D}${includedir} || true
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.1" >> ${D}${sysconfdir}/powervr.ini
# The ES2.x, ES3.x, ES5.x and ES6.x CPUs have different SGX hardware, so we need to install multiple sets of userspace
install -d ${D}${libdir}/ES6.0
install -d ${D}${libdir}/ES5.0
install -d ${D}${libdir}/ES3.0
install -d ${D}${libdir}/ES2.0
install -d ${D}${bindir}/ES6.0
install -d ${D}${bindir}/ES5.0
install -d ${D}${bindir}/ES3.0
install -d ${D}${bindir}/ES2.0
cp -pPR ${ES2LOCATION}/lib*${IMGPV} ${D}${libdir}/ES2.0/
cp ${ES2LOCATION}/p[dv]* ${D}${bindir}/ES2.0/
cp -pPR ${D}${libdir}/lib*${IMGPV} ${D}${libdir}/ES3.0/
cp ${D}${bindir}/p[dv]* ${D}${bindir}/ES3.0
if [ -e ${ES5LOCATION} ] ; then
cp -pPR ${ES5LOCATION}/lib*${IMGPV} ${D}${libdir}/ES5.0/
cp ${ES5LOCATION}/p[dv]* ${D}${bindir}/ES5.0/
fi
if [ -e ${ES6LOCATION} ] ; then
cp -pPR ${ES6LOCATION}/lib*${IMGPV} ${D}${libdir}/ES6.0/
cp ${ES6LOCATION}/p[dv]* ${D}${bindir}/ES6.0/
fi
rm ${D}${bindir}/ES*/*.h ${D}${bindir}/ES*/pdsasm ${D}${bindir}/pdsasm -f || true
install -d ${D}${prefix}/share/applications
cp ${WORKDIR}/*.desktop ${D}${prefix}/share/applications
rm ${D}${prefix}/share/applications/sample.desktop
install -d ${D}${bindir}/SGX/demos/X11/
install -d ${D}${bindir}/SGX/demos/Raw/
install -m 0755 ${S}/demos/x11/* ${D}${bindir}/SGX/demos/X11/
install -m 0755 ${S}/demos/raw/* ${D}${bindir}/SGX/demos/Raw/
install -d ${D}${bindir}/SGX/trainingcourses/Raw
install -d ${D}${bindir}/SGX/trainingcourses/X11
install -m 0755 ${S}/trainingcourses/x11/* ${D}${bindir}/SGX/trainingcourses/X11/
install -m 0755 ${S}/trainingcourses/raw/* ${D}${bindir}/SGX/trainingcourses/Raw/
# Delete objects and linker scripts hidden between the headers
find ${D} -name "*.o" -delete
find ${D} -name "*.o.cmd" -delete
install -d ${D}${sysconfdir}/udev/rules.d
install -m 0644 ${WORKDIR}/99-bufferclass.rules ${D}${sysconfdir}/udev/rules.d/
}
PACKAGES =+ "${PN}-rawdemos \
${PN}-x11demos \
${PN}-rawtrainingcourses \
${PN}-x11trainingcourses \
"
PACKAGES += "xserver-kdrive-powervrsgx \
${PN}-tests "
PACKAGES =+ "${PN}-blitwsegl ${PN}-flipwsegl ${PN}-frontwsegl ${PN}-linuxfbwsegl ${PN}-x11wsegl"
FILES_${PN}-blitwsegl = "${libdir}/libpvrPVR2D_BLITWSEGL.so.* ${libdir}/*/libpvrPVR2D_BLITWSEGL.so.*"
FILES_${PN}-flipwsegl = "${libdir}/libpvrPVR2D_FLIPWSEGL.so.* ${libdir}/*/libpvrPVR2D_FLIPWSEGL.so.*"
FILES_${PN}-frontwsegl = "${libdir}/libpvrPVR2D_FRONTWSEGL.so.* ${libdir}/*/libpvrPVR2D_FRONTWSEGL.so.*"
FILES_${PN}-linuxfbwsegl = "${libdir}/libpvrPVR2D_LINUXFBWSEGL.so.* ${libdir}/*/libpvrPVR2D_LINUXFBWSEGL.so.*"
FILES_${PN}-x11wsegl = "${libdir}/libpvrPVR2D_X11WSEGL.so* ${libdir}/*/libpvrPVR2D_X11WSEGL.so*"
CONFFILES_${PN} = "${sysconfdir}/powervr.ini"
FILES_${PN} = "${sysconfdir} ${libdir}/lib*.so.* ${libdir}/ES*/* ${bindir}/pvrsrvinit ${bindir}/cputype ${bindir}/*/*"
FILES_xserver-kdrive-powervrsgx = "${bindir}/Xsgx"
FILES_${PN}-tests = "${bindir}/*"
FILES_${PN}-dbg = "${libdir}/.debug/* ${bindir}/.debug/* \
${libdir}/ES*/.debug ${bindir}/*/.debug\
${bindir}/SGX/demos/*/.debug/* \
${bindir}/SGX/trainingcourses/*/.debug/* \
"
FILES_${PN}-rawdemos = "${bindir}/SGX/demos/Raw/*"
FILES_${PN}-x11demos = "${bindir}/SGX/demos/X11/* ${prefix}/share/applications "
RRECOMMENDS_${PN}-x11demos = "${PN}-x11wsegl"
FILES_${PN}-rawtrainingcourses = "${bindir}/SGX/trainingcourses/Raw/*"
FILES_${PN}-x11trainingcourses = "${bindir}/SGX/trainingcourses/X11/*"
RRECOMMENDS_${PN}-x11trainingcourses = "${PN}-x11wsegl"
# The libs need the kernel-modules
RRECOMMENDS_${PN} = "omap3-sgx-modules"
# The initscript calls fbset, cputype calls devmem2
RDEPENDS_${PN} += "fbset devmem2"
#HACK! These are binaries, so we can't guarantee that LDFLAGS match :(
INSANE_SKIP_${PN} = True
INSANE_SKIP_${PN}-blitwsegl = True
INSANE_SKIP_${PN}-flipwsegl = True
INSANE_SKIP_${PN}-frontwsegl = True
INSANE_SKIP_${PN}-linuxfbwsegl = True
INSANE_SKIP_${PN}-x11wsegl = True
INSANE_SKIP_${PN}-tests = True
INSANE_SKIP_xserver-kdrive-powervrsgx = True
# Quality control is really poor on these SDKs, so hack around the latest madness:
FILES_${PN} += "${libdir}/*.so "
FILES_${PN}-dev = "${includedir}"
inherit update-rc.d
INITSCRIPT_NAME = "pvr-init"
INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ."
# Append to update-rc.d postinst
pkg_postinst_${PN}_append() {
rm -f /etc/powervr-esrev
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
}

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,8 @@
[Desktop Entry]
Name=NAME Demo
Comment=OGLES Demo
Exec=EXEC
Icon=star
Type=Application
Categories=Graphics;

View File

@@ -0,0 +1,30 @@
BINLOCATION_omap3 = "${S}/gfx_rel_es3.x"
BINLOCATION_ti816x = "${S}/gfx_rel_es6.x"
ES2LOCATION = "${S}/gfx_rel_es2.x"
ES3LOCATION = "${S}/gfx_rel_es3.x"
ES5LOCATION = "${S}/gfx_rel_es5.x"
ES6LOCATION = "${S}/gfx_rel_es6.x"
require libgles-omap3.inc
# download required binary distribution from:
# http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/latest/index_FDS.html
# see libgles-omap3.inc for detailed installation instructions
SGXPV = "4_03_00_02"
IMGPV = "1.6.16.3977"
BINFILE := "Graphics_SDK_setuplinux_${SGXPV}.bin"
SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/${SGXPV}/exports/Graphics_SDK_setuplinux_${SGXPV}.bin \
file://cputype \
file://rc.pvr \
file://sample.desktop \
file://99-bufferclass.rules \
"
SRC_URI[md5sum] = "ff8c1f2b8e4cb42f4ced6a613b081ada"
SRC_URI[sha256sum] = "cdb0bd3964e107733d632aa8224e0537b05c1ffac34befc036423458c8d75255"
S = "${WORKDIR}/Graphics_SDK_${SGXPV}"