Implement con_unblank from struct consw. The new function is called
sticon_unblank(). Remove the related code from sticon_blank().
Sticon uses the global state vga_is_gfx in several places to test if
the console runs in text or graphics mode. Track the mode switches in
sticon_blank() and sticon_unblank(). As sticon_unblank() does not have
a mode_switch parameter, derive the value from vga_is_gfx and vc_mode.
There is no display unblanking in sticon: only return true to redraw
the console.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/video/console/sticon.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c
index 6f58e6a9e76a..0d882ea6b37f 100644
--- a/drivers/video/console/sticon.c
+++ b/drivers/video/console/sticon.c
@@ -302,17 +302,22 @@ static bool sticon_switch(struct vc_data *conp)
static bool sticon_blank(struct vc_data *c, enum vesa_blank_mode blank,
bool mode_switch)
{
- if (blank == VESA_NO_BLANKING) {
+ sti_clear(sticon_sti, 0, 0, c->vc_rows, c->vc_cols, BLANK, font_data[c->vc_num]);
+
if (mode_switch)
- vga_is_gfx = 0;
+ vga_is_gfx = 1;
+
return true;
- }
- sti_clear(sticon_sti, 0, 0, c->vc_rows, c->vc_cols, BLANK,
- font_data[c->vc_num]);
- if (mode_switch)
- vga_is_gfx = 1;
+}
- return true;
+static bool sticon_unblank(struct vc_data *c)
+{
+ bool mode_switch = vga_is_gfx && c->vc_mode == KD_TEXT;
+
+ if (mode_switch)
+ vga_is_gfx = 0;
+
+ return true;
}
static u8 sticon_build_attr(struct vc_data *conp, u8 color,@@ -356,6 +361,7 @@ static const struct consw sti_con = {
.con_scroll = sticon_scroll,
.con_switch = sticon_switch,
.con_blank = sticon_blank,
+ .con_unblank = sticon_unblank,
.con_font_set = sticon_font_set,
.con_font_default = sticon_font_default,
.con_build_attr = sticon_build_attr,--
2.55.0