Skip to content

Commit

Permalink
fix(drm): add privacy screen modules to the initrd
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jwrdegoede authored and johannbg committed Dec 10, 2021
1 parent 475497b commit 14d97a6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules.d/50drm/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

0 comments on commit 14d97a6

Please sign in to comment.