belliash wrote:
I thought it is same mode, as on all hardware I got, I was able to draw on framebuffer as well as use EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
That behaviour may not be mandated by the UEFI spec, especially in the Console (Text) mode. For instance, if the firmware is allowed to rely on the VGA text-mode for its console (text) mode, there wouldn't be a frame-buffer-like, pixel-addressable interface available. Digging through the spec, or having someone more knowledgable about UEFI respond, could help.
A search shows two enum constants related to (perhaps a non-standard protocol) EFI_CONSOLE_CONTROL_PROTOCOL (CCP):
Code: Select all
EfiConsoleControlScreenGraphics
EfiConsoleControlScreenText
rEFInd seems to make use of CCP when switching the screen between console and graphics.
belliash wrote:
What I also noticed is that EfiST->ConOut->ClearScreen(EfiST->ConOut); does not clear that "progress bar" draw on the screen after changing mode. And this happens not only on affected Lenovo S205. I tested this on another hardware as well and while, there was no other difference, it as well was unable to remove that bar with ConOut->ClearScreen(). This worked only under OVMF so far.
The firmware could possibly allocate different buffers for Console/UGA/GOP modes, and overlay them based on how these modes are being utilized by the UEFI client programs (for instance, to allow quicker switching between the modes). If that is the case, clearing one buffer may or may not affect the other buffers.
belliash wrote:
Also as you can see on screenshot below, FB size is 0 bytes:
Can't say why it is zero.
----
I think maintaining a clear separation between the 3 modes Console/UGA/GOP, and utilizing them in a mutually exclusive manner, based on which of them are desired and available, may help sidestep these problems. Looking up the spec, other boot loaders/managers (licenses permitting) as rEFInd, systemd-boot, etc., or contacting the support forums of the UEFI vendors (Lenovo here, or even AMD), could help in determining how the client programs are expected to behave.
Do UEFI firmwares get updates the way BIOSes get them? If so, and if the firmware isn't the latest for the laptop model you are running, updating it may bring its features to the same parity/level as those we expect from it.
It is likely that at least some of the behaviours, if not all, being demonstrated here cannot be fully attributed to being a result of something broken in the firmware.
---
Edit: Despite that fact that drawing on the framebuffer returned by GOP seems to overwrites the ConsoleOut text on the screen, that doesn't imply that the framebuffer backing the text-output protocol and that backing the GOP are the same. It may be the case that they are separate, and are being overlayed by the GPU scanout hardware, giving the illusion that one is drawing on the framebuffer associated with the text-out protocol. If the buffers aren't the same, then, it is likely that a SetMode is necessary on GOP to inform the firmware that a client-renderable linear buffer must be configured for GOP.
In case the framebuffers are exactly the same (as I have been assuming thus far), the fact that ConsoleOut is able to properly display your bootloader's menu must imply that, internally, the GPU knows how to arrange font bitmaps on the very buffer that, if we try to draw to directly, shows tiling-like artifacts. This is a very good indicator that, if the buffers are the same, then tiling is in effect.
Also, ipxe boot-loader has a comment that says that CCP was relevant as an older, EDK-based, non-standard protocol to control the text/graphics sub-modes for the console, implemented by some older version 1.10 UEFI firmware.
Again, all of this is based on the symptoms here, and need to be corroborated with the spec, or with someone who knows the spec.
---
Edit2:
I have also been assuming that the resolution returned by the GOP matches the panel's resolution, further also assuming that there is no hardware on this laptop like there is Hardware Video Scaler on Raspberry Pis that can carry out scanline resizing on the fly, i.e. system-set resolution will be, for instance, 1024x768 but the panel is running at 1920x1080, and the scanlines from the 1024x768 framebuffer are enlarged using image processing filters.
If the resolution returned by GOP isn't the resolution at which the screen is running (hence my initial question about Fn key combination), then SetMode seems to be a way out of this situation. Querying the GOP's current resolution without first running SetMode on it could perhaps be returning something that's not applicable to the current ConsoleOut screen.