Skip to content

fbcon: use whole rows in the console grid - #123

Merged
FengHeting merged 4 commits into
ViudiraTech:developfrom
FengHeting:fix/fbcon-console-grid
Nov 2, 2026
Merged

FengHeting merged 4 commits into
ViudiraTech:developfrom
FengHeting:fix/fbcon-console-grid

Conversation

@FengHeting

Copy link
Copy Markdown
Contributor

Summary

  • fbcon_init() and fbcon_resize() size the grid with height / font_height, so every allocated row is fully visible instead of the last row extending past the framebuffer and being clipped cell by cell. The uncovered bottom strip is still painted by fbcon_clear_uncovered_bottom().
  • The grid is clamped to at least 1x1 for framebuffers smaller than a cell.
  • video_get_info() returns the tracked c_width/c_height instead of recomputing them, so callers see the grid fbcon actually allocated, including the 80x25 fallback.

Testing

Default configuration builds.

The grid used ceil(height / font_height) rows, so the last allocated
row extended past the framebuffer and had to be clipped cell by cell.
Round down when sizing the grid in fbcon_init() and fbcon_resize() so
every console row is fully visible; the uncovered bottom strip is
already painted by fbcon_clear_uncovered_bottom().  Clamp the grid to
at least one row and one column for framebuffers smaller than a cell.

Signed-off-by: MicroFish <2609948707@qq.com>
video_get_info() recomputed the console grid from the framebuffer and
font dimensions instead of reporting the grid fbcon owns.  That misses
the 80x25 fallback used when the framebuffer is smaller than a cell and
can disagree with the allocated grid.  Return the tracked c_width and
c_height so callers see the console grid that is actually in use.

Signed-off-by: MicroFish <2609948707@qq.com>
@FengHeting
FengHeting merged commit 0fab7f9 into ViudiraTech:develop Nov 2, 2026
2 checks passed
@FengHeting
FengHeting deleted the fix/fbcon-console-grid branch November 2, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant