Skip to content

Commit acbe159

Browse files
Thomas Zimmermanngregkh
authored andcommitted
dummycon: Trigger redraw when switching consoles with deferred takeover
commit 03bcbbb upstream. Signal vt subsystem to redraw console when switching to dummycon with deferred takeover enabled. Makes the console switch to fbcon and displays the available output. With deferred takeover enabled, dummycon acts as the placeholder until the first output to the console happens. At that point, fbcon takes over. If the output happens while dummycon is not active, it cannot inform fbcon. This is the case if the vt subsystem runs in graphics mode. A typical graphical boot starts plymouth, a display manager and a compositor; all while leaving out dummycon. Switching to a text-mode console leaves the console with dummycon even if a getty terminal has been started. Returning true from dummycon's con_switch helper signals the vt subsystem to redraw the screen. If there's output available dummycon's con_putc{s} helpers trigger deferred takeover of fbcon, which sets a display mode and displays the output. If no output is available, dummycon remains active. v2: - make the comment slightly more verbose (Javier) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reported-by: Andrei Borzenkov <arvidjaar@gmail.com> Closes: https://bugzilla.suse.com/show_bug.cgi?id=1242191 Tested-by: Andrei Borzenkov <arvidjaar@gmail.com> Acked-by: Javier Martinez Canillas <javierm@redhat.com> Fixes: 83d83be ("console/fbcon: Add support for deferred console takeover") Cc: Hans de Goede <hdegoede@redhat.com> Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: <stable@vger.kernel.org> # v4.19+ Link: https://lore.kernel.org/r/20250520071418.8462-1-tzimmermann@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent de72e0a commit acbe159

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

drivers/video/console/dummycon.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
8585
/* Redraw, so that we get putc(s) for output done while blanked */
8686
return true;
8787
}
88+
89+
static bool dummycon_switch(struct vc_data *vc)
90+
{
91+
/*
92+
* Redraw, so that we get putc(s) for output done while switched
93+
* away. Informs deferred consoles to take over the display.
94+
*/
95+
return true;
96+
}
8897
#else
8998
static void dummycon_putc(struct vc_data *vc, u16 c, unsigned int y,
9099
unsigned int x) { }
@@ -95,6 +104,10 @@ static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
95104
{
96105
return false;
97106
}
107+
static bool dummycon_switch(struct vc_data *vc)
108+
{
109+
return false;
110+
}
98111
#endif
99112

100113
static const char *dummycon_startup(void)
@@ -124,11 +137,6 @@ static bool dummycon_scroll(struct vc_data *vc, unsigned int top,
124137
return false;
125138
}
126139

127-
static bool dummycon_switch(struct vc_data *vc)
128-
{
129-
return false;
130-
}
131-
132140
/*
133141
* The console `switch' structure for the dummy console
134142
*

0 commit comments

Comments
 (0)