[systemd-devel] [PATCH 1/1] graphics: Do not require nonstandard console control protocol

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Wed Jan 15 06:55:50 PST 2014


Hi,

On 15.01.2014 13:34, Tom Gundersen wrote:
> On Wed, Jan 15, 2014 at 12:08 PM, Joonas Lahtinen
> <joonas.lahtinen at linux.intel.com> wrote:
>> Console Control Protocol is a nonstandard UEFI interface and lack of
>> it shall not be treated as an error.
> Ah, great! I was struggling to make the splash work on tianocore for
> the longest time, and this fixes it indeed.
>
> Applied and pushed.

Great that it helped. The same goes for other implementations too.

> Only minor issue left now is that we need to explicitly clear the
> screen before writing in console mode (as can be seen if you boot into
> tianocore and press 'P' followed by any other keys to switch between
> the modes). Care to take a look at that?

I think it is more by design than a bug, as now the graphics mode switch 
function does nothing. There's no telling the UEFI implementation if you 
want to draw text or graphics. I've seen multiple implementations in 
some Windows bootloader leaves some text on screen behind logo, and 
others where only cursor is seen, and in rare case the background is 
completely black. It's just not specified by standard (or at least not 
implemented widely), if the text output should cause screen to clear.

Fbcon behaves pretty much the same way, the graphics get overwritten by 
the text, and the text continues from where it left off, independent of 
each other. So it's up to the application to enforce screen clearing if 
they want to.

One simple solution to ensure uniform behaviour across implementations 
could be to do explicit clear on the screen and home the cursor to upper 
left always when a text mode is requested. And vice versa, clear screen 
when graphics mode is requested.

Was this the problem you meant?

Regards, Joonas

> Cheers,
>
> Tom
>
>>   src/efi/graphics.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/efi/graphics.c b/src/efi/graphics.c
>> index 062ce27..c85daa3 100644
>> --- a/src/efi/graphics.c
>> +++ b/src/efi/graphics.c
>> @@ -67,8 +67,10 @@ EFI_STATUS graphics_mode(BOOLEAN on) {
>>           EFI_STATUS err;
>>
>>           err = LibLocateProtocol(&ConsoleControlProtocolGuid, (VOID **)&ConsoleControl);
>> -        if (EFI_ERROR(err))
>> -                return err;
>> +        if (EFI_ERROR(err)) {
>> +                /* console control protocol is nonstandard and might not exist. */
>> +                return err == EFI_NOT_FOUND ? EFI_SUCCESS : err;
>> +        }
>>
>>           /* check current mode */
>>           err = uefi_call_wrapper(ConsoleControl->GetMode, 4, ConsoleControl, &current, &uga_exists, &stdin_locked);
>> --
>> 1.8.1.4
>>
>> _______________________________________________
>> systemd-devel mailing list
>> systemd-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel



More information about the systemd-devel mailing list