* [PATCH] dummycon: Trigger redraw when switching consoles with deferred takeover
@ 2025-05-19 7:10 Thomas Zimmermann
2025-05-19 9:04 ` Javier Martinez Canillas
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Zimmermann @ 2025-05-19 7:10 UTC (permalink / raw)
To: gregkh, hdegoede, arvidjaar
Cc: dri-devel, linux-fbdev, linux-kernel, Thomas Zimmermann, stable
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.
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>
Fixes: 83d83bebf401 ("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+
---
drivers/video/console/dummycon.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
index 139049368fdc..afb8e4d2fc34 100644
--- a/drivers/video/console/dummycon.c
+++ b/drivers/video/console/dummycon.c
@@ -85,6 +85,12 @@ static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
/* Redraw, so that we get putc(s) for output done while blanked */
return true;
}
+
+static bool dummycon_switch(struct vc_data *vc)
+{
+ /* Redraw, so that we get putc(s) for output done while switched away */
+ return true;
+}
#else
static void dummycon_putc(struct vc_data *vc, u16 c, unsigned int y,
unsigned int x) { }
@@ -95,6 +101,10 @@ static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
{
return false;
}
+static bool dummycon_switch(struct vc_data *vc)
+{
+ return false;
+}
#endif
static const char *dummycon_startup(void)
@@ -124,11 +134,6 @@ static bool dummycon_scroll(struct vc_data *vc, unsigned int top,
return false;
}
-static bool dummycon_switch(struct vc_data *vc)
-{
- return false;
-}
-
/*
* The console `switch' structure for the dummy console
*
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] dummycon: Trigger redraw when switching consoles with deferred takeover
2025-05-19 7:10 [PATCH] dummycon: Trigger redraw when switching consoles with deferred takeover Thomas Zimmermann
@ 2025-05-19 9:04 ` Javier Martinez Canillas
2025-05-19 9:12 ` Thomas Zimmermann
0 siblings, 1 reply; 3+ messages in thread
From: Javier Martinez Canillas @ 2025-05-19 9:04 UTC (permalink / raw)
To: Thomas Zimmermann, gregkh, hdegoede, arvidjaar
Cc: dri-devel, linux-fbdev, linux-kernel, Thomas Zimmermann, stable
Thomas Zimmermann <tzimmermann@suse.de> writes:
Hello Thomas,
> 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.
>
> 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>
> Fixes: 83d83bebf401 ("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+
> ---
> drivers/video/console/dummycon.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
> index 139049368fdc..afb8e4d2fc34 100644
> --- a/drivers/video/console/dummycon.c
> +++ b/drivers/video/console/dummycon.c
> @@ -85,6 +85,12 @@ static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
> /* Redraw, so that we get putc(s) for output done while blanked */
> return true;
> }
> +
> +static bool dummycon_switch(struct vc_data *vc)
> +{
> + /* Redraw, so that we get putc(s) for output done while switched away */
Maybe this comment could be a little bit more verbose about why this is needed
for the framebuffer console deferred takeover case? It doesn't have to be as
elaborated as how you have it in the commit message, but more information would
be nice IMO.
> + return true;
> +}
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] dummycon: Trigger redraw when switching consoles with deferred takeover
2025-05-19 9:04 ` Javier Martinez Canillas
@ 2025-05-19 9:12 ` Thomas Zimmermann
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Zimmermann @ 2025-05-19 9:12 UTC (permalink / raw)
To: Javier Martinez Canillas, gregkh, hdegoede, arvidjaar
Cc: dri-devel, linux-fbdev, linux-kernel, stable
Am 19.05.25 um 11:04 schrieb Javier Martinez Canillas:
> Thomas Zimmermann <tzimmermann@suse.de> writes:
>
> Hello Thomas,
>
>> 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.
>>
>> 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>
>> Fixes: 83d83bebf401 ("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+
>> ---
>> drivers/video/console/dummycon.c | 15 ++++++++++-----
>> 1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
>> index 139049368fdc..afb8e4d2fc34 100644
>> --- a/drivers/video/console/dummycon.c
>> +++ b/drivers/video/console/dummycon.c
>> @@ -85,6 +85,12 @@ static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
>> /* Redraw, so that we get putc(s) for output done while blanked */
>> return true;
>> }
>> +
>> +static bool dummycon_switch(struct vc_data *vc)
>> +{
>> + /* Redraw, so that we get putc(s) for output done while switched away */
> Maybe this comment could be a little bit more verbose about why this is needed
> for the framebuffer console deferred takeover case? It doesn't have to be as
> elaborated as how you have it in the commit message, but more information would
> be nice IMO.
I copied that from dummycon_blank(), as I assumed that the relevant
people know why. But yeah, I can elaborate a bit more. Best regards Thomas
>
>> + return true;
>> +}
> Acked-by: Javier Martinez Canillas <javierm@redhat.com>
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-19 9:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 7:10 [PATCH] dummycon: Trigger redraw when switching consoles with deferred takeover Thomas Zimmermann
2025-05-19 9:04 ` Javier Martinez Canillas
2025-05-19 9:12 ` Thomas Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).