Skip to content

Commit

Permalink
fbdev: directly call fbcon_suspended/resumed
Browse files Browse the repository at this point in the history
With the sh_mobile notifier removed we can just directly call the
fbcon code here.

v2: Remove now unused local variable.

v3: fixup !CONFIG_FRAMEBUFFER_CONSOLE, noticed by kbuild

Signed-off-by: Daniel Vetter <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Konstantin Khorenko <[email protected]>
Cc: Yisheng Xie <[email protected]>
Cc: "Michał Mirosław" <[email protected]>
Cc: Peter Rosin <[email protected]>
Cc: Mikulas Patocka <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
danvet committed Jun 12, 2019
1 parent 9c22ad9 commit 50c5056
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
10 changes: 2 additions & 8 deletions drivers/video/fbdev/core/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2919,7 +2919,7 @@ static int fbcon_set_origin(struct vc_data *vc)
return 0;
}

static void fbcon_suspended(struct fb_info *info)
void fbcon_suspended(struct fb_info *info)
{
struct vc_data *vc = NULL;
struct fbcon_ops *ops = info->fbcon_par;
Expand All @@ -2932,7 +2932,7 @@ static void fbcon_suspended(struct fb_info *info)
fbcon_cursor(vc, CM_ERASE);
}

static void fbcon_resumed(struct fb_info *info)
void fbcon_resumed(struct fb_info *info)
{
struct vc_data *vc;
struct fbcon_ops *ops = info->fbcon_par;
Expand Down Expand Up @@ -3330,12 +3330,6 @@ static int fbcon_event_notify(struct notifier_block *self,
int idx, ret = 0;

switch(action) {
case FB_EVENT_SUSPEND:
fbcon_suspended(info);
break;
case FB_EVENT_RESUME:
fbcon_resumed(info);
break;
case FB_EVENT_MODE_CHANGE:
fbcon_modechanged(info);
break;
Expand Down
7 changes: 2 additions & 5 deletions drivers/video/fbdev/core/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1917,17 +1917,14 @@ EXPORT_SYMBOL(unregister_framebuffer);
*/
void fb_set_suspend(struct fb_info *info, int state)
{
struct fb_event event;

WARN_CONSOLE_UNLOCKED();

event.info = info;
if (state) {
fb_notifier_call_chain(FB_EVENT_SUSPEND, &event);
fbcon_suspended(info);
info->state = FBINFO_STATE_SUSPENDED;
} else {
info->state = FBINFO_STATE_RUNNING;
fb_notifier_call_chain(FB_EVENT_RESUME, &event);
fbcon_resumed(info);
}
}
EXPORT_SYMBOL(fb_set_suspend);
Expand Down
8 changes: 0 additions & 8 deletions include/linux/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,6 @@ struct fb_cursor_user {

/* The resolution of the passed in fb_info about to change */
#define FB_EVENT_MODE_CHANGE 0x01
/* The display on this fb_info is being suspended, no access to the
* framebuffer is allowed any more after that call returns
*/
#define FB_EVENT_SUSPEND 0x02
/* The display on this fb_info was resumed, you can restore the display
* if you own it
*/
#define FB_EVENT_RESUME 0x03
/* An entry from the modelist was removed */
#define FB_EVENT_MODE_DELETE 0x04

Expand Down
4 changes: 4 additions & 0 deletions include/linux/fbcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ void __exit fb_console_exit(void);
int fbcon_fb_registered(struct fb_info *info);
void fbcon_fb_unregistered(struct fb_info *info);
void fbcon_fb_unbind(struct fb_info *info);
void fbcon_suspended(struct fb_info *info);
void fbcon_resumed(struct fb_info *info);
#else
static inline void fb_console_init(void) {}
static inline void fb_console_exit(void) {}
static inline int fbcon_fb_registered(struct fb_info *info) { return 0; }
static inline void fbcon_fb_unregistered(struct fb_info *info) {}
static inline void fbcon_fb_unbind(struct fb_info *info) {}
static inline void fbcon_suspended(struct fb_info *info) {}
static inline void fbcon_resumed(struct fb_info *info) {}
#endif

#endif /* _LINUX_FBCON_H */

0 comments on commit 50c5056

Please sign in to comment.