diff options
author | Matthias Schiffer <matthias.schiffer@ew.tq-group.com> | 2023-01-19 11:29:52 +0100 |
---|---|---|
committer | Ryan Eatmon <reatmon@ti.com> | 2023-01-31 14:44:08 -0600 |
commit | f50f55102f926ba58ea22339a98e4239370af6c6 (patch) | |
tree | e731509161bc4c89dc23013acff3f7f8e9f33889 /meta-ti-bsp | |
parent | 71bcf5a4b688bbef04230e6f9120f1c8c7fc2366 (diff) | |
download | meta-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.rules | 1 | ||||
-rw-r--r-- | meta-ti-bsp/recipes-graphics/libgles/ti-sgx-ddk-um_1.17.4948957.bb | 23 |
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 | ||
15 | BRANCH = "ti-img-sgx/kirkstone/${PV}" | 15 | BRANCH = "ti-img-sgx/kirkstone/${PV}" |
16 | 16 | ||
17 | SRC_URI = "git://git.ti.com/git/graphics/omap5-sgx-ddk-um-linux.git;protocol=https;branch=${BRANCH}" | 17 | SRC_URI = " \ |
18 | git://git.ti.com/git/graphics/omap5-sgx-ddk-um-linux.git;protocol=https;branch=${BRANCH} \ | ||
19 | file://pvrsrvkm.rules \ | ||
20 | " | ||
18 | SRCREV = "905809029b877fea42e91b9738825a6294ff1775" | 21 | SRCREV = "905809029b877fea42e91b9738825a6294ff1775" |
19 | 22 | ||
20 | TARGET_PRODUCT:ti33x = "ti335x" | 23 | TARGET_PRODUCT:ti33x = "ti335x" |
@@ -27,6 +30,9 @@ INITSCRIPT_PARAMS = "defaults 8" | |||
27 | 30 | ||
28 | inherit update-rc.d | 31 | inherit update-rc.d |
29 | 32 | ||
33 | PACKAGECONFIG ??= "udev" | ||
34 | PACKAGECONFIG[udev] = ",,,udev" | ||
35 | |||
30 | PROVIDES += "virtual/egl virtual/libgles1 virtual/libgles2 virtual/libgbm" | 36 | PROVIDES += "virtual/egl virtual/libgles1 virtual/libgles2 virtual/libgbm" |
31 | 37 | ||
32 | DEPENDS += "libdrm udev wayland wayland-protocols libffi expat" | 38 | DEPENDS += "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}/*" | |||
64 | FILES:${PN} += "${includedir}/*" | 84 | FILES:${PN} += "${includedir}/*" |
65 | FILES:${PN} += "${sysconfdir}/*" | 85 | FILES:${PN} += "${sysconfdir}/*" |
66 | FILES:${PN} += "${datadir}/*" | 86 | FILES:${PN} += "${datadir}/*" |
87 | FILES:${PN} += "${nonarch_base_libdir}/udev/rules.d" | ||
67 | 88 | ||
68 | INSANE_SKIP:${PN} += "dev-so ldflags useless-rpaths" | 89 | INSANE_SKIP:${PN} += "dev-so ldflags useless-rpaths" |
69 | INSANE_SKIP:${PN} += "already-stripped dev-deps" | 90 | INSANE_SKIP:${PN} += "already-stripped dev-deps" |