libpayload: cbgfx: Allow rotation of the display
commit564720f2c8b6c37aeceb10bd1a4064165ebdafb0
authorNicolas Boichat <drinkcat@chromium.org>
Tue, 6 Aug 2019 00:23:54 +0000 (6 08:23 +0800)
committerMartin Roth <martinroth@google.com>
Thu, 8 Aug 2019 03:20:06 +0000 (8 03:20 +0000)
treea83154135717ceb84c2338e3cfb914e00c107035
parent87f265b210e02a7aefb6da0bae61c2b0d9239a3e
libpayload: cbgfx: Allow rotation of the display

Sometimes the display native orientation does not match the device
default orientation, so allow rotation of the framebuffer before
it is displayed on screen.

set_pixel now take coordinates in the rotated coordinate system,
and converts the coordinates before writing to the framebuffer.

Also, screen.size now matches the rotated system (_not_ the
framebuffer size).

BUG=b:132049716
TEST=Boot krane, see that FW screen is orientation properly.

Change-Id: If9316c0ce33c17057372ef5995a2c68de4f11f02
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34732
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
payloads/libpayload/drivers/video/graphics.c
payloads/libpayload/include/coreboot_tables.h