added new nv.setting to let the driver force a certain card to be used as primary in a system with multiple cards. The card in question gets a minus (-) before it's actual name so it's listed at the top in the /dev/graphics/ folder. It's a hack, but it's handy to have for now.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15185 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen 2005-11-27 10:32:08 +00:00
parent 38f6264454
commit 49a89482a7
2 changed files with 35 additions and 22 deletions

View File

@ -352,21 +352,22 @@ static struct {
};
static nv_settings current_settings = { // see comments in nv.settings
// for driver
/* for driver */
DRIVER_PREFIX ".accelerant",
false, // dumprom
// for accelerant
0x00000000, // logmask
0, // memory
0, // tv_output
true, // usebios
true, // hardcursor
false, // switchhead
false, // force_pci
false, // unhide_fw
true, // pgm_panel
true, // dma_acc
false, // vga_on_tv
"none", // primary
false, // dumprom
/* for accelerant */
0x00000000, // logmask
0, // memory
0, // tv_output
true, // usebios
true, // hardcursor
false, // switchhead
false, // force_pci
false, // unhide_fw
true, // pgm_panel
true, // dma_acc
false, // vga_on_tv
};
static void dumprom (void *rom, uint32 size, pci_info pcii)
@ -490,6 +491,10 @@ init_driver(void) {
if ((strlen (item) > 0) && (strlen (item) < sizeof (current_settings.accelerant) - 1)) {
strcpy (current_settings.accelerant, item);
}
item = get_driver_parameter (settings_handle, "primary", "", "");
if ((strlen (item) > 0) && (strlen (item) < sizeof (current_settings.primary) - 1)) {
strcpy (current_settings.primary, item);
}
current_settings.dumprom = get_driver_boolean_parameter (settings_handle, "dumprom", false, false);
// for accelerant
@ -781,6 +786,7 @@ static void probe_devices(void) {
uint32 pci_index = 0;
uint32 count = 0;
device_info *di = pd->di;
char tmp_name[B_OS_NAME_LENGTH];
/* while there are more pci devices */
while ((count < MAX_DEVICES) && ((*pci_bus->get_nth_pci_info)(pci_index, &(di->pcii)) == B_NO_ERROR)) {
@ -795,10 +801,16 @@ static void probe_devices(void) {
/* if we match a supported device */
if (*devices == di->pcii.device_id ) {
/* publish the device name */
sprintf(di->name, "graphics/" DEVICE_FORMAT,
sprintf(tmp_name, DEVICE_FORMAT,
di->pcii.vendor_id, di->pcii.device_id,
di->pcii.bus, di->pcii.device, di->pcii.function);
/* tweak the exported name to show first in the alphabetically ordered /dev/
* hierarchy folder, so the system will use it as primary adaptor if requested
* via nv.settings. */
if (strcmp(tmp_name, current_settings.primary) == 0)
sprintf(tmp_name, "-%s", current_settings.primary);
/* add /dev/ hierarchy path */
sprintf(di->name, "graphics/%s", tmp_name);
/* remember the name */
pd->device_names[count] = di->name;
/* mark the driver as available for R/W open */

View File

@ -4,17 +4,18 @@
# ~/config/settings/kernel/drivers/
#
# nv.driver parameters
# accelerant "nv.accelerant"
# nv.driver parameters:
# accelerant "nv.accelerant" # if enabled selects accelerant filename to be used
#primary "10de_0110_000000" # if enabled selects device to be used as primary device ('hack')
dumprom false # dump bios rom to file (in home folder)
# nv.accelerant parameters
# nv.accelerant parameters:
usebios true # if true rely on bios to coldstart the card
#memory 2 # in MB, override builtin memory size detection
hardcursor true # if true use on-chip cursor capabilities
#logmask 0x00000000 # nothing logged, is default
#logmask 0x08000604 # log overlay use in full
#logmask 0xffffffff # log everything
dumprom false # dump bios rom in ~/nv.rom
#logmask 0x08000604 # log overlay use in full to file (in home folder)
#logmask 0xffffffff # log everything to file (in home folder)
switchhead false # switch head assignment (dualhead cards only)
force_pci false # block AGP mode use if true (AGP cards only)
dma_acc true # if true enable DMA cmd fetching for 2D acc (instead of using PIO)