summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@openbsd.org>2013-03-15 00:02:24 +0100
committerMark Kettenis <kettenis@openbsd.org>2013-03-15 00:02:24 +0100
commite409ab65dc3739b1927ee0dce62637235279932f (patch)
treed7cc5db18707959fdefa3800e9b6595e5aedc7a4
parent2e40f447e2518d7493542dd49d6787ad22399dba (diff)
Skip further initialization of a vga devices if a drm driver attached a
wsdisplay device itself.
-rw-r--r--sys/dev/ic/vga.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c
index ce40fc657c4..a10224c24e7 100644
--- a/sys/dev/ic/vga.c
+++ b/sys/dev/ic/vga.c
@@ -522,12 +522,24 @@ vga_extended_attach(struct device *self, bus_space_tag_t iot,
int console;
struct vga_config *vc;
struct wsemuldisplaydev_attach_args aa;
+ extern struct cfdriver wsdisplay_cd;
+ struct device *dev;
console = vga_is_console(iot, type);
+ if (console)
+ vga_console_attached = 1;
+
+ /* Bail if a drm driver already attached a wsdisplay. */
+ for (dev = TAILQ_NEXT(self, dv_list); dev != NULL;
+ dev = TAILQ_NEXT(dev, dv_list)) {
+ if (dev->dv_parent != self)
+ continue;
+ if (dev->dv_cfdata->cf_driver == &wsdisplay_cd)
+ return NULL;
+ }
if (console) {
vc = &vga_console_vc;
- vga_console_attached = 1;
} else {
vc = malloc(sizeof(*vc), M_DEVBUF, M_NOWAIT | M_ZERO);
if (vc == NULL)