OSDN Git Service

Merge remote-tracking branch 'x86/nougat-x86' into oreo-x86
[android-x86/device-generic-common.git] / init.sh
diff --git a/init.sh b/init.sh
index 2bd8163..dc82efa 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -67,13 +67,10 @@ function init_hal_audio()
                VirtualBox*|Bochs*)
                        [ -d /proc/asound/card0 ] || modprobe snd-sb16 isapnp=0 irq=5
                        ;;
-               *)
+               TS10*)
+                       set_prop_if_empty hal.audio.out pcmC0D2p
                        ;;
        esac
-
-       if grep -qi "IntelHDMI" /proc/asound/card0/id; then
-               [ -d /proc/asound/card1 ] || set_property ro.hardware.audio.primary hdmi
-       fi
 }
 
 function init_hal_bluetooth()
@@ -186,6 +183,8 @@ function init_uvesafb()
 
 function init_hal_gralloc()
 {
+       [ "$VULKAN" = "1" ] && GRALLOC=gbm
+
        case "$(readlink /sys/class/graphics/fb0/device/driver)" in
                *virtio_gpu)
                        HWC=${HWC:-drm}
@@ -215,6 +214,20 @@ function init_hal_hwcomposer()
        return
 }
 
+function init_hal_vulkan()
+{
+       case "$(readlink /sys/class/graphics/fb0/device/driver)" in
+               *i915)
+                       set_property ro.hardware.vulkan android-x86
+                       ;;
+               *amdgpu)
+                       set_property ro.hardware.vulkan radv
+                       ;;
+               *)
+                       ;;
+       esac
+}
+
 function init_hal_lights()
 {
        chown 1000.1000 /sys/class/backlight/*/brightness
@@ -427,6 +440,7 @@ function do_init()
        init_hal_gps
        init_hal_gralloc
        init_hal_hwcomposer
+       init_hal_vulkan
        init_hal_lights
        init_hal_power
        init_hal_sensors
@@ -485,6 +499,9 @@ function do_bootcomplete()
                Surface*Go)
                        echo on > /sys/devices/pci0000:00/0000:00:15.1/i2c_designware.1/power/control
                        ;;
+               VMware*)
+                       pm disable com.android.bluetooth
+                       ;;
                X80*Power)
                        set_property power.nonboot-cpu-off 1
                        ;;