Andrew Fish

On Jun 16, 2021, at 2:45 PM, David F. <df7729@...> wrote:

Also, I found if there are 2 GOP handles and you change the mode of
one, the other one doesn't reflect the change (but still doesn't solve
anything with the original question), are you supposed to set the mode
on every handle to keep that part in sync?

A common implementation is to have the Conspliter [1] driver that produces virtual handles that aggregate how many actual devices you have and manages policy. 

You should grab the protocols on the gST->ConsoleOutHandle as these are the Spec defined active console devices. 

In terms on Simple Text Output Protocol on Graphics this is the default driver in edk2 [2]. These are the config knobs you can set from your DSC file to control defaults. 

gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn ## SOMETIMES_CONSUMES
Note: If you have serial active that may mess with the Conspliter and force it to pick a lower resolution since it has to find the best match between the serial and graphics Simple Text In. So try the Graphics without the serial terminal connect to see if it does different stuff. 


Andrew Fish

On Tue, Jun 15, 2021 at 11:33 PM David F. via
<df7729@...> wrote:


I've found that most implementation of UEFI don't automatically change
the resolution when setting the mode with STOP (Simple Text Output
Protocol) .  You can use GOP to change it after the mode but that
causes other problems.  For example, using surface pro 7 in this case,
with 4K screen.  The default text mode is 342x96 which puts it in
2736x1824 mode which you'd expect and the text is tiny.  But now you
set the mode to 0 which is 80x25 and it actually sets the mode to
2736x1824 if not already in that resolution and uses a 80x25 area in
the center of the screen, still tiny text you can hardly read.  If you
then say you want GOP in 640x480 mode (which is available as GOP mode
1 on this system, it will make the font larger but you can't see
anything because it's still offset to the middle of the 2736x1824 area
and you're only seeing the 640x480 upper left of that area on the
screen.   Likewise if you have it in 342x96 so it's fully in the upper
left corner of the screen and change the mode to say 800x600
(available as GOP mode 2 on this system) it will make the text
readable but the text can go off the screen in both directions because
it's still 342x96 when the 100x31 STOP mode would be the correct one
(which happens to be mode 2 on this system).

Shouldn't setting the STOP mode handle adjusting the resolution since
that's the main reason you want to change the mode so the size shown
on the screen changes to something you can read.

Any tricks? I've tried a bunch of things, resetting the controller,
using the Reset() protocol function, and other things but nothing
works.  As soon as you use STOP to set the mode, it is back to high
resolution and using an area centered in the screen and changing the
resolution after that leaves it in the area centered in the high res
screen and not in the upper left area.


Join to automatically receive all group messages.