Commit 37455dc6 authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] fbdev: do the deletion of mode entries at fbdev level

If a request for deletion of an entry in the mode database is requested, do
it at core fbdev level instead of doing it at the console level.
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0a857e23
...@@ -2671,7 +2671,7 @@ static void fbcon_modechanged(struct fb_info *info) ...@@ -2671,7 +2671,7 @@ static void fbcon_modechanged(struct fb_info *info)
} }
} }
static void fbcon_mode_deleted(struct fb_info *info, static int fbcon_mode_deleted(struct fb_info *info,
struct fb_videomode *mode) struct fb_videomode *mode)
{ {
struct fb_info *fb_info; struct fb_info *fb_info;
...@@ -2694,8 +2694,7 @@ static void fbcon_mode_deleted(struct fb_info *info, ...@@ -2694,8 +2694,7 @@ static void fbcon_mode_deleted(struct fb_info *info,
break; break;
} }
} }
if (!found) return found;
fb_delete_videomode(mode, &info->monspecs.modelist);
} }
static int fbcon_event_notify(struct notifier_block *self, static int fbcon_event_notify(struct notifier_block *self,
...@@ -2704,6 +2703,7 @@ static int fbcon_event_notify(struct notifier_block *self, ...@@ -2704,6 +2703,7 @@ static int fbcon_event_notify(struct notifier_block *self,
struct fb_event *event = (struct fb_event *) data; struct fb_event *event = (struct fb_event *) data;
struct fb_info *info = event->info; struct fb_info *info = event->info;
struct fb_videomode *mode; struct fb_videomode *mode;
int ret = 0;
switch(action) { switch(action) {
case FB_EVENT_SUSPEND: case FB_EVENT_SUSPEND:
...@@ -2717,11 +2717,11 @@ static int fbcon_event_notify(struct notifier_block *self, ...@@ -2717,11 +2717,11 @@ static int fbcon_event_notify(struct notifier_block *self,
break; break;
case FB_EVENT_MODE_DELETE: case FB_EVENT_MODE_DELETE:
mode = (struct fb_videomode *) event->data; mode = (struct fb_videomode *) event->data;
fbcon_mode_deleted(info, mode); ret = fbcon_mode_deleted(info, mode);
break; break;
} }
return 0; return ret;
} }
/* /*
......
...@@ -1089,18 +1089,26 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) ...@@ -1089,18 +1089,26 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
if (var->activate & FB_ACTIVATE_INV_MODE) { if (var->activate & FB_ACTIVATE_INV_MODE) {
struct fb_videomode mode1, mode2; struct fb_videomode mode1, mode2;
struct fb_event event; int ret = 0;
fb_var_to_videomode(&mode1, var); fb_var_to_videomode(&mode1, var);
fb_var_to_videomode(&mode2, &info->var); fb_var_to_videomode(&mode2, &info->var);
/* make sure we don't delete the videomode of current var */ /* make sure we don't delete the videomode of current var */
if (fb_mode_is_equal(&mode1, &mode2)) ret = fb_mode_is_equal(&mode1, &mode2);
return -EINVAL;
if (!ret) {
struct fb_event event;
event.info = info; event.info = info;
event.data = &mode1; event.data = &mode1;
notifier_call_chain(&fb_notifier_list, FB_EVENT_MODE_DELETE, ret = notifier_call_chain(&fb_notifier_list,
&event); FB_EVENT_MODE_DELETE, &event);
return 0; }
if (!ret)
fb_delete_videomode(&mode1, &info->monspecs.modelist);
return ret;
} }
if ((var->activate & FB_ACTIVATE_FORCE) || if ((var->activate & FB_ACTIVATE_FORCE) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment