linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Sync PS3 framebuffer on panic.
@ 2007-03-29 22:46 David Woodhouse
  2007-04-06 21:25 ` [Cbe-oss-dev] " Geoff Levand
  0 siblings, 1 reply; 2+ messages in thread
From: David Woodhouse @ 2007-03-29 22:46 UTC (permalink / raw)
  To: cbe-oss-dev; +Cc: linuxppc-dev

There's not a lot of point in printing a nice message about the panic
unless we then ask the hypervisor to update the screen for us. It's a
hack, but in the absence of sensible devel units with a real console
(thanks, Sony!) it's the best we can do.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index ac5df96..1ae9091 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -46,6 +46,8 @@
 static void smp_send_stop(void) {}
 #endif
 
+extern void ps3fb_sync(int);
+
 int ps3_get_firmware_version(union ps3_firmware_version *v)
 {
 	int result = lv1_get_version_info(&v->raw);
@@ -88,8 +90,20 @@ static void ps3_power_off(void)
 
 static void ps3_panic(char *str)
 {
+	static int panicked = 0;
+
 	DBG("%s:%d %s\n", __func__, __LINE__, str);
 
+#ifdef CONFIG_FB_PS3
+	/* It's almost certainly the only available console device outside
+	   Sony, and we don't _see_ the events leading up to the panic 
+	   unless we ask the hypervisor to update it. So do so. Once. */
+	if (!panicked) {
+		panicked = 1;
+		ps3fb_sync(0);
+	}
+#endif
+
 	smp_send_stop();
 	printk("\n");
 	printk("   System does not reboot automatically.\n");
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 81e43cd..f90a43e 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -381,7 +381,7 @@ static const struct fb_videomode *ps3fb_default_mode(void)
 	return &ps3fb_modedb[mode - 1];
 }
 
-static int ps3fb_sync(u32 frame)
+int ps3fb_sync(u32 frame)
 {
 	int i, status;
 	u32 xres, yres;

-- 
dwmw2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Cbe-oss-dev] [PATCH] Sync PS3 framebuffer on panic.
  2007-03-29 22:46 [PATCH] Sync PS3 framebuffer on panic David Woodhouse
@ 2007-04-06 21:25 ` Geoff Levand
  0 siblings, 0 replies; 2+ messages in thread
From: Geoff Levand @ 2007-04-06 21:25 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linuxppc-dev, cbe-oss-dev

David Woodhouse wrote:
> There's not a lot of point in printing a nice message about the panic
> unless we then ask the hypervisor to update the screen for us.

I added this one to ps3-linux.git.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-06 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-29 22:46 [PATCH] Sync PS3 framebuffer on panic David Woodhouse
2007-04-06 21:25 ` [Cbe-oss-dev] " Geoff Levand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).