From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mx.groups.io with SMTP id smtpd.web10.641.1624494893869045798 for ; Wed, 23 Jun 2021 17:34:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CBEn8l6f; spf=pass (domain: gmail.com, ip: 209.85.210.175, mailfrom: df7729@gmail.com) Received: by mail-pf1-f175.google.com with SMTP id x16so3671362pfa.13 for ; Wed, 23 Jun 2021 17:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=P/hXSrM19VrsPrwwAxiQY7AA0D4zFLbTE/VHD0snpZU=; b=CBEn8l6fo+AoTDynlBEAyv48+984KMIQK0kZdezhRTVf6OrwHw/M/a+mNt8C0+u8aL wHAM7peTOx/cDqA+ShZ+EI7jz2ShN+CdRzUhuzvJi+Do8GR7Q0MsbtMxFGSe0j331vn2 kQFZWpuvHsj3/bCL6b6oPhaFgyxA5G/8yQ9xD7wiKl+t/Z/CFQe2e7CqFDCRuzLf9X8i /nh3etxC5j9/VWu+UwLTcQxNQXI46A0RS5+YyOLsipMbDZIu2gNtKPL3B8G4btcFD6+j bLyqH9qvwOtIDQp92OvgoTQiLb6A9ud84b1W/pwhsc9LCERf7rDj939QSqyp4Ncraq8t lb1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=P/hXSrM19VrsPrwwAxiQY7AA0D4zFLbTE/VHD0snpZU=; b=JoiNFMu/H6OsRb2B6FhKUPL2yzVZkdoFeuwyYqyTxr1Kn3HwsRXHDqdREIsaCJPcro CjcIvCvGnlmMqJgJeb5cPN9lhsHfDhiBDyXkGgNEbv+N7ttjYwERcO6LbY9mADs+sZ/R /bo+hIyTZmc4uHs7HzjY1Yq4hfAwjzxvRccibmXTId8oDnaVOwsxV8zEVyfm88JcPUub IXYXFEOW4Vff8Ky2YUWRA+jOazLuXJnfNsU5q9kPxdfVekBLRJp7Eu+J9EdxJ6I7fdCm 9MUsPuFdSLy7FouswgpfaL83NbCNX2Ebzpg1kVxo1Mp78M+L8+40dX1vhdxR9+wJVyRO nZBg== X-Gm-Message-State: AOAM530oeKVs4kQVjk/gLG5dqTpCtLBA4CHKSoXh+Iisj18qOReyooAI 1VMPEa713Gk9oF/8V1/WHp3tWe/UnRelwgZBzNA= X-Google-Smtp-Source: ABdhPJwwN85Vel0oeq94an3CXobAghXV797eV2v4Ta8AWcZKs8BHZYcDoKGR/3zZ1qXIcvehnrv8Jei8KIoMIf0R320= X-Received: by 2002:a63:1b54:: with SMTP id b20mr2059355pgm.151.1624494893397; Wed, 23 Jun 2021 17:34:53 -0700 (PDT) MIME-Version: 1.0 References: <1688FC67A39CB5DB.19105@groups.io> <77881bee-4efb-df6a-8cef-9a24eee343d3@redhat.com> In-Reply-To: <77881bee-4efb-df6a-8cef-9a24eee343d3@redhat.com> From: "David F." Date: Wed, 23 Jun 2021 17:34:42 -0700 Message-ID: Subject: Re: [edk2-devel] SIMPLE_TEXT_OUTPUT_PROTOCOL and Video Resolution To: Laszlo Ersek Cc: devel@edk2.groups.io, Andrew Fish Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It would be nice to just update the specs to say, when a text mode is chosen the resolution shall be set to the lowest resolution that supports the cols and rows of the given text mode. Then over time all the systems will handle it. On Wed, Jun 23, 2021 at 3:24 AM Laszlo Ersek wrote: > > On 06/17/21 01:22, Andrew Fish via groups.io wrote: > > > > > >> On Jun 16, 2021, at 2:45 PM, David F. 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 solv= e > >> anything with the original question), are you supposed to set the mod= e > >> on every handle to keep that part in sync? > >> > > > > A common implementation is to have the Conspliter [1] driver that prod= uces virtual handles that aggregate how many actual devices you have and ma= nages policy. > > > > You should grab the protocols on the gST->ConsoleOutHandle as these ar= e the Spec defined active console devices. > > > > > > In terms on Simple Text Output Protocol on Graphics this is the defaul= t driver in edk2 [2]. These are the config knobs you can set from your DSC = file to control defaults. > > > > [Pcd] > > gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## SOMET= IMES_CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution ## SOMET= IMES_CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## SOMET= IMES_CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn ## SOMET= IMES_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 bet= ween the serial and graphics Simple Text In. So try the Graphics without th= e serial terminal connect to see if it does different stuff. > > Regarding the serial terminal aspect, we discussed the following patch (= maybe: workaround?) for that, many years ago, off-list: > > diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/Mde= ModulePkg/Universal/Console/TerminalDxe/Terminal.c > index a98b690c8b95..ded5513c74a7 100644 > --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c > +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c > @@ -115,9 +115,44 @@ TERMINAL_DEV mTerminalDevTemplate =3D { > }; > > TERMINAL_CONSOLE_MODE_DATA mTerminalConsoleModeData[] =3D { > - {80, 25}, > - {80, 50}, > - {100, 31}, > + { 80, 25 }, // from graphics resolution 640 x 480 > + { 80, 50 }, // from graphics resolution 640 x 960 > + { 100, 25 }, // from graphics resolution 800 x 480 > + { 100, 31 }, // from graphics resolution 800 x 600 > + { 104, 32 }, // from graphics resolution 832 x 624 > + { 120, 33 }, // from graphics resolution 960 x 640 > + { 128, 31 }, // from graphics resolution 1024 x 600 > + { 128, 40 }, // from graphics resolution 1024 x 768 > + { 144, 45 }, // from graphics resolution 1152 x 864 > + { 144, 45 }, // from graphics resolution 1152 x 870 > + { 160, 37 }, // from graphics resolution 1280 x 720 > + { 160, 40 }, // from graphics resolution 1280 x 760 > + { 160, 40 }, // from graphics resolution 1280 x 768 > + { 160, 42 }, // from graphics resolution 1280 x 800 > + { 160, 50 }, // from graphics resolution 1280 x 960 > + { 160, 53 }, // from graphics resolution 1280 x 1024 > + { 170, 40 }, // from graphics resolution 1360 x 768 > + { 170, 40 }, // from graphics resolution 1366 x 768 > + { 175, 55 }, // from graphics resolution 1400 x 1050 > + { 180, 47 }, // from graphics resolution 1440 x 900 > + { 200, 47 }, // from graphics resolution 1600 x 900 > + { 200, 63 }, // from graphics resolution 1600 x 1200 > + { 210, 55 }, // from graphics resolution 1680 x 1050 > + { 240, 56 }, // from graphics resolution 1920 x 1080 > + { 240, 63 }, // from graphics resolution 1920 x 1200 > + { 240, 75 }, // from graphics resolution 1920 x 1440 > + { 250, 105 }, // from graphics resolution 2000 x 2000 > + { 256, 80 }, // from graphics resolution 2048 x 1536 > + { 256, 107 }, // from graphics resolution 2048 x 2048 > + { 320, 75 }, // from graphics resolution 2560 x 1440 > + { 320, 84 }, // from graphics resolution 2560 x 1600 > + { 320, 107 }, // from graphics resolution 2560 x 2048 > + { 350, 110 }, // from graphics resolution 2800 x 2100 > + { 400, 126 }, // from graphics resolution 3200 x 2400 > + { 480, 113 }, // from graphics resolution 3840 x 2160 > + { 512, 113 }, // from graphics resolution 4096 x 2160 > + { 960, 227 }, // from graphics resolution 7680 x 4320 > + { 1024, 227 }, // from graphics resolution 8192 x 4320 > // > // New modes can be added here. > // > > but the discussion didn't go anywhere over several months, so we've been= carrying this patch downstream-only ever since. > > Thanks > Laszlo > > > > > > > [1] https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Univers= al/Console/ConSplitterDxe > > > > [2] https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Univers= al/Console/GraphicsConsoleDxe > > > > > > Thanks, > > > > Andrew Fish > > > >> On Tue, Jun 15, 2021 at 11:33 PM David F. via groups.io > >> wrote: > >>> > >>> Hello, > >>> > >>> I've found that most implementation of UEFI don't automatically chan= ge > >>> 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 cas= e, > >>> 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 y= ou > >>> then say you want GOP in 640x480 mode (which is available as GOP mod= e > >>> 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 ar= ea > >>> 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 upp= er > >>> 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 becau= se > >>> 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 sinc= e > >>> 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. > >>> > >>> Thanks. > >>> > >> > >> > >> > >> > >> > > > > > > > >=20 > > > > > > >