On 2026-08-31T16:30:56, Valentin Haudiquet
<[email protected]> wrote:
> video: console: fix scrolling on rotated consoles
>
> For odd rotations (rot=1 and rot=3) the console rows advance along the
> physical X axis by the font height (priv->y_charsize): console_move_rows()
> and console_set_row() treat a row as fontdata->height physical columns.
>
> But the scroll condition in vidconsole_newline() compared the cursor
> position against the font *width* (priv->x_charsize):
>
>     priv->ycur + priv->x_charsize > vid_priv->xsize
>
> The condition is only met at the bottom boundary when
> (xsize % font_height) < font_width. With CONFIG_VIDEO_FONT_16X32 on a
> 1200x1920 panel used with rot=3, xsize % 32 == 16 == font_width, so the
> condition is never true at the boundary: the console fills the visible
> rows and then keeps drawing past the right screen edge, corrupting the
> following scanout line (and past the framebuffer allocation on the last
> scanout line), with no visible scrolling.
>
> Use priv->y_charsize in the odd-rotation branch, matching the even-
> rotation branch which already correctly compares against the character
> height. With this the cursor wraps back to row 0 and scrolling advances
> by one row per newline as expected.
>
> Fixes: 18a85cf7b5da ("video: Avoid starting a new line to close to the 
> bottom")
> Signed-off-by: Valentin Haudiquet <[email protected]>
>
> drivers/video/vidconsole-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to