OSDN Git Service

Merge remote-tracking branch 'x86/oreo-x86' into pie-x86
[android-x86/device-generic-common.git] / init.sh
diff --git a/init.sh b/init.sh
index 564dd3c..e791896 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -184,15 +184,15 @@ function init_hal_gralloc()
 {
        [ "$VULKAN" = "1" ] && GRALLOC=gbm
 
-       case "$(cat /proc/fb | head -1)" in
-               *virtio*drmfb|*DRM*emulated)
+       case "$(readlink /sys/class/graphics/fb0/device/driver)" in
+               *virtio_gpu)
                        HWC=${HWC:-drm}
                        GRALLOC=${GRALLOC:-gbm}
                        video=${video:-1280x768}
                        ;&
-               0*i915drmfb|0*inteldrmfb|0*radeondrmfb|0*nouveau*|0*svgadrmfb|0*amdgpudrmfb)
+               *i915|*radeon|*nouveau|*vmwgfx|*amdgpu)
                        if [ "$HWACCEL" != "0" ]; then
-                               set_property ro.hardware.hwcomposer ${HWC:-}
+                               ${HWC:+set_property ro.hardware.hwcomposer $HWC}
                                set_property ro.hardware.gralloc ${GRALLOC:-drm}
                                set_drm_mode
                        fi
@@ -200,7 +200,7 @@ function init_hal_gralloc()
                "")
                        init_uvesafb
                        ;&
-               0*)
+               *)
                        ;;
        esac
 
@@ -216,11 +216,11 @@ function init_hal_hwcomposer()
 
 function init_hal_vulkan()
 {
-       case "$(cat /proc/fb | head -1)" in
-               0*i915drmfb|0*inteldrmfb)
+       case "$(readlink /sys/class/graphics/fb0/device/driver)" in
+               *i915)
                        set_property ro.hardware.vulkan android-x86
                        ;;
-               0*amdgpudrmfb)
+               *amdgpu)
                        set_property ro.hardware.vulkan radv
                        ;;
                *)