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

(-)profile.orig/Profile.pm (+52 lines)
Lines 226-231 sub ProfileIntelSetupMonitorLayout { Link Here
226
}
226
}
227
227
228
#=====================================
228
#=====================================
229
# ProfileRadeonGetMonitorLayout
230
#-------------------------------------
231
sub ProfileRadeonGetMonitorLayout {
232
	my $xorglog  = ProfileReadXLogFile();
233
	my %devs = ();
234
	my $secondary = "AUTO";
235
	$_ = $xorglog;
236
	while (/^\(..\) RADEON\(\d+\): Port(\d):\n Monitor\s.*\n Connector\s*--\s*(\S+)\s*$/mg) {
237
		my $p=$1;
238
		my $c=$2;
239
		$devs{$p}=$c;
240
	}
241
	if (! defined $devs{2}) {
242
		if (! defined $devs{1}) {
243
			print STDERR "*** No output configuration found\n";
244
		} else {
245
			print STDERR "*** No secondary output found\n";
246
		}
247
	} elsif ($devs{2} eq "VGA" || $devs{2} eq "DVI-A") {
248
		$secondary = "CRT";
249
	} elsif ($devs{1} eq "LVDS" && $devs{2} eq "DVI-I") {
250
		$secondary = "CRT";
251
	} elsif ($devs{2} eq "DVI-D") {
252
		$secondary = "TMDS";
253
	} else {
254
		print STDERR "*** Nontrivial output configuration $devs{1},$devs{2} found\n";
255
	}
256
	print STDERR "*** Selecting AUTO,$secondary as monitor configuration.\n";
257
	return "AUTO,$secondary";
258
}
259
260
#=====================================
261
# ProfileRadeonSetupMonitorLayout
262
#-------------------------------------
263
sub ProfileRadeonSetupMonitorLayout {
264
	my $profile = $_[0];
265
	my $stdname = ProfileName();
266
	local $/;
267
	open (FD,"<",$profile) ||
268
		die "*** $stdname: Can't open $profile: $!";
269
	my $profileData = <FD>;
270
	my $monitorLayout = ProfileRadeonGetMonitorLayout();
271
	$profileData =~ s/\[MONITORLAYOUT\]/$monitorLayout/;
272
	close FD;
273
	open (FD,">",$profile) ||
274
		die "*** $stdname: Can't open $profile: $!";
275
	print FD $profileData;
276
	close FD;
277
	return $monitorLayout;
278
}
279
280
#=====================================
229
# ProfileNVidiaGetMonitorLayout
281
# ProfileNVidiaGetMonitorLayout
230
#-------------------------------------
282
#-------------------------------------
231
sub ProfileNVidiaGetMonitorLayout {
283
sub ProfileNVidiaGetMonitorLayout {
(-)profile.orig/Radeon_DualHead.pl (+4 lines)
Lines 21-28 my $profile = ProfileInitScript(); Link Here
21
#====================================
21
#====================================
22
# Do the profile adaptions...
22
# Do the profile adaptions...
23
#------------------------------------
23
#------------------------------------
24
my $mlayout = ProfileRadeonSetupMonitorLayout ($profile);
25
24
open (FD,">>",$profile) ||
26
open (FD,">>",$profile) ||
25
	die "Radeon_DualHead: Can't open $profile: $!";
27
	die "Radeon_DualHead: Can't open $profile: $!";
28
print FD "Device->[X]->Raw->20->Option=\"MonitorLayout\" \"$mlayout\"\n";
29
print FD "Device->[X+1]->Raw->20->Option=\"MonitorLayout\" \"$mlayout\"\n";
26
#====================================
30
#====================================
27
# check secondary DDC data
31
# check secondary DDC data
28
#------------------------------------
32
#------------------------------------
(-)profile.orig/Radeon_DualHead_DriverOptions (-13 / +14 lines)
Lines 12-27 $Model = Monitor -> [X] -> ModelName Link Here
12
12
13
Device  -> [X] -> Option = SaXDualHead
13
Device  -> [X] -> Option = SaXDualHead
14
14
15
Device  -> [X] -> Raw -> 20 -> Option = "MergedFB" "yes"
15
Device  -> [X] -> Raw -> 20 -> Option = "MonitorLayout" "[MONITORLAYOUT]"
16
Device  -> [X] -> Raw -> 21 -> Option = "IgnoreEDID" "yes"
16
Device  -> [X] -> Raw -> 21 -> Option = "MergedFB" "yes"
17
Device  -> [X] -> Raw -> 22 -> Option = "CRT2Position" "Clone"
17
Device  -> [X] -> Raw -> 22 -> Option = "IgnoreEDID" "yes"
18
Device  -> [X] -> Raw -> 23 -> Option = "SaXDualOrientation" "LeftOf"
18
Device  -> [X] -> Raw -> 23 -> Option = "CRT2Position" "Clone"
19
Device  -> [X] -> Raw -> 24 -> Option = "SaXDualMode" "Clone"
19
Device  -> [X] -> Raw -> 24 -> Option = "SaXDualOrientation" "LeftOf"
20
Device  -> [X] -> Raw -> 25 -> Option = "SaXDualMonitorVendor" "${Vendor}"
20
Device  -> [X] -> Raw -> 25 -> Option = "SaXDualMode" "Clone"
21
Device  -> [X] -> Raw -> 26 -> Option = "SaXDualMonitorModel" "${Model}"
21
Device  -> [X] -> Raw -> 26 -> Option = "SaXDualMonitorVendor" "${Vendor}"
22
Device  -> [X] -> Raw -> 28 -> Option = "CRT2HSync" "${Hsync}"
22
Device  -> [X] -> Raw -> 27 -> Option = "SaXDualMonitorModel" "${Model}"
23
Device  -> [X] -> Raw -> 29 -> Option = "CRT2VRefresh" "${Vsync}"
23
Device  -> [X] -> Raw -> 29 -> Option = "CRT2HSync" "${Hsync}"
24
Device  -> [X] -> Raw -> 30 -> Option = "MetaModes" "${Modes[0]},${Modes[0]}"
24
Device  -> [X] -> Raw -> 30 -> Option = "CRT2VRefresh" "${Vsync}"
25
Device  -> [X] -> Raw -> 31 -> Option = "SaXDualHSync" "${Hsync}"
25
Device  -> [X] -> Raw -> 31 -> Option = "MetaModes" "${Modes[0]},${Modes[0]}"
26
Device  -> [X] -> Raw -> 32 -> Option = "SaXDualVSync" "${Vsync}"
26
Device  -> [X] -> Raw -> 32 -> Option = "SaXDualHSync" "${Hsync}"
27
Device  -> [X] -> Raw -> 33 -> Option = "SaXDualResolution" "${Modes[0]}"
27
Device  -> [X] -> Raw -> 33 -> Option = "SaXDualVSync" "${Vsync}"
28
Device  -> [X] -> Raw -> 34 -> Option = "SaXDualResolution" "${Modes[0]}"
(-)profile.orig/Radeon_DualHead_DriverOptions.pl (+9 lines)
Lines 18-23 my $profile = ProfileInitScript(); Link Here
18
#====================================
18
#====================================
19
# Do the profile adaptions...
19
# Do the profile adaptions...
20
#------------------------------------
20
#------------------------------------
21
my $mlayout = ProfileRadeonSetupMonitorLayout ($profile);
22
23
#====================================
24
# Do the profile adaptions...
25
#------------------------------------
21
if (! ProfileIsXOrgVendor ("fglrx")) {
26
if (! ProfileIsXOrgVendor ("fglrx")) {
22
	#====================================
27
	#====================================
23
	# Call fglrx dual profile
28
	# Call fglrx dual profile
Lines 45-50 if (! ProfileIsXOrgVendor ("fglrx")) { Link Here
45
		print FD "SaXMeta->[X]->SAX_NO_CDB_CHECK=1\n";
50
		print FD "SaXMeta->[X]->SAX_NO_CDB_CHECK=1\n";
46
		print FD "\$MS=Screen->[X]->Depth->16->Modes\n";
51
		print FD "\$MS=Screen->[X]->Depth->16->Modes\n";
47
		print FD "Device->[X]->Option=SaXDualHead\n";
52
		print FD "Device->[X]->Option=SaXDualHead\n";
53
		print FD "$dx=\"MonitorLayout\" \"$mlayout\"\n";
54
		$dx = eval $dt;
48
		print FD "$dx=\"MergedFB\" \"yes\"\n";
55
		print FD "$dx=\"MergedFB\" \"yes\"\n";
49
		$dx = eval $dt;
56
		$dx = eval $dt;
50
		print FD "$dx=\"IgnoreEDID\" \"yes\"\n";
57
		print FD "$dx=\"IgnoreEDID\" \"yes\"\n";
Lines 81-86 if (! ProfileIsXOrgVendor ("fglrx")) { Link Here
81
		my $id = 20;
88
		my $id = 20;
82
		my $dt = '"Device->[X]->Raw->".$id++."->Option"';
89
		my $dt = '"Device->[X]->Raw->".$id++."->Option"';
83
		my $dx = eval $dt;
90
		my $dx = eval $dt;
91
		print FD "$dx=\"MonitorLayout\" \"$mlayout\"\n";
92
		$dx = eval $dt;
84
		print FD "$dx=\"MergedFB\" \"yes\"\n";
93
		print FD "$dx=\"MergedFB\" \"yes\"\n";
85
		$dx = eval $dt;
94
		$dx = eval $dt;
86
		print FD "$dx=\"IgnoreEDID\" \"yes\"\n";
95
		print FD "$dx=\"IgnoreEDID\" \"yes\"\n";

Return to bug 263199