View | Details | Raw Unified | Return to bug 351627
Collapse All | Expand All

(-)./sysp/maps/Driver.map.orig (+1 lines)
Lines 12-14 fglrx : FireGL Link Here
12
tseng    : VideoRAM
12
tseng    : VideoRAM
13
intel    : Depth24,Intel
13
intel    : Depth24,Intel
14
fbdev    : NoModelines
14
fbdev    : NoModelines
15
radeonhd : Depth24,RadeonHD
(-)./profile/Profile.pm.orig (+69 lines)
Lines 573-576 sub ProfileSortRandrData { Link Here
573
	return @sortedChannels;
573
	return @sortedChannels;
574
}
574
}
575
575
576
#=====================================
577
# ProfileSortRandrData
578
#-------------------------------------
579
sub ProfileSortRandrDataForRadeonHD {
580
	my $rroutput = shift;
581
	my @channels = split ("%",$rroutput);
582
	my @sortedChannels = ();
583
	my $index = -1;
584
	# /.../
585
	# assume first channel is internal display
586
	# skip the internal display
587
	# ----
588
	foreach my $channel (@channels) {
589
		my @data = split (" ",$channel); $index++;
590
		if ( $data[1] ne "connected") {
591
			next;
592
		}
593
		delete $channels[$index];
594
		last;
595
	}
596
	$index = 10;
597
	foreach my $channel (@channels) {
598
		my @data = split (" ",$channel);
599
		my $outputName  = $data[0];
600
		my $outputState = $data[1];
601
		# /.../
602
		# activate all connected output channels
603
		# in a specific order
604
		# ----
605
		if ($outputState ne "connected") {
606
			next;
607
		}
608
		if ($outputName eq "PANEL") {
609
			$sortedChannels[0] = $outputName;
610
		}
611
		elsif ($outputName =~ /^DVI-I_1/) {
612
			$sortedChannels[1] = $outputName;
613
		}
614
		elsif ($outputName =~ /^DVI-I_2/) {
615
			$sortedChannels[2] = $outputName;
616
		}
617
		elsif ($outputName =~ /^DVI-D_1/) {
618
			$sortedChannels[3] = $outputName;
619
		}
620
		elsif ($outputName =~ /^DVI-D_2/) {
621
			$sortedChannels[4] = $outputName;
622
		}
623
		elsif ($outputName =~ /^DVI-I/) {
624
			$sortedChannels[5] = $outputName;
625
		}
626
		elsif ($outputName =~ /^DVI-D/) {
627
			$sortedChannels[6] = $outputName;
628
		}
629
		elsif ($outputName =~ /^VGA_1/) {
630
			$sortedChannels[7] = $outputName;
631
		}
632
		elsif ($outputName =~ /^VGA_2/) {
633
			$sortedChannels[8] = $outputName;
634
		}
635
		elsif ($outputName =~ /^VGA/) {
636
			$sortedChannels[9] = $outputName;
637
		} else {
638
			$sortedChannels[$index] = $outputName;
639
			$index++;
640
		}
641
	}
642
	return @sortedChannels;
643
}
644
576
1;
645
1;
(-)./profile/MergedFB.pl.orig (+3 lines)
Lines 29-34 sub getProfile { Link Here
29
		/^nvidia/    && do {
29
		/^nvidia/    && do {
30
			return "$dir/NVidia_DualHead_DriverOptions";
30
			return "$dir/NVidia_DualHead_DriverOptions";
31
		};
31
		};
32
		/^radeonhd/    && do {
33
			return "$dir/RadeonHD_DualHead_DriverOptions";
34
		};
32
		/^radeon/    && do {
35
		/^radeon/    && do {
33
			return "$dir/Radeon_DualHead_DriverOptions";
36
			return "$dir/Radeon_DualHead_DriverOptions";
34
		};
37
		};
(-)./profile/RadeonHD.orig (+6 lines)
Line 0 Link Here
1
# /.../
2
# RadeonHD driver profile which adds the option monitor-X -> Monitor[0]
3
# to the primary monitor section for the radeonhd driver
4
# ---- 
5
# dynamic profile
6
#
(-)./profile/RadeonHD.pl.orig (+48 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use lib '/usr/share/sax/profile';
4
5
use strict;
6
use Profile;
7
8
#====================================
9
# Init profile script
10
#------------------------------------
11
my $profile = ProfileInitScript();
12
13
#=====================================
14
# get SYSP xstuff data
15
#-------------------------------------
16
my $outputName;
17
my $xstuff = new SaX::SaXImportSysp ($SaX::SYSP_DESKTOP);
18
$xstuff->doImport();
19
my $rroutput = $xstuff->getItem("RandR");
20
my $randrok  = 1;
21
if ((! defined $rroutput) || ($rroutput eq "<undefined>")) {
22
	$randrok = 0;
23
}
24
if ($randrok) {
25
	#=====================================
26
	# use first randr plugin as primary
27
	#-------------------------------------
28
	my @channels = split ("%",$rroutput);
29
	foreach my $channel (@channels) {
30
		my @data = split (" ",$channel);
31
		my $outputState = $data[1];
32
		if ($outputState ne "connected") {
33
			next;
34
		}
35
		$outputName = $data[0];
36
		last;
37
	}
38
}
39
#====================================
40
# Do the profile adaptions...
41
#------------------------------------
42
open (FD,">",$profile) ||
43
	die "RadeonHD: Can't open $profile: $!";
44
if (defined $outputName) {
45
	print FD "Device -> [X] -> Raw -> 18 -> Option = ";
46
	print FD "\"monitor-$outputName\" \"Monitor[0]\"\n";
47
}
48
close FD;
(-)./profile/RadeonHD_DualHead_DriverOptions.orig (+23 lines)
Line 0 Link Here
1
# /.../
2
# profile to setup the second channel on an
3
# radeonhd based dual head card
4
# -----------------------------
5
SaXMeta -> [X] ->  SAX_NO_CDB_CHECK = 1
6
7
$Modes  = Screen  -> [X] -> Depth -> 16 -> Modes
8
$Hsync  = Monitor -> [X] -> HorizSync
9
$Vsync  = Monitor -> [X] -> VertRefresh
10
$Vendor = Monitor -> [X] -> VendorName
11
$Model  = Monitor -> [X] -> ModelName
12
13
Device  -> [X] -> Option = SaXDualHead
14
15
Device  -> [X] -> Raw -> 21 -> Option = "SaXDualMode" "Clone"
16
Device  -> [X] -> Raw -> 22 -> Option = "SaXDualOrientation" "LeftOf"
17
Device  -> [X] -> Raw -> 23 -> Option = "SaXDualHSync" "${Hsync}"
18
Device  -> [X] -> Raw -> 24 -> Option = "SaXDualVSync" "${Vsync}"
19
Device  -> [X] -> Raw -> 25 -> Option = "SaXDualResolution" "${Modes[0]}"
20
Device  -> [X] -> Raw -> 26 -> Option = "SaXDualMonitorVendor" "${Vendor}"
21
Device  -> [X] -> Raw -> 27 -> Option = "SaXDualMonitorModel" "${Model}"
22
23
Device  -> [X] -> Raw -> 28 -> Option = "SaXExternal" "Identifier__AND__EXT__PLUS__VertRefresh__AND__${Vsync}__PLUS__HorizSync__AND__${Hsync}__PLUS__PreferredMode__AND__${Modes[0]}__PLUS__VendorName__AND__${Vendor}__PLUS__ModelName__AND__${Model}"
(-)./profile/RadeonHD_DualHead_DriverOptions.pl.orig (+170 lines)
Line 0 Link Here
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 = "RadeonHD_DualHead_DriverOptions";
12
13
#====================================
14
# Init profile script
15
#------------------------------------
16
my $profile = ProfileInitScript();
17
18
#====================================
19
# get DisplaySize for second channel
20
#------------------------------------
21
my %data = ProfileGetDDC2Data();
22
my $Size;
23
foreach my $key (keys %data) {
24
	my $val = $data{$key};
25
	SWITCH: for ($key) {
26
		/^Size/       && do {
27
			$Size = $val;
28
			last SWITCH;
29
		};
30
	}
31
}
32
#=====================================
33
# get SYSP xstuff data
34
#-------------------------------------
35
my $xstuff = new SaX::SaXImportSysp ($SaX::SYSP_DESKTOP);
36
$xstuff->doImport();
37
my $rroutput = $xstuff->getItem("RandR");
38
my $randrok  = 1;
39
if ((! defined $rroutput) || ($rroutput eq "<undefined>")) {
40
	$randrok = 0;
41
}
42
#====================================
43
# Do the profile adaptions...
44
#------------------------------------
45
if (ProfileIsNoteBookHardware()) {
46
	open (FD,">",$profile) ||
47
		die "$name: Can't open $profile: $!";
48
	my $id = 21;
49
	my $dt = '"Device->[X]->Raw->".$id++."->Option"';
50
	my $dx = eval $dt;
51
	print FD "SaXMeta->[X]->SAX_NO_CDB_CHECK=1\n";
52
	print FD "\$MS=Screen->[X]->Depth->16->Modes\n";
53
	print FD "\$Hsync=Monitor->[X]->HorizSync\n";
54
	print FD "\$Vsync=Monitor->[X]->VertRefresh\n";
55
	print FD "Device->[X]->Option=SaXDualHead\n";
56
	print FD "$dx=\"SaXDualMode\" \"Clone\"\n";
57
	$dx = eval $dt;
58
	print FD "$dx=\"SaXDualOrientation\" \"LeftOf\"\n";
59
	$dx = eval $dt;
60
	print FD "$dx=\"SaXDualHSync\" \"31-48\"\n";
61
	$dx = eval $dt;
62
	print FD "$dx=\"SaXDualVSync\" \"50-60\"\n";
63
	$dx = eval $dt;
64
	print FD "$dx=\"SaXDualResolution\" \"1024x768\"\n";
65
	$dx = eval $dt;
66
	print FD "$dx=\"SaXDualMonitorVendor\" \"__VESA__\"\n";
67
	$dx = eval $dt;
68
	print FD "$dx=\"SaXDualMonitorModel\" \"1024X768\@60HZ\"\n";
69
	$dx = eval $dt;
70
	print FD "$dx=\"SaXExternal\" \"Identifier__AND__EXT__PLUS__VertRefresh__AND__50-60__PLUS__HorizSync__AND__31-48__PLUS__PreferredMode__AND__1024x768__PLUS__VendorName__AND____VESA____PLUS__ModelName__AND__1024X768\@60HZ";
71
	if (defined $Size) {
72
		print FD "__PLUS__DisplaySize__AND__$Size\"\n";
73
	} else {
74
		print FD "\"\n";
75
	}
76
	if ($randrok) {
77
		#=====================================
78
		# setup randr plugin data
79
		#-------------------------------------
80
		my @sortedChannels = ProfileSortRandrData ($rroutput);
81
		foreach my $outputName (@sortedChannels) {
82
			if ((defined $outputName) && ($outputName ne "")) {
83
				$dx = eval $dt;
84
				print FD "$dx=\"monitor-$outputName\" \"EXT\"\n";
85
			}
86
		}
87
	}
88
	close FD;
89
} else {
90
	#====================================
91
	# check secondary DDC data
92
	#------------------------------------
93
	open (FD,">>",$profile) ||
94
		die "$name: Can't open $profile: $!";
95
	my %data   = ProfileGetDDC2Data();
96
	my $id = 21;
97
	my $dt = '"Device->[X]->Raw->".$id++."->Option"';
98
	my $dx = eval $dt;
99
	print FD "$dx=\"SaXDualMode\" \"Clone\"\n";
100
	$dx = eval $dt;
101
	print FD "$dx=\"SaXDualOrientation\" \"LeftOf\"\n";
102
	$dx = eval $dt;
103
	my $Hsync  = '${Hsync}';
104
	my $Vsync  = '${Vsync}';
105
	my $Vendor = '${Vendor}';
106
	my $Model  = '${Model}'; 
107
	my $Modes  = '${Modes[0]}';
108
	foreach my $key (keys %data) {
109
		my $val = $data{$key};
110
		SWITCH: for ($key) {
111
			/^Model/      && do {
112
				$id = 27;
113
				$dx = eval $dt;
114
				print FD "$dx=\"SaXDualMonitorModel\" \"$val\"\n";
115
				$Model = $val;
116
				last SWITCH;
117
			};
118
			/^Vendor/     && do {
119
				$id = 26;
120
				$dx = eval $dt;
121
				print FD "$dx=\"SaXDualMonitorVendor\" \"$val\"\n";
122
				$Vendor = $val;
123
				last SWITCH;
124
			};
125
			/^Resolution/ && do {
126
				$id = 25;
127
				$dx = eval $dt;
128
				print FD "$dx=\"SaXDualResolution\" \"$val\"\n";
129
				$Modes = $val;
130
				last SWITCH;
131
			};
132
			/^Hsync/      && do {
133
				$id = 23;
134
				$dx = eval $dt;
135
				print FD "$dx=\"SaXDualHSync\" \"$val\"\n";
136
				$Hsync = $val;
137
				last SWITCH;
138
			};
139
			/^Vsync/      && do {
140
				$id = 24;
141
				$dx = eval $dt;
142
				print FD "$dx=\"SaXDualVSync\" \"$val\"\n";
143
				$Vsync = $val;
144
				last SWITCH;
145
			};
146
		}
147
	}
148
	$id = 28;
149
	$dx = eval $dt;
150
	print FD "$dx=\"SaXExternal\" \"Identifier__AND__EXT__PLUS__VertRefresh__AND__".$Vsync."__PLUS__HorizSync__AND__".$Hsync."__PLUS__PreferredMode__AND__".$Modes."__PLUS__VendorName__AND__".$Vendor."__PLUS__ModelName__AND__".$Model;
151
	if (defined $Size) {
152
		print FD "__PLUS__DisplaySize__AND__$Size\"\n";
153
	} else {
154
		print FD "\"\n";
155
	}
156
	if ($randrok) {
157
		#=====================================
158
		# setup randr plugin data
159
		#-------------------------------------
160
		my @sortedChannels = ProfileSortRandrDataForRadeonHD ($rroutput);
161
		foreach my $outputName (@sortedChannels) {
162
			if ((defined $outputName) && ($outputName ne "")) {
163
				$dx = eval $dt;
164
				print FD "$dx=\"monitor-$outputName\" \"EXT\"\n";
165
print STDERR "$dx=\"monitor-$outputName\" \"EXT\"\n";
166
			}
167
		}
168
	}
169
	close FD;
170
}

Return to bug 351627