diff options
Diffstat (limited to 'recipes-graphics')
3 files changed, 329 insertions, 0 deletions
diff --git a/recipes-graphics/libgles/libgles-omap3-5.01.00.01/rc.pvr b/recipes-graphics/libgles/libgles-omap3-5.01.00.01/rc.pvr new file mode 100755 index 00000000..132749af --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3-5.01.00.01/rc.pvr | |||
@@ -0,0 +1,134 @@ | |||
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 | |||
45 | lsmod | grep pvrsrvkm > /dev/null | ||
46 | |||
47 | if [ "$?" != "0" ] | ||
48 | then | ||
49 | insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko") | ||
50 | |||
51 | if [ "$?" != "0" ] | ||
52 | then | ||
53 | echo "Could not find pvrsrvkm driver" | ||
54 | exit 1 | ||
55 | fi | ||
56 | fi | ||
57 | |||
58 | modprobe omaplfb | ||
59 | modprobe bufferclass_ti | ||
60 | |||
61 | pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3` | ||
62 | bc_maj=`grep "bc" /proc/devices | cut -b1,2,3` | ||
63 | |||
64 | if [ -e /dev/pvrsrvkm ] ; then | ||
65 | rm -f /dev/pvrsrvkm | ||
66 | fi | ||
67 | |||
68 | mknod /dev/pvrsrvkm c $pvr_maj 0 | ||
69 | chmod 666 /dev/pvrsrvkm | ||
70 | |||
71 | touch /etc/powervr-esrev | ||
72 | |||
73 | SAVED_ESREVISION="$(cat /etc/powervr-esrev)" | ||
74 | } | ||
75 | |||
76 | sgxfinish () { | ||
77 | # Fix up a bug in opkg | ||
78 | if [ $(readlink /usr/lib/libsrv_um.so) != $(readlink /usr/lib/libsrv_um.so.1) ] ; then | ||
79 | cd /usr/lib | ||
80 | ln -sf $(readlink /usr/lib/libsrv_um.so.1) libsrv_um.so | ||
81 | fi | ||
82 | |||
83 | if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then | ||
84 | echo -n "Starting SGX fixup for" | ||
85 | echo " ES${ES_REVISION}.x" | ||
86 | cp -a /usr/lib/ES${ES_REVISION}.0/* /usr/lib | ||
87 | cp -a /usr/bin/ES${ES_REVISION}.0/* /usr/bin | ||
88 | echo "${ES_REVISION}" > /etc/powervr-esrev | ||
89 | fi | ||
90 | |||
91 | if ! /usr/bin/pvrsrvctl --start --no-module; then return; fi | ||
92 | } | ||
93 | |||
94 | case $CPUTYPE in | ||
95 | "OMAP3530") | ||
96 | sgxprepare | ||
97 | |||
98 | devmem2 0x48004B48 w 0x2 > /dev/null | ||
99 | devmem2 0x48004B10 w 0x1 > /dev/null | ||
100 | devmem2 0x48004B00 w 0x2 > /dev/null | ||
101 | |||
102 | ES_REVISION="$(devmem2 0x50000014 | sed -e s:0x00010205:5: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')" | ||
103 | |||
104 | sgxfinish | ||
105 | ;; | ||
106 | "TI33XX") | ||
107 | sgxprepare | ||
108 | |||
109 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:8: | tail -n1 | awk -F': ' '{print $2}')" | ||
110 | |||
111 | sgxfinish | ||
112 | ;; | ||
113 | "TI43XX") | ||
114 | sgxprepare | ||
115 | |||
116 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:8: | tail -n1 | awk -F': ' '{print $2}')" | ||
117 | |||
118 | sgxfinish | ||
119 | ;; | ||
120 | "TI816x") | ||
121 | sgxprepare | ||
122 | |||
123 | devmem2 0x48180F04 w 0x0 > /dev/null | ||
124 | devmem2 0x48180900 w 0x2 > /dev/null | ||
125 | devmem2 0x48180920 w 0x2 > /dev/null | ||
126 | |||
127 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:6: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')" | ||
128 | |||
129 | sgxfinish | ||
130 | ;; | ||
131 | *) | ||
132 | echo No SGX hardware, not starting PVR | ||
133 | ;; | ||
134 | esac | ||
diff --git a/recipes-graphics/libgles/libgles-omap3-5.01.00.01/rc_dri.pvr b/recipes-graphics/libgles/libgles-omap3-5.01.00.01/rc_dri.pvr new file mode 100755 index 00000000..9b75aaf5 --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3-5.01.00.01/rc_dri.pvr | |||
@@ -0,0 +1,145 @@ | |||
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 | lsmod | grep pvrsrvkm > /dev/null | ||
58 | |||
59 | if [ "$?" != "0" ] | ||
60 | then | ||
61 | insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko") | ||
62 | |||
63 | if [ "$?" != "0" ] | ||
64 | then | ||
65 | echo "Could not find pvrsrvkm driver" | ||
66 | exit 1 | ||
67 | fi | ||
68 | fi | ||
69 | |||
70 | modprobe bufferclass_ti | ||
71 | |||
72 | pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3` | ||
73 | bc_maj=`grep "bc" /proc/devices | cut -b1,2,3` | ||
74 | |||
75 | if [ -e /dev/pvrsrvkm ] ; then | ||
76 | rm -f /dev/pvrsrvkm | ||
77 | fi | ||
78 | |||
79 | mknod /dev/pvrsrvkm c $pvr_maj 0 | ||
80 | chmod 666 /dev/pvrsrvkm | ||
81 | |||
82 | touch /etc/powervr-esrev | ||
83 | |||
84 | SAVED_ESREVISION="$(cat /etc/powervr-esrev)" | ||
85 | } | ||
86 | |||
87 | sgxfinish () { | ||
88 | # Fix up a bug in opkg | ||
89 | if [ $(readlink /usr/lib/libsrv_um.so) != $(readlink /usr/lib/libsrv_um.so.1) ] ; then | ||
90 | cd /usr/lib | ||
91 | ln -sf $(readlink /usr/lib/libsrv_um.so.1) libsrv_um.so | ||
92 | fi | ||
93 | |||
94 | if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then | ||
95 | echo -n "Starting SGX fixup for" | ||
96 | echo " ES${ES_REVISION}.x" | ||
97 | cp -a /usr/lib/ES${ES_REVISION}.0/* /usr/lib | ||
98 | cp -a /usr/bin/ES${ES_REVISION}.0/* /usr/bin | ||
99 | echo "${ES_REVISION}" > /etc/powervr-esrev | ||
100 | fi | ||
101 | |||
102 | if ! /usr/bin/pvrsrvctl --start --no-module; then return; fi | ||
103 | } | ||
104 | |||
105 | case $CPUTYPE in | ||
106 | "OMAP3530") | ||
107 | sgxprepare | ||
108 | |||
109 | devmem2 0x48004B48 w 0x2 > /dev/null | ||
110 | devmem2 0x48004B10 w 0x1 > /dev/null | ||
111 | devmem2 0x48004B00 w 0x2 > /dev/null | ||
112 | |||
113 | ES_REVISION="$(devmem2 0x50000014 | sed -e s:0x00010205:5: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')" | ||
114 | |||
115 | sgxfinish | ||
116 | ;; | ||
117 | "TI33XX") | ||
118 | sgxprepare | ||
119 | |||
120 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:8: | tail -n1 | awk -F': ' '{print $2}')" | ||
121 | |||
122 | sgxfinish | ||
123 | ;; | ||
124 | "TI43XX") | ||
125 | sgxprepare | ||
126 | |||
127 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:8: | tail -n1 | awk -F': ' '{print $2}')" | ||
128 | |||
129 | sgxfinish | ||
130 | ;; | ||
131 | "TI816x") | ||
132 | sgxprepare | ||
133 | |||
134 | devmem2 0x48180F04 w 0x0 > /dev/null | ||
135 | devmem2 0x48180900 w 0x2 > /dev/null | ||
136 | devmem2 0x48180920 w 0x2 > /dev/null | ||
137 | |||
138 | ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x00010205:6: -e s:0x00010201:3: -e s:0x00010003:2: | tail -n1 | awk -F': ' '{print $2}')" | ||
139 | |||
140 | sgxfinish | ||
141 | ;; | ||
142 | *) | ||
143 | echo No SGX hardware, not starting PVR | ||
144 | ;; | ||
145 | esac | ||
diff --git a/recipes-graphics/libgles/libgles-omap3_5.01.00.01.bb b/recipes-graphics/libgles/libgles-omap3_5.01.00.01.bb new file mode 100644 index 00000000..a3b34fe5 --- /dev/null +++ b/recipes-graphics/libgles/libgles-omap3_5.01.00.01.bb | |||
@@ -0,0 +1,50 @@ | |||
1 | require libgles-omap3-no-x.inc | ||
2 | |||
3 | LICENSE = "TSPA" | ||
4 | |||
5 | PR = "${INC_PR}.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 | BINLOCATION_ti43x = "${S}/gfx_rel_es9.x" | ||
12 | |||
13 | PLATFORM = "LinuxARMV7" | ||
14 | PVR_INIT = "pvrsrvctl" | ||
15 | |||
16 | SGXPV = "5_01_00_01" | ||
17 | IMGPV = "1.10.2359475" | ||
18 | |||
19 | TI_BIN_UNPK_WDEXT := "/Graphics_SDK_${SGXPV}" | ||
20 | |||
21 | BINFILE_HARDFP = "Graphics_SDK_setuplinux_hardfp_${SGXPV}.bin" | ||
22 | MD5SUM_HARDFP = "0ee7d59808330d442a51c0990c2cb30e" | ||
23 | SHA256SUM_HARDFP = "769daae439677a7a85bbbced14cee4f85b19823e0b99560078d0a864c525c128" | ||
24 | |||
25 | # For now we only have hardfp version | ||
26 | python __anonymous() { | ||
27 | tunes = bb.data.getVar("TUNE_FEATURES", d, 1) | ||
28 | if not tunes: | ||
29 | return | ||
30 | pkgn = bb.data.getVar("PN", d, 1) | ||
31 | pkgv = bb.data.getVar("PV", d, 1) | ||
32 | if "callconvention-hard" not in tunes: | ||
33 | bb.warn("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv)) | ||
34 | raise bb.parse.SkipPackage("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv)) | ||
35 | } | ||
36 | |||
37 | BINFILE := "${BINFILE_HARDFP}" | ||
38 | |||
39 | SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/gfxsdk/${SGXPV}/exports/${BINFILE} \ | ||
40 | file://cputype \ | ||
41 | file://rc.pvr \ | ||
42 | file://99-bufferclass.rules \ | ||
43 | " | ||
44 | |||
45 | SRC_URI[md5sum] := "${MD5SUM_HARDFP}" | ||
46 | SRC_URI[sha256sum] := "${SHA256SUM_HARDFP}" | ||
47 | |||
48 | S = "${WORKDIR}/Graphics_SDK_${SGXPV}" | ||
49 | |||
50 | LIBGLESWINDOWSYSTEM ?= "libpvrPVR2D_FRONTWSEGL.so.1" | ||