Project

General

Profile

Actions

Feature #13360

closed

loader: use BGRA RBG data in gfx functions

Added by Toomas Soome over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bootloader
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Hard
Tags:
Gerrit CR:

Description

All image data from tem and from imported images (gfx_fb_putimage()) should only operate using BGRA data format. This does allow us to simplify gfx related operations and allows to use the same implementation for UEFI and BIOS VBE.

8-bit indexed colors do have RGB data array already (to be saved in palette registers), all we need is BGRA <-> index translations while transferring data between RAM and framebuffer.
24/32 bit depth is trivial case, we can store this data directly.

15/16 bit depth is a bit more tricky; if we would attempt to store 8-bit component to framebuffer, there would be data loss because of smaller mask size in 15/16 bit mode.
Therefore, we must take account of the mask size of 15/16 bit mode while we are generating BGRA color data. This does address data from terminal emulator.
However, there is secondary source of 32-bit color data - from PNG images. For now, we are addressing PNG case by right sifting color components to match the mask. This technique is not perfect and can cause color distortions, but it is what we have been using so far.

24/32 bit depth is trivial case, we can store this data directly.

Testing done: switch gfx modes with different depths, observe the screen output is correct. No changes in loader behavior, both UEFI and BIOS versions.

Implement bitmap version of UEFI Blt() function.

Actions #1

Updated by Electric Monk over 1 year ago

  • Gerrit CR set to 1099
Actions #2

Updated by Electric Monk over 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 2d84dc94714fa18a51c85173f806acbc2d1b4257

commit  2d84dc94714fa18a51c85173f806acbc2d1b4257
Author: Toomas Soome <tsoome@me.com>
Date:   2021-01-26T19:37:52.000Z

    13360 loader: use BGRA RBG data in gfx functions
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF