Page MenuHomeFreeBSD

vt: implement rotation for framebuffer consoles
Needs ReviewPublic

Authored by sg2342_googlemail.com on Feb 9 2022, 1:41 AM.

Details

Reviewers
imp
emaste
Summary

tunable "kern.vt.rotate" controls behaviour:
1 - if witdh < height (Portrait mode display): rotate 270 degrees
90 - rotate 90 degrees
180 - rotate 180 degrees
270 - rotate 270 degrees
all other values or undefined - no rotation

https://reviews.freebsd.org/D34220 must be merged before this can go in, otherwise vt_cpulogos will write outside of framebuffer memory if the rotation is 90 or 270.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 44549
Build 41437: arc lint + arc unit

Event Timeline

cem added inline comments.
sys/sys/fbio.h
158–159

Maybe 0x10, 0x20?

sys/sys/fbio.h
158–159

I am not even sure these belong in fbio.h at all; i'm also unsure about the naming. before this change elements of fb_info where relevant for all fb users, the _ROTATE_ flags are only relevant for vt. but i needed a place to stash 2 bits.

flags base 16 in fbio.h, style(9) in vt_fb.c

  • reduce number of fb_flags to two
  • use switch/case in vt_fb_setpixel() and vt_fb_bitblt_bitmap() rotation code
  • in vt_fb_setpixel(): re-order offset calculation in the 90 degree case
  • vt_fb_bitblt_bitmap(): add break after the last case