diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-02-19 21:53:31 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-02-19 21:53:31 +0000 |
commit | ea6875b9490bb5acb288aa27c915ea1ec7a85cd6 (patch) | |
tree | c816868f7dd3aae316e77ee71094c7247085ca5e /xserver/hw | |
parent | e647bdbae7a31c0b6f2af81b95781ee7c19d4221 (diff) |
Add code to choose a video driver based on the wscons(4) display type. Makes
it possible to run X without a configuration file on (some) sparc64 machines
and perhaps other machines that use wscons(4) frame buffers.
ok matthieu@
Diffstat (limited to 'xserver/hw')
-rw-r--r-- | xserver/hw/xfree86/common/xf86AutoConfig.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/xserver/hw/xfree86/common/xf86AutoConfig.c b/xserver/hw/xfree86/common/xf86AutoConfig.c index 7e5fab412..f613b81cb 100644 --- a/xserver/hw/xfree86/common/xf86AutoConfig.c +++ b/xserver/hw/xfree86/common/xf86AutoConfig.c @@ -453,6 +453,36 @@ chooseVideoDriver(void) } else { if (info != NULL) chosen_driver = videoPtrToDriverName(info); +#ifdef __OpenBSD__ + if (chosen_driver == NULL) { + int fd = xf86Info.screenFd; + int type; + + if (ioctl(fd, WSDISPLAYIO_GTYPE, &type) != -1) { + switch (type) { + case WSDISPLAY_TYPE_SUNFFB: + chosen_driver = "sunffb"; + break; +#ifdef notyet + case WSDISPLAY_TYPE_SUNCG6: + chosen_driver = "suncg6"; + break; +#endif + case WSDISPLAY_TYPE_IFB: + chosen_driver = "wildcatfb"; + break; + + default: +#if defined(__i386__) || defined(__amd64__) + chosen_driver = "vesa"; +#else + chosen_driver = "wsfb"; +#endif + break; + } + } + } +#endif if (chosen_driver == NULL) { #if defined __i386__ || defined __amd64__ || defined __x86_64__ || defined __hurd__ chosen_driver = "vesa"; |