Browse Source

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 <hdegoede@redhat.com>
master
Hans de Goede 2 years ago committed by Jóhann B. Guðmundsson
parent
commit
14d97a6a28
  1. 14
      modules.d/50drm/module-setup.sh

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

@ -29,6 +29,8 @@ installkernel() { @@ -29,6 +29,8 @@ installkernel() {
# as we could e.g. be in the installer; nokmsboot boot parameter will disable
# loading of the driver if needed
if [[ $hostonly ]]; then
local i modlink modname

for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
[[ -e $i ]] || continue
[[ -n $(< "$i") ]] || continue
@ -39,7 +41,19 @@ installkernel() { @@ -39,7 +41,19 @@ installkernel() {
fi
fi
done
# if there is a privacy screen then its driver must be loaded before the
# kms driver will bind, otherwise its probe() will return -EPROBE_DEFER
# note privacy screens always register, even with e.g. nokmsboot
for i in /sys/class/drm/privacy_screen-*/device/driver/module; do
[[ -L $i ]] || continue
modlink=$(readlink "$i")
modname=$(basename "$modlink")
instmods "$modname"
done
else
dracut_instmods -o -s "drm_crtc_init|drm_dev_register|drm_encoder_init" "=drivers/gpu/drm" "=drivers/staging"
# also include privacy screen providers (see above comment)
# atm all providers live under drivers/platform/x86
dracut_instmods -o -s "drm_privacy_screen_register" "=drivers/platform/x86"
fi
}

Loading…
Cancel
Save