From: <Aiv...@un...> - 2003-04-07 09:03:25
|
Hi all, Previous xf86 hack may be is ugly, but works for me long time. Blank screen, then user type Ctrl-Alt-Fx, realy dont like me, and possible don't like others concurent X's users. I test same "hack" versions again. When X server do not see in PCI devices list neighbourhood video adapter, then it do no try disable unused video adapters. So , we should restrict video adapters visibility for runing X servers. Fortunately all info about video adapters colected in one xf86 function FindPCIVideoInfo(void) and one time during xf86 initialization. Now FindPCIVideoInfo(void) body is changed and xf86 can see only video adapter specified with additional parameter -prefbusid (This mean "preferred PCI bus identifier"). startx -- -prefbusid 1:0:0 now will use only AGP adapter. Without this parameter xf86 is unchanged. Advantages against old multihead "hack": 1) user can use Linux text mode Virtual Consoles. 2) AGP server now is restartable (at least for Nvidia). Disadvantages: User cannot use text mode console during secondary xf86 init. secondary xf86 cannot be started from VC ! Howto restore VGA fonts: Ctrl-Alt-F1 -- show garbage on screen Ctrl-F7 -- switch back to xf86 Ctrl-Alt-F1 -- to text mode console, now standard look. Garbage pop up only , than user 1-st time switch to text mode. After 1-st switch console and xf86 can be changed any times, until secondary xf86 do full restart. I cannot undestand why libint10.a clean up VGA fonts. Real, unreal, protected CPU modes is strange for me. Actualy libint10.a is perpretrator. If user try switch to VC during 2-nd xf86 initialization, then VC show 2-nd video adapter boot message and system hung up. Seems libint10.a need legacy VGA. xf86 startting order: 1-st must be started xf86 over primary (VGA) video adapter. xf86 store VGA fonts internal. 2-nd may start any xf86 wich use secondary adapter. xf86 stopping oder: 1-st must be stopped all secondary xf86 servers. last must be stopped xf86 over VGA. this xf86 should restore VGA fonts. If VGA fonts are not restored may be used "/bin/consolechars -d" - I add this command in my desktop manager start/stop script. Reverse xf86 stopping order used by gdm, but oft VGA fonts are not restored and I add "consolechars -d". Of course international user should restore their national fonts. I have troubles with my bunch of Nvidia. I can start xf86 servers only in one order 0:11:0, 0:9:0, 1:0:0. To go around the ban I start xf86: X -probeonly -layout X2 X -probeonly -layout X1 startx -- X0 :0 -layout X0 -prefbusid 1:0:0 vt7 startx -- X1 :1 -layout X1 -prefbusid 0:9:0 vt16 startx -- X2 :2 -layout X2 -prefbusid 0:11:0 vt8 This is Nvidia specific feature/bug. (driver version 1.0-4349) file: http://startx.times.lv/xf86-430-prefbusid.diff text: diff -Nurp xc/programs/Xserver/hw/xfree86/common/xf86Globals.c xc-chg-prefbusid/programs/Xserver/hw/xfree86/common/xf86Globals.c --- xc/programs/Xserver/hw/xfree86/common/xf86Globals.c 2003-02-20 04:05:14.000000000 +0000 +++ xc-chg-prefbusid/programs/Xserver/hw/xfree86/common/xf86Globals.c 2003-04-01 16:28:14.000000000 +0100 @@ -215,6 +215,7 @@ Bool xf86MiscModInDevAllowNonLocal = FAL #endif PropertyPtr *xf86RegisteredPropertiesTable = NULL; Bool xf86inSuspend = FALSE; +PciBusId xf86PrefBusId; #ifdef DLOPEN_HACK /* diff -Nurp xc/programs/Xserver/hw/xfree86/common/xf86Init.c xc-chg-prefbusid/programs/Xserver/hw/xfree86/common/xf86Init.c --- xc/programs/Xserver/hw/xfree86/common/xf86Init.c 2003-02-26 09:21:38.000000000 +0000 +++ xc-chg-prefbusid/programs/Xserver/hw/xfree86/common/xf86Init.c 2003-04-01 17:54:13.000000000 +0100 @@ -1553,6 +1553,24 @@ ddxProcessArgument(int argc, char **argv xf86AllowMouseOpenFail = TRUE; return 1; } + if (!strcmp(argv[i], "-prefbusid")) + { + int bus, device, func; + if (++i >= argc) + return 0; + if (sscanf(argv[i], "%d:%d:%d", &bus, &device, &func) == 3) + { + xf86PrefBusId.bus = bus; + xf86PrefBusId.device = device; + xf86PrefBusId.func = func; + return 2; + } + else + { + ErrorF("Invalid preferred PCI BusId\n"); + return 0; + } + } /* OS-specific processing */ return xf86ProcessArgument(argc, argv, i); } diff -Nurp xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c xc-chg-prefbusid/programs/Xserver/hw/xfree86/common/xf86pciBus.c --- xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c 2003-02-18 15:42:11.000000000 +0000 +++ xc-chg-prefbusid/programs/Xserver/hw/xfree86/common/xf86pciBus.c 2003-04-01 17:29:10.000000000 +0100 @@ -160,7 +160,10 @@ FindPCIVideoInfo(void) int num = 0; pciVideoPtr info; Bool mem64 = FALSE; + int DoPrefBusIdCheck = 0; + if( xf86PrefBusId.bus || xf86PrefBusId.device || xf86PrefBusId.func ) + DoPrefBusIdCheck = 1; pcrpp = xf86PciInfo = xf86scanpci(0); getPciClassFlags(pcrpp); @@ -182,7 +185,11 @@ FindPCIVideoInfo(void) subclass = pcrp->pci_sub_class; } - if (PCIINFOCLASSES(baseclass, subclass)) { + if (PCIINFOCLASSES(baseclass, subclass) && + (DoPrefBusIdCheck ? + (xf86PrefBusId.bus == pcrp->busnum && + xf86PrefBusId.device == pcrp->devnum && + xf86PrefBusId.func == pcrp->funcnum):1)) { num++; xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo, sizeof(pciVideoPtr) * (num + 1)); diff -Nurp xc/programs/Xserver/hw/xfree86/common/xf86Priv.h xc-chg-prefbusid/programs/Xserver/hw/xfree86/common/xf86Priv.h --- xc/programs/Xserver/hw/xfree86/common/xf86Priv.h 2002-12-12 18:29:10.000000000 +0000 +++ xc-chg-prefbusid/programs/Xserver/hw/xfree86/common/xf86Priv.h 2003-04-01 16:28:42.000000000 +0100 @@ -53,6 +53,7 @@ extern Bool xf86BestRefresh; extern Gamma xf86Gamma; extern char *xf86ServerName; extern Bool xf86ShowUnresolved; +extern PciBusId xf86PrefBusId; /* Other parameters */ Please replay if I gibber and please replay if You done. Aivils Stoss p.s. ISA and VLB adapters stay untested :-) |