Author: branden
Date: 2004-03-26 19:54:22 -0500 (Fri, 26 Mar 2004)
New Revision: 1194

Added:
   trunk/debian/patches/080_pci_isolate_device_feature.diff
Modified:
   trunk/debian/TODO
   trunk/debian/changelog
   trunk/debian/patches/911_debian_XF86Config_to_XF86Config-4.diff
Log:
Implement IsolateDevice and SingleCard layout options for XF86Config, and
-isolateDev command-line flag for XFree86 X server.  Useful for multi-card
setups where different X servers run on each card (thanks, Andreas
Schuldei).  (Closes: #207543)


Modified: trunk/debian/TODO
===================================================================
--- trunk/debian/TODO   2004-03-26 22:51:05 UTC (rev 1193)
+++ trunk/debian/TODO   2004-03-27 00:54:22 UTC (rev 1194)
@@ -58,14 +58,6 @@
   debconf for /dev/gpmdata port users; make IntelliMouse only choice for
   /dev/gpmdata port, eliminating question
 * Add NEWS item describing package split.  Cover the xlib6g situation.
-* #207543: xserver-xfree86: prefBusID patch to select prefered PCI bus id
-  I think the option should be called something better than "prefBusId",
-  though.  Something that communicates the fact that operations are limited
-  only to a particular bus would be good, which the term "pref[erred]" doesn't.
-  DECISION: "IsolateBus".
-  05:17PM|<stockholm> Overfiend: I swear upon the suckery tentacle of foulest
-  demon spawn that the IsolateBus patch doesn't break anything for people who
-  don't use it!
 * Add FAQ items:
   + How do I debug crashes in X clients?
   + How do I debug crashes in the XFree86 X server?

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2004-03-26 22:51:05 UTC (rev 1193)
+++ trunk/debian/changelog      2004-03-27 00:54:22 UTC (rev 1194)
@@ -80,8 +80,13 @@
     Radeon chipset's memory size is queried, and if zero is returned, the
     chipset is re-POSTed via the int10 interface.  (Closes: #234575)
 
- -- Branden Robinson <[EMAIL PROTECTED]>  Fri, 26 Mar 2004 17:47:47 -0500
+  * Implement IsolateDevice and SingleCard layout options for XF86Config, and
+    -isolateDev command-line flag for XFree86 X server.  Useful for multi-card
+    setups where different X servers run on each card (thanks, Andreas
+    Schuldei).  (Closes: #207543)
 
+ -- Branden Robinson <[EMAIL PROTECTED]>  Fri, 26 Mar 2004 19:51:50 -0500
+
 xfree86 (4.3.0-7) unstable; urgency=medium
 
   * Urgency due to fix for FTBFS.  Yes -- I too am begging for it to stop.

Added: trunk/debian/patches/080_pci_isolate_device_feature.diff
===================================================================
--- trunk/debian/patches/080_pci_isolate_device_feature.diff    2004-03-26 
22:51:05 UTC (rev 1193)
+++ trunk/debian/patches/080_pci_isolate_device_feature.diff    2004-03-27 
00:54:22 UTC (rev 1194)
@@ -0,0 +1,222 @@
+$Id$
+
+Implement IsolateDevice and SingleCard layout options for XF86Config, and
+-isolateDevice command-line flag for XFree86 X server.  Useful for
+multi-card setups where different X servers run on each card.
+
+This patch by Andreas Schuldei and Branden Robinson.
+
+--- xc/programs/Xserver/hw/xfree86/XF86Config.man~     2004-03-26 
18:10:22.000000000 -0500
++++ xc/programs/Xserver/hw/xfree86/XF86Config.man      2004-03-26 
18:53:20.000000000 -0500
+@@ -1592,7 +1592,7 @@
+ section provides information specific to the whole session, including
+ session-specific
+ .BR Options .
+-The
++In addition to options specific to this section (described below), the
+ .B ServerFlags
+ options (described above) may be specified here, and ones given here
+ override those given in the
+@@ -1678,12 +1678,30 @@
+ .RE
+ .TP 7
+ .B Options
+-Any option permitted in the
++In addition to the following, any option permitted in the
+ .B ServerFlags
+ section may also be specified here.  When the same option appears in both
+ places, the value given here overrides the one given in the
+ .B ServerFlags
+ section.
++.TP 7
++.BI "Option \*qIsolateDevice\*q  \*q" bus\-id \*q
++Restrict device resets to the specified
++.IR bus\-id .
++See the
++.B BusID
++option (described in
++.BR "DEVICE SECTION" ,
++above) for the format of the
++.I bus\-id
++parameter.  This option overrides
++.BR SingleCard ,
++if specified.  At present, only PCI devices can be isolated in this manner.
++.TP 7
++.BI "Option \*qSingleCard\*q  \*q" boolean \*q
++As
++.BR IsolateDevice ,
++except that the bus ID of the first device in the layout is used.
+ .PP
+ Here is an example of a
+ .B ServerLayout
+--- xc/programs/Xserver/hw/xfree86/XFree86.man~        2004-03-26 
19:04:30.000000000 -0500
++++ xc/programs/Xserver/hw/xfree86/XFree86.man 2004-03-26 19:10:42.000000000 
-0500
+@@ -192,6 +192,19 @@
+ this are downgraded from fatal errors to warnings.  This option should
+ be used with care.
+ .TP 8
++.B \-isolateDevice \fIbus\-id\fP
++Restrict device resets to the device at
++.IR bus\-id .
++The
++.I bus\-id
++string has the form
++.IB bustype : bus : device : function
++(e.g., \(oqPCI:1:0:0\(cq).
++At present, only isolation of PCI devices is supported; i.e., this option
++is ignored if
++.I bustype
++is anything other than \(oqPCI\(cq.
++.TP 8
+ .B \-keeptty
+ Prevent the server from detaching its initial controlling terminal.
+ This option is only useful when debugging the server.  Not all platforms
+diff -urN xc/programs/Xserver/hw/xfree86/common~/xf86Config.c 
xc/programs/Xserver/hw/xfree86/common/xf86Config.c
+--- xc/programs/Xserver/hw/xfree86/common~/xf86Config.c        2004-03-26 
18:29:19.000000000 -0500
++++ xc/programs/Xserver/hw/xfree86/common/xf86Config.c 2004-03-26 
19:02:42.000000000 -0500
+@@ -1416,6 +1416,20 @@
+     return TRUE;
+ }
+ 
++typedef enum {
++    LAYOUT_ISOLATEDEVICE,
++    LAYOUT_SINGLECARD
++} LayoutValues;
++
++static OptionInfoRec LayoutOptions[] = {
++  { LAYOUT_ISOLATEDEVICE,     "IsolateDevice",        OPTV_STRING,
++      {0}, FALSE },
++  { LAYOUT_SINGLECARD,                "SingleCard",           OPTV_BOOLEAN,
++      {0}, FALSE },
++  { -1,                               NULL,                   OPTV_NONE,
++      {0}, FALSE },
++};
++
+ /*
+  * figure out which layout is active, which screens are used in that layout,
+  * which drivers and monitors are used in these screens
+@@ -2213,6 +2227,8 @@
+     const char *filename;
+     char *searchpath;
+     MessageType from = X_DEFAULT;
++    char *scanptr;
++    Bool singlecard = 0;
+ 
+     if (getuid() == 0)
+       searchpath = ROOT_CONFIGPATH;
+@@ -2283,6 +2299,29 @@
+       }
+     }
+ 
++    xf86ProcessOptions(-1, xf86ConfigLayout.options, LayoutOptions);
++
++    if ((scanptr = xf86GetOptValString(LayoutOptions, LAYOUT_ISOLATEDEVICE))) 
{
++      ; /* IsolateDevice specified; overrides SingleCard */
++    } else {
++      xf86GetOptValBool(LayoutOptions, LAYOUT_SINGLECARD, &singlecard);
++      if (singlecard)
++          scanptr = xf86ConfigLayout.screens->screen->device->busID;
++    }
++    if (scanptr) {
++      int bus, device, func, stroffset = 0;
++      if (strncmp(scanptr, "PCI:", 4) != 0) {
++          xf86Msg(X_WARNING, "Bus types other than PCI not yet isolable.\n"
++                             "\tIgnoring IsolateDevice option.\n");
++      } else if (sscanf(scanptr, "PCI:%d:%d:%d", &bus, &device, &func) == 3) {
++          xf86IsolateDevice.bus = bus;
++          xf86IsolateDevice.device = device;
++          xf86IsolateDevice.func = func;
++          xf86Msg(X_INFO,
++                  "Isolating PCI bus \"%d:%d:%d\"\n", bus, device, func);
++      }
++    }
++
+     /* Now process everything else */
+ 
+     if (!configFiles(xf86configptr->conf_files) ||
+diff -urN xc/programs/Xserver/hw/xfree86/common~/xf86Globals.c 
xc/programs/Xserver/hw/xfree86/common/xf86Globals.c
+--- xc/programs/Xserver/hw/xfree86/common~/xf86Globals.c       2004-03-26 
18:29:19.000000000 -0500
++++ xc/programs/Xserver/hw/xfree86/common/xf86Globals.c        2004-03-26 
18:29:40.000000000 -0500
+@@ -215,6 +215,7 @@
+ #endif
+ PropertyPtr *xf86RegisteredPropertiesTable = NULL;
+ Bool xf86inSuspend = FALSE;
++PciBusId xf86IsolateDevice;
+ 
+ #ifdef DLOPEN_HACK
+ /*
+diff -urN xc/programs/Xserver/hw/xfree86/common~/xf86Init.c 
xc/programs/Xserver/hw/xfree86/common/xf86Init.c
+--- xc/programs/Xserver/hw/xfree86/common~/xf86Init.c  2004-03-26 
18:29:19.000000000 -0500
++++ xc/programs/Xserver/hw/xfree86/common/xf86Init.c   2004-03-26 
19:17:21.000000000 -0500
+@@ -1590,6 +1590,25 @@
+     xf86AllowMouseOpenFail = TRUE;
+     return 1;
+   }
++  if (!strcmp(argv[i], "-isolateDevice"))
++  {
++    int bus, device, func;
++    if (++i >= argc)
++      return 0;
++    if (strncmp(argv[i], "PCI:", 4)) {
++      ErrorF("Bus types other than PCI not yet isolable\n");
++      return 0;
++    }
++    if (sscanf(argv[i], "PCI:%d:%d:%d", &bus, &device, &func) == 3) {
++      xf86IsolateDevice.bus = bus;
++      xf86IsolateDevice.device = device;
++      xf86IsolateDevice.func = func;
++      return 2;
++    } else {
++      ErrorF("Invalid isolated device specifiation\n");
++      return 0;
++    }
++  }
+   /* OS-specific processing */
+   return xf86ProcessArgument(argc, argv, i);
+ }
+@@ -1650,6 +1669,7 @@
+ #endif
+   ErrorF("-bestRefresh           choose modes with the best refresh rate\n");
+   ErrorF("-ignoreABI             make module ABI mismatches non-fatal\n");
++  ErrorF("-isolateDevice bus_id  restrict device resets to bus_id (PCI 
only)\n");
+   ErrorF("-version               show the server version\n");
+   /* OS-specific usage */
+   xf86UseMsg();
+diff -urN xc/programs/Xserver/hw/xfree86/common~/xf86Priv.h 
xc/programs/Xserver/hw/xfree86/common/xf86Priv.h
+--- xc/programs/Xserver/hw/xfree86/common~/xf86Priv.h  2004-03-26 
18:29:19.000000000 -0500
++++ xc/programs/Xserver/hw/xfree86/common/xf86Priv.h   2004-03-26 
18:29:40.000000000 -0500
+@@ -53,6 +53,7 @@
+ extern Gamma xf86Gamma;
+ extern char *xf86ServerName;
+ extern Bool xf86ShowUnresolved;
++extern PciBusId xf86IsolateDevice;
+ 
+ /* Other parameters */
+ 
+diff -urN xc/programs/Xserver/hw/xfree86/common~/xf86pciBus.c 
xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c
+--- xc/programs/Xserver/hw/xfree86/common~/xf86pciBus.c        2004-03-26 
18:29:19.000000000 -0500
++++ xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c 2004-03-26 
19:04:03.000000000 -0500
+@@ -160,7 +160,10 @@
+     int num = 0;
+     pciVideoPtr info;
+     Bool mem64 = FALSE;
++    int DoIsolateDeviceCheck = 0;
+ 
++    if (xf86IsolateDevice.bus || xf86IsolateDevice.device || 
xf86IsolateDevice.func)
++      DoIsolateDeviceCheck = 1;
+     pcrpp = xf86PciInfo = xf86scanpci(0);
+     getPciClassFlags(pcrpp);
+     
+@@ -182,7 +185,11 @@
+           subclass = pcrp->pci_sub_class;
+       }
+       
+-      if (PCIINFOCLASSES(baseclass, subclass)) {
++      if (PCIINFOCLASSES(baseclass, subclass) &&
++          (DoIsolateDeviceCheck ?
++          (xf86IsolateDevice.bus == pcrp->busnum &&
++           xf86IsolateDevice.device == pcrp->devnum &&
++           xf86IsolateDevice.func == pcrp->funcnum) : 1)) {
+           num++;
+           xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo,
+                                         sizeof(pciVideoPtr) * (num + 1));


Property changes on: trunk/debian/patches/080_pci_isolate_device_feature.diff
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/debian/patches/911_debian_XF86Config_to_XF86Config-4.diff
===================================================================
--- trunk/debian/patches/911_debian_XF86Config_to_XF86Config-4.diff     
2004-03-26 22:51:05 UTC (rev 1193)
+++ trunk/debian/patches/911_debian_XF86Config_to_XF86Config-4.diff     
2004-03-27 00:54:22 UTC (rev 1194)
@@ -22,8 +22,8 @@
  for its initial setup.  This configuration file is searched for in the
  following places when the server is started as a normal user:
  .PP
---- xc/programs/Xserver/hw/xfree86/XFree86.man~        2003-08-01 
15:38:34.000000000 -0500
-+++ xc/programs/Xserver/hw/xfree86/XFree86.man 2003-08-01 15:44:02.000000000 
-0500
+--- xc/programs/Xserver/hw/xfree86/XFree86.man~        2004-03-26 
19:34:38.000000000 -0500
++++ xc/programs/Xserver/hw/xfree86/XFree86.man 2004-03-26 19:34:44.000000000 
-0500
 @@ -93,21 +93,24 @@
  Allow the server to start up even if the mouse device can't be opened
  or initialised.  This is equivalent to the
@@ -81,7 +81,7 @@
  .TP 8
  .B \-fbbpp \fIn\fP
  Sets the number of framebuffer bits per pixel.  You should only set this
-@@ -198,7 +204,9 @@
+@@ -211,7 +217,9 @@
  support (or can use) this option.
  .TP 8
  .B \-keyboard \fIkeyboard-name\fP
@@ -92,7 +92,7 @@
  .B InputDevice
  section called
  .I keyboard-name
-@@ -211,7 +219,9 @@
+@@ -224,7 +232,9 @@
  section is used for the core keyboard.
  .TP 8
  .B \-layout \fIlayout-name\fP
@@ -103,7 +103,7 @@
  .B Layout
  section called
  .IR layout-name .
-@@ -258,17 +268,21 @@
+@@ -271,17 +281,21 @@
  pixmap format, even though it is a perfectly legal format.
  This is equvalent to the
  .B Pixmap
@@ -128,7 +128,7 @@
  .B InputDevice
  section called
  .I pointer-name
-@@ -304,7 +318,9 @@
+@@ -317,7 +331,9 @@
  scanpci(1) and pcitweak(1).
  .TP 8
  .B \-screen \fIscreen-name\fP
@@ -139,7 +139,7 @@
  .B Screen
  section called
  .IR screen-name .
-@@ -363,7 +379,9 @@
+@@ -376,7 +392,9 @@
  is used to recognize the special key combinations, see
  the documentation on the
  .B HandleSpecialKeys
@@ -150,7 +150,7 @@
  .PP
  The special combinations of key presses recognized directly
  by \fIXFree86\fP are:
-@@ -372,24 +390,28 @@
+@@ -385,24 +403,28 @@
  Immediately kills the server -- no questions asked.  This can be disabled
  with the
  .B DontZap
@@ -183,7 +183,7 @@
  kills clients with an active keyboard or mouse grab as well as killing any
  application that may have locked the server, normally using the
  XGrabServer(__libmansuffix__) Xlib function.
-@@ -397,7 +419,8 @@
+@@ -410,7 +432,8 @@
  .B Ctrl+Alt+Keypad-Divide
  Not treated specially by default.  If the
  .B AllowDeactivateGrabs
@@ -193,7 +193,7 @@
  deactivates any active keyboard and mouse grabs.
  .TP 8
  .B Ctrl+Alt+F1...F12
-@@ -405,18 +428,20 @@
+@@ -418,18 +441,20 @@
  combinations are used to switch to virtual terminals 1 through 12,
  respectively.  This can be disabled with the
  .B DontVTSwitch
@@ -217,7 +217,7 @@
  manual page.  The most commonly used locations are shown here.
  .TP 30
  /etc/X11/XF86Config
-@@ -465,7 +490,7 @@
+@@ -478,7 +503,7 @@
  Initial access control list for display \fIn\fP
  .SH "SEE ALSO"
  X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1),

Reply via email to