Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 65304 | Differences between
and this patch

Collapse All | Expand All

(-)xc/programs/Xserver/hw/xfree86/xorg.conf.man~ (-2 / +20 lines)
Lines 1592-1598 Link Here
1592
section provides information specific to the whole session, including
1592
section provides information specific to the whole session, including
1593
session-specific
1593
session-specific
1594
.BR Options .
1594
.BR Options .
1595
The
1595
In addition to options specific to this section (described below), the
1596
.B ServerFlags
1596
.B ServerFlags
1597
options (described above) may be specified here, and ones given here
1597
options (described above) may be specified here, and ones given here
1598
override those given in the
1598
override those given in the
Lines 1678-1689 Link Here
1678
.RE
1678
.RE
1679
.TP 7
1679
.TP 7
1680
.B Options
1680
.B Options
1681
Any option permitted in the
1681
In addition to the following, any option permitted in the
1682
.B ServerFlags
1682
.B ServerFlags
1683
section may also be specified here.  When the same option appears in both
1683
section may also be specified here.  When the same option appears in both
1684
places, the value given here overrides the one given in the
1684
places, the value given here overrides the one given in the
1685
.B ServerFlags
1685
.B ServerFlags
1686
section.
1686
section.
1687
.TP 7
1688
.BI "Option \*qIsolateDevice\*q  \*q" bus\-id \*q
1689
Restrict device resets to the specified
1690
.IR bus\-id .
1691
See the
1692
.B BusID
1693
option (described in
1694
.BR "DEVICE SECTION" ,
1695
above) for the format of the
1696
.I bus\-id
1697
parameter.  This option overrides
1698
.BR SingleCard ,
1699
if specified.  At present, only PCI devices can be isolated in this manner.
1700
.TP 7
1701
.BI "Option \*qSingleCard\*q  \*q" boolean \*q
1702
As
1703
.BR IsolateDevice ,
1704
except that the bus ID of the first device in the layout is used.
1687
.PP
1705
.PP
1688
Here is an example of a
1706
Here is an example of a
1689
.B ServerLayout
1707
.B ServerLayout
(-)xc/programs/Xserver/hw/xfree86/Xorg.man~ (+13 lines)
Lines 192-197 Link Here
192
this are downgraded from fatal errors to warnings.  This option should
192
this are downgraded from fatal errors to warnings.  This option should
193
be used with care.
193
be used with care.
194
.TP 8
194
.TP 8
195
.B \-isolateDevice \fIbus\-id\fP
196
Restrict device resets to the device at
197
.IR bus\-id .
198
The
199
.I bus\-id
200
string has the form
201
.IB bustype : bus : device : function
202
(e.g., \(oqPCI:1:0:0\(cq).
203
At present, only isolation of PCI devices is supported; i.e., this option
204
is ignored if
205
.I bustype
206
is anything other than \(oqPCI\(cq.
207
.TP 8
195
.B \-keeptty
208
.B \-keeptty
196
Prevent the server from detaching its initial controlling terminal.
209
Prevent the server from detaching its initial controlling terminal.
197
This option is only useful when debugging the server.  Not all platforms
210
This option is only useful when debugging the server.  Not all platforms
(-)xc/programs/Xserver/hw/xfree86/common~/xf86Config.c (+39 lines)
Lines 1416-1421 Link Here
1416
    return TRUE;
1416
    return TRUE;
1417
}
1417
}
1418
1418
1419
typedef enum {
1420
    LAYOUT_ISOLATEDEVICE,
1421
    LAYOUT_SINGLECARD
1422
} LayoutValues;
1423
1424
static OptionInfoRec LayoutOptions[] = {
1425
  { LAYOUT_ISOLATEDEVICE,	"IsolateDevice",	OPTV_STRING,
1426
	{0}, FALSE },
1427
  { LAYOUT_SINGLECARD,		"SingleCard",		OPTV_BOOLEAN,
1428
	{0}, FALSE },
1429
  { -1,				NULL,			OPTV_NONE,
1430
	{0}, FALSE },
1431
};
1432
1419
/*
1433
/*
1420
 * figure out which layout is active, which screens are used in that layout,
1434
 * figure out which layout is active, which screens are used in that layout,
1421
 * which drivers and monitors are used in these screens
1435
 * which drivers and monitors are used in these screens
Lines 2213-2218 Link Here
2213
    const char *filename;
2227
    const char *filename;
2214
    char *searchpath;
2228
    char *searchpath;
2215
    MessageType from = X_DEFAULT;
2229
    MessageType from = X_DEFAULT;
2230
    char *scanptr;
2231
    Bool singlecard = 0;
2216
2232
2217
    if (getuid() == 0)
2233
    if (getuid() == 0)
2218
	searchpath = ROOT_CONFIGPATH;
2234
	searchpath = ROOT_CONFIGPATH;
Lines 2283-2288 Link Here
2283
	}
2299
	}
2284
    }
2300
    }
2285
2301
2302
    xf86ProcessOptions(-1, xf86ConfigLayout.options, LayoutOptions);
2303
2304
    if ((scanptr = xf86GetOptValString(LayoutOptions, LAYOUT_ISOLATEDEVICE))) {
2305
	; /* IsolateDevice specified; overrides SingleCard */
2306
    } else {
2307
	xf86GetOptValBool(LayoutOptions, LAYOUT_SINGLECARD, &singlecard);
2308
	if (singlecard)
2309
	    scanptr = xf86ConfigLayout.screens->screen->device->busID;
2310
    }
2311
    if (scanptr) {
2312
	int bus, device, func, stroffset = 0;
2313
	if (strncmp(scanptr, "PCI:", 4) != 0) {
2314
	    xf86Msg(X_WARNING, "Bus types other than PCI not yet isolable.\n"
2315
			       "\tIgnoring IsolateDevice option.\n");
2316
	} else if (sscanf(scanptr, "PCI:%d:%d:%d", &bus, &device, &func) == 3) {
2317
	    xf86IsolateDevice.bus = bus;
2318
	    xf86IsolateDevice.device = device;
2319
	    xf86IsolateDevice.func = func;
2320
	    xf86Msg(X_INFO,
2321
		    "Isolating PCI bus \"%d:%d:%d\"\n", bus, device, func);
2322
	}
2323
    }
2324
2286
    /* Now process everything else */
2325
    /* Now process everything else */
2287
2326
2288
    if (!configFiles(xf86configptr->conf_files) ||
2327
    if (!configFiles(xf86configptr->conf_files) ||
(-)xc/programs/Xserver/hw/xfree86/common~/xf86Globals.c (+1 lines)
Lines 215-220 Link Here
215
#endif
215
#endif
216
PropertyPtr *xf86RegisteredPropertiesTable = NULL;
216
PropertyPtr *xf86RegisteredPropertiesTable = NULL;
217
Bool xf86inSuspend = FALSE;
217
Bool xf86inSuspend = FALSE;
218
PciBusId xf86IsolateDevice;
218
219
219
#ifdef DLOPEN_HACK
220
#ifdef DLOPEN_HACK
220
/*
221
/*
(-)xc/programs/Xserver/hw/xfree86/common~/xf86Init.c (+20 lines)
Lines 1590-1595 Link Here
1590
    xf86AllowMouseOpenFail = TRUE;
1590
    xf86AllowMouseOpenFail = TRUE;
1591
    return 1;
1591
    return 1;
1592
  }
1592
  }
1593
  if (!strcmp(argv[i], "-isolateDevice"))
1594
  {
1595
    int bus, device, func;
1596
    if (++i >= argc)
1597
	return 0;
1598
    if (strncmp(argv[i], "PCI:", 4)) {
1599
	ErrorF("Bus types other than PCI not yet isolable\n");
1600
	return 0;
1601
    }
1602
    if (sscanf(argv[i], "PCI:%d:%d:%d", &bus, &device, &func) == 3) {
1603
	xf86IsolateDevice.bus = bus;
1604
	xf86IsolateDevice.device = device;
1605
	xf86IsolateDevice.func = func;
1606
	return 2;
1607
    } else {
1608
	ErrorF("Invalid isolated device specifiation\n");
1609
	return 0;
1610
    }
1611
  }
1593
  /* OS-specific processing */
1612
  /* OS-specific processing */
1594
  return xf86ProcessArgument(argc, argv, i);
1613
  return xf86ProcessArgument(argc, argv, i);
1595
}
1614
}
Lines 1650-1655 Link Here
1650
#endif
1669
#endif
1651
  ErrorF("-bestRefresh           choose modes with the best refresh rate\n");
1670
  ErrorF("-bestRefresh           choose modes with the best refresh rate\n");
1652
  ErrorF("-ignoreABI             make module ABI mismatches non-fatal\n");
1671
  ErrorF("-ignoreABI             make module ABI mismatches non-fatal\n");
1672
  ErrorF("-isolateDevice bus_id  restrict device resets to bus_id (PCI only)\n");
1653
  ErrorF("-version               show the server version\n");
1673
  ErrorF("-version               show the server version\n");
1654
  /* OS-specific usage */
1674
  /* OS-specific usage */
1655
  xf86UseMsg();
1675
  xf86UseMsg();
(-)xc/programs/Xserver/hw/xfree86/common~/xf86Priv.h (+1 lines)
Lines 53-58 Link Here
53
extern Gamma xf86Gamma;
53
extern Gamma xf86Gamma;
54
extern char *xf86ServerName;
54
extern char *xf86ServerName;
55
extern Bool xf86ShowUnresolved;
55
extern Bool xf86ShowUnresolved;
56
extern PciBusId xf86IsolateDevice;
56
57
57
/* Other parameters */
58
/* Other parameters */
58
59
(-)xc/programs/Xserver/hw/xfree86/common~/xf86pciBus.c (-1 / +8 lines)
Lines 160-166 Link Here
160
    int num = 0;
160
    int num = 0;
161
    pciVideoPtr info;
161
    pciVideoPtr info;
162
    Bool mem64 = FALSE;
162
    Bool mem64 = FALSE;
163
    int DoIsolateDeviceCheck = 0;
163
164
165
    if (xf86IsolateDevice.bus || xf86IsolateDevice.device || xf86IsolateDevice.func)
166
	DoIsolateDeviceCheck = 1;
164
    pcrpp = xf86PciInfo = xf86scanpci(0);
167
    pcrpp = xf86PciInfo = xf86scanpci(0);
165
    getPciClassFlags(pcrpp);
168
    getPciClassFlags(pcrpp);
166
    
169
    
Lines 182-188 Link Here
182
	    subclass = pcrp->pci_sub_class;
185
	    subclass = pcrp->pci_sub_class;
183
	}
186
	}
184
	
187
	
185
	if (PCIINFOCLASSES(baseclass, subclass)) {
188
	if (PCIINFOCLASSES(baseclass, subclass) &&
189
	    (DoIsolateDeviceCheck ?
190
	    (xf86IsolateDevice.bus == pcrp->busnum &&
191
	     xf86IsolateDevice.device == pcrp->devnum &&
192
	     xf86IsolateDevice.func == pcrp->funcnum) : 1)) {
186
	    num++;
193
	    num++;
187
	    xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo,
194
	    xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo,
188
					  sizeof(pciVideoPtr) * (num + 1));
195
					  sizeof(pciVideoPtr) * (num + 1));

Return to bug 65304