summaryrefslogtreecommitdiffstats
path: root/meta-ti-bsp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>2023-01-19 11:29:52 +0100
committerRyan Eatmon <reatmon@ti.com>2023-01-31 14:44:08 -0600
commitf50f55102f926ba58ea22339a98e4239370af6c6 (patch)
treee731509161bc4c89dc23013acff3f7f8e9f33889 /meta-ti-bsp
parent71bcf5a4b688bbef04230e6f9120f1c8c7fc2366 (diff)
downloadmeta-ti-f50f55102f926ba58ea22339a98e4239370af6c6.tar.gz
ti-sgx-ddk-um: use udev for userspace initialization
The ti-sgx-ddk driver requires an additional userspace initialization step after the kernel module has probed the device. Without this initialization, no EGL context can be created and Weston etc. will fail to start. The driver package contains an init script, but this does not work on pure systemd-based systems without sysvinit compat support (as provided by the systemd-compat-units package). Introduce an enabled-by-default PACKAGECONFIG that installs a udev rule instead to run the init command automatically when the driver is loaded, solving the issue without depending on a specific init system. On builds without udev, this PACKAGECONFIG can be disabled, reverting to the old init script-based solution. udev reports several events when the pvrsrvkm module is loaded: - add event for the kernel module - add events for two DRM devices - bind event for the GPU platform device The DRM devices aren't nice to match on, and the kernel module add is too early to run `pvrsrvctl --start`, so we trigger on the platform device bind. Tested with Weston 9.0.0 on the AM65x-based TQ-Systems MBa65xx. Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Diffstat (limited to 'meta-ti-bsp')
-rw-r--r--meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um/pvrsrvkm.rules1
-rw-r--r--meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb23
2 files changed, 23 insertions, 1 deletions
diff --git a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um/pvrsrvkm.rules b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um/pvrsrvkm.rules
new file mode 100644
index 00000000..e49fd9b8
--- /dev/null
+++ b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um/pvrsrvkm.rules
@@ -0,0 +1 @@
SUBSYSTEM=="platform", ACTION=="bind", ENV{DRIVER}=="pvrsrvkm", RUN+="/usr/bin/pvrsrvctl --start --no-module"
diff --git a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
index 09295c83..1c479ee0 100644
--- a/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
+++ b/meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb
@@ -14,7 +14,10 @@ PR = "r38"
14 14
15BRANCH = "ti-img-sgx/kirkstone/${PV}" 15BRANCH = "ti-img-sgx/kirkstone/${PV}"
16 16
17SRC_URI = "git://git.ti.com/git/graphics/omap5-sgx-ddk-um-linux.git;protocol=https;branch=${BRANCH}" 17SRC_URI = " \
18 git://git.ti.com/git/graphics/omap5-sgx-ddk-um-linux.git;protocol=https;branch=${BRANCH} \
19 file://pvrsrvkm.rules \
20"
18SRCREV = "905809029b877fea42e91b9738825a6294ff1775" 21SRCREV = "905809029b877fea42e91b9738825a6294ff1775"
19 22
20TARGET_PRODUCT:ti33x = "ti335x" 23TARGET_PRODUCT:ti33x = "ti335x"
@@ -27,6 +30,9 @@ INITSCRIPT_PARAMS = "defaults 8"
27 30
28inherit update-rc.d 31inherit update-rc.d
29 32
33PACKAGECONFIG ??= "udev"
34PACKAGECONFIG[udev] = ",,,udev"
35
30PROVIDES += "virtual/egl virtual/libgles1 virtual/libgles2 virtual/libgbm" 36PROVIDES += "virtual/egl virtual/libgles1 virtual/libgles2 virtual/libgbm"
31 37
32DEPENDS += "libdrm udev wayland wayland-protocols libffi expat" 38DEPENDS += "libdrm udev wayland wayland-protocols libffi expat"
@@ -56,6 +62,20 @@ do_install () {
56 oe_runmake install DESTDIR=${D} TARGET_PRODUCT=${TARGET_PRODUCT} 62 oe_runmake install DESTDIR=${D} TARGET_PRODUCT=${TARGET_PRODUCT}
57 ln -sf libGLESv2.so.2 ${D}${libdir}/libGLESv2.so.1 63 ln -sf libGLESv2.so.2 ${D}${libdir}/libGLESv2.so.1
58 64
65 without_sysvinit=${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}
66 with_udev=${@bb.utils.contains('PACKAGECONFIG', 'udev', 'true', 'false', d)}
67
68 # Delete initscript if it is not needed or would conflict with the udev rules
69 if $without_sysvinit || $with_udev; then
70 rm -rf ${D}${sysconfdir}/init.d
71 rmdir --ignore-fail-on-non-empty ${D}${sysconfdir}
72 fi
73
74 if $with_udev; then
75 install -m644 -D ${WORKDIR}/pvrsrvkm.rules \
76 ${D}${nonarch_base_libdir}/udev/rules.d/80-pvrsrvkm.rules
77 fi
78
59 chown -R root:root ${D} 79 chown -R root:root ${D}
60} 80}
61 81
@@ -64,6 +84,7 @@ FILES:${PN} += " ${libdir}/*"
64FILES:${PN} += "${includedir}/*" 84FILES:${PN} += "${includedir}/*"
65FILES:${PN} += "${sysconfdir}/*" 85FILES:${PN} += "${sysconfdir}/*"
66FILES:${PN} += "${datadir}/*" 86FILES:${PN} += "${datadir}/*"
87FILES:${PN} += "${nonarch_base_libdir}/udev/rules.d"
67 88
68INSANE_SKIP:${PN} += "dev-so ldflags useless-rpaths" 89INSANE_SKIP:${PN} += "dev-so ldflags useless-rpaths"
69INSANE_SKIP:${PN} += "already-stripped dev-deps" 90INSANE_SKIP:${PN} += "already-stripped dev-deps"