aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r--drivers/video/fbmem.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 346f257215a7..a1f2e7ce730b 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -954,6 +954,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
954 goto done; 954 goto done;
955 955
956 if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) { 956 if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
957 struct fb_var_screeninfo old_var;
957 struct fb_videomode mode; 958 struct fb_videomode mode;
958 959
959 if (info->fbops->fb_get_caps) { 960 if (info->fbops->fb_get_caps) {
@@ -963,10 +964,20 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
963 goto done; 964 goto done;
964 } 965 }
965 966
967 old_var = info->var;
966 info->var = *var; 968 info->var = *var;
967 969
968 if (info->fbops->fb_set_par) 970 if (info->fbops->fb_set_par) {
969 info->fbops->fb_set_par(info); 971 ret = info->fbops->fb_set_par(info);
972
973 if (ret) {
974 info->var = old_var;
975 printk(KERN_WARNING "detected "
976 "fb_set_par error, "
977 "error code: %d\n", ret);
978 goto done;
979 }
980 }
970 981
971 fb_pan_display(info, &info->var); 982 fb_pan_display(info, &info->var);
972 fb_set_cmap(&info->cmap, info); 983 fb_set_cmap(&info->cmap, info);