From 48dbce5fa001f66dd934dfc459838d0f13010443 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Sat, 29 Nov 2008 15:42:18 -0600
Subject: MV support for vesa

Signed-off-by: James Meyer <james.meyer@operamail.com>
---
 .../templates/xorg/xorg.conf.vesa                  | 72 ++++++++++++++++++++++
 abs/mv-core/MythVantage-config/xconfig.sh          | 14 ++++-
 2 files changed, 84 insertions(+), 2 deletions(-)
 create mode 100755 abs/mv-core/MythVantage-config/templates/xorg/xorg.conf.vesa

diff --git a/abs/mv-core/MythVantage-config/templates/xorg/xorg.conf.vesa b/abs/mv-core/MythVantage-config/templates/xorg/xorg.conf.vesa
new file mode 100755
index 0000000..c569819
--- /dev/null
+++ b/abs/mv-core/MythVantage-config/templates/xorg/xorg.conf.vesa
@@ -0,0 +1,72 @@
+# nvidia-xconfig: X configuration file generated by nvidia-xconfig
+# nvidia-xconfig:  version 1.0  (buildmeister@builder3)  Tue Aug  1 21:11:12 PDT 2006
+
+Section "ServerLayout"
+    Identifier     "Layout0"
+    Screen      0  "Screen0"
+    InputDevice    "Keyboard0" "CoreKeyboard"
+    InputDevice    "Mouse0" "CorePointer"
+EndSection
+
+Section "Files"
+    RgbPath         "/usr/X11R6/lib/X11/rgb"
+EndSection
+
+Section "Module"
+    Load           "dbe"
+    Load           "extmod"
+    Load           "type1"
+    Load           "freetype"
+  
+EndSection
+
+Section "InputDevice"
+    # generated from default
+    Identifier     "Mouse0"
+    Driver         "mouse"
+    Option         "Protocol" "auto"
+    Option         "Device" "/dev/psaux"
+    Option         "Emulate3Buttons" "no"
+    Option         "ZAxisMapping" "4 5"
+EndSection
+
+Section "InputDevice"
+    # generated from default
+    Identifier     "Keyboard0"
+    Driver         "keyboard"
+EndSection
+
+Section "Monitor"
+    Identifier     "Monitor0"
+    VendorName     "Unknown"
+    ModelName      "Unknown"
+    HorizSync       30.0 - 110.0
+    VertRefresh     50.0 - 150.0
+    Option         "DPMS" "false"
+    Modeline  "1280x720" 74.25   1280 1316 1452 1644    720  720  723  751 -hsync +vsync
+    Modeline  "1280x720_60.00" 74.25 1280 1352 1432 1648 720 725 730 750 -hsync -vsync
+    ModeLine  "848x480" 34.0 848 880 1016 1072 480 494 495 527 -hsync -vsync
+    Modeline  "800x600" 38.34 800 832 928 1024 600 604 608 624 -HSync -VSync 
+    ModeLine "NTSC-DVD-72p" 32.432 720 736 800 858 480 484 492 525
+EndSection
+
+Section "Device"
+    Identifier     "Device0"
+    Driver         "vesa"
+    VendorName     "Generic Corporation"
+    Option "DPI" "100 x 100"
+
+
+EndSection
+
+Section "Screen"
+    Identifier     "Screen0"
+    Device         "Device0"
+    Monitor        "Monitor0"
+    DefaultDepth    24
+    SubSection     "Display"
+        Depth       24
+        Modes     "1280x720" 
+    EndSubSection
+EndSection
+
diff --git a/abs/mv-core/MythVantage-config/xconfig.sh b/abs/mv-core/MythVantage-config/xconfig.sh
index 42603d6..4984dc5 100755
--- a/abs/mv-core/MythVantage-config/xconfig.sh
+++ b/abs/mv-core/MythVantage-config/xconfig.sh
@@ -4,10 +4,17 @@ BASE=""
 #TEMPLATES="/usr/share/templates"
 
 function Xvalues {
-    VGACARDTYPE=`lspci|grep -i vga|sort -r|head -n 1| cut -d: -f3|cut -d" " -f 2`
+    CMDLINE=$(cat /proc/cmdline)
+    echo $CMDLINE |grep -q forceXvesa
+    if [ $? = 0 ]
+    then
+	    VGACARDTYPE=vesa
+    else
+	    VGACARDTYPE=`lspci|grep -i vga|sort -r|head -n 1| cut -d: -f3|cut -d" " -f 2`
+    fi
     echo $VGACARDTYPE
     currentmode=`cat $BASE/etc/X11/xorg.conf |grep Modes|awk -Fs ' { print $2 } '`
-    }
+}
 
 function presetupX {
 if [ x$XUseAdvanced =  x1 ]
@@ -192,6 +199,9 @@ function setupX {
                     fi
                                 ;;
 
+	     vesa)  sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" $TEMPLATES/xorg/xorg.conf.vesa > $XORG_CONF
+
+
 	*)  #XCONF=`hwd -x |grep etc`
         XCONF=`hwd -x |grep etc|tr -d [:cntrl:]|cut -d\/ -f 2-`
 
-- 
cgit v0.12