1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
|
package Xconfigurator;
use diagnostics;
use strict;
use vars qw($in $install $isLaptop @window_managers @depths @monitorSize2resolution @hsyncranges %min_hsync4wres @vsyncranges %depths @resolutions %serversdriver @svgaservers @accelservers @allbutfbservers @allservers %vgamodes %videomemory @ramdac_name @ramdac_id @clockchip_name @clockchip_id %keymap_translate %standard_monitors $XF86firstchunk_text $XF86firstchunk_text2 $keyboardsection_start $keyboardsection_start_v4 $keyboardsection_part2 $keyboardsection_part3 $keyboardsection_part3_v4 $keyboardsection_end $pointersection_text $pointersection_text_v4 $monitorsection_text1 $monitorsection_text2 $monitorsection_text3 $monitorsection_text4 $modelines_text_Trident_TG_96xx $modelines_text $devicesection_text $devicesection_text_v4 $screensection_text1 %lines @options %xkb_options $default_monitor $layoutsection_v4);
use common qw(:common :file :functional :system);
use log;
use detect_devices;
use run_program;
use Xconfigurator_consts;
use any;
use modules;
use my_gtk qw(:wrappers);
my $tmpconfig = "/tmp/Xconfig";
my ($prefix, %monitors);
1;
sub getVGAMode($) { $_[0]->{card}{vga_mode} || $vgamodes{"640x480x16"}; }
sub readCardsDB {
my ($file) = @_;
my ($card, %cards);
local *F;
open F, $file or die "file $file not found";
my ($lineno, $cmd, $val) = 0;
my $fs = {
LINE => sub { push @{$card->{lines}}, $val unless $val eq "VideoRam" },
NAME => sub {
$cards{$card->{type}} = $card if $card;
$card = { type => $val };
},
SEE => sub {
my $c = $cards{$val} or die "Error in database, invalid reference $val at line $lineno";
push @{$card->{lines}}, @{$c->{lines} || []};
add2hash($card->{flags}, $c->{flags});
add2hash($card, $c);
},
CHIPSET => sub {
$card->{chipset} = $val;
$card->{flags}{needChipset} = 1 if $val eq 'GeForce DDR';
$card->{flags}{needVideoRam} = 1 if member($val, qw(mgag10 mgag200 RIVA128 SiS6326));
},
SERVER => sub { $card->{server} = $val; },
DRIVER => sub { $card->{driver} = $val; },
RAMDAC => sub { $card->{ramdac} = $val; },
DACSPEED => sub { $card->{dacspeed} = $val; },
CLOCKCHIP => sub { $card->{clockchip} = $val; $card->{flags}{noclockprobe} = 1; },
NOCLOCKPROBE => sub { $card->{flags}{noclockprobe} = 1 },
UNSUPPORTED => sub { $card->{flags}{unsupported} = 1 },
COMMENT => sub {},
};
foreach (<F>) { $lineno++;
s/\s+$//;
/^#/ and next;
/^$/ and next;
/^END/ and last;
($cmd, $val) = /(\S+)\s*(.*)/ or next; #log::l("bad line $lineno ($_)"), next;
my $f = $fs->{$cmd};
$f ? &$f() : log::l("unknown line $lineno ($_)");
}
\%cards;
}
sub readCardsNames {
my $file = "/usr/X11R6/lib/X11/CardsNames";
local *F; open F, $file or die "can't find $file\n";
map { (split '=>')[0] } <F>;
}
sub cardName2RealName {
my $file = "/usr/X11R6/lib/X11/CardsNames";
my ($name) = @_;
local *F; open F, $file or die "can't find $file\n";
foreach (<F>) { chop;
my ($name_, $real) = split '=>';
return $real if $name eq $name_;
}
$name;
}
sub updateCardAccordingName {
my ($card, $name) = @_;
my $cards = readCardsDB("/usr/X11R6/lib/X11/Cards+");
add2hash($card->{flags}, $cards->{$name}{flags});
add2hash($card, $cards->{$name});
$card;
}
sub readMonitorsDB {
my ($file) = @_;
%monitors and return;
local *F;
open F, $file or die "can't open monitors database ($file): $!";
my $lineno = 0; foreach (<F>) {
$lineno++;
s/\s+$//;
/^#/ and next;
/^$/ and next;
my @fields = qw(vendor type eisa hsyncrange vsyncrange);
my @l = split /\s*;\s*/;
@l == @fields or log::l("bad line $lineno ($_)"), next;
my %l; @l{@fields} = @l;
if ($monitors{$l{type}}) {
my $i; for ($i = 0; $monitors{"$l{type} ($i)"}; $i++) {}
$l{type} = "$l{type} ($i)";
}
$monitors{"$l{vendor}|$l{type}"} = \%l;
}
while (my ($k, $v) = each %standard_monitors) {
$monitors{_("Generic") . "|" . translate($k)} =
{ hsyncrange => $v->[1], vsyncrange => $v->[2] };
}
}
sub rewriteInittab {
my ($runlevel) = @_;
my $f = "$prefix/etc/inittab";
-r $f or log::l("missing inittab!!!"), return;
substInFile { s/^(id:)[35](:initdefault:)\s*$/$1$runlevel$2\n/ } $f;
}
sub keepOnlyLegalModes {
my ($card, $monitor) = @_;
my $mem = 1024 * ($card->{memory} || ($card->{server} eq 'FBDev' ? 2048 : 99999));
my $hsync = max(split(/[,-]/, $monitor->{hsyncrange}));
while (my ($depth, $res) = each %{$card->{depth}}) {
@$res = grep {
$mem >= product(@$_, $depth / 8) &&
$hsync >= ($min_hsync4wres{$_->[0]} || 0) &&
($card->{server} ne 'FBDev' || $vgamodes{"$_->[0]x$_->[1]x$depth"})
} @$res;
delete $card->{depth}{$depth} if @$res == 0;
}
}
sub cardConfigurationAuto() {
my $card;
if (my ($c) = grep { $_->{driver} =~ /(Card|Server):/ } detect_devices::probeall()) {
local $_ = $c->{driver};
$card->{type} = $1 if /Card:(.*)/;
$card->{server} = $1 if /Server:(.*)/;
$card->{flags}{needVideoRam} &&= /86c368/;
$card->{identifier} = $c->{description};
push @{$card->{lines}}, @{$lines{$card->{identifier}} || []};
}
#- take a default on sparc if nothing has been found.
if (arch() =~ /^sparc/ && !$card->{server} && !$card->{type}) {
log::l("Using probe with /proc/fb as nothing has been found!");
local $_ = cat_("/proc/fb");
if (/Mach64/) { $card->{server} = "Mach64" }
elsif (/Permedia2/) { $card->{server} = "3DLabs" }
else { $card->{server} = "Sun24" }
}
$card;
}
sub cardConfiguration(;$$$) {
my ($card, $noauto, $allowFB) = @_;
$card ||= {};
updateCardAccordingName($card, $card->{type}) if $card->{type}; #- try to get info from given type
undef $card->{type} unless $card->{server}; #- bad type as we can't find the server
add2hash($card, cardConfigurationAuto()) unless $card->{server} || $noauto;
$card->{server} = 'FBDev' unless !$allowFB || $card->{server} || $card->{type} || $noauto;
$card->{type} = cardName2RealName($in->ask_from_treelist(_("Graphic card"), _("Select a graphic card"), '|', ['Unlisted', readCardsNames()])) unless $card->{type} || $card->{server};
undef $card->{type}, $card->{server} = $in->ask_from_list(_("X server"), _("Choose a X server"), $allowFB ? \@allservers : \@allbutfbservers ) if $card->{type} eq "Unlisted";
updateCardAccordingName($card, $card->{type}) if $card->{type};
add2hash($card, { vendor => "Unknown", board => "Unknown" });
#- 3D acceleration configuration for XFree 3.3 using Utah-GLX.
$card->{Utah_glx} = ($card->{identifier} =~ /MGA G[24]00/ || #- 8bpp does not work.
$card->{identifier} =~ /3D Rage Pro AGP/ || #- by default only such card are supported, with AGP ?
$card->{type} =~ /RIVA TNT/ || $card->{type} =~ /RIVA128/ || $card->{type} =~ /GeForce 256/ ||
#- $card->{type} =~ /SiS / || #- EXPERIMENTAL
#- $card->{type} =~ /S3 ViRGE/ || #- EXPERIMENTAL, 15bits only (!).
#- $card->{type} =~ /S3 Savage3D/ || #- EXPERIMENTAL, use no_pixmap_cache, 16bit only.
$card->{type} =~ /Intel 810/);
#- 3D acceleration configuration for XFree 4.0 using DRI.
$card->{DRI_glx} = ($card->{identifier} =~ /Voodoo [35]/ || #- 16bit only #- NOT YET $card->{identifier} =~ /Voodoo Banshee/ ||
$card->{identifier} =~ /MGA G[24]00/ || #- prefer 16bit (24bit not well tested according to DRI)
$card->{type} =~ /Intel 810/ || #- 16bit
$card->{type} =~ /ATI Rage 128/); #- 16 and 32 bits, prefer 16bit as no DMA.
#- check to use XFree 4.0 or XFree 3.3.
$card->{use_xf4} = !$::force_xf3 && $card->{driver} && !$card->{flags}{unsupported};
#- ask the expert user if he want 3D acceleration.
if ($::expert && ($card->{Utah_glx} || $card->{DRI_glx})) {
$in->ask_yesorno('', _("Do you want support for hardware 3D acceleration?", 1)) or
$card->{Utah_glx} = $card->{DRI_glx} = ''; #- disable all 3D acceleration
}
#- try to figure if 3D acceleration is supported
#- by XFree 3.3 but not XFree 4.0 then ask user to keep XFree 3.3 ?
if ($card->{use_xf4} && $card->{Utah_glx} && !$card->{DRI_glx}) {
$::beginner || $in->ask_yesorno('',
_("Your card can have 3D acceleration but only with XFree 3.3.
Do You want to use XFree 3.3 instead of XFree 4.0?"), 1) and $card->{use_xf4} = '';
}
$card->{prog} = "/usr/X11R6/bin/" . ($card->{use_xf4} ? 'XFree86' : $card->{server} =~ /Sun (.*)/x ?
"Xsun$1" : "XF86_$card->{server}");
-x "$prefix$card->{prog}" or $install && do {
$in->suspend if ref($in) =~ /newt/;
&$install($card->{server}, $card->{Utah_glx} ? 'Mesa' : ()) if !$card->{use_xf4};
&$install('server') if $card->{use_xf4}; #- add XFree86-libs-DRI here if using DRI (future split of XFree86 TODO)
$in->resume if ref($in) =~ /newt/;
};
-x "$prefix$card->{prog}" or die "server $card->{server} is not available (should be in $prefix$card->{prog})";
unless ($card->{type}) {
$card->{flags}{noclockprobe} = member($card->{server}, qw(I128 S3 S3V Mach64));
}
$card->{options_xf3}{power_saver} = 1;
$card->{options_xf4}{DPMS} = 1;
$card->{flags}{needVideoRam} and
$card->{memory} ||=
$videomemory{$in->ask_from_list_('',
_("Select the memory size of your graphic card"),
[ sort { $videomemory{$a} <=> $videomemory{$b} }
keys %videomemory])};
#- hack for ATI Mach64 card where two options should be used if using Utah-GLX.
if ($card->{type} =~ /ATI Mach64/) {
$card->{options_xf3}{no_font_cache} = $card->{Utah_glx};
$card->{options_xf3}{no_pixmap_cache} = $card->{Utah_glx};
}
#- 3D acceleration configuration for XFree 4.0 using DRI, this is enabled by default
#- but for some there is a need to specify VideoRam (else it won't run).
if ($card->{DRI_glx}) {
($card->{flags}{needVideoRam}, $card->{memory}) = ('fakeVideoRam', 32768) if $card->{identifier} =~ /MGA G[24]00/;
($card->{flags}{needVideoRam}, $card->{memory}) = ('fakeVideoRam', 10000) if $card->{type} =~ /Intel 810/;
}
if (!$::isStandalone && $card->{driver} eq "i810") {
require modules;
modules::load("agpgart"); };
}
$card;
}
sub optionsConfiguration($) {
my ($o) = @_;
my @l;
my %l;
foreach (@options) {
if ($o->{card}{server} eq $_->[1] && $o->{card}{identifier} =~ /$_->[2]/) {
my $options = 'options_' . ($o->{card}{server} eq 'XFree86' ? 'xf4' : 'xf3');
$o->{card}{$options}{$_->[0]} ||= 0;
unless ($l{$_->[0]}) {
push @l, $_->[0], { val => \$o->{card}{$options}{$_->[0]}, type => 'bool' };
$l{$_->[0]} = 1;
}
}
}
@l = @l[0..19] if @l > 19; #- reduce list size to 10 for display (it's a hash).
$in->ask_from_entries_refH('', _("Choose options for server"), \@l);
}
sub monitorConfiguration(;$$) {
my $monitor = shift || {};
my $useFB = shift || 0;
$monitor->{hsyncrange} && $monitor->{vsyncrange} and return $monitor;
readMonitorsDB("/usr/X11R6/lib/X11/MonitorsDB");
add2hash($monitor, { type => $in->ask_from_treelist(_("Monitor"), _("Choose a monitor"), '|', ['Unlisted', keys %monitors], _("Generic") . '|' . translate($default_monitor)) }) unless $monitor->{type};
if ($monitor->{type} eq 'Unlisted') {
$in->ask_from_entries_ref('',
_("The two critical parameters are the vertical refresh rate, which is the rate
at which the whole screen is refreshed, and most importantly the horizontal
sync rate, which is the rate at which scanlines are displayed.
It is VERY IMPORTANT that you do not specify a monitor type with a sync range
that is beyond the capabilities of your monitor: you may damage your monitor.
If in doubt, choose a conservative setting."),
[ _("Horizontal refresh rate"), _("Vertical refresh rate") ],
[ { val => \$monitor->{hsyncrange}, list => \@hsyncranges },
{ val => \$monitor->{vsyncrange}, list => \@vsyncranges }, ]);
} else {
add2hash($monitor, $monitors{$monitor->{type}});
}
add2hash($monitor, { type => "Unknown", vendor => "Unknown", model => "Unknown", manual => 1 });
}
sub testConfig($) {
my ($o) = @_;
my ($resolutions, $clocklines);
write_XF86Config($o, $tmpconfig);
unlink "/tmp/.X9-lock";
#- restart_xfs;
my $f = $tmpconfig . ($o->{card}{use_xf4} && "-4");
local *F;
open F, "$prefix$o->{card}{prog} :9 -probeonly -pn -xf86config $f 2>&1 |";
foreach (<F>) {
$o->{card}{memory} ||= $2 if /(videoram|Video RAM):\s*(\d*)/;
# look for clocks
push @$clocklines, $1 if /clocks: (.*)/ && !/(pixel |num)clocks:/;
push @$resolutions, [ $1, $2 ] if /: Mode "(\d+)x(\d+)": mode clock/;
print;
}
close F or die "X probeonly failed";
($resolutions, $clocklines);
}
sub testFinalConfig($;$$) {
my ($o, $auto, $skiptest) = @_;
$o->{monitor}{hsyncrange} && $o->{monitor}{vsyncrange} or
$in->ask_warn('', _("Monitor not configured")), return;
$o->{card}{server} or
$in->ask_warn('', _("Graphic card not configured yet")), return;
$o->{card}{depth} or
$in->ask_warn('', _("Resolutions not chosen yet")), return;
my $f = "/etc/X11/XF86Config.test";
write_XF86Config($o, $::testing ? $tmpconfig : "$prefix/$f");
$skiptest || $o->{card}{server} =~ 'FBDev|Sun' and return 1; #- avoid testing with these.
#- needed for bad cards not restoring cleanly framebuffer
my $bad_card = $o->{card}{identifier} =~ /i740|ViRGE/;
$bad_card ||= $o->{card}{identifier} eq "ATI|3D Rage P/M Mobility AGP 2x";
$bad_card ||= $o->{card}{use_xf4}; #- TODO obsoleted to check, when using fbdev of XFree 4.0!
log::l("the graphic card does not like X in framebuffer") if $bad_card;
my $mesg = _("Do you want to test the configuration?");
my $def = 1;
if ($bad_card && !$::isStandalone) {
!$::expert || $auto and return 1;
$mesg = $mesg . "\n" . _("Warning: testing is dangerous on this graphic card");
$def = 0;
}
$auto && $def or $in->ask_yesorno(_("Test of the configuration"), $mesg, $def) or return 1;
unlink "$prefix/tmp/.X9-lock";
#- create a link from the non-prefixed /tmp/.X11-unix/X9 to the prefixed one
#- that way, you can talk to :9 without doing a chroot
#- but take care of non X11 install :-)
if (-d "/tmp/.X11-unix") {
symlinkf "$prefix/tmp/.X11-unix/X9", "/tmp/.X11-unix/X9" if $prefix;
} else {
symlinkf "$prefix/tmp/.X11-unix", "/tmp/.X11-unix" if $prefix;
}
#- restart_xfs;
my $f_err = "$prefix/tmp/Xoutput";
my $pid;
unless ($pid = fork) {
open STDERR, ">$f_err";
chroot $prefix if $prefix;
exec $o->{card}{prog},
($o->{card}{prog} !~ /Xsun/ ? ("-xf86config", ($::testing ? $tmpconfig : $f) . ($o->{card}{use_xf4} && "-4")) : ()),
":9" or c::_exit(0);
}
do { sleep 1 } until c::Xtest(":9") || waitpid($pid, c::WNOHANG());
my $b = before_leaving { unlink $f_err };
unless (c::Xtest(":9")) {
local $_;
local *F; open F, $f_err;
i: while (<F>) {
if (/\b(error|not supported)\b/i) {
my @msg = !/error/ && $_ ;
while (<F>) {
/not fatal/ and last i;
/^$/ and last;
push @msg, $_;
}
$in->ask_warn('', [ _("An error has occurred:"), " ", @msg, _("\ntry to change some parameters") ]);
return 0;
}
}
}
local *F;
open F, "|perl" or die '';
print F "use lib qw(", join(' ', @INC), ");\n";
print F q{
use interactive_gtk;
use my_gtk qw(:wrappers);
$ENV{DISPLAY} = ":9";
gtkset_mousecursor_normal();
gtkset_background(200 * 257, 210 * 257, 210 * 257);
my ($h, $w) = Gtk::Gdk::Window->new_foreign(Gtk::Gdk->ROOT_WINDOW)->get_size;
$my_gtk::force_position = [ $w / 3, $h / 2.4 ];
$my_gtk::force_focus = 1;
my $text = Gtk::Label->new;
my $time = 8;
Gtk->timeout_add(1000, sub {
$text->set(_("Leaving in %d seconds", $time));
$time-- or Gtk->main_quit;
});
exit (interactive_gtk->new->ask_yesorno('', [ _("Is this the correct setting?"), $text ], 0) ? 0 : 222);
};
my $rc = close F;
my $err = $?;
unlink "/tmp/.X11-unix/X9" if $prefix;
kill 2, $pid;
$rc || $err == 222 << 8 or $in->ask_warn('', _("An error has occurred, try to change some parameters"));
$rc;
}
sub autoResolutions($;$) {
my ($o, $nowarning) = @_;
my $card = $o->{card};
|