|
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 AUTOCRT,$secondary as monitor configuration.\n"; |
| 257 |
return "AUTOCRT,$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 { |