home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / sax / profile / Intel_DualHead_DriverOptions.pl < prev    next >
Perl Script  |  2006-11-29  |  3KB  |  123 lines

  1. #!/usr/bin/perl
  2.  
  3. use lib '/usr/share/sax/profile';
  4.  
  5. use strict;
  6. use Profile;
  7.  
  8. #====================================
  9. # Profile name...
  10. #------------------------------------
  11. my $name = "Intel_DualHead_DriverOptions";
  12.  
  13. #====================================
  14. # Init profile script
  15. #------------------------------------
  16. my $profile = ProfileInitScript();
  17.  
  18. #====================================
  19. # Do the profile adaptions...
  20. #------------------------------------
  21. my $mlayout = ProfileIntelSetupMonitorLayout ($profile);
  22.  
  23. #====================================
  24. # Do the profile adaptions...
  25. #------------------------------------
  26. if (ProfileIsNoteBookHardware()) {
  27.     open (FD,">",$profile) ||
  28.         die "$name: Can't open $profile: $!";
  29.     my $id = 20;
  30.     my $dt = '"Device->[X]->Raw->".$id++."->Option"';
  31.     my $dx = eval $dt;
  32.     print FD "SaXMeta->[X]->SAX_NO_CDB_CHECK=1\n";
  33.     print FD "\$MS=Screen->[X]->Depth->16->Modes\n";
  34.     print FD "Device->[X]->Option=SaXDualHead\n";
  35.     print FD "$dx=\"MonitorLayout\" \"$mlayout\"\n";
  36.     $dx = eval $dt;
  37.     print FD "$dx=\"SaXDualMode\" \"Clone\"\n";
  38.     $dx = eval $dt;
  39.     print FD "$dx=\"Clone\" \"yes\"\n";
  40.     $dx = eval $dt;
  41.     print FD "$dx=\"SaXDualOrientation\" \"LeftOf\"\n";
  42.     $dx = eval $dt;
  43.     print FD "$dx=\"SaXDualHSync\" \"31-48\"\n";
  44.     $dx = eval $dt;
  45.     print FD "$dx=\"SaXDualVSync\" \"50-60\"\n";
  46.     $dx = eval $dt;
  47.     print FD "$dx=\"SaXDualResolution\" \"1024x768\"\n";
  48.     $dx = eval $dt;
  49.     print FD "$dx=\"SaXDualMonitorVendor\" \"__VESA__\"\n";
  50.     $dx = eval $dt;
  51.     print FD "$dx=\"SaXDualMonitorModel\" \"1024X768\@60HZ\"\n";
  52.     $dx = eval $dt;
  53.     print FD "$dx=\"SecondMonitorHorizSync\" \"31-48\"\n";
  54.     $dx = eval $dt;
  55.     print FD "$dx=\"SecondMonitorVertRefresh\" \"50-60\"\n";
  56.     $dx = eval $dt;
  57.     print FD "$dx=\"MetaModes\" \"\${MS[0]}-1024x768;1024x768-1024x768\"\n";
  58.     close FD;
  59. } else {
  60.     #====================================
  61.     # check secondary DDC data
  62.     #------------------------------------
  63.     open (FD,">>",$profile) ||
  64.         die "$name: Can't open $profile: $!";
  65.     my %data   = ProfileGetDDC2Data();
  66.     my $id = 20;
  67.     my $dt = '"Device->[X]->Raw->".$id++."->Option"';
  68.     my $dx = eval $dt;
  69.     print FD "$dx=\"MonitorLayout\" \"$mlayout\"\n";
  70.     $dx = eval $dt;
  71.     print FD "$dx=\"SaXDualMode\" \"Clone\"\n";
  72.     $dx = eval $dt;
  73.     print FD "$dx=\"Clone\" \"yes\"\n";
  74.     $dx = eval $dt;
  75.     print FD "$dx=\"SaXDualOrientation\" \"LeftOf\"\n";
  76.     $dx = eval $dt;
  77.     foreach my $key (keys %data) {
  78.         my $val = $data{$key};
  79.         SWITCH: for ($key) {
  80.             /^Model/      && do {
  81.                 $id = 28;
  82.                 $dx = eval $dt;
  83.                 print FD "$dx=\"SaXDualMonitorModel\" \"$val\"\n";
  84.                 last SWITCH;
  85.             };
  86.             /^Vendor/     && do {
  87.                 $id = 27;
  88.                 $dx = eval $dt;
  89.                 print FD "$dx=\"SaXDualMonitorVendor\" \"$val\"\n";
  90.                 last SWITCH;
  91.             };
  92.             /^Resolution/ && do {
  93.                 $id = 31;
  94.                 $dx = eval $dt;
  95.                 print FD "$dx=\"MetaModes\" \"\${Modes[0]}-$val\"\n";
  96.                 $id = 26;
  97.                 $dx = eval $dt;
  98.                 print FD "$dx=\"SaXDualResolution\" \"$val\"\n";
  99.                 last SWITCH;
  100.             };
  101.             /^Hsync/      && do {
  102.                 $id = 29;
  103.                 $dx = eval $dt;
  104.                 print FD "$dx=\"SecondMonitorHorizSync\" \"$val\"\n";
  105.                 $id = 24;
  106.                 $dx = eval $dt;
  107.                 print FD "$dx=\"SaXDualHSync\" \"$val\"\n";
  108.                 last SWITCH;
  109.             };
  110.             /^Vsync/      && do {
  111.                 $id = 30;
  112.                 $dx = eval $dt;
  113.                 print FD "$dx=\"SecondMonitorVertRefresh\" \"$val\"\n";
  114.                 $id = 25;
  115.                 $dx = eval $dt;
  116.                 print FD "$dx=\"SaXDualVSync\" \"$val\"\n";
  117.                 last SWITCH;
  118.             };
  119.         }
  120.     }
  121.     close FD;
  122. }
  123.