From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: DRI Development <dri-devel@lists.freedesktop.org>,
LKML <linux-kernel@vger.kernel.org>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Paulo Zanoni <przanoni@gmail.com>
Subject: [PATCH RESEND 2/2] drm/i915: prevent the vgacon from ever reloading
Date: Fri, 27 Nov 2015 16:10:05 +0100 [thread overview]
Message-ID: <1448637005-3847-2-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1448637005-3847-1-git-send-email-daniel.vetter@ffwll.ch>
It only leads to bloodshed and tears - we don't bother to restore a
working legacy vga hw setup.
On haswell with the new dynamic power well code this leads to even
more hilarity since for some configurations the hardware is simply no
longer there.
The actual implementation is a bit a hack - we realy on fbcon to kick
out the vgacon. To make this also work with I915_FBDEV=n (or FBCON=n)
and VGA_CONSOLE=y i915 already unregisters the vga console manually
early in the driver load sequence.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Paulo Zanoni <przanoni@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67813
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/i915/i915_dma.c | 1 +
drivers/gpu/drm/i915/intel_fbdev.c | 3 +++
drivers/video/console/vgacon.c | 9 +++++++++
include/linux/console.h | 2 ++
4 files changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index a81c76603544..c6a154dc1070 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -45,6 +45,7 @@
#include <linux/pnp.h>
#include <linux/vga_switcheroo.h>
#include <linux/slab.h>
+#include <linux/console.h>
#include <acpi/video.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 7ccde58f8c98..0ca6d3852f4f 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -717,6 +717,9 @@ static void intel_fbdev_initial_config(void *data, async_cookie_t cookie)
if (drm_fb_helper_initial_config(&ifbdev->helper,
ifbdev->preferred_bpp))
intel_fbdev_fini(dev_priv->dev);
+
+ /* Need to do this after fbcon setup for "smooth" takeover. */
+ vgacon_unregister();
}
void intel_fbdev_initial_config_async(struct drm_device *dev)
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 517f565b65d7..86aef3195135 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -1416,6 +1416,15 @@ static int vgacon_dummy(struct vc_data *c)
return 0;
}
+/*
+ * Used by drivers which wreak utter havoc to the legacy vga state to prevent
+ * the vga console driver from ever reloading.
+ */
+void vgacon_unregister(void)
+{
+ give_up_console(&vga_con);
+}
+EXPORT_SYMBOL(vgacon_unregister);
#define DUMMY (void *) vgacon_dummy
const struct consw vga_con = {
diff --git a/include/linux/console.h b/include/linux/console.h
index 44b7fe8a2dbb..79fb65b6beb7 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -190,8 +190,10 @@ void vcs_remove_sysfs(int index);
#ifdef CONFIG_VGA_CONSOLE
extern bool vgacon_text_force(void);
+extern void vgacon_unregister(void);
#else
static inline bool vgacon_text_force(void) { return false; }
+static inline void vgacon_unregister(void) {}
#endif
#endif /* _LINUX_CONSOLE_H */
--
2.5.1
next prev parent reply other threads:[~2015-11-27 15:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-27 15:10 [PATCH RESEND 1/2] vgacon: dummy implementation for vgacon_text_force Daniel Vetter
2015-11-27 15:10 ` Daniel Vetter [this message]
2015-11-27 15:40 ` [PATCH RESEND 2/2] drm/i915: prevent the vgacon from ever reloading Emil Velikov
2015-11-28 0:37 ` Ilia Mirkin
2015-11-29 12:47 ` Daniel Vetter
2015-11-29 14:10 ` Emil Velikov
2015-11-27 15:29 ` [PATCH RESEND 1/2] vgacon: dummy implementation for vgacon_text_force Emil Velikov
2015-11-29 12:49 ` Daniel Vetter
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=1448637005-3847-2-git-send-email-daniel.vetter@ffwll.ch \
--to=daniel.vetter@ffwll.ch \
--cc=akpm@linux-foundation.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=przanoni@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®