Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164880
b: refs/heads/master
c: 0fcf6ad
h: refs/heads/master
v: v3
  • Loading branch information
Florian Tobias Schandinat authored and Linus Torvalds committed Sep 23, 2009
1 parent e4a53f6 commit b27622e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 360fa58828784f307c3977d5ff4c8e400f074a56
refs/heads/master: 0fcf6ada2b8eb42d132c0846384f1299889609e3
48 changes: 37 additions & 11 deletions trunk/drivers/video/console/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo,
int oldidx, int found)
{
struct fbcon_ops *ops = oldinfo->fbcon_par;
int err = 0;
int err = 0, ret;

if (oldinfo->fbops->fb_release &&
oldinfo->fbops->fb_release(oldinfo, 0)) {
Expand All @@ -752,8 +752,14 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo,
newinfo in an undefined state. Thus, a call to
fb_set_par() may be needed for the newinfo.
*/
if (newinfo->fbops->fb_set_par)
newinfo->fbops->fb_set_par(newinfo);
if (newinfo->fbops->fb_set_par) {
ret = newinfo->fbops->fb_set_par(newinfo);

if (ret)
printk(KERN_ERR "con2fb_release_oldinfo: "
"detected unhandled fb_set_par error, "
"error code %d\n", ret);
}
}

return err;
Expand All @@ -763,11 +769,18 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info,
int unit, int show_logo)
{
struct fbcon_ops *ops = info->fbcon_par;
int ret;

ops->currcon = fg_console;

if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT))
info->fbops->fb_set_par(info);
if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT)) {
ret = info->fbops->fb_set_par(info);

if (ret)
printk(KERN_ERR "con2fb_init_display: detected "
"unhandled fb_set_par error, "
"error code %d\n", ret);
}

ops->flags |= FBCON_FLAGS_INIT;
ops->graphics = 0;
Expand Down Expand Up @@ -1006,7 +1019,7 @@ static void fbcon_init(struct vc_data *vc, int init)
struct vc_data *svc = *default_mode;
struct display *t, *p = &fb_display[vc->vc_num];
int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
int cap;
int cap, ret;

if (info_idx == -1 || info == NULL)
return;
Expand Down Expand Up @@ -1092,8 +1105,15 @@ static void fbcon_init(struct vc_data *vc, int init)
*/
if (CON_IS_VISIBLE(vc) && vc->vc_mode == KD_TEXT) {
if (info->fbops->fb_set_par &&
!(ops->flags & FBCON_FLAGS_INIT))
info->fbops->fb_set_par(info);
!(ops->flags & FBCON_FLAGS_INIT)) {
ret = info->fbops->fb_set_par(info);

if (ret)
printk(KERN_ERR "fbcon_init: detected "
"unhandled fb_set_par error, "
"error code %d\n", ret);
}

ops->flags |= FBCON_FLAGS_INIT;
}

Expand Down Expand Up @@ -2119,7 +2139,7 @@ static int fbcon_switch(struct vc_data *vc)
struct fbcon_ops *ops;
struct display *p = &fb_display[vc->vc_num];
struct fb_var_screeninfo var;
int i, prev_console, charcnt = 256;
int i, ret, prev_console, charcnt = 256;

info = registered_fb[con2fb_map[vc->vc_num]];
ops = info->fbcon_par;
Expand Down Expand Up @@ -2174,8 +2194,14 @@ static int fbcon_switch(struct vc_data *vc)

if (old_info != NULL && (old_info != info ||
info->flags & FBINFO_MISC_ALWAYS_SETPAR)) {
if (info->fbops->fb_set_par)
info->fbops->fb_set_par(info);
if (info->fbops->fb_set_par) {
ret = info->fbops->fb_set_par(info);

if (ret)
printk(KERN_ERR "fbcon_switch: detected "
"unhandled fb_set_par error, "
"error code %d\n", ret);
}

if (old_info != info)
fbcon_del_cursor_timer(old_info);
Expand Down
15 changes: 13 additions & 2 deletions trunk/drivers/video/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
goto done;

if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
struct fb_var_screeninfo old_var;
struct fb_videomode mode;

if (info->fbops->fb_get_caps) {
Expand All @@ -963,10 +964,20 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
goto done;
}

old_var = info->var;
info->var = *var;

if (info->fbops->fb_set_par)
info->fbops->fb_set_par(info);
if (info->fbops->fb_set_par) {
ret = info->fbops->fb_set_par(info);

if (ret) {
info->var = old_var;
printk(KERN_WARNING "detected "
"fb_set_par error, "
"error code: %d\n", ret);
goto done;
}
}

fb_pan_display(info, &info->var);
fb_set_cmap(&info->cmap, info);
Expand Down

0 comments on commit b27622e

Please sign in to comment.