[edk2-devel] [edk2-platform][PATCH v2 1/3] MdeModulePkg/GraphicsConsoleDxe: Change default CursorVisible to FALSE

Samer El-Haj-Mahmoud posted 3 patches 5 years, 1 month ago
[edk2-devel] [edk2-platform][PATCH v2 1/3] MdeModulePkg/GraphicsConsoleDxe: Change default CursorVisible to FALSE
Posted by Samer El-Haj-Mahmoud 5 years, 1 month ago
REF: https://github.com/pftf/RPi4/issues/115

GraphicsConsoleDxe defaults the ConOut Mode.CursorVisible to TRUE.
However, the driver never draws the cursor during init. This results
in the first call to disable the cursor (using ConOut->EnableCursor(FALSE))
to actually draw the cursor on the screen, as the logic in FlushCursor depends
on the Mode.CursorVisible state to determine if it should draw or erase
the cursor.

Fix by changing the default CursorVisible in this driver to FALSE.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com>
Cc: Pete Batard <pete@akeo.ie>
Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
---
 MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
index c042451a9b52..6b8d11d587d1 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
@@ -33,7 +33,7 @@ GRAPHICS_CONSOLE_DEV    mGraphicsConsoleDevTemplate = {
     EFI_TEXT_ATTR(EFI_LIGHTGRAY, EFI_BLACK),
     0,
     0,
-    TRUE
+    FALSE
   },
   (GRAPHICS_CONSOLE_MODE_DATA *) NULL,
   (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) NULL
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69265): https://edk2.groups.io/g/devel/message/69265
Mute This Topic: https://groups.io/mt/79103138/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [edk2-platform][PATCH v2 1/3] MdeModulePkg/GraphicsConsoleDxe: Change default CursorVisible to FALSE
Posted by Pete Batard 5 years, 1 month ago
On 2020.12.20 13:53, Samer El-Haj-Mahmoud wrote:
> REF: https://github.com/pftf/RPi4/issues/115
> 
> GraphicsConsoleDxe defaults the ConOut Mode.CursorVisible to TRUE.
> However, the driver never draws the cursor during init. This results
> in the first call to disable the cursor (using ConOut->EnableCursor(FALSE))
> to actually draw the cursor on the screen, as the logic in FlushCursor depends
> on the Mode.CursorVisible state to determine if it should draw or erase
> the cursor.
> 
> Fix by changing the default CursorVisible in this driver to FALSE.
> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com>
> Cc: Pete Batard <pete@akeo.ie>
> Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
> ---
>   MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
> index c042451a9b52..6b8d11d587d1 100644
> --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
> +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
> @@ -33,7 +33,7 @@ GRAPHICS_CONSOLE_DEV    mGraphicsConsoleDevTemplate = {
>       EFI_TEXT_ATTR(EFI_LIGHTGRAY, EFI_BLACK),
> 
>       0,
> 
>       0,
> 
> -    TRUE
> 
> +    FALSE
> 
>     },
> 
>     (GRAPHICS_CONSOLE_MODE_DATA *) NULL,
> 
>     (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) NULL
> 

Reviewed-by: Pete Batard <pete@akeo.ie>
Tested-by: Pete Batard <pete@akeo.ie> (On an RPi4 platform where we had 
this annoyance of an unwanted cursor displaying on top of the platform logo)


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69419): https://edk2.groups.io/g/devel/message/69419
Mute This Topic: https://groups.io/mt/79103138/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-