aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/console/fbcon.c48
-rw-r--r--drivers/video/fbmem.c15
2 files changed, 50 insertions, 13 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 3a44695b9c09..4bee7c2e6313 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -725,7 +725,7 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo,
725 int oldidx, int found) 725 int oldidx, int found)
726{ 726{
727 struct fbcon_ops *ops = oldinfo->fbcon_par; 727 struct fbcon_ops *ops = oldinfo->fbcon_par;
728 int err = 0; 728 int err = 0, ret;
729 729
730 if (oldinfo->fbops->fb_release && 730 if (oldinfo->fbops->fb_release &&
731 oldinfo->fbops->fb_release(oldinfo, 0)) { 731 oldinfo->fbops->fb_release(oldinfo, 0)) {
@@ -752,8 +752,14 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo,
752 newinfo in an undefined state. Thus, a call to 752 newinfo in an undefined state. Thus, a call to
753 fb_set_par() may be needed for the newinfo. 753 fb_set_par() may be needed for the newinfo.
754 */ 754 */
755 if (newinfo->fbops->fb_set_par) 755 if (newinfo->fbops->fb_set_par) {
756 newinfo->fbops->fb_set_par(newinfo); 756 ret = newinfo->fbops->fb_set_par(newinfo);
757
758 if (ret)
759 printk(KERN_ERR "con2fb_release_oldinfo: "
760 "detected unhandled fb_set_par error, "
761 "error code %d\n", ret);
762 }
757 } 763 }
758 764
759 return err; 765 return err;
@@ -763,11 +769,18 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info,
763 int unit, int show_logo) 769 int unit, int show_logo)
764{ 770{
765 struct fbcon_ops *ops = info->fbcon_par; 771 struct fbcon_ops *ops = info->fbcon_par;
772 int ret;
766 773
767 ops->currcon = fg_console; 774 ops->currcon = fg_console;
768 775
769 if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT)) 776 if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT)) {
770 info->fbops->fb_set_par(info); 777 ret = info->fbops->fb_set_par(info);
778
779 if (ret)
780 printk(KERN_ERR "con2fb_init_display: detected "
781 "unhandled fb_set_par error, "
782 "error code %d\n", ret);
783 }
771 784
772 ops->flags |= FBCON_FLAGS_INIT; 785 ops->flags |= FBCON_FLAGS_INIT;
773 ops->graphics = 0; 786 ops->graphics = 0;
@@ -1006,7 +1019,7 @@ static void fbcon_init(struct vc_data *vc, int init)
1006 struct vc_data *svc = *default_mode; 1019 struct vc_data *svc = *default_mode;
1007 struct display *t, *p = &fb_display[vc->vc_num]; 1020 struct display *t, *p = &fb_display[vc->vc_num];
1008 int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256; 1021 int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
1009 int cap; 1022 int cap, ret;
1010 1023
1011 if (info_idx == -1 || info == NULL) 1024 if (info_idx == -1 || info == NULL)
1012 return; 1025 return;
@@ -1092,8 +1105,15 @@ static void fbcon_init(struct vc_data *vc, int init)
1092 */ 1105 */
1093 if (CON_IS_VISIBLE(vc) && vc->vc_mode == KD_TEXT) { 1106 if (CON_IS_VISIBLE(vc) && vc->vc_mode == KD_TEXT) {
1094 if (info->fbops->fb_set_par && 1107 if (info->fbops->fb_set_par &&
1095 !(ops->flags & FBCON_FLAGS_INIT)) 1108 !(ops->flags & FBCON_FLAGS_INIT)) {
1096 info->fbops->fb_set_par(info); 1109 ret = info->fbops->fb_set_par(info);
1110
1111 if (ret)
1112 printk(KERN_ERR "fbcon_init: detected "
1113 "unhandled fb_set_par error, "
1114 "error code %d\n", ret);
1115 }
1116
1097 ops->flags |= FBCON_FLAGS_INIT; 1117 ops->flags |= FBCON_FLAGS_INIT;
1098 } 1118 }
1099 1119
@@ -2119,7 +2139,7 @@ static int fbcon_switch(struct vc_data *vc)
2119 struct fbcon_ops *ops; 2139 struct fbcon_ops *ops;
2120 struct display *p = &fb_display[vc->vc_num]; 2140 struct display *p = &fb_display[vc->vc_num];
2121 struct fb_var_screeninfo var; 2141 struct fb_var_screeninfo var;
2122 int i, prev_console, charcnt = 256; 2142 int i, ret, prev_console, charcnt = 256;
2123 2143
2124 info = registered_fb[con2fb_map[vc->vc_num]]; 2144 info = registered_fb[con2fb_map[vc->vc_num]];
2125 ops = info->fbcon_par; 2145 ops = info->fbcon_par;
@@ -2174,8 +2194,14 @@ static int fbcon_switch(struct vc_data *vc)
2174 2194
2175 if (old_info != NULL && (old_info != info || 2195 if (old_info != NULL && (old_info != info ||
2176 info->flags & FBINFO_MISC_ALWAYS_SETPAR)) { 2196 info->flags & FBINFO_MISC_ALWAYS_SETPAR)) {
2177 if (info->fbops->fb_set_par) 2197 if (info->fbops->fb_set_par) {
2178 info->fbops->fb_set_par(info); 2198 ret = info->fbops->fb_set_par(info);
2199
2200 if (ret)
2201 printk(KERN_ERR "fbcon_switch: detected "
2202 "unhandled fb_set_par error, "
2203 "error code %d\n", ret);
2204 }
2179 2205
2180 if (old_info != info) 2206 if (old_info != info)
2181 fbcon_del_cursor_timer(old_info); 2207 fbcon_del_cursor_timer(old_info);
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);