OSDN Git Service

initrd: determine HWACCEL by /proc/fb
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 10 Jul 2012 00:57:08 +0000 (08:57 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 10 Jul 2012 01:04:01 +0000 (09:04 +0800)
Currently only inteldrmfb and radeondrmfb support OpenGL hardware
acceleration. So set HWACCEL according to /proc/fb.

initrd/scripts/0-auto-detect

index 6389440..78614a3 100644 (file)
@@ -1,6 +1,6 @@
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2011/04/20
+# Last updated 2012/07/10
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -24,7 +24,15 @@ load_uvesafb()
 {
        [ -x /sbin/v86d ] || ln -s ../android/sbin/v86d /sbin
        [ -c /dev/fb0 ] || modprobe uvesafb mode_option=${UVESA_MODE:-800x600}-16 ${UVESA_OPTION:-mtrr=3 scroll=redraw}
-       [ -c /dev/card0 ] || export HWACCEL=0
+       if [ -z "$HWACCEL" ]; then
+               case "`cat /proc/fb`" in
+                       *inteldrmfb|*radeondrmfb)
+                               ;;
+                       *)
+                               export HWACCEL=0
+                               ;;
+               esac
+       fi
 }
 
 find_network_dev_name()