summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-02-03 07:42:15 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-02-03 07:42:15 +0000
commit5a04b7146307d1001bf9a68c4320c8dbc7e817f7 (patch)
treeaddd5d08bec64505de4dac1d790928fcf05f893f
parent78c2bd694380504587be4897ce410b2b18fdfcf6 (diff)
Prevent efifb(4) from attaching if we're the console.
Unfortunately, making this decision in radeondrm_attachhook() is too late because at that point efifb(4) would have already been attached. This means that if we decide to bail in radeondrm_attachhook() we may end up without a glass console. That may happen for example if the firmware package has not been installed. I'm still looking for a solution for that problem. ok jsg@
-rw-r--r--sys/dev/pci/drm/radeon/radeon_kms.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c
index f710924de45..ff26aca9238 100644
--- a/sys/dev/pci/drm/radeon/radeon_kms.c
+++ b/sys/dev/pci/drm/radeon/radeon_kms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_kms.c,v 1.46 2016/01/06 19:56:08 kettenis Exp $ */
+/* $OpenBSD: radeon_kms.c,v 1.47 2016/02/03 07:42:14 kettenis Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -41,6 +41,14 @@
extern int vga_console_attached;
#endif
+#ifdef __amd64__
+#include "efifb.h"
+#endif
+
+#if NEFIFB > 0
+#include <machine/efifbvar.h>
+#endif
+
#define DRIVER_NAME "radeon"
#define DRIVER_DESC "ATI Radeon"
#define DRIVER_DATE "20080613"
@@ -501,6 +509,12 @@ radeondrm_attach_kms(struct device *parent, struct device *self, void *aux)
vga_console_attached = 1;
#endif
}
+#if NEFIFB > 0
+ if (efifb_is_console(pa)) {
+ rdev->console = 1;
+ efifb_cndetach();
+ }
+#endif
#endif
#define RADEON_PCI_MEM 0x10