[PATCH] vt/console: try harder to print output when panicing

2010-06-22 Thread Dave Airlie
From: Jesse Barnes 

Jesse's initial patch commit said:

"At panic time (i.e. when oops_in_progress is set) we should try a bit
harder to update the screen and make sure output gets to the VT, since
some drivers are capable of flipping back to it.

So make sure we try to unblank and update the display if called from a
panic context."

I've enhanced this to add a flag to the vc that console layer can set
to indicate they want this behaviour to occur. This also adds support
to fbcon for that flag and adds an fb flag for drivers to indicate
they want to use the support. It enables this for KMS drivers.

Signed-off-by: Dave Airlie 
---
 drivers/char/vt.c   |   13 +
 drivers/gpu/drm/i915/intel_fb.c |4 +---
 drivers/gpu/drm/nouveau/nouveau_fbcon.c |1 +
 drivers/gpu/drm/radeon/radeon_fb.c  |2 +-
 drivers/video/console/fbcon.c   |4 +++-
 include/linux/console_struct.h  |1 +
 include/linux/fb.h  |4 
 include/linux/vt_kern.h |7 +++
 8 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 7cdb6ee..6e04c9e 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -698,7 +698,10 @@ void redraw_screen(struct vc_data *vc, int is_switch)
update_attr(vc);
clear_buffer_attributes(vc);
}
-   if (update && vc->vc_mode != KD_GRAPHICS)
+
+   /* Forcibly update if we're panicing */
+   if ((update && vc->vc_mode != KD_GRAPHICS) ||
+   vt_force_oops_output(vc))
do_update_region(vc, vc->vc_origin, 
vc->vc_screenbuf_size / 2);
}
set_cursor(vc);
@@ -736,6 +739,7 @@ static void visual_init(struct vc_data *vc, int num, int 
init)
vc->vc_hi_font_mask = 0;
vc->vc_complement_mask = 0;
vc->vc_can_do_color = 0;
+   vc->vc_panic_force_write = false;
vc->vc_sw->con_init(vc, init);
if (!vc->vc_complement_mask)
vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
@@ -2498,7 +2502,7 @@ static void vt_console_print(struct console *co, const 
char *b, unsigned count)
goto quit;
}
 
-   if (vc->vc_mode != KD_TEXT)
+   if (vc->vc_mode != KD_TEXT && !vt_force_oops_output(vc))
goto quit;
 
/* undraw cursor first */
@@ -3703,7 +3707,8 @@ void do_unblank_screen(int leaving_gfx)
return;
}
vc = vc_cons[fg_console].d;
-   if (vc->vc_mode != KD_TEXT)
+   /* Try to unblank in oops case too */
+   if (vc->vc_mode != KD_TEXT && !vt_force_oops_output(vc))
return; /* but leave console_blanked != 0 */
 
if (blankinterval) {
@@ -3712,7 +3717,7 @@ void do_unblank_screen(int leaving_gfx)
}
 
console_blanked = 0;
-   if (vc->vc_sw->con_blank(vc, 0, leaving_gfx))
+   if (vc->vc_sw->con_blank(vc, 0, leaving_gfx) || 
vt_force_oops_output(vc))
/* Low-level driver cannot restore -> do it ourselves */
update_screen(vc);
if (console_blank_hook)
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index c3c5052..bd5d87a 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -128,7 +128,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
 
strcpy(info->fix.id, "inteldrmfb");
 
-   info->flags = FBINFO_DEFAULT;
+   info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
info->fbops = &intelfb_ops;
 
/* setup aperture base/size for vesafb takeover */
@@ -146,8 +146,6 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
info->fix.smem_start = dev->mode_config.fb_base + obj_priv->gtt_offset;
info->fix.smem_len = size;
 
-   info->flags = FBINFO_DEFAULT;
-
info->screen_base = ioremap_wc(dev->agp->base + obj_priv->gtt_offset,
   size);
if (!info->screen_base) {
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c 
b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index c9a4a0d..9b2d3b7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -250,6 +250,7 @@ nouveau_fbcon_create(struct nouveau_fbdev *nfbdev,
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA |
  FBINFO_HWACCEL_FILLRECT |
  FBINFO_HWACCEL_IMAGEBLIT;
+   info->flags |= FBINFO_CAN_FORCE_OUTPUT;
info->fbops = &nouveau_fbcon_ops;
info->fix.smem_start = dev->mode_config.fb_base + nvbo->bo.offset -
   dev_priv->vm_vram_base;
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c 
b/drivers/gpu/drm/radeon/radeon_fb.c
index dc1634b..dbf8696 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon

[PATCH] fb: fix colliding defines for fb flags.

2010-06-22 Thread Dave Airlie
From: Dave Airlie 

When I added the flags I must have been using a 25 line terminal and missed the 
following flags.

The collided with flag has one user in staging despite being in-tree for 5 
years.

I'm happy to push this via my drm tree unless someone really wants to do it.

Signed-off-by: Dave Airlie 
Cc: sta...@kernel.org
---
 include/linux/fb.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/fb.h b/include/linux/fb.h
index 907ace3..8e5a9df 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -786,8 +786,6 @@ struct fb_tile_ops {
 #define FBINFO_MISC_USEREVENT  0x1 /* event request
  from userspace */
 #define FBINFO_MISC_TILEBLITTING   0x2 /* use tile blitting */
-#define FBINFO_MISC_FIRMWARE   0x4 /* a replaceable firmware
- inited framebuffer */
 
 /* A driver may set this flag to indicate that it does want a set_par to be
  * called every time when fbcon_switch is executed. The advantage is that with
@@ -801,6 +799,8 @@ struct fb_tile_ops {
  */
 #define FBINFO_MISC_ALWAYS_SETPAR   0x4
 
+/* where the fb is a firmware driver, and can be replaced with a proper one */
+#define FBINFO_MISC_FIRMWARE0x8
 /*
  * Host and GPU endianness differ.
  */
-- 
1.7.1


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 16273] suspend/resume failure with radeon kms driver

2010-06-22 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=16273


Andrew Morton  changed:

   What|Removed |Added

 CC||a...@linux-foundation.org
  Component|Hibernation/Suspend |Video(DRI - non Intel)
 AssignedTo|power-management_ot...@kern |drivers_video-...@kernel-bu
   |el-bugs.osdl.org|gs.osdl.org
Product|Power Management|Drivers




--- Comment #1 from Andrew Morton   2010-06-23 
00:06:03 ---
Recategorised to DRI.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are watching the assignee of the bug.

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel