1. 23 Sep, 2021 1 commit
  2. 25 Aug, 2018 1 commit
    • Colin Percival's avatar
      Speed up vt(4) by keeping a record of the most recently drawn character and · ee97b233
      Colin Percival authored
      the foreground and background colours.  In bitblt_text functions, compare
      values to this cache and don't re-draw the characters if they haven't changed.
      When invalidating the display, clear this cache in order to force characters
      to be redrawn; also force full redraws between suspend/resume pairs since odd
      artifacts can otherwise result.
      
      When scrolling the display (which is where most time is spent within the vt
      driver) this yields a significant performance improvement if most lines are
      less than the width of the terminal, since this avoids re-drawing blanks on
      top of blanks.
      
      (Note that "re-drawing" here includes writing to the VGA text mode buffer; on
      virtualized systems this can be extremely slow since it triggers a glyph
      being rendered onto a 640x480 screen).
      
      On a c5.4xlarge EC2 instance (with emulated text mode VGA) this cuts the time
      spent in vt(4) during the kernel boot from 1200 ms to 700ms; on my laptop
      (with a 3200x1800 display) the corresponding time is reduced from 970 ms down
      to 155 ms.
      
      Reviewed by:	imp, cem
      Approved by:	re (gjb)
      Relnotes:	Significant speedup in vt(4) and the system boot generally.
      Differential Revision:	https://reviews.freebsd.org/D16723
      ee97b233
  3. 07 Aug, 2018 1 commit
    • Colin Percival's avatar
      Replace a pair of 8-bit writes to VGA memory with a single 16-bit write. · 0b4d5eb8
      Colin Percival authored
      The VGA "text mode" buffer has a pair of bytes for each character: One
      byte for the character symbol, and an "attribute" byte encoding the
      foreground and background colours.  When updating the screen, we were
      writing these two bytes separately.
      
      On some virtualized systems, every write results in a glyph being redrawn
      into a (graphical) virtual screen; writing these two bytes separately
      results in twice as much work being done to draw characters, whereas if
      we perform a single 16-bit write instead, the character only needs to be
      redrawn once.
      
      On an EC2 c5.4xlarge instance, this change cuts 1.30s from the kernel boot,
      speeding it up from 8.90s to 7.60s.
      
      MFC after:	1 week
      0b4d5eb8
  4. 25 Jun, 2018 4 commits
  5. 18 May, 2018 1 commit
    • Ed Maste's avatar
      vt: add more cp437 mappings for vga textmode · 649d7b46
      Ed Maste authored
      In UTF-8 locales mandoc uses a number of characters outside of the Basic
      Latin group, e.g. from general punctuation or miscellaneous mathematical
      symbols, and these rendered as ? in text mode.
      
      This change adds (char, replacement, code point, description):
      
          ¦ | U+00A6 Broken bar
          ✓ √ U+2713 Checkmark
      
      Sponsored by:   The FreeBSD Foundation
      649d7b46
  6. 10 May, 2018 1 commit
    • Jean-Sébastien Pédron's avatar
      vt(4): Use default VGA palette · 5e251aec
      Jean-Sébastien Pédron authored
      Before this change, the VGA palette was configured to match the shell
      palette (e.g. color #1 was red). There was one glitch early in boot when
      the vt(4)'s VGA palette was loaded: the loader's logo would switch from
      red to blue. Likewise for the "Booting..." message switching from blue
      to red. That's because the loader's logo was drawed with the default VGA
      palette where a few colors are swapped compared to the shell palette
      (e.g. blue <-> red).
      
      This change configures the default VGA palette during initialization and
      converts input's colors from shell to VGA palette index.
      
      There should be no visible changes, except the loader's logo which will
      keep its original color.
      
      Reviewed by:	eadler
      5e251aec
  7. 12 Apr, 2018 1 commit
    • Ed Maste's avatar
      vt: add three more cp437 mappings for vga textmode · 185aba2d
      Ed Maste authored
      In UTF-8 locales mandoc uses a number of characters outside of the Basic
      Latin group, e.g. from general punctuation or miscellaneous mathematical
      symbols, and these rendered as ? in text mode.
      
      This change adds (char, replacement, code point, description):
      
          – - U+2013 En Dash
          ⟨ < U+27E8 Mathematical Left Angle Bracket
          ⟩ > U+27E9 Mathematical Right Angle Bracket
      
      This change addresses some common cases; there are others that still
      need to be added after a more thorough review.
      
      PR:		227409
      MFC after:	1 week
      Sponsored by:	The FreeBSD Foundation
      185aba2d
  8. 13 Mar, 2018 1 commit
  9. 14 Jun, 2017 1 commit
  10. 30 Apr, 2016 1 commit
  11. 26 Apr, 2016 1 commit
  12. 28 Mar, 2016 1 commit
  13. 13 Aug, 2015 1 commit
    • Marcel Moolenaar's avatar
      Fix text mode operation. · 6280434f
      Marcel Moolenaar authored
      We first map 64KB at 0xA0000 and then determine whether to work
      in text or graphics mode.  When graphics mode, the mapping is
      precisely what we need and everything is fine.  But text mode,
      has the frame buffer relocated to 0xB8000. We didn't map that
      much to safely add 0x18000 bytes to the base address.
      
      Now we first check whether to work in text or graphics mode and
      then map the frame buffer at the right address and with the
      right size (0xA0000+64KB for graphics, 0xB8000+32KB for text).
      
      PR:		202276
      Tested by:	ed@
      6280434f
  14. 12 Aug, 2015 1 commit
    • Marcel Moolenaar's avatar
      Better support memory mapped console devices, such as VGA and EFI · 7ef5e8bc
      Marcel Moolenaar authored
      frame buffers and memory mapped UARTs.
      
      1.  Delay calling cninit() until after pmap_bootstrap(). This makes
          sure we have PMAP initialized enough to add translations. Keep
          kdb_init() after cninit() so that we have console when we need
          to break into the debugger on boot.
      2.  Unfortunately, the ATPIC code had be moved as well so as to
          avoid a spurious trap #30. The reason for which is not known
          at this time.
      3.  In pmap_mapdev_attr(), when we need to map a device prior to the
          VM system being initialized, use virtual_avail as the KVA to map
          the device at. In particular, avoid using the direct map on amd64
          because we can't demote by virtue of not being able to allocate
          yet. Keep track of the translation.
          Re-use the translation after the VM has been initialized to not
          waste KVA and to satisfy the assumption in uart(4) that the handle
          returned for the low-level console is the same as later returned
          when the device is probed and attached.
      4.  In pmap_unmapdev() remove the mapping from the table when called
          pre-init. Otherwise keep the mapping. During bus probe and attach
          device resources are mapped and unmapped multiple times, which
          would have us destroy the mapping used by the low-level console.
      5.  In pmap_init(), set pmap_initialized to signal that we're not
          pre-init anymore. On amd64, bring the direct map in sync with the
          translations created at that time.
      6.  Implement bus_space_map() and bus_space_unmap() for real: when
          the tag corresponds to memory space, call the corresponding
          pmap_mapdev() and pmap_unmapdev() functions to construct and
          actual handle.
      7.  In efifb.c and vt_vga.c, remove the crutches and hacks and simply
          call pmap_mapdev_attr() or bus_space_map() as desired.
      
      Notes:
      1.  uart(4) already used bus_space_map() during low-level console
          setup but since serial ports have traditionally been I/O port
          based, the lack of a proper implementation for said function
          was not a problem. It has always supported memory mapped UARTs
          for low-level consoles by setting hw.uart.console accordingly.
      2.  The use of the direct map on amd64 without setting caching
          attributes has been a bigger problem than previously thought.
          This change has the fortunate (and unexpected) side-effect of
          fixing various EFI frame buffer problems (though not all).
      
      PR: 191564, 194952
      
      Special thanks to:
      1.  XipLink, Inc -- generously donated an Intel Bay Trail E3800
          based eval board (ADLE3800PC).
      2.  The FreeBSD Foundation, in particular emaste@ -- for UEFI
          support in general and testing.
      3.  Everyone who tested the proposed for PR 191564.
      4.  jhb@ and kib@ for being a soundboard and applying a clue bat
          if so needed.
      7ef5e8bc
  15. 29 Apr, 2015 1 commit
  16. 01 Mar, 2015 1 commit
    • Jean-Sébastien Pédron's avatar
      vt(4): Add support to "downgrade" from eg. vt_fb to vt_vga · 76e2f976
      Jean-Sébastien Pédron authored
      The main purpose of this feature is to be able to unload a KMS driver.
      
      When going back from the current vt(4) backend to the previous backend,
      the previous backend is reinitialized with the special VDF_DOWNGRADE
      flag set. Then the current driver is terminated with the new "vd_fini"
      callback.
      
      In the case of vt_fb and vt_vga, this allows the former to pass the
      vgapci device vt_fb used to vt_vga so the device can be rePOSTed.
      
      Differential Revision:	https://reviews.freebsd.org/D687
      76e2f976
  17. 05 Feb, 2015 1 commit
  18. 30 Dec, 2014 1 commit
  19. 22 Dec, 2014 1 commit
    • Roger Pau Monné's avatar
      vt: register the memory regions used by the vt drivers · acb332a8
      Roger Pau Monné authored
      Current VT drivers don't register the memory regions they use with the
      nexus. This patch makes vt_vga and vt_efifb register the memory regions they
      use.
      
      This is needed (at least) for Xen support, since the FreeBSD kernel will try
      to use the holes in the memory map to map memory from other domains and
      setup it's grant table.
      
      Sponsored by:		Citrix Systems R&D
      Reported by:		sbruno
      Tested by:		emaste
      Reviewed by:		ray
      PR:			195537
      Differential Revision:	https://reviews.freebsd.org/D1291
      acb332a8
  20. 05 Sep, 2014 1 commit
  21. 25 Aug, 2014 2 commits
  22. 24 Aug, 2014 1 commit
  23. 23 Aug, 2014 3 commits
    • Jean-Sébastien Pédron's avatar
      vt(4): Add vd_bitblt_bmp_t callback · 631bb572
      Jean-Sébastien Pédron authored
      The code was already there in all backends, we just expose it. This is
      used to display the splash screen.
      
      MFC after:	1 week
      631bb572
    • Jean-Sébastien Pédron's avatar
      vt(4): Fix cursor handling in vt_flush() · 946d0288
      Jean-Sébastien Pédron authored
      There were situations where the cursor was not erased/redrawn or its
      position was marked as dirty even though it's not displayed. The code is
      now more straightforward.
      
      At the same, add a function to determine if the cursor covers a given
      area. This is used by backends to know if they need to draw the cursor.
      
      This new function should be paired with a new state in struct vt_device,
      called vd_mshown, which indicates if the cursor should be displayed.
      This again simplifies vd_bitblt_text_t callback's API.
      
      MFC after:	1 week
      946d0288
    • Jean-Sébastien Pédron's avatar
      vt_vga: Give only the character part of term_char_t to vga_get_cp437() · 81788a2b
      Jean-Sébastien Pédron authored
      This fixes a bug where vga_get_cp437() was called with an invalid
      argument. The screen was then filled with '?' instead of the actual
      character.
      
      MFC after:	1 week
      81788a2b
  24. 22 Aug, 2014 6 commits
  25. 21 Aug, 2014 1 commit
  26. 07 Aug, 2014 1 commit
  27. 03 Aug, 2014 1 commit
  28. 07 Jul, 2014 1 commit
    • Marcel Moolenaar's avatar
      Remove ia64. · e7d939bd
      Marcel Moolenaar authored
      This includes:
      o   All directories named *ia64*
      o   All files named *ia64*
      o   All ia64-specific code guarded by __ia64__
      o   All ia64-specific makefile logic
      o   Mention of ia64 in comments and documentation
      
      This excludes:
      o   Everything under contrib/
      o   Everything under crypto/
      o   sys/xen/interface
      o   sys/sys/elf_common.h
      
      Discussed at: BSDcan
      e7d939bd
  29. 18 Jun, 2014 1 commit