From: David Herrmann <dh.herrmann@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH] vgacon: prevent vgacon from reloading
Date: Wed, 2 Oct 2013 11:25:44 +0200 [thread overview]
Message-ID: <1380705944-4155-1-git-send-email-dh.herrmann@gmail.com> (raw)
If vgacon got unloaded for any reason, we can never be sure that vga
registers are still accessible. fbdev/DRM/xycon might reconfigure graphics
devices in a way that prevents vgacon from working again. Therefore,
inhibit rebinding vgacon.
Note that this _might_ break use-cases where users unbind vgacon and then
rebind it without breaking VGA mode. However, this seems to be rarely
useful and given that several GPUs cannot even restore VGA mode it seems
safer to prevent it entirely.
This also adds a dependency to dummy_con as the VT layer does not allow
failure during console-rebinding. Hence, we need a guarantee that
dummy_con is available.
To avoid recursive Kconfig dependencies, we move the vga-con/sgi-con
conflict directly into VGA_CONSOLE and make DUMMY_CONSOLE always active.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
drivers/video/console/Kconfig | 2 +-
drivers/video/console/vgacon.c | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 846caab..173f1e7 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -8,6 +8,7 @@ config VGA_CONSOLE
bool "VGA text console" if EXPERT || !X86
depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && \
!SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \
+ SGI_NEWPORT_CONSOLE!=y && DUMMY_CONSOLE && \
(!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER)
default y
help
@@ -71,7 +72,6 @@ config SGI_NEWPORT_CONSOLE
config DUMMY_CONSOLE
bool
- depends on VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y
default y
config DUMMY_CONSOLE_COLUMNS
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 9d8feac..d598af6 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -368,6 +368,7 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines)
static const char *vgacon_startup(void)
{
+ static bool vgacon_inhibit;
const char *display_desc = NULL;
u16 saved1, saved2;
volatile u16 *p;
@@ -375,14 +376,15 @@ static const char *vgacon_startup(void)
if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB ||
screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) {
no_vga:
-#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
return conswitchp->con_startup();
-#else
- return NULL;
-#endif
}
+ /* fbdev/DRM can disable VGA-mode so prevent reloading */
+ if (vgacon_inhibit)
+ goto no_vga;
+ vgacon_inhibit = true;
+
/* boot_params.screen_info initialized? */
if ((screen_info.orig_video_mode == 0) &&
(screen_info.orig_video_lines == 0) &&
--
1.8.4
next reply other threads:[~2013-10-02 9:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-02 9:25 David Herrmann [this message]
2013-10-02 9:41 ` [PATCH] vgacon: prevent vgacon from reloading David Herrmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380705944-4155-1-git-send-email-dh.herrmann@gmail.com \
--to=dh.herrmann@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.