xfree86: "Staticize" functions in xf86AutoConfig.c
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
This commit is contained in:
parent
7c6b5458de
commit
1e1dbd1e46
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue
Block a user