From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Michael Schmitz <schmitzmic@gmail.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
linux-fbdev@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-m68k@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 3/4] fbdev: atafb: Fix broken frame buffer after kexec
Date: Fri, 15 Feb 2019 09:59:00 +0100 [thread overview]
Message-ID: <20190215085901.21479-4-geert@linux-m68k.org> (raw)
In-Reply-To: <20190215085901.21479-1-geert@linux-m68k.org>
On Falcon, Atari frame buffer initialization relies on preprogrammed
register values. These register values are changed to blank the
console.
Hence when using kexec to boot into a new kernel while the console is
blanked, the new kernel cannot determine the current video
configuration, and the Atari frame buffer driver fails to initialize:
atafb: phys_screen_base 6ce000 screen_len 4096
Fix this by doing a straight-forward conversion of the driver to a
platform device driver, and adding a shutdown handler that unblanks the
display.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/video/fbdev/atafb.c | 34 ++++++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index d82007c113e6303c..4db8166d11b30409 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -54,6 +54,7 @@
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
+#include <linux/platform_device.h>
#include <asm/setup.h>
#include <linux/uaccess.h>
@@ -3072,7 +3073,7 @@ int __init atafb_setup(char *options)
return 0;
}
-int __init atafb_init(void)
+static int __init atafb_probe(struct platform_device *pdev)
{
int pad, detected_mode, error;
unsigned int defmode = 0;
@@ -3084,9 +3085,6 @@ int __init atafb_init(void)
atafb_setup(option);
printk("atafb_init: start\n");
- if (!MACH_IS_ATARI)
- return -ENODEV;
-
do {
#ifdef ATAFB_EXT
if (external_addr) {
@@ -3247,4 +3245,32 @@ int __init atafb_init(void)
return 0;
}
+static void atafb_shutdown(struct platform_device *pdev)
+{
+ /* Unblank before kexec */
+ if (fbhw->blank)
+ fbhw->blank(0);
+}
+
+static struct platform_driver atafb_driver = {
+ .shutdown = atafb_shutdown,
+ .driver = {
+ .name = "atafb",
+ },
+};
+
+static int __init atafb_init(void)
+{
+ struct platform_device *pdev;
+
+ if (!MACH_IS_ATARI)
+ return -ENODEV;
+
+ pdev = platform_device_register_simple("atafb", -1, NULL, 0);
+ if (IS_ERR(pdev))
+ return PTR_ERR(pdev);
+
+ return platform_driver_probe(&atafb_driver, atafb_probe);
+}
+
device_initcall(atafb_init);
--
2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-02-15 8:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20190215085951epcas3p184e61f75bec825fb68681a36867da7f1@epcas3p1.samsung.com>
2019-02-15 8:58 ` [PATCH 0/4] fbdev: atafb: Fix after kexec, misc. cleanups Geert Uytterhoeven
2019-02-15 8:58 ` [PATCH 1/4] fbdev: atafb: Stop printing virtual screen_base Geert Uytterhoeven
2019-02-15 8:58 ` [PATCH 2/4] fbdev: atafb: Remove obsolete module support Geert Uytterhoeven
2019-02-15 8:59 ` Geert Uytterhoeven [this message]
2019-02-15 8:59 ` [PATCH 4/4] fbdev: atafb: Modernize printing of kernel messages Geert Uytterhoeven
2019-04-01 11:59 ` [PATCH 0/4] fbdev: atafb: Fix after kexec, misc. cleanups Bartlomiej Zolnierkiewicz
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=20190215085901.21479-4-geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=b.zolnierkie@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=schmitzmic@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