Skip to content

Commit

Permalink
[PATCH] intelfb/fbdev: Save info->flags in a local variable
Browse files Browse the repository at this point in the history
Reported by: Pavel Kysilka (Bugzilla Bug 5059)

The intelfb driver does not keep resolution set with fbset after
switching to anot console and back.

Steps to reproduce:

  initial options: tty1,tty2 - 1024x768-60
  1) tty1 - fbset after booting (1024x768-60)
  2) tty1 - fbset 800x600-100
  tty1: 800x600-100
  3) swith to tty2, swith to tty1
  tty1: 1024x768-60 (the same resolution as default from kernel booting)

This bug is caused by intelfb unintentionally destroying info->flags in
set_par(). Therefore the flag, FBINFO_MISC_USEREVENT used to notify
fbcon of a mode change was cleared causing the above problem. This bug
though is not intelfb specific, as other drivers may also be affected.

The fix is to save info->flags in a local variable before calling any
of the driver hooks.  A more definitive fix (for post 2.6.13) is to
separate info->flags into one that is set by the driver and another that
is set by core fbdev/fbcon.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Aug 15, 2005
1 parent 6bd4934 commit 3edea48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/video/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
int
fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
{
int err;
int err, flags = info->flags;

if (var->activate & FB_ACTIVATE_INV_MODE) {
struct fb_videomode mode1, mode2;
Expand Down Expand Up @@ -682,7 +682,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
!list_empty(&info->modelist))
err = fb_add_videomode(&mode, &info->modelist);

if (!err && info->flags & FBINFO_MISC_USEREVENT) {
if (!err && (flags & FBINFO_MISC_USEREVENT)) {
struct fb_event event;

info->flags &= ~FBINFO_MISC_USEREVENT;
Expand Down

0 comments on commit 3edea48

Please sign in to comment.