09 3月 2010

[游手] HP mini 2133 Ubuntu 9.04 VGA 設定

明是生病了,沒有力氣做什麼正事,卻撐著發燒的身體,把裝在 HP mini 2133 裡的 Ubuntu Linux 9.04 的 VGA 設定和 3D 加速搞出來了!(呀呼~)

故事是這麼開始的…

HP mini 2133 在全世界有許多國家販售,但是有在玩 Linux 的,或是在電子製造業待過的都會知道,就算是「同一型號」的硬體,只要生產地不同、販賣地不同,甚至只是生產日期的不同,都可能會有不一樣的晶片元件在裡面。

所以,雖然 HP mini 2133 這款小筆電上採用的雖然都是 VIA 的處理器和繪圖晶片,但是還是有些細節不太一樣。


好玩的部份來了!我買的 HP mini 2133 是搭售 Suse Linux 的,買回來後我再改裝成 Ubuntu Linux,但是不管是哪一種 Linux,在購買的那個時候 VIA 方面卻「還沒寫好繪圖晶片給 Linux 用的 3D 驅動程式!」也就是說,我買了一部極速 400 km/hr 的超級跑車,但是「耐得住這個速度的輪子還沒發明出來!」 (-_-)"

不過呢,Open Source 開放原始碼的社群裡的各家高手們可沒有閒著,馬上就開始著手用逆向工程的方式寫出了驅動程式。但是…客倌啊…有一好,沒兩好,世間事就是這麼樣地難以一兼二顧啊!

開放原始碼的高手們寫出了 OpenChrome 這套繪圖晶片的驅動程式,可以讓 HP mini 2133 上的 VGA 輸出埠正常地使用。只要接上外接螢幕的線,不管是寬螢幕電視、投影機還是桌上的 LCD/CRT 都能馬上辨識出來,進入 Clone 模式。這樣拿來做簡報,真是再好不過了!

相較之下, 3D 加速的部份,因為涉及晶片本身的規格內容,而 VIA 方面又不願意公開,所以大夥兒都還在繼續努力做著逆向工程…

另一方面呢, VIA 經過近兩年的努力,終於寫出了自家產品繪圖晶片給 Linux 用的 3D 加速驅動程式, 叫做 VIA Chrome 9 驅動程式…但是搞笑的是…如果裝上這個驅動程式的話, 3D 加速的部份是正常了,但是卻沒辦法做 VGA 的輸出…也就是說,所有的外接顯示器都不能用!媽呀…如果不能外接做簡報,那要小筆電幹嘛?

所以…簡單地說,對一個 HP mini 2133 的使用者來說,你究竟應該要:
1. 安裝 OpenChrome:可以外接螢幕做簡報,但是沒有 3D 加速功能!
2. 安裝 VIA Chrome 9: 不能外接螢幕做簡報,但是有 3D 加速功能!

做為一個使用者的我,我想要可以外接螢幕,不然我手上這個小小的螢幕才對角線 8 吋…整體看來,比一個披薩還小啊…

我也想要有 3D 加速!因為我最常用的 Linux 功能就是 Compiz 的「多重桌面(影片)」的功能 (就是影片中像是一個大方塊,可以轉來轉去換面的功能。每一面都是一個新的桌面)!我可以方便地在閱讀或是做整理的時候,切換桌面,在不同的主題或是文件圖表、Paper 等等之間遊走、比較。

而且這樣的加速功能並不需要很新的硬體哦!我的桌機已經堂堂邁入十歲了,跑起上面的 Compiz 3D 特效,和影片裡一樣順哩!

如果我能有外接螢幕的功能,也能有 3D 加速的功能,那就可以在簡報的時候同時帶著大家一起比較兩個、甚至更多不同的東西之間的異同了!這絕對遠比在畫面下方那細細的一條「工具列」上切來切去地在不同程式間切換,來得有效率多了!

經過三個禮拜的研究,我得到這個小小的結論:同時擁有 3D 加速和 VGA-out 的功能,應該是可行的。如果能讓 VIA 的 Chrome 9 負責 3D 加速的部份,然後讓 VGA-out 的功能在 xorg.conf 檔中設定好,我看不出任何理由做不出來!(當然,也可能是因為我很遜,所以看不出來!)

--- 廢話分格線;以上都是廢話 ---

照著我的思緒,我先在 Ubuntu Linux 9.04 (Jaunty) 版中安裝的 VIA Chrome 9 的驅動程式:

1. 打開終端機,輸入:
sudo apt-get install linux-headers-generic
2. 接著用 wget 把驅動程式抓回來:
wget http://www.viaarena.com/Driver/5.74.33.86a-u904-50937.tgz
3. 解開抓回來的驅動程式:
tar -xvvf 5.74.33.86a-u904-50937.tgz
4. 切換工作目錄來編譯驅動程式:
cd 5.74.33.86a-u904-50937/DRM_Code/chrome9_2.6.27_28/
5. 編譯:
make
6. 把編好的 .ko 檔移到安裝程式的 bin 目錄:
cp via_chrome9.ko ../../bin
7. 切換工作目錄,準備安裝:
cd ../../
8. 安裝驅動程式:
sudo ./vinstall
9. 把 VIA 的驅動程式加入 Compiz 的許可名單 (whitelist) 裡,這麼一來才能正常啟動 Compiz 的特效:
sudo gedit /usr/bin/compiz
找到下面這一段 whitelist, 然後把 via 加進去 (紅字部份)
# Driver whitelist
WHITELIST="nvidia intel ati radeon i810 via"

到這裡,算是裝好 VIA 的 Chrome 9 驅動程式了。這時候已經可以從 [系統] > [偏好設定] > [外觀] > [特效] 這裡去啟用 Compiz 的效果了。

接著我們繼續調整 xorg.conf 檔。

10. 先把目前的 xorg.conf 檔做個備份,以免玩壞了,還有東西可以補救:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
11. 我拿國外 luvit 改出來的 xorg.conf 檔,自己再做了點修正 (共三個地方,主要是把解析度從 1024x600 改成 1024x768),luvit 和其他的外國的 HP 2133 使用者都說這個檔案可以直接使用,但是我試用後,發現解析度不太對勁兒。可能是我之前說的型號一樣,但是裡面的晶片元件不太一樣的緣故吧。

檔案內容如下:
### VIA template edited by luvit with some modifications by Fr4gZ0n3###

Section "ServerFlags"
#    Option        "DefaultServerLayout"    "LCD-clone"
#    Option        "DefaultServerLayout"    "CRT-clone"
#    Option        "DefaultServerLayout"    "LCD-only"
#    Option        "DefaultServerLayout"    "CRT-only"

    Option        "AllowMouseOpenFail"    "on"
    Option        "Pixmap"        "32"
    EndSection

# Default locations of font files - change if required.

    Section "Files"
    FontPath    "/usr/share/fonts/X11/misc"
    FontPath    "/usr/share/fonts/X11/cyrillic"
    FontPath    "/usr/share/fonts/X11/100dpi/:unscaled"
    FontPath    "/usr/share/fonts/X11/75dpi/:unscaled"
    FontPath    "/usr/share/fonts/X11/Type1"
    FontPath    "/usr/share/fonts/X11/100dpi"
    FontPath    "/usr/share/fonts/X11/75dpi"
    FontPath    "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"

    ModulePath    "/usr/lib/xorg/modules"
    InputDevices    "/dev/gpmdata"
    InputDevices    "/dev/input/mice"
    EndSection

    Section "DRI"
    Group 0
    Mode 0666
    EndSection

    Section "InputDevice"
    Identifier    "Keyboard 0"
    Driver        "kbd"
    Option        "Protocol"        "Standard"
    Option        "XkbLayout"       "us"
    Option        "XkbModel"        "pc104"
    Option        "XkbRules"        "xfree86"
    EndSection

    Section "InputDevice"
    Identifier    "Mouse 0"
    Driver        "synaptics"
    Option        "Buttons"         "5"
    Option        "Device"          "/dev/input/mice"
    Option        "Emulate3Buttons" "on"
    Option        "InputFashion"    "Mouse"
    Option        "Name"            "Synaptics Touchpad"
    Option        "Protocol"        "explorerps/2"
    Option        "SHMConfig"       "on"  # GUI setting access
    Option        "ZAxisMapping"    "4 5"
    EndSection

    Section "InputDevice"
    Identifier    "Mouse 1"
    Driver        "mouse"
    Option        "CorePointer"
    Option        "Buttons"         "5"
    Option        "Device"          "/dev/input/mice"
    Option        "Emulate3Buttons" "on"
    Option        "Name"            "Generic Mouse"
    Option        "Protocol"        "Auto"
    Option        "Vendor"          "Sysp"
    Option        "ZAxisMapping"    "4 5"
    EndSection

    Section "Module"
    Load  "glx"
    Load  "dri"
    Load  "extmod"
    Load    "dbe"
    Load    "freetype"
    Load    "record"
    Load    "v4l"
    EndSection

# Device outputs not connected in the HP-2133

    Section "Monitor"
    Identifier "Monitor"
    ModeLine "720x480" 26.7 720 736 808 896 480 481 484 497
    ModeLine "720x576" 32.7 720 744 816 912 576 577 580 597
    ModeLine "800x480" 29.58 800 816 896 992 480 481 484 497
    ModeLine "848x480" 31.5 848 864 952 1056 480 481 484 497
    ModeLine "856x480" 31.7 856 872 960 1064 480 481 484 497
    ModeLine "960x600" 45.98 960 1000 1096 1232  600 601 604 622 -HSync +Vsync
    Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -HSync +Vsync
    ModeLine "1000x600" 48.07 1000 1040 1144 1288 600 601 604 622 -HSync +Vsync
    ModeLine "1024x512" 41.3 1024 1056 1160 1296 512 513 516 531
    ModeLine "1088x612" 52.95 1088 1128 1240 1392 612 613 616 634 -HSync +Vsync
    ModeLine "1152x720" 67.32 1152 1208 1328 1504 720 721 724 746 -HSync +Vsync
    ModeLine "1200x720" 70.18 1200 1256 1384 1568 720 721 724 746 -HSync +Vsync
    ModeLine "1280x600" 61.50 1280 1336 1464 1648 600 601 604 622 -HSync +Vsync
    ModeLine "1280x720" 74.6 1280 1341 1474 1688 720 721 724 746
    ModeLine "1280x768" 80.1 1280 1344 1480 1680 768 769 772 795
    ModeLine "1360x768" 85.50 1360 1392 1712 1744 768 783 791 807 +HSync +Vsync
    ModeLine "1366x768" 85.86 1366 1440 1584 1800 768 769 772 795 -HSync +Vsync
    ModeLine "1440x900" 106.47 1440 1520 1672 1904 900 901 904 932 -HSync +Vsync
    ModeLine "1440x1050" 126.2 1440 1536 1688 1936 1050 1051 1054 1087
    ModeLine "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -HSync +Vsync
    ModeLine "1600x1024" 136.36 1600 1704 1872 2144 1024 1025 1028 1060 -HSync +Vsync
    ModeLine "1792x1344" 202.97 1792 1920 2112 2432 1344 1345 1348 1391 -HSync +Vsync
    ModeLine "1856x1392" 218.57 1856 1992 2192 2528 1392 1393 1396 1441 -HSync +Vsync
    ModeLine "1920x1080" 172.9 1920 2043 2249 2578 1080 1081 1084 1118
    ModeLine "2048x1536" 266.95 2048 2200 2424 2800 1536 1537 1540 1589 -HSync +Vsync
    ModeLine "720x480" 34.9 720 752 824 928 480 481 484 502
    ModeLine "720x576" 42.6 720 760 832 944 576 577 580 602
    ModeLine "848x480" 41.0 848 880 968 1088 480 481 484 502
    ModeLine "856x480" 41.3 856 888 976 1096 480 481 484 502
    ModeLine "1024x512" 53.3 1024 1072 1176 1328 512 513 516 535
    ModeLine "1280x768" 103.0 1280 1360 1496 1712 768 769 772 802
    ModeLine "1440x1050" 160.0 1440 1536 1696 1952 1050 1051 1054 1096
    ModeLine "1280x768" 118.5 1280 1368 1504 1728 768 769 772 807
    ModeLine "1440x1050" 184.5 1440 1544 1704 1968 1050 1051 1054 1103
    ModeLine "848x480" 47.4 848 888 976 1104 480 481 484 505
    Option        "Ignore"    "true"
    EndSection

    Section "Monitor"
    Identifier "Monitor"
    ModeLine "720x480" 26.7 720 736 808 896 480 481 484 497
    ModeLine "720x576" 32.7 720 744 816 912 576 577 580 597
    ModeLine "800x480" 29.58 800 816 896 992 480 481 484 497
    ModeLine "848x480" 31.5 848 864 952 1056 480 481 484 497
    ModeLine "856x480" 31.7 856 872 960 1064 480 481 484 497
    ModeLine "960x600" 45.98 960 1000 1096 1232  600 601 604 622 -HSync +Vsync
    ModeLine "1000x600" 48.07 1000 1040 1144 1288 600 601 604 622 -HSync +Vsync
    ModeLine "1024x512" 41.3 1024 1056 1160 1296 512 513 516 531
    Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -HSync +Vsync
    ModeLine "1088x612" 52.95 1088 1128 1240 1392 612 613 616 634 -HSync +Vsync
    ModeLine "1152x720" 67.32 1152 1208 1328 1504 720 721 724 746 -HSync +Vsync
    ModeLine "1200x720" 70.18 1200 1256 1384 1568 720 721 724 746 -HSync +Vsync
    ModeLine "1280x600" 61.50 1280 1336 1464 1648 600 601 604 622 -HSync +Vsync
    ModeLine "1280x720" 74.6 1280 1341 1474 1688 720 721 724 746
    ModeLine "1280x768" 80.1 1280 1344 1480 1680 768 769 772 795
    ModeLine "1360x768" 85.50 1360 1392 1712 1744 768 783 791 807 +HSync +Vsync
    ModeLine "1366x768" 85.86 1366 1440 1584 1800 768 769 772 795 -HSync +Vsync
    ModeLine "1440x900" 106.47 1440 1520 1672 1904 900 901 904 932 -HSync +Vsync
    ModeLine "1440x1050" 126.2 1440 1536 1688 1936 1050 1051 1054 1087
    ModeLine "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -HSync +Vsync
    ModeLine "1600x1024" 136.36 1600 1704 1872 2144 1024 1025 1028 1060 -HSync +Vsync
    ModeLine "1792x1344" 202.97 1792 1920 2112 2432 1344 1345 1348 1391 -HSync +Vsync
    ModeLine "1856x1392" 218.57 1856 1992 2192 2528 1392 1393 1396 1441 -HSync +Vsync
    ModeLine "1920x1080" 172.9 1920 2043 2249 2578 1080 1081 1084 1118
    ModeLine "2048x1536" 266.95 2048 2200 2424 2800 1536 1537 1540 1589 -HSync +Vsync
    ModeLine "720x480" 34.9 720 752 824 928 480 481 484 502
    ModeLine "720x576" 42.6 720 760 832 944 576 577 580 602
    ModeLine "848x480" 41.0 848 880 968 1088 480 481 484 502
    ModeLine "856x480" 41.3 856 888 976 1096 480 481 484 502
    ModeLine "1024x512" 53.3 1024 1072 1176 1328 512 513 516 535
    ModeLine "1280x768" 103.0 1280 1360 1496 1712 768 769 772 802
    ModeLine "1440x1050" 160.0 1440 1536 1696 1952 1050 1051 1054 1096
    ModeLine "1280x768" 118.5 1280 1368 1504 1728 768 769 772 807
    ModeLine "1440x1050" 184.5 1440 1544 1704 1968 1050 1051 1054 1103
    ModeLine "848x480" 47.4 848 888 976 1104 480 481 484 505
    Option        "Ignore"    "true"
    EndSection

# Internal LCD does not return DDC information.
# Define first channel:

    Section "Modes"    # See also "HP-2133 Known Modes" at file end.
    Identifier    "HP-2133 LCD Modes"
    # Default mode "1280x768": 80.1 MHz, 47.7 kHz, 60.0 Hz
    Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -HSync +Vsync
    # Default mode "1280x720": 74.6 MHz, 44.2 kHz, 59.2 Hz
    # Modeline "1280x720-59.2"   74.60  1280 1341 1474 1688  720 721 724 746 -hsync +vsync
    # Default mode "1024x768": 65.0 MHz, 48.4 kHz, 60.0 Hz
    #Modeline "1024x768-60.0"   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync
    EndSection

    Section "Monitor"
    Identifier "Monitor"
    ModeLine "720x480" 26.7 720 736 808 896 480 481 484 497
    ModeLine "720x576" 32.7 720 744 816 912 576 577 580 597
    ModeLine "800x480" 29.58 800 816 896 992 480 481 484 497
    ModeLine "848x480" 31.5 848 864 952 1056 480 481 484 497
    ModeLine "856x480" 31.7 856 872 960 1064 480 481 484 497
    ModeLine "960x600" 45.98 960 1000 1096 1232  600 601 604 622 -HSync +Vsync
    ModeLine "1000x600" 48.07 1000 1040 1144 1288 600 601 604 622 -HSync +Vsync
    ModeLine "1024x512" 41.3 1024 1056 1160 1296 512 513 516 531
    Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -HSync +Vsync
    ModeLine "1088x612" 52.95 1088 1128 1240 1392 612 613 616 634 -HSync +Vsync
    ModeLine "1152x720" 67.32 1152 1208 1328 1504 720 721 724 746 -HSync +Vsync
    ModeLine "1200x720" 70.18 1200 1256 1384 1568 720 721 724 746 -HSync +Vsync
    ModeLine "1280x600" 61.50 1280 1336 1464 1648 600 601 604 622 -HSync +Vsync
    ModeLine "1280x720" 74.6 1280 1341 1474 1688 720 721 724 746
    ModeLine "1280x768" 80.1 1280 1344 1480 1680 768 769 772 795
    ModeLine "1360x768" 85.50 1360 1392 1712 1744 768 783 791 807 +HSync +Vsync
    ModeLine "1366x768" 85.86 1366 1440 1584 1800 768 769 772 795 -HSync +Vsync
    ModeLine "1440x900" 106.47 1440 1520 1672 1904 900 901 904 932 -HSync +Vsync
    ModeLine "1440x1050" 126.2 1440 1536 1688 1936 1050 1051 1054 1087
    ModeLine "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -HSync +Vsync
    ModeLine "1600x1024" 136.36 1600 1704 1872 2144 1024 1025 1028 1060 -HSync +Vsync
    ModeLine "1792x1344" 202.97 1792 1920 2112 2432 1344 1345 1348 1391 -HSync +Vsync
    ModeLine "1856x1392" 218.57 1856 1992 2192 2528 1392 1393 1396 1441 -HSync +Vsync
    ModeLine "1920x1080" 172.9 1920 2043 2249 2578 1080 1081 1084 1118
    ModeLine "2048x1536" 266.95 2048 2200 2424 2800 1536 1537 1540 1589 -HSync +Vsync
    ModeLine "720x480" 34.9 720 752 824 928 480 481 484 502
    ModeLine "720x576" 42.6 720 760 832 944 576 577 580 602
    ModeLine "848x480" 41.0 848 880 968 1088 480 481 484 502
    ModeLine "856x480" 41.3 856 888 976 1096 480 481 484 502
    ModeLine "1024x512" 53.3 1024 1072 1176 1328 512 513 516 535
    ModeLine "1280x768" 103.0 1280 1360 1496 1712 768 769 772 802
    ModeLine "1440x1050" 160.0 1440 1536 1696 1952 1050 1051 1054 1096
    ModeLine "1280x768" 118.5 1280 1368 1504 1728 768 769 772 807
    ModeLine "1440x1050" 184.5 1440 1544 1704 1968 1050 1051 1054 1103
    ModeLine "848x480" 47.4 848 888 976 1104 480 481 484 505
    VertRefresh    50.00-100.00            # X11 discovery claim
    HorizSync    30.00-113.00            # X11 discovery claim
    # Dot clock range: 20.00-270.00MHz      # X11 discovery claim
    # Typical dot pitch is: .1515mm x .1515mm
    # Native resolution is: 1280x768
    DisplaySize    193 116                 # Actual: 193.9 116.4
    UseModes    "HP-2133 LCD Modes"
    Option        "PreferredMode"        "1024x600"
    Option        "DPMS"
    EndSection

    Section "Device"
    Driver "via"
    VendorName  "VIA Tech"
    BoardName   "via"
            #Option "PanelID" "0"    #640x480,    Single,    Dithering
    Identifier    "via-P4M900 Device 0"
    BusID        "PCI:1:0:0"
    Option        "Monitor-LCD"        "HP-2133 LCD"
#    Option        "PanelID"        "17"    # 1280x720 Single, Dithering
#    Option        "PanelID"           "12"    # 1280x768 Single, Non-Dithering
    Option        "NoDDCValue"
    EndSection

    Section "Screen"
    Monitor  "Monitor"
    SubSection "Display"
        Modes  "1024x600"
        #Virtual 1024 600
        Depth  24
    EndSubSection
    Identifier    "via-P4M900 Screen 0"
    Device        "via-P4M900 Device 0"
    Subsection    "Display"
        Depth    24             # Depth 16 broke
#        Modes    "1280x768-60.0" "1280x720-59.2" "1024x768-60.0"
            Modes    "1024x600"
#        Virtual    1024 600
    EndSubsection
    # Device section options:
    Option        "ForceLCD"        "true"    # BIOS setting over-ride
    Option        "ActiveDevice"        "LCD"
    Option        "VideoOnDevice"        "LCD"    # Broke ?
    Option        "SetMpegFBNumber"    "true"    # Unknown if required
    EndSection

# External device expected to return DDC information.
# Flying on full auto here, the smoke you smell may be your monitor:

    Section "Monitor"
    Identifier "Monitor"
    ModeLine "720x480" 26.7 720 736 808 896 480 481 484 497
    ModeLine "720x576" 32.7 720 744 816 912 576 577 580 597
    ModeLine "800x480" 29.58 800 816 896 992 480 481 484 497
    ModeLine "848x480" 31.5 848 864 952 1056 480 481 484 497
    ModeLine "856x480" 31.7 856 872 960 1064 480 481 484 497
    ModeLine "960x600" 45.98 960 1000 1096 1232  600 601 604 622 -HSync +Vsync
    ModeLine "1000x600" 48.07 1000 1040 1144 1288 600 601 604 622 -HSync +Vsync
    ModeLine "1024x512" 41.3 1024 1056 1160 1296 512 513 516 531
    Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -HSync +Vsync
    ModeLine "1088x612" 52.95 1088 1128 1240 1392 612 613 616 634 -HSync +Vsync
    ModeLine "1152x720" 67.32 1152 1208 1328 1504 720 721 724 746 -HSync +Vsync
    ModeLine "1200x720" 70.18 1200 1256 1384 1568 720 721 724 746 -HSync +Vsync
    ModeLine "1280x600" 61.50 1280 1336 1464 1648 600 601 604 622 -HSync +Vsync
    ModeLine "1280x720" 74.6 1280 1341 1474 1688 720 721 724 746
    ModeLine "1280x768" 80.1 1280 1344 1480 1680 768 769 772 795
    ModeLine "1360x768" 85.50 1360 1392 1712 1744 768 783 791 807 +HSync +Vsync
    ModeLine "1366x768" 85.86 1366 1440 1584 1800 768 769 772 795 -HSync +Vsync
    ModeLine "1440x900" 106.47 1440 1520 1672 1904 900 901 904 932 -HSync +Vsync
    ModeLine "1440x1050" 126.2 1440 1536 1688 1936 1050 1051 1054 1087
    ModeLine "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -HSync +Vsync
    ModeLine "1600x1024" 136.36 1600 1704 1872 2144 1024 1025 1028 1060 -HSync +Vsync
    ModeLine "1792x1344" 202.97 1792 1920 2112 2432 1344 1345 1348 1391 -HSync +Vsync
    ModeLine "1856x1392" 218.57 1856 1992 2192 2528 1392 1393 1396 1441 -HSync +Vsync
    ModeLine "1920x1080" 172.9 1920 2043 2249 2578 1080 1081 1084 1118
    ModeLine "2048x1536" 266.95 2048 2200 2424 2800 1536 1537 1540 1589 -HSync +Vsync
    ModeLine "720x480" 34.9 720 752 824 928 480 481 484 502
    ModeLine "720x576" 42.6 720 760 832 944 576 577 580 602
    ModeLine "848x480" 41.0 848 880 968 1088 480 481 484 502
    ModeLine "856x480" 41.3 856 888 976 1096 480 481 484 502
    ModeLine "1024x512" 53.3 1024 1072 1176 1328 512 513 516 535
    ModeLine "1280x768" 103.0 1280 1360 1496 1712 768 769 772 802
    ModeLine "1440x1050" 160.0 1440 1536 1696 1952 1050 1051 1054 1096
    ModeLine "1280x768" 118.5 1280 1368 1504 1728 768 769 772 807
    ModeLine "1440x1050" 184.5 1440 1544 1704 1968 1050 1051 1054 1103
    ModeLine "848x480" 47.4 848 888 976 1104 480 481 484 505
    Option        "DPMS"
    EndSection

    Section "Device"
    Driver "via"
    VendorName  "VIA Tech"
    BoardName   "via"
            #Option "PanelID" "0"    #640x480,    Single,    Dithering
    Identifier    "via-P4M900 Device 1"
    BusID        "PCI:1:0:0"
    Option        "Monitor-CRT"        "HP-2133 External"
    EndSection

    Section "Screen"
    Monitor  "Monitor"
    SubSection "Display"
        Modes  "1024x600"
        #Virtual 1024 600
        Depth  24
    EndSubSection
    Identifier    "via-P4M900 Screen 1"
    Device        "via-P4M900 Device 1"
    Subsection    "Display"
        Depth    24             # Depth 16 broke
#        Virtual    2048 1536
    EndSubsection
    # Device section options:
    Option        "ActiveDevice"        "CRT"
    Option        "VideoOnDevice"        "CRT"    # Broke ?
    Option        "SetMpegFBNumber"    "true"    # Unknown if required
    EndSection

# Single channel, dual outputs driven, screen descriptions

    Section "Screen"
    Monitor  "Monitor"
    SubSection "Display"
        Modes  "1024x768" #Changed by Peter
        #Virtual 1024 600
        Depth  24
    EndSubSection
    Identifier    "via-P4M900 Clone 0"
    Device        "via-P4M900 Device 0"
    Subsection    "Display"
        Depth    24            # Depth 16 broke
#        Modes    "1024x600" "1200x720" "1024x768"
            Modes    "1024x768" #Changed by Peter
#        Virtual    2048 1536
    EndSubsection
    # Device section options:
    Option        "ActiveDevice"        "LCD,CRT"
    Option        "ForceLCD"        "true"
    Option        "VideoOnDevice"        "LCD"    # Broke ?
    # Option true turned off mouse on LCD:
    Option        "Simultaneous"        "false"
    EndSection

    Section "Screen"
    Monitor  "Monitor"
    SubSection "Display"
        Modes  "1024x768" #Changed by Peter
        #Virtual 1024 600
        Depth  24
    EndSubSection
    Identifier    "via-P4M900 Clone 1"
    Device        "via-P4M900 Device 1"
    Subsection    "Display"
        Depth    24             # Depth 16 broke
#        Virtual    2048 1536
    EndSubsection
    # Device section options:
    Option        "ActiveDevice"        "CRT,LCD"
    Option        "ForceLCD"        "true"
    Option        "VideoOnDevice"        "CRT"    # Broke ?
    # Option true turned off mouse on LCD:
    Option        "Simultaneous"        "false"
    EndSection

# RandR is broken, in various places, for various reasons:
# The driver does not recognize the RandR naming conventions:
# (WW) VIA(0): Option "Monitor-LCD" is not used
# (WW) VIA(0): Option "Monitor-CRT" is not used
# (WW) VIA(0): Option "Monitor-DVI" is not used
# (WW) VIA(0): Option "Monitor-TV" is not used
# (==) RandR enabled
# And if you can't name them, xrandr can't select them.  Bummer.

# Old-school layouts

    Section "ServerLayout"
    Option "RandR" "False"
    Identifier    "LCD-clone"
    InputDevice    "Keyboard 0"    "CoreKeyBoard"
    InputDevice    "Mouse 0"    "SendCoreEvents"
    InputDevice    "Mouse 1"    "SendCoreEvents"
    Screen        "via-P4M900 Clone 0"
    EndSection

    Section "ServerLayout"
    Option "RandR" "False"
    Identifier    "CRT-clone"
    InputDevice    "Keyboard 0"    "CoreKeyBoard"
    InputDevice    "Mouse 0"    "SendCoreEvents"
    InputDevice    "Mouse 1"    "SendCoreEvents"
    Screen        "via-P4M900 Clone 1"
    EndSection

    Section "ServerLayout"
    Option "RandR" "False"
    Identifier    "LCD-only"
    InputDevice    "Keyboard 0"    "CoreKeyBoard"
    InputDevice    "Mouse 0"    "SendCoreEvents"
    InputDevice    "Mouse 1"    "SendCoreEvents"
    Screen        "via-P4M900 Screen 0"
    EndSection

    Section "ServerLayout"
    Option "RandR" "False"
    Identifier    "CRT-only"
    InputDevice    "Keyboard 0"    "CoreKeyBoard"
    InputDevice    "Mouse 0"    "SendCoreEvents"
    InputDevice    "Mouse 1"    "SendCoreEvents"
    Screen        "via-P4M900 Screen 1"
    EndSection

Section "Modes"
    Identifier  "HP-2133 Known Modes"
    ## X11 discovered modes are marked "Default mode";
    ## VIA reference file modes are marked "Extra mode" in this list.
    ## All have been renamed to include refresh rate and not conflict
    ## with the standard VESA names (most are VESA standard rates).

    ## Refresh rate 60Hz - The prefered LCD refresh rate.

    # Default mode "2048x1536": 266.9 MHz, 95.3 kHz, 60.0 Hz
    Modeline "2048x1536-60.0"  266.95  2048 2200 2424 2800  1536 1537 1540 1589 -hsync +vsync
    # Default mode "1920x1440": 234.0 MHz, 90.0 kHz, 60.0 Hz
    Modeline "1920x1440-60.0"  234.00  1920 2048 2256 2600  1440 1441 1444 1500 -hsync +vsync
    # Default mode "1920x1200": 193.2 MHz, 74.5 kHz, 60.0 Hz
    Modeline "1920x1200-60.0"  193.16  1920 2048 2256 2592  1200 1201 1204 1242

    ## 1080p (image 16:9, pixel 1:1)
    # Default mode "1920x1080": 172.9 MHz, 67.1 kHz, 60.0 Hz
    Modeline "1920x1080-60.0"  172.90  1920 2043 2249 2578  1080 1081 1084 1118 -hsync +vsync

    # Default mode "1856x1392": 218.3 MHz, 86.4 kHz, 60.0 Hz
    Modeline "1856x1392-60.0"  218.30  1856 1952 2176 2528  1392 1393 1396 1439 -hsync +vsync
    # Default mode "1856x1392": 218.6 MHz, 86.5 kHz, 60.0 Hz
    Modeline "1856x1392-60.0"  218.57  1856 1992 2192 2528  1392 1393 1396 1441 -hsync +vsync
    # Default mode "1792x1344": 204.8 MHz, 83.7 kHz, 60.0 Hz
    Modeline "1792x1344-60.0"  204.80  1792 1920 2120 2448  1344 1345 1348 1394 -hsync +vsync
    # Default mode "1792x1344": 203.0 MHz, 83.5 kHz, 60.0 Hz
    Modeline "1792x1344-60.0"  202.97  1792 1920 2112 2432  1344 1345 1348 1391 -hsync +vsync
    # Default mode "1680x1050": 147.1 MHz, 65.2 kHz, 60.0 Hz
    Modeline "1680x1050-60.0"  147.14  1680 1784 1968 2256  1050 1051 1054 1087
    # Default mode "1600x1200": 162.0 MHz, 75.0 kHz, 60.0 Hz
    Modeline "1600x1200-60.0"  162.00  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync
    # Default mode "1600x1024": 136.4 MHz, 63.6 kHz, 60.0 Hz
    Modeline "1600x1024-60.0"  136.36  1600 1704 1872 2144  1024 1025 1028 1060 -hsync +vsync
    # Default mode "1600x900": 119.0 MHz, 55.9 kHz, 60.0 Hz
    Modeline "1600x900-60.0"  119.00  1600 1696 1864 2128  900 901 904 932 -hsync +vsync
    # Default mode "1440x1050": 126.2 MHz, 65.2 kHz, 60.0 Hz
    Modeline "1440x1050-60.0"  126.20  1440 1536 1688 1936  1050 1051 1054 1087 -hsync +vsync
    # Default mode "1440x900": 108.8 MHz, 56.9 kHz, 60.2 Hz
    Modeline "1440x900-60.2"  108.84  1440 1472 1880 1912  900 918 927 946 +hsync +vsync
    # Default mode "1440x900": 106.5 MHz, 55.9 kHz, 60.0 Hz
    Modeline "1440x900-60.0"  106.47  1440 1520 1672 1904  900 901 904 932 -hsync +vsync
    # Default mode "1400x1050": 122.0 MHz, 64.9 kHz, 60.0 Hz
    Modeline "1400x1050-60.0"  122.00  1400 1488 1640 1880  1050 1052 1064 1082 +hsync +vsync

    ## Alternate version of 720p (image approx 16:9, pixel 1:1)
    # Default mode "1366x768": 85.9 MHz, 47.7 kHz, 60.0 Hz
    Modeline "1366x768-60.0"   85.86  1366 1440 1584 1800  768 769 772 795 -hsync +vsync

    # Default mode "1360x768": 85.5 MHz, 49.0 kHz, 60.7 Hz
    Modeline "1360x768-60.7"   85.50  1360 1392 1712 1744  768 783 791 807 +hsync +vsync
    Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -HSync +Vsync
    # Default mode "1280x1024": 108.0 MHz, 64.0 kHz, 60.0 Hz
    Modeline "1280x1024-60.0"  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync
    # Default mode "1280x960": 108.0 MHz, 60.0 kHz, 60.0 Hz
    Modeline "1280x960-60.0"  108.00  1280 1376 1488 1800  960 961 964 1000 +hsync +vsync
    # Default mode "1280x800": 83.5 MHz, 49.7 kHz, 60.0 Hz
    Modeline "1280x800-60.0"   83.46  1280 1344 1480 1680  800 801 804 828
    # Default mode "1280x768": 80.1 MHz, 47.7 kHz, 60.0 Hz
    Modeline "1280x768-60.0"   80.14  1280 1344 1480 1680  768 769 772 795

    ## One version of 720p (image 16:9, pixel 1:1)
    # Default mode "1280x720": 74.6 MHz, 44.2 kHz, 59.2 Hz
    Modeline "1280x720-59.2"   74.60  1280 1341 1474 1688  720 721 724 746 -hsync +vsync

    # Default mode "1280x600": 61.5 MHz, 37.3 kHz, 60.0 Hz
    Modeline "1280x600-60.0"   61.50  1280 1336 1464 1648  600 601 604 622 -hsync +vsync
    # Default mode "1200x720": 70.2 MHz, 44.8 kHz, 60.0 Hz
    Modeline "1200x720-60.0"   70.18  1200 1256 1384 1568  720 721 724 746 -hsync +vsync
    # Default mode "1152x720": 67.3 MHz, 44.8 kHz, 60.0 Hz
    Modeline "1152x720-60.0"   67.32  1152 1208 1328 1504  720 721 724 746 -hsync +vsync
    # Default mode "1088x612": 53.0 MHz, 38.0 kHz, 60.0 Hz
    Modeline "1088x612-60.0"   52.95  1088 1128 1240 1392  612 613 616 634 -hsync +vsync
    # Default mode "1024x768": 65.0 MHz, 48.4 kHz, 60.0 Hz
    Modeline "1024x768-60.0"   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync
    # Default mode "1024x600": 49.0 MHz, 37.3 kHz, 60.0 Hz
    Modeline "1024x600-60.0"   48.96  1024 1064 1168 1312  600 601 604 622 -hsync +vsync
    # Default mode "1024x512": 41.3 MHz, 31.9 kHz, 60.0 Hz
    Modeline "1024x512-60.0"   41.30  1024 1056 1160 1296  512 513 516 531 -hsync +vsync
    # Default mode "1000x600": 48.1 MHz, 37.3 kHz, 60.0 Hz
    Modeline "1000x600-60.0"   48.07  1000 1040 1144 1288  600 601 604 622 -hsync +vsync
    # Default mode "960x600": 46.0 MHz, 37.3 kHz, 60.0 Hz
    Modeline "960x600-60.0"   45.98  960 1000 1096 1232  600 601 604 622 -hsync +vsync
    # Default mode "856x480": 31.7 MHz, 29.8 kHz, 59.9 Hz
    Modeline "856x480-59.9"   31.70  856 872 960 1064  480 481 484 497 -hsync +vsync
    # Default mode "848x480": 31.5 MHz, 29.8 kHz, 60.0 Hz
    Modeline "848x480-60.0"   31.50  848 864 952 1056  480 481 484 497 -hsync +vsync
    # Extra mode
    ModeLine "800x480-x" 29.58 800 816 896 992 480 481 484 497
    # Default mode "800x600": 40.0 MHz, 37.9 kHz, 60.3 Hz
    Modeline "800x600-60.3"   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync
    # Default mode "800x600": 36.0 MHz, 35.2 kHz, 56.2 Hz
    Modeline "800x600-56.2"   36.00  800 824 896 1024  600 601 603 625 +hsync +vsync
    # Default mode "800x480": 40.0 MHz, 37.9 kHz, 60.3 Hz
    Modeline "800x480-60.3"   40.00  800 832 960 1056  480 541 545 628 -hsync +vsync
    # Default mode "720x576": 32.7 MHz, 35.9 kHz, 60.1 Hz
    Modeline "720x576-60.1"   32.70  720 744 816 912  576 577 580 597 -hsync +vsync

    ## NTSC-M  (actually 710.9x486 active area)
    # Default mode "720x480": 26.7 MHz, 29.8 kHz, 60.0 Hz
    Modeline "720x480-60.0"   26.70  720 736 808 896  480 481 484 497 -hsync +vsync

    # Default mode "640x480": 25.2 MHz, 31.5 kHz, 59.9 Hz
    Modeline "640x480-59.9"   25.18  640 656 752 800  480 490 492 525 -hsync -vsync
    # Default mode "480x640": 24.8 MHz, 39.8 kHz, 60.0 Hz
    Modeline "480x640-60.0"   24.82  480 504 552 624  640 641 644 663 -hsync +vsync

    ## Refresh rate 65Hz

    # Default mode "1600x1200": 175.5 MHz, 81.2 kHz, 65.0 Hz
    Modeline "1600x1200-65.0"  175.50  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync

    ## Refresh rate 70Hz

    # Default mode "1600x1200": 189.0 MHz, 87.5 kHz, 70.0 Hz
    Modeline "1600x1200-70.0"  189.00  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync
    # Default mode "1400x1050": 151.0 MHz, 77.0 kHz, 70.0 Hz
    Modeline "1400x1050-70.0"  151.00  1400 1464 1656 1960  1050 1051 1054 1100 +hsync +vsync
    # Default mode "1024x768": 75.0 MHz, 56.5 kHz, 70.1 Hz
    Modeline "1024x768-70.1"   75.00  1024 1048 1184 1328  768 771 777 806 -hsync -vsync

    ## Refresh rate 72Hz

    # Default mode "1920x1200": 230.0 MHz, 91.0 kHz, 72.8 Hz
    Modeline "1920x1200-72.8"  230.00  1920 1936 2096 2528  1200 1201 1204 1250 -hsync -vsync
    # Default mode "800x600": 50.0 MHz, 48.1 kHz, 72.2 Hz
    Modeline "800x600-72.2"   50.00  800 856 976 1040  600 637 643 666 +hsync +vsync
    # Default mode "640x480": 31.5 MHz, 37.9 kHz, 72.8 Hz
    Modeline "640x480-72.8"   31.50  640 664 704 832  480 489 492 520 -hsync -vsync

    ## Refresh Rate 75Hz

    # Default mode "1792x1344": 261.0 MHz, 106.3 kHz, 75.0 Hz
    Modeline "1792x1344-75.0"  261.00  1792 1888 2104 2456  1344 1345 1348 1417 -hsync +vsync
    # Default mode "1600x1200": 202.5 MHz, 93.8 kHz, 75.0 Hz
    Modeline "1600x1200-75.0"  202.50  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync
    # Extra mode "1440x1050"
    ModeLine "1440x1050-x" 160.0 1440 1536 1696 1952 1050 1051 1054 1096
    # Default mode "1400x1050": 155.8 MHz, 81.5 kHz, 74.8 Hz
    Modeline "1400x1050-74.8"  155.80  1400 1464 1784 1912  1050 1052 1064 1090 +hsync +vsync
    # Default mode "1280x1024": 135.0 MHz, 80.0 kHz, 75.0 Hz
    Modeline "1280x1024-75.0"  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync
    # Extra mode "1280x768"
    ModeLine "1280x768-x" 103.0 1280 1360 1496 1712 768 769 772 802
    # Default mode "1152x864": 108.0 MHz, 67.5 kHz, 75.0 Hz
    Modeline "1152x864-75.0"  108.00  1152 1216 1344 1600  864 865 868 900 +hsync +vsync
    # Default mode "1024x768": 78.8 MHz, 60.0 kHz, 75.0 Hz
    Modeline "1024x768-75.0"   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync
    # Extra mode "1024x512"
    ModeLine "1024x512-x" 53.3 1024 1072 1176 1328 512 513 516 535
    # Default mode "800x600": 49.5 MHz, 46.9 kHz, 75.0 Hz
    Modeline "800x600-75.0"   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync
    # Extra mode "856x480"
    ModeLine "856x480-x" 41.3 856 888 976 1096 480 481 484 502
    # Extra mode "848x480"
    ModeLine "848x480-x" 41.0 848 880 968 1088 480 481 484 502
    # Extra mode "720x576"
    ModeLine "720x576-x" 42.6 720 760 832 944 576 577 580 602
    # Extra mode "720x480"
    ModeLine "720x480-x" 34.9 720 752 824 928 480 481 484 502
    # Default mode "640x480": 31.5 MHz, 37.5 kHz, 75.0 Hz
    Modeline "640x480-75.0"   31.50  640 656 720 840  480 481 484 500 -hsync -vsync

    ## Refresh rate 85Hz

    # Default mode "1600x1200": 229.5 MHz, 106.2 kHz, 85.0 Hz
    Modeline "1600x1200-85.0"  229.50  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync
    # Default mode "1400x1050": 184.0 MHz, 93.9 kHz, 85.3 Hz
    Modeline "1400x1050-85.3"  184.00  1400 1464 1656 1960  1050 1051 1054 1100 +hsync +vsync
    # Extra mode "1440x1050"
    ModeLine "1440x1050-x" 184.5 1440 1544 1704 1968 1050 1051 1054 1103
    # Default mode "1280x1024": 157.5 MHz, 91.1 kHz, 85.0 Hz
    Modeline "1280x1024-85.0"  157.50  1280 1344 1504 1728  1024 1025 1028 1072 +hsync +vsync
    # Default mode "1280x960": 148.5 MHz, 85.9 kHz, 85.0 Hz
    Modeline "1280x960-85.0"  148.50  1280 1344 1504 1728  960 961 964 1011 +hsync +vsync
    # Extra mode "1280x768"
    ModeLine "1280x768-x" 118.5 1280 1368 1504 1728 768 769 772 807
    # Default mode "1152x864": 121.5 MHz, 77.5 kHz, 85.1 Hz
    Modeline "1152x864-85.1"  121.50  1152 1216 1344 1568  864 865 868 911 +hsync -vsync
    # Default mode "1024x768": 94.5 MHz, 68.7 kHz, 85.0 Hz
    Modeline "1024x768-85.0"   94.50  1024 1072 1168 1376  768 769 772 808 +hsync +vsync
    # Extra mode "848x480"
    ModeLine "848x480-x" 47.4 848 888 976 1104 480 481 484 505
    # Default mode "800x600": 56.3 MHz, 53.7 kHz, 85.1 Hz
    Modeline "800x600-85.1"   56.30  800 832 896 1048  600 601 604 631 +hsync +vsync
    # Default mode "640x480": 36.0 MHz, 43.3 kHz, 85.0 Hz
    Modeline "640x480-85.0"   36.00  640 696 752 832  480 481 484 509 -hsync -vsync
EndSection


請把上面的設定 copy 回去,另存成 xorg.conf.luvit.768 這樣的檔案在你的桌面上。然後在終端機裡鍵入以下指令,把 xorg.conf 檔代換成上述內容:
sudo cp ~/Desktop/xorg.conf.luvit.768 /etc/X11/xorg.conf
接著登出、再登入一次,讓 Gnome 去讀新的 xorg.conf 就有 VGA-out 了!

至於你的 Compiz 要開啟什麼樣的功能,就超過這篇要講的範圍了。不過,看到投影機在牆面上投射出來,巨大的方塊旋轉畫面時…有一種被震憾到的感動啊!

1 則留言:

  1. 補充 Ubuntu 10.04 的做法…
    1. 同上

    2. wget http://www.viaarena.com/Driver/5.75.32.87a-u1004-55689.tar.gz

    3. tar -xvvf 5.75.32.87a-u1004-55689.tar.gz

    4. cd 5.75.32.87a-u1004-55689/VIA_Chrome9_2.6.33/

    5. make

    6. cp via_chrome9.ko ../bin

    7. cd ../

    8. sudo ./vinstall

    9. 省略 (從 9.10 開始,就不需要設定 Compiz 的 whitelist 了)

    10. 同上

    以上做完後,重新登入就可以看到在 Ubuntu 10.04 下啟動 3D 而且可以做 VGA-out 的 HP-mini 2133 囉!:)

    11. 同上 (對,可以繼續用這個 xorg.conf 設定檔)

    回覆刪除