From ff4be9e854cdf124998f7a4a7d82dbbe23e78719 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Sat, 31 Oct 2020 13:19:52 +0800 Subject: [PATCH 1/1] init.sh: check driver name instead of fb name The name in /proc/fb varies between different kernel versions. That's annoying. Use the driver name of fb0 which seems to be fixed. --- init.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.sh b/init.sh index a9d3d1e..805e25b 100644 --- a/init.sh +++ b/init.sh @@ -185,8 +185,8 @@ function init_uvesafb() function init_hal_gralloc() { - case "$(cat /proc/fb | head -1)" in - *virtiodrmfb) + case "$(readlink /sys/class/graphics/fb0/device/driver)" in + *virtio_gpu) if [ "$HWACCEL" != "0" ]; then set_property ro.hardware.hwcomposer drm set_property ro.hardware.gralloc gbm @@ -194,7 +194,7 @@ function init_hal_gralloc() fi set_prop_if_empty sleep.state none ;; - 0*inteldrmfb|0*radeondrmfb|0*nouveaufb|0*svgadrmfb|0*amdgpudrmfb) + *i915|*radeon|*nouveau|*vmwgfx|*amdgpu) if [ "$HWACCEL" != "0" ]; then set_property ro.hardware.gralloc drm set_drm_mode @@ -203,7 +203,7 @@ function init_hal_gralloc() "") init_uvesafb ;& - 0*) + *) ;; esac -- 2.11.0