Skip to contentSkip to conversation

BootLogoLib: align logo coords to be even

PATCH In review Marcin Juszkiewicz 2 participants 3 messages Jun 17, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 BootLogoLib: align logo coords to be even

If we draw logo at odd coords then BootLogoLib goes into exception and boot process ends:

Synchronous Exception at 0x00000101FB943E48
PC 0x0101FB943E48 (0x0101FB93F000+0x00004E48) [ 0] QemuVideoDxe.dll PC 0x0101FB943314 (0x0101FB93F000+0x00004314) [ 0] QemuVideoDxe.dll PC 0x0101FB92F798 (0x0101FB92D000+0x00002798) [ 1] ConSplitterDxe.dll PC 0x0101FBA96BC4 (0x0101FBA8E000+0x00008BC4) [ 2] BdsDxe.dll PC 0x0101FF7FDF50 (0x0101FF7F3000+0x0000AF50) [ 3] DxeCore.dll

This change resizes logo from 193x58 to 194x58px to make it's sizes even. And if coords are odd then they are bumped a bit to make things work.

---
 .../Library/BootLogoLib/BootLogoLib.c         |   4 ++++
 MdeModulePkg/Logo/Logo.bmp                    | Bin 12446 -> 34010 bytes
 2 files changed, 4 insertions(+)
MdeModulePkg/Library/BootLogoLib/BootLogoLib.c +4 -0
index 478ec2d40e2b..3b7b5f3146e8 100644
@@ -205,6 +205,10 @@ BootLogoEnableLogo (
     DestX += OffsetX;
     DestY += OffsetY;
 
+    // align logo to even coords
+    if (DestX % 2 != 0) DestX++;
+    if (DestY % 2 != 0) DestY++;
+
     if ((DestX >= 0) && (DestY >= 0)) {
       if (GraphicsOutput != NULL) {
         Status = GraphicsOutput->Blt (
MdeModulePkg/Logo/Logo.bmp binary +0 -0
index 3e85229e17595ba1f9c59e13692a4f8362ebc850..136345a56ac44e3ea8d3c91114b5a2676dc90e2a 100644
GIT binary patch
Signature · 1 line
2.45.1
#2 lore raw
Quoted 11 lines · Marcin Juszkiewicz

If we draw logo at odd coords then BootLogoLib goes into exception and boot process ends:

Synchronous Exception at 0x00000101FB943E48
PC 0x0101FB943E48 (0x0101FB93F000+0x00004E48) [ 0] QemuVideoDxe.dll PC 0x0101FB943314 (0x0101FB93F000+0x00004314) [ 0] QemuVideoDxe.dll PC 0x0101FB92F798 (0x0101FB92D000+0x00002798) [ 1] ConSplitterDxe.dll PC 0x0101FBA96BC4 (0x0101FBA8E000+0x00008BC4) [ 2] BdsDxe.dll PC 0x0101FF7FDF50 (0x0101FF7F3000+0x0000AF50) [ 3] DxeCore.dll

Quoted 5 lines

This change resizes logo from 193x58 to 194x58px to make it's sizes even. And if coords are odd then they are bumped a bit to make things work.

This should be fixed in the SBSA firmware - unaligned accesses are fine on arm64 as long as they don't target device memory. So this likely implies that the framebuffer is mapped with device attributes while it should be mapped normal-non-cacheable.

Quoted 292 lines
---
 .../Library/BootLogoLib/BootLogoLib.c         |   4 ++++
 MdeModulePkg/Logo/Logo.bmp                    | Bin 12446 -> 34010 bytes
 2 files changed, 4 insertions(+)
MdeModulePkg/Library/BootLogoLib/BootLogoLib.c +4 -0
index 478ec2d40e2b..3b7b5f3146e8 100644
@@ -205,6 +205,10 @@ BootLogoEnableLogo (
     DestX += OffsetX;
     DestY += OffsetY;
 
+    // align logo to even coords
+    if (DestX % 2 != 0) DestX++;
+    if (DestY % 2 != 0) DestY++;
+
     if ((DestX >= 0) && (DestY >= 0)) {
       if (GraphicsOutput != NULL) {
         Status = GraphicsOutput->Blt (
MdeModulePkg/Logo/Logo.bmp binary +0 -1
index 3e85229e17595ba1f9c59e13692a4f8362ebc850..136345a56ac44e3ea8d3c91114b5a2676dc90e2a 100644
GIT binary patch
 
--

2.45.1

#3 lore raw

W dniu 17.06.2024 o 10:39, Ard Biesheuvel pisze:

Quoted 10 lines
Quoted 10 lines

If we draw logo at odd coords then BootLogoLib goes into exception and boot process ends:

Synchronous Exception at 0x00000101FB943E48
PC 0x0101FB943E48 (0x0101FB93F000+0x00004E48) [ 0] QemuVideoDxe.dll PC 0x0101FB943314 (0x0101FB93F000+0x00004314) [ 0] QemuVideoDxe.dll PC 0x0101FB92F798 (0x0101FB92D000+0x00002798) [ 1] ConSplitterDxe.dll PC 0x0101FBA96BC4 (0x0101FBA8E000+0x00008BC4) [ 2] BdsDxe.dll PC 0x0101FF7FDF50 (0x0101FF7F3000+0x0000AF50) [ 3] DxeCore.dll

Quoted 7 lines
Quoted 5 lines

This change resizes logo from 193x58 to 194x58px to make it's sizes even. And if coords are odd then they are bumped a bit to make things work.

This should be fixed in the SBSA firmware

One coffee was not enough so I sent it to QEMU devel instead of EDK2 devel mailing list...

Quoted 3 lines

unaligned accesses are fine on arm64 as long as they don't target device memory. So this likely implies that the framebuffer is mapped with device attributes while it should be mapped > normal-non-cacheable.

OK, so need to go through QEMU source now.