diff options
Diffstat (limited to 'xorg-server/hw/xfree86')
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86Bus.c | 3 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86Xinput.h | 5 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86platformBus.c | 22 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86platformBus.h | 1 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/os-support/bsd/ppc_video.c | 2 |
5 files changed, 26 insertions, 7 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Bus.c b/xorg-server/hw/xfree86/common/xf86Bus.c index b3b3f8cc5..bd3e4e37b 100644 --- a/xorg-server/hw/xfree86/common/xf86Bus.c +++ b/xorg-server/hw/xfree86/common/xf86Bus.c @@ -210,6 +210,9 @@ xf86BusProbe(void) #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) xf86SbusProbe(); #endif +#ifdef XSERVER_PLATFORM_BUS + xf86platformPrimary(); +#endif } /* diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.h b/xorg-server/hw/xfree86/common/xf86Xinput.h index 9fe8c87b6..66a64fb48 100644 --- a/xorg-server/hw/xfree86/common/xf86Xinput.h +++ b/xorg-server/hw/xfree86/common/xf86Xinput.h @@ -51,6 +51,7 @@ #ifndef _xf86Xinput_h #define _xf86Xinput_h +#include "xf86.h" #include "xf86str.h" #include "inputstr.h" #include <X11/extensions/XI.h> @@ -85,7 +86,7 @@ typedef struct _InputDriverRec { /* This is to input devices what the ScrnInfoRec is to screens. */ -typedef struct _InputInfoRec { +struct _InputInfoRec { struct _InputInfoRec *next; char *name; char *driver; @@ -110,7 +111,7 @@ typedef struct _InputInfoRec { void *module; XF86OptionPtr options; InputAttributes *attrs; -} *InputInfoPtr; +}; /* xf86Globals.c */ extern InputInfoPtr xf86InputDevs; diff --git a/xorg-server/hw/xfree86/common/xf86platformBus.c b/xorg-server/hw/xfree86/common/xf86platformBus.c index 946039940..5ad9b7080 100644 --- a/xorg-server/hw/xfree86/common/xf86platformBus.c +++ b/xorg-server/hw/xfree86/common/xf86platformBus.c @@ -435,10 +435,9 @@ xf86platformProbeDev(DriverPtr drvp) /* for non-seat0 servers assume first device is the master */ if (ServerIsNotSeat0()) break; - if (xf86_platform_devices[j].pdev) { - if (xf86IsPrimaryPlatform(&xf86_platform_devices[j])) - break; - } + + if (xf86IsPrimaryPlatform(&xf86_platform_devices[j])) + break; } } @@ -594,4 +593,19 @@ void xf86platformVTProbe(void) xf86PlatformReprobeDevice(i, xf86_platform_devices[i].attribs); } } + +void xf86platformPrimary(void) +{ + /* use the first platform device as a fallback */ + if (primaryBus.type == BUS_NONE) { + xf86Msg(X_INFO, "no primary bus or device found\n"); + + if (xf86_num_platform_devices > 0) { + primaryBus.id.plat = &xf86_platform_devices[0]; + primaryBus.type = BUS_PLATFORM; + + xf86Msg(X_NONE, "\tfalling back to %s\n", primaryBus.id.plat->attribs->syspath); + } + } +} #endif diff --git a/xorg-server/hw/xfree86/common/xf86platformBus.h b/xorg-server/hw/xfree86/common/xf86platformBus.h index 317dd24d5..a7335b9da 100644 --- a/xorg-server/hw/xfree86/common/xf86platformBus.h +++ b/xorg-server/hw/xfree86/common/xf86platformBus.h @@ -155,6 +155,7 @@ extern _X_EXPORT int xf86PlatformMatchDriver(char *matches[], int nmatches); extern void xf86platformVTProbe(void); +extern void xf86platformPrimary(void); #endif #endif diff --git a/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c b/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c index 947a68678..3fd28c3b5 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c +++ b/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c @@ -76,7 +76,7 @@ ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) (flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE), MAP_SHARED, fd, Base); if (base == MAP_FAILED) - FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)", + FatalError("%s: could not mmap screen [s=%lx,a=%lx] (%s)", "xf86MapVidMem", Size, Base, strerror(errno)); return base; |