Skip to content

Commit 14d97a6

Browse files
jwrdegoedejohannbg
authored andcommitted
fix(drm): add privacy screen modules to the initrd
Starting with kernel 5.17 the kernel supports the builtin privacy screens built into the LCD panel of some new laptop models. This means that the drm drivers will now return -EPROBE_DEFER from their probe() method on models with a builtin privacy screen when the privacy screen provider driver has not been loaded yet. Make dracut add the privacy screen providing drivers to the initrd (when necessary for hostmode=yes), so that drm drivers on affected drivers can probe() successfully. Signed-off-by: Hans de Goede <[email protected]>
1 parent 475497b commit 14d97a6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modules.d/50drm/module-setup.sh

+14
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ installkernel() {
2929
# as we could e.g. be in the installer; nokmsboot boot parameter will disable
3030
# loading of the driver if needed
3131
if [[ $hostonly ]]; then
32+
local i modlink modname
33+
3234
for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
3335
[[ -e $i ]] || continue
3436
[[ -n $(< "$i") ]] || continue
@@ -39,7 +41,19 @@ installkernel() {
3941
fi
4042
fi
4143
done
44+
# if there is a privacy screen then its driver must be loaded before the
45+
# kms driver will bind, otherwise its probe() will return -EPROBE_DEFER
46+
# note privacy screens always register, even with e.g. nokmsboot
47+
for i in /sys/class/drm/privacy_screen-*/device/driver/module; do
48+
[[ -L $i ]] || continue
49+
modlink=$(readlink "$i")
50+
modname=$(basename "$modlink")
51+
instmods "$modname"
52+
done
4253
else
4354
dracut_instmods -o -s "drm_crtc_init|drm_dev_register|drm_encoder_init" "=drivers/gpu/drm" "=drivers/staging"
55+
# also include privacy screen providers (see above comment)
56+
# atm all providers live under drivers/platform/x86
57+
dracut_instmods -o -s "drm_privacy_screen_register" "=drivers/platform/x86"
4458
fi
4559
}

0 commit comments

Comments
 (0)