video: Adjust rotated console to start at right edge
authorSimon Glass <sjg@chromium.org>
Fri, 3 Jul 2020 03:12:17 +0000 (21:12 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Thu, 9 Jul 2020 04:33:24 +0000 (12:33 +0800)
commit9beb364a2844605ae664c048853bcfef769f9464
tree265096bade1fda7186b34428a429e515f758ed52
parenta254d11dda3064489eeffa5cb935b212986627f3
video: Adjust rotated console to start at right edge

At present when the console is rotated 180 degrees it starts almost a
whole character to the left of the right edge (typically 7 pixels with
an 8-pixel-wide font). On a display which aligns with the font width,
this just wastes space. On a display that does not this can result in
x_frac going negative for the final character (the one on the left
side) and the overflow -EAGAIN check at the start of the function
failing.

Change the function to start at the rightmost pixel to fix these
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
drivers/video/console_rotate.c
test/dm/video.c