diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index bc4c80bad..ac40ab35c 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -271,7 +271,7 @@ xf86AutoConfig(void) return (ret == CONFIG_OK); } -int +static int xchomp(char *line) { size_t len = 0; @@ -287,46 +287,6 @@ xchomp(char *line) return 0; } -GDevPtr -autoConfigDevice(GDevPtr preconf_device) -{ - GDevPtr ptr = NULL; - - if (!xf86configptr) { - return NULL; - } - - /* If there's a configured section with no driver chosen, use it */ - if (preconf_device) { - ptr = preconf_device; - } else { - ptr = xcalloc(1, sizeof(GDevRec)); - if (!ptr) { - return NULL; - } - ptr->chipID = -1; - ptr->chipRev = -1; - ptr->irq = -1; - - ptr->active = TRUE; - ptr->claimed = FALSE; - ptr->identifier = "Autoconfigured Video Device"; - ptr->driver = NULL; - } - if (!ptr->driver) { - ptr->driver = chooseVideoDriver(); - } - - /* TODO Handle multiple screen sections */ - if (xf86ConfigLayout.screens && !xf86ConfigLayout.screens->screen->device) { - xf86ConfigLayout.screens->screen->device = ptr; - ptr->myScreenSection = xf86ConfigLayout.screens->screen; - } - xf86Msg(X_DEFAULT, "Assigned the driver to the xf86ConfigLayout\n"); - - return ptr; -} - #ifdef __linux__ /* This function is used to provide a workaround for binary drivers that * don't export their PCI ID's properly. If distros don't end up using this @@ -531,7 +491,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) } } -char* +static char* chooseVideoDriver(void) { char *chosen_driver = NULL; @@ -554,3 +514,43 @@ chooseVideoDriver(void) return chosen_driver; } + +GDevPtr +autoConfigDevice(GDevPtr preconf_device) +{ + GDevPtr ptr = NULL; + + if (!xf86configptr) { + return NULL; + } + + /* If there's a configured section with no driver chosen, use it */ + if (preconf_device) { + ptr = preconf_device; + } else { + ptr = xcalloc(1, sizeof(GDevRec)); + if (!ptr) { + return NULL; + } + ptr->chipID = -1; + ptr->chipRev = -1; + ptr->irq = -1; + + ptr->active = TRUE; + ptr->claimed = FALSE; + ptr->identifier = "Autoconfigured Video Device"; + ptr->driver = NULL; + } + if (!ptr->driver) { + ptr->driver = chooseVideoDriver(); + } + + /* TODO Handle multiple screen sections */ + if (xf86ConfigLayout.screens && !xf86ConfigLayout.screens->screen->device) { + xf86ConfigLayout.screens->screen->device = ptr; + ptr->myScreenSection = xf86ConfigLayout.screens->screen; + } + xf86Msg(X_DEFAULT, "Assigned the driver to the xf86ConfigLayout\n"); + + return ptr; +} diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h index 53188941f..de287041a 100644 --- a/hw/xfree86/common/xf86Config.h +++ b/hw/xfree86/common/xf86Config.h @@ -68,7 +68,5 @@ ConfigStatus xf86HandleConfigFile(Bool); Bool xf86AutoConfig(void); GDevPtr autoConfigDevice(GDevPtr preconf_device); -char* chooseVideoDriver(void); -int xchomp(char *line); #endif /* _xf86_config_h */