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:
@@ -352,21 +352,22 @@ static struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static nv_settings current_settings = { // see comments in nv.settings
|
static nv_settings current_settings = { // see comments in nv.settings
|
||||||
// for driver
|
/* for driver */
|
||||||
DRIVER_PREFIX ".accelerant",
|
DRIVER_PREFIX ".accelerant",
|
||||||
false, // dumprom
|
"none", // primary
|
||||||
// for accelerant
|
false, // dumprom
|
||||||
0x00000000, // logmask
|
/* for accelerant */
|
||||||
0, // memory
|
0x00000000, // logmask
|
||||||
0, // tv_output
|
0, // memory
|
||||||
true, // usebios
|
0, // tv_output
|
||||||
true, // hardcursor
|
true, // usebios
|
||||||
false, // switchhead
|
true, // hardcursor
|
||||||
false, // force_pci
|
false, // switchhead
|
||||||
false, // unhide_fw
|
false, // force_pci
|
||||||
true, // pgm_panel
|
false, // unhide_fw
|
||||||
true, // dma_acc
|
true, // pgm_panel
|
||||||
false, // vga_on_tv
|
true, // dma_acc
|
||||||
|
false, // vga_on_tv
|
||||||
};
|
};
|
||||||
|
|
||||||
static void dumprom (void *rom, uint32 size, pci_info pcii)
|
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)) {
|
if ((strlen (item) > 0) && (strlen (item) < sizeof (current_settings.accelerant) - 1)) {
|
||||||
strcpy (current_settings.accelerant, item);
|
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);
|
current_settings.dumprom = get_driver_boolean_parameter (settings_handle, "dumprom", false, false);
|
||||||
|
|
||||||
// for accelerant
|
// for accelerant
|
||||||
@@ -781,6 +786,7 @@ static void probe_devices(void) {
|
|||||||
uint32 pci_index = 0;
|
uint32 pci_index = 0;
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
device_info *di = pd->di;
|
device_info *di = pd->di;
|
||||||
|
char tmp_name[B_OS_NAME_LENGTH];
|
||||||
|
|
||||||
/* while there are more pci devices */
|
/* while there are more pci devices */
|
||||||
while ((count < MAX_DEVICES) && ((*pci_bus->get_nth_pci_info)(pci_index, &(di->pcii)) == B_NO_ERROR)) {
|
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 we match a supported device */
|
||||||
if (*devices == di->pcii.device_id ) {
|
if (*devices == di->pcii.device_id ) {
|
||||||
/* publish the device name */
|
/* 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.vendor_id, di->pcii.device_id,
|
||||||
di->pcii.bus, di->pcii.device, di->pcii.function);
|
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 */
|
/* remember the name */
|
||||||
pd->device_names[count] = di->name;
|
pd->device_names[count] = di->name;
|
||||||
/* mark the driver as available for R/W open */
|
/* mark the driver as available for R/W open */
|
||||||
|
|||||||
@@ -4,17 +4,18 @@
|
|||||||
# ~/config/settings/kernel/drivers/
|
# ~/config/settings/kernel/drivers/
|
||||||
#
|
#
|
||||||
|
|
||||||
# nv.driver parameters
|
# nv.driver parameters:
|
||||||
# accelerant "nv.accelerant"
|
# 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
|
usebios true # if true rely on bios to coldstart the card
|
||||||
#memory 2 # in MB, override builtin memory size detection
|
#memory 2 # in MB, override builtin memory size detection
|
||||||
hardcursor true # if true use on-chip cursor capabilities
|
hardcursor true # if true use on-chip cursor capabilities
|
||||||
#logmask 0x00000000 # nothing logged, is default
|
#logmask 0x00000000 # nothing logged, is default
|
||||||
#logmask 0x08000604 # log overlay use in full
|
#logmask 0x08000604 # log overlay use in full to file (in home folder)
|
||||||
#logmask 0xffffffff # log everything
|
#logmask 0xffffffff # log everything to file (in home folder)
|
||||||
dumprom false # dump bios rom in ~/nv.rom
|
|
||||||
switchhead false # switch head assignment (dualhead cards only)
|
switchhead false # switch head assignment (dualhead cards only)
|
||||||
force_pci false # block AGP mode use if true (AGP 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)
|
dma_acc true # if true enable DMA cmd fetching for 2D acc (instead of using PIO)
|
||||||
|
|||||||
Reference in New Issue
Block a user