From ea6875b9490bb5acb288aa27c915ea1ec7a85cd6 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Thu, 19 Feb 2009 21:53:31 +0000 Subject: 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@ --- xserver/hw/xfree86/common/xf86AutoConfig.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'xserver/hw') 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"; -- cgit v1.2.3