diff options
4 files changed, 391 insertions, 0 deletions
diff --git a/recipes-bsp/powervr-drivers/omap3-sgx-modules_4.09.00.01.bb b/recipes-bsp/powervr-drivers/omap3-sgx-modules_4.09.00.01.bb new file mode 100644 index 00000000..55e427f6 --- /dev/null +++ b/recipes-bsp/powervr-drivers/omap3-sgx-modules_4.09.00.01.bb | |||
@@ -0,0 +1,56 @@ | |||
1 | DESCRIPTION = "Kernel drivers for the PowerVR SGX chipset found in the omap3 SoCs" | ||
2 | LICENSE = "GPLv2" | ||
3 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea5743acf520dd81ca172e69f818a3d4" | ||
4 | |||
5 | TI_BIN_UNPK_CMDS="Y: qY:workdir:Y" | ||
6 | require ../../recipes-ti/includes/ti-eula-unpack.inc | ||
7 | |||
8 | SGXPV = "4_09_00_01" | ||
9 | IMGPV = "1.9.2188537" | ||
10 | BINFILE = "Graphics_SDK_setuplinux_${SGXPV}_minimal_demos.bin" | ||
11 | |||
12 | inherit module | ||
13 | |||
14 | MACHINE_KERNEL_PR_append = "a" | ||
15 | PR = "${MACHINE_KERNEL_PR}" | ||
16 | |||
17 | DEFAULT_PREFERENCE = "-1" | ||
18 | |||
19 | SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/${SGXPV}/exports/${BINFILE}" | ||
20 | |||
21 | SRC_URI[md5sum] = "bd35e9d8843aff3a2aca9d41e7db1c7d" | ||
22 | SRC_URI[sha256sum] = "eb37f75ddde4640b09e760fa86e689beb394330ecdf68786188c34f249247647" | ||
23 | |||
24 | TI_BIN_UNPK_WDEXT="/Graphics_SDK_${SGXPV}" | ||
25 | S = "${WORKDIR}${TI_BIN_UNPK_WDEXT}/GFX_Linux_KM" | ||
26 | |||
27 | PVRBUILD = "release" | ||
28 | export KERNELDIR = "${STAGING_KERNEL_DIR}" | ||
29 | |||
30 | INHIBIT_PACKAGE_STRIP = "1" | ||
31 | |||
32 | TI_PLATFORM_omap3 = "omap3630" | ||
33 | TI_PLATFORM_ti814x = "ti81xx" | ||
34 | TI_PLATFORM_ti816x = "ti81xx" | ||
35 | TI_PLATFORM_ti33x = "ti335x" | ||
36 | |||
37 | MODULESLOCATION_omap3 = "dc_omapfb3_linux" | ||
38 | MODULESLOCATION_ti814x = "dc_ti81xx_linux" | ||
39 | MODULESLOCATION_ti816x = "dc_ti81xx_linux" | ||
40 | MODULESLOCATION_ti33x = "dc_ti335x_linux" | ||
41 | |||
42 | export SUPPORT_XORG ?= "${@base_contains('DISTRO_FEATURES', 'x11', '1', '0', d)}" | ||
43 | |||
44 | MAKE_TARGETS = " BUILD=${PVRBUILD} TI_PLATFORM=${TI_PLATFORM} SUPPORT_XORG=${SUPPORT_XORG}" | ||
45 | |||
46 | do_install() { | ||
47 | mkdir -p ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/gpu/pvr | ||
48 | cp ${S}/pvrsrvkm.ko \ | ||
49 | ${S}/services4/3rdparty/${MODULESLOCATION}/omaplfb.ko \ | ||
50 | ${S}/services4/3rdparty/bufferclass_ti/bufferclass_ti.ko \ | ||
51 | ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/gpu/pvr | ||
52 | |||
53 | if [ "${SUPPORT_XORG}" = "1" ]; then | ||
54 | cp ${S}/services4/3rdparty/linux_drm/drm.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/gpu/pvr | ||
55 | fi | ||
56 | } | ||
diff --git a/recipes-graphics/libgles/libgles-omap3-4.09.00.01/rc.pvr b/recipes-graphics/libgles/libgles-omap3-4.09.00.01/rc.pvr new file mode 100755 index 00000000..7b5cefa5 --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3-4.09.00.01/rc.pvr | |||
@@ -0,0 +1,124 @@ | |||
1 | #!/bin/sh | ||
2 | PATH=$PATH:/usr/sbin | ||
3 | |||
4 | # Check if an fb device is available. If not then just go ahead and | ||
5 | # exit because we have no display. | ||
6 | fbset > /dev/null 2>&1 | ||
7 | if [ "$?" == "1" ] | ||
8 | then | ||
9 | # looks like there is no display, so let's exit | ||
10 | exit 0 | ||
11 | fi | ||
12 | |||
13 | BITSPERPIXEL="$(fbset | grep geom | awk '{print $6}')" | ||
14 | YRES="$(fbset | grep geom | awk '{print $3}')" | ||
15 | |||
16 | CPUTYPE="$(cputype)" | ||
17 | |||
18 | if [ "$1" = "" ]; then | ||
19 | echo PVR-INIT: Please use start, stop, or restart. | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
23 | if [ "$1" = "stop" -o "$1" = "restart" ]; then | ||
24 | echo Stopping PVR | ||
25 | rmmod bufferclass_ti | ||
26 | rmmod omaplfb 2>/dev/null | ||
27 | rmmod pvrsrvkm 2>/dev/null | ||
28 | fi | ||
29 | |||
30 | if [ "$1" = "stop" ]; then | ||
31 | exit 0 | ||
32 | fi | ||
33 | |||
34 | # Set RGBA ordering to something the drivers like | ||
35 | if [ "$BITSPERPIXEL" = "32" ] ; then | ||
36 | fbset -rgba 8/16,8/8,8/0,8/24 | ||
37 | fi | ||
38 | |||
39 | # Try to enable triple buffering when there's enough VRAM | ||
40 | fbset -vyres $(expr $YRES \* 3) | ||
41 | |||
42 | sgxprepare () { | ||
43 | echo Starting PVR | ||
44 | insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko") | ||
45 | |||
46 | if [ "$?" != "0" ] | ||
47 | then | ||
48 | echo "Could not find pvrsrvkm driver" | ||
49 | exit 1 | ||
50 | fi | ||
51 | |||
52 | modprobe omaplfb | ||
53 | modprobe bufferclass_ti | ||
54 | |||
55 | pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3` | ||
56 | bc_maj=`grep "bc" /proc/devices | cut -b1,2,3` | ||
57 | |||
58 | if [ -e /dev/pvrsrvkm ] ; then | ||
59 | rm -f /dev/pvrsrvkm | ||
60 | fi | ||
61 | |||
62 | mknod /dev/pvrsrvkm c $pvr_maj 0 | ||
63 | chmod 666 /dev/pvrsrvkm | ||
64 | |||
65 | touch /etc/powervr-esrev | ||
66 | |||
67 | SAVED_ESREVISION="$(cat /etc/powervr-esrev)" | ||
68 | } | ||
69 | |||
70 | sgxfinish () { | ||
71 | # Fix up a bug in opkg | ||
72 | if [ $(readlink /usr/lib/libsrv_um.so) != $(readlink /usr/lib/libsrv_um.so.1) ] ; then | ||
73 | cd /usr/lib | ||
74 | ln -sf $(readlink /usr/lib/libsrv_um.so.1) libsrv_um.so | ||
75 | fi | ||
76 | |||
77 | if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then | ||
78 | echo -n "Starting SGX fixup for" | ||
79 | echo " ES${ES_REVISION}.x" | ||
80 | cp -a /usr/lib/ES${ES_REVISION}.0/* /usr/lib | ||
81 | cp -a /usr/bin/ES${ES_REVISION}.0/* /usr/bin | ||
82 | echo "${ES_REVISION}" > /etc/powervr-esrev | ||
83 | fi | ||
84 | |||
85 | if ! /usr/bin/pvrsrvctl --start --no-module; then return; fi | ||
86 | } | ||
87 | |||
88 | case $CPUTYPE in | ||
89 | "OMAP3530") | ||
90 | sgxprepare | ||
91 | |||
92 | devmem2 0x48004B48 w 0x2 > /dev/null | ||
93 | devmem2 0x48004B10 w 0x1 > /dev/null | ||
94 | devmem2 0x48004B00 w 0x2 > /dev/null | ||
95 | |||
96 | ES_REVISION="$(devmem2 0x50000014 | sed -e s:0x00010205:5: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')" | ||
97 | |||
98 | sgxfinish | ||
99 | ;; | ||
100 | "TI33XX") | ||
101 | sgxprepare | ||
102 | |||
103 | devmem2 0x44e01104 w 0x0 > /dev/null | ||
104 | devmem2 0x44e00904 w 0x2 > /dev/null | ||
105 | |||
106 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:8: | tail -n1 | awk -F': ' '{print $2}')" | ||
107 | |||
108 | sgxfinish | ||
109 | ;; | ||
110 | "TI816x") | ||
111 | sgxprepare | ||
112 | |||
113 | devmem2 0x48180F04 w 0x0 > /dev/null | ||
114 | devmem2 0x48180900 w 0x2 > /dev/null | ||
115 | devmem2 0x48180920 w 0x2 > /dev/null | ||
116 | |||
117 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:6: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')" | ||
118 | |||
119 | sgxfinish | ||
120 | ;; | ||
121 | *) | ||
122 | echo No SGX hardware, not starting PVR | ||
123 | ;; | ||
124 | esac | ||
diff --git a/recipes-graphics/libgles/libgles-omap3-4.09.00.01/rc_dri.pvr b/recipes-graphics/libgles/libgles-omap3-4.09.00.01/rc_dri.pvr new file mode 100755 index 00000000..dd1e9421 --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3-4.09.00.01/rc_dri.pvr | |||
@@ -0,0 +1,136 @@ | |||
1 | #!/bin/sh | ||
2 | PATH=$PATH:/usr/sbin | ||
3 | |||
4 | # Check if an fb device is available. If not then just go ahead and | ||
5 | # exit because we have no display. | ||
6 | fbset > /dev/null 2>&1 | ||
7 | if [ "$?" == "1" ] | ||
8 | then | ||
9 | # looks like there is no display, so let's exit | ||
10 | exit 0 | ||
11 | fi | ||
12 | |||
13 | BITSPERPIXEL="$(fbset | grep geom | awk '{print $6}')" | ||
14 | YRES="$(fbset | grep geom | awk '{print $3}')" | ||
15 | |||
16 | CPUTYPE="$(cputype)" | ||
17 | |||
18 | if [ "$1" = "" ]; then | ||
19 | echo PVR-INIT: Please use start, stop, or restart. | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
23 | if [ "$1" = "stop" -o "$1" = "restart" ]; then | ||
24 | echo Stopping PVR | ||
25 | |||
26 | # Stop the X Server. | ||
27 | # | ||
28 | [ -f /tmp/.X0-lock ] && read XPID < /tmp/.X0-lock && [ -n "$XPID" ] && kill $XPID && while [ -e /proc/$XPID ] ; do sleep 1; done | ||
29 | |||
30 | rmmod bufferclass_ti | ||
31 | rmmod pvrsrvkm 2>/dev/null | ||
32 | rmmod drm 2>/dev/null | ||
33 | fi | ||
34 | |||
35 | if [ "$1" = "stop" ]; then | ||
36 | exit 0 | ||
37 | fi | ||
38 | |||
39 | # Set RGBA ordering to something the drivers like | ||
40 | if [ "$BITSPERPIXEL" = "32" ] ; then | ||
41 | fbset -rgba 8/16,8/8,8/0,8/24 | ||
42 | fi | ||
43 | |||
44 | # Try to enable triple buffering when there's enough VRAM | ||
45 | fbset -vyres $(expr $YRES \* 3) | ||
46 | |||
47 | sgxprepare () { | ||
48 | echo Starting PVR | ||
49 | |||
50 | # Start the X Server. | ||
51 | # The X Server will load the PVR Services module. | ||
52 | # | ||
53 | /usr/local/XSGX/bin/X -verbose -config /usr/local/XSGX/etc/xorg.conf & | ||
54 | |||
55 | modprobe drm | ||
56 | |||
57 | insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko") | ||
58 | |||
59 | if [ "$?" != "0" ] | ||
60 | then | ||
61 | echo "Could not find pvrsrvkm driver" | ||
62 | exit 1 | ||
63 | fi | ||
64 | |||
65 | modprobe bufferclass_ti | ||
66 | |||
67 | pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3` | ||
68 | bc_maj=`grep "bc" /proc/devices | cut -b1,2,3` | ||
69 | |||
70 | if [ -e /dev/pvrsrvkm ] ; then | ||
71 | rm -f /dev/pvrsrvkm | ||
72 | fi | ||
73 | |||
74 | mknod /dev/pvrsrvkm c $pvr_maj 0 | ||
75 | chmod 666 /dev/pvrsrvkm | ||
76 | |||
77 | touch /etc/powervr-esrev | ||
78 | |||
79 | SAVED_ESREVISION="$(cat /etc/powervr-esrev)" | ||
80 | } | ||
81 | |||
82 | sgxfinish () { | ||
83 | # Fix up a bug in opkg | ||
84 | if [ $(readlink /usr/lib/libsrv_um.so) != $(readlink /usr/lib/libsrv_um.so.1) ] ; then | ||
85 | cd /usr/lib | ||
86 | ln -sf $(readlink /usr/lib/libsrv_um.so.1) libsrv_um.so | ||
87 | fi | ||
88 | |||
89 | if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then | ||
90 | echo -n "Starting SGX fixup for" | ||
91 | echo " ES${ES_REVISION}.x" | ||
92 | cp -a /usr/lib/ES${ES_REVISION}.0/* /usr/lib | ||
93 | cp -a /usr/bin/ES${ES_REVISION}.0/* /usr/bin | ||
94 | echo "${ES_REVISION}" > /etc/powervr-esrev | ||
95 | fi | ||
96 | |||
97 | if ! /usr/bin/pvrsrvctl --start --no-module; then return; fi | ||
98 | } | ||
99 | |||
100 | case $CPUTYPE in | ||
101 | "OMAP3530") | ||
102 | sgxprepare | ||
103 | |||
104 | devmem2 0x48004B48 w 0x2 > /dev/null | ||
105 | devmem2 0x48004B10 w 0x1 > /dev/null | ||
106 | devmem2 0x48004B00 w 0x2 > /dev/null | ||
107 | |||
108 | ES_REVISION="$(devmem2 0x50000014 | sed -e s:0x00010205:5: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')" | ||
109 | |||
110 | sgxfinish | ||
111 | ;; | ||
112 | "TI33XX") | ||
113 | sgxprepare | ||
114 | |||
115 | devmem2 0x44e01104 w 0x0 > /dev/null | ||
116 | devmem2 0x44e00904 w 0x2 > /dev/null | ||
117 | |||
118 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:8: | tail -n1 | awk -F': ' '{print $2}')" | ||
119 | |||
120 | sgxfinish | ||
121 | ;; | ||
122 | "TI816x") | ||
123 | sgxprepare | ||
124 | |||
125 | devmem2 0x48180F04 w 0x0 > /dev/null | ||
126 | devmem2 0x48180900 w 0x2 > /dev/null | ||
127 | devmem2 0x48180920 w 0x2 > /dev/null | ||
128 | |||
129 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:6: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')" | ||
130 | |||
131 | sgxfinish | ||
132 | ;; | ||
133 | *) | ||
134 | echo No SGX hardware, not starting PVR | ||
135 | ;; | ||
136 | esac | ||
diff --git a/recipes-graphics/libgles/libgles-omap3_4.09.00.01.bb b/recipes-graphics/libgles/libgles-omap3_4.09.00.01.bb new file mode 100644 index 00000000..7c6f2316 --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3_4.09.00.01.bb | |||
@@ -0,0 +1,75 @@ | |||
1 | require libgles-omap3.inc | ||
2 | |||
3 | LICENSE = "TSPA" | ||
4 | |||
5 | DEFAULT_PREFERENCE = "-1" | ||
6 | |||
7 | BINLOCATION_omap3 = "${S}/gfx_rel_es3.x" | ||
8 | BINLOCATION_ti816x = "${S}/gfx_rel_es6.x" | ||
9 | BINLOCATION_ti814x = "${S}/gfx_rel_es6.x" | ||
10 | BINLOCATION_ti33x = "${S}/gfx_rel_es8.x" | ||
11 | |||
12 | PLATFORM = "LinuxARMV7" | ||
13 | PVR_INIT = "pvrsrvctl" | ||
14 | |||
15 | # download required binary distribution from: | ||
16 | # http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/latest/index_FDS.html | ||
17 | # see libgles-omap3.inc for detailed installation instructions | ||
18 | |||
19 | SGXPV = "4_09_00_01" | ||
20 | IMGPV = "1.9.2188537" | ||
21 | BINFILE = "Graphics_SDK_setuplinux_${SGXPV}_minimal_demos.bin" | ||
22 | TI_BIN_UNPK_WDEXT := "/Graphics_SDK_${SGXPV}" | ||
23 | SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/${SGXPV}/exports/${BINFILE} \ | ||
24 | file://cputype \ | ||
25 | file://rc.pvr \ | ||
26 | file://rc_dri.pvr \ | ||
27 | file://sample.desktop \ | ||
28 | file://99-bufferclass.rules \ | ||
29 | " | ||
30 | SRC_URI[md5sum] = "bd35e9d8843aff3a2aca9d41e7db1c7d" | ||
31 | SRC_URI[sha256sum] = "eb37f75ddde4640b09e760fa86e689beb394330ecdf68786188c34f249247647" | ||
32 | |||
33 | S = "${WORKDIR}/Graphics_SDK_${SGXPV}" | ||
34 | |||
35 | LIBGLESWINDOWSYSTEM ?= "${@base_contains('DISTRO_FEATURES', 'x11',"libpvrPVR2D_DRIWSEGL.so" ,"libpvrPVR2D_FRONTWSEGL.so.1", d)}" | ||
36 | |||
37 | do_configure_append() { | ||
38 | |||
39 | # Change PVR server's user mode library to point to DRI | ||
40 | for drifile in $(find ${S} -name "libsrv_um_dri.so"); do | ||
41 | if [ "$drifile" != "" ] | ||
42 | then | ||
43 | dir=$(dirname ${drifile}) | ||
44 | if [ "$SUPPORT_XORG" = "1" ] | ||
45 | then | ||
46 | mv ${dir}/libsrv_um_dri.so ${dir}/libsrv_um.so | ||
47 | else | ||
48 | rm -rf ${dir}/libsrv_um_dri.so | ||
49 | fi | ||
50 | fi | ||
51 | |||
52 | done | ||
53 | } | ||
54 | |||
55 | do_install_append() { | ||
56 | |||
57 | # In this version of the graphics SDK the following directories do not exist: | ||
58 | # /GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/pvr2d.h (doesn't exist) | ||
59 | # /GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/GLES/egltypes.h (doesn't exist) | ||
60 | # Therefore, need to copy these files manually at the only location that they do exist | ||
61 | cp -pPr ${S}/include/pvr2d/*.h ${D}${includedir} | ||
62 | cp -pPr ${S}/include/OGLES/GLES ${D}${includedir}/ | ||
63 | |||
64 | rm ${D}${sysconfdir}/init.d/pvr-init | ||
65 | |||
66 | if [ "$SUPPORT_XORG" = "1" ]; then | ||
67 | cp -pP ${WORKDIR}/rc_dri.pvr ${D}${sysconfdir}/init.d/pvr-init | ||
68 | else | ||
69 | cp -pP ${WORKDIR}/rc.pvr ${D}${sysconfdir}/init.d/pvr-init | ||
70 | fi | ||
71 | |||
72 | } | ||
73 | |||
74 | RRECOMMENDS_${PN}-x11demos = "${PN}-driwsegl" | ||
75 | RRECOMMENDS_${PN}-x11trainingcourses = "${PN}-driwsegl" | ||