Attention is currently required from: Angel Pons, Nico Huber.

Angel Pons uploaded patch set #2 to this change.

View Change

The following approvals got outdated and were removed: Code-Review+1 by Nico Huber

gfxtest: Introduce `From_RGBA` constructor for `Pixel_Type`

The `Pixel_Type` record uses a different order for its components, as
the hardware expects the data bytes in BGRA order but most people are
used to RGBA order for color components. However, this approach makes
the compiler complain:

warning: component clause out of order with respect to declaration [-gnatw_r]

This prevents building gfxtest since the warning gets promoted to an
error. While the issue is easy to work around (use BGRA order in the
declaration), *having* to work around this problem is most certainly
not ideal.

Introduce the `From_RGBA` function which maps 3 or 4 RGB(A) bytes to
a `Pixel_Type` record. Alpha is optional for convenience, as most of
the pixel handling uses fully opaque colors anyway.

Use this new function to replace positional aggregate initialization
to preserve colors (red is red, blue is blue). Omitting `255` alphas
makes up for the (slightly) increased verbosity of the code.

TEST=Run this and make sure all builds pass:

for f in configs/*
do
make distclean
make DEBUG=1 cnf=$f gfx_test -j$(nproc)
done

Change-Id: I77dbdcd6c235e411585585779c31777adcef57d0
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
---
M gfxtest/hw-gfx-gma-gfx_test.adb
1 file changed, 13 insertions(+), 17 deletions(-)

git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/54/81854/2

To view, visit change 81854. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libgfxinit
Gerrit-Branch: main
Gerrit-Change-Id: I77dbdcd6c235e411585585779c31777adcef57d0
Gerrit-Change-Number: 81854
Gerrit-PatchSet: 2
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-CC: Elyes Haouas <ehaouas@noos.fr>
Gerrit-Attention: Nico Huber <nico.h@gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus@gmail.com>
Gerrit-MessageType: newpatchset