Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pc-tty: add framebuffer-based console #515

Merged
merged 4 commits into from
Nov 22, 2024
Merged

Conversation

adamgreloch
Copy link
Member

@adamgreloch adamgreloch commented Sep 25, 2024

Adds a graphics mode console that prints terminal output in 8x16 font to a linear framebuffer located under address queried via platformctl/pctl_graphmode in a maximum resolution supported by current graphic mode

This implementation assumes ARGB ordering of the framebuffer

JIRA: RTOS-925

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: ia32 qemu/hw

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

tty/pc-tty/ttypc.h Outdated Show resolved Hide resolved
@phoenix-rtos phoenix-rtos deleted a comment from github-actions bot Oct 4, 2024
@phoenix-rtos phoenix-rtos deleted a comment from github-actions bot Oct 4, 2024
@phoenix-rtos phoenix-rtos deleted a comment from github-actions bot Oct 4, 2024
@phoenix-rtos phoenix-rtos deleted a comment from github-actions bot Oct 4, 2024
@phoenix-rtos phoenix-rtos deleted a comment from github-actions bot Oct 4, 2024
@adamgreloch adamgreloch marked this pull request as ready for review October 4, 2024 08:26
@adamgreloch adamgreloch marked this pull request as draft October 4, 2024 11:41
@adamgreloch adamgreloch force-pushed the adamgreloch/RTOS-925 branch from 2654383 to 548f3f7 Compare October 4, 2024 12:40
tty/pc-tty/ttypc_vt.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_vt.c Show resolved Hide resolved
tty/pc-tty/ttypc_vt.c Show resolved Hide resolved
@adamgreloch adamgreloch force-pushed the adamgreloch/RTOS-925 branch 3 times, most recently from 6d0bbae to 1370274 Compare October 7, 2024 07:33
@adamgreloch adamgreloch marked this pull request as ready for review October 10, 2024 14:47
@adamgreloch adamgreloch force-pushed the adamgreloch/RTOS-925 branch 2 times, most recently from c8fb3ba to 7a450db Compare October 21, 2024 07:58
Copy link

github-actions bot commented Oct 21, 2024

Unit Test Results

7 958 tests  +9   7 416 ✅ +185   42m 1s ⏱️ - 1m 45s
  470 suites +9     542 💤  - 176 
    1 files   ±0       0 ❌ ±  0 

Results for commit 543c775. ± Comparison against base commit 3a4fd5d.

This pull request removes 729 and adds 738 tests. Note that renamed tests count towards both.
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.A
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.E
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.F
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.G
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.a
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.e
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.f
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.g
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.inf_nan_a
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.inf_nan_e
…
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.A
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.E
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.F
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.G
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.a
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.e
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.f
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.g
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.inf_nan_a
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_aefg.inf_nan_e
…
This pull request removes 137 skipped tests and adds 33 skipped tests. Note that renamed tests count towards both.
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.A
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.E
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.F
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.G
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.a
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.e
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.f
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.g
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.inf_nan_a
phoenix-rtos-tests/libc/scanf ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf.stdio_scanf_aefg.inf_nan_e
…
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_rest.m_brackets
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_rest.m_c
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_rest.m_s
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_squareBrackets.white_spaces
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_rest.m_brackets
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_rest.m_c
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_rest.m_s
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_squareBrackets.white_spaces
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_rest.m_brackets
phoenix-rtos-tests/libc/scanf-advanced ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/libc/scanf-advanced.stdio_scanf_rest.m_c
…

♻️ This comment has been updated with latest results.

tty/pc-tty/ttypc.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_fbcon.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_fbcon.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_fbcon.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_fbcon.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_fbfont.h Show resolved Hide resolved
tty/pc-tty/ttypc_vga.c Show resolved Hide resolved
tty/pc-tty/ttypc_vga.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_vga.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_fbcon.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_vga.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_vt.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_vga.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_vt.c Outdated Show resolved Hide resolved
tty/pc-tty/ttypc_vt.c Outdated Show resolved Hide resolved
Adds a graphics mode console that prints terminal output in 8x16 font
to a linear framebuffer located under address queried via platformctl/pctl_graphmode
in a 80x25 terminal resolution.

This implementation assumes ARGB ordering of the framebuffer

JIRA: RTOS-925
Graphical apps can now disable console drawing via ioctl/TTYSETMODE to
ensure uninterrupted drawing (otherwise app and console would draw
to the framebuffer in the same time, causing mess)

JIRA: RTOS-925
Current vt will now automatically resize from 80x25 to the maximum
resolution supported by current graphic mode if fbcon is enabled
(i.e. for 1280x800 and 8x16 font it will resize to 160x50)

JIRA: RTOS-925
Since the _ttypc_vga_{set,read,write,move} have the ttypc_vt_t already
passed, they can retrieve the vga pointer from that struct. This also
makes the API more secure in case of fbcon, which implicitly assumed
vga == vt->vram when calculating char positions. Now this assumption is
guaranteed

JIRA: RTOS-925
Copy link
Member

@agkaminski agkaminski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adamgreloch adamgreloch merged commit b7db794 into master Nov 22, 2024
36 checks passed
@adamgreloch adamgreloch deleted the adamgreloch/RTOS-925 branch November 22, 2024 15:28
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.

2 participants