Bug 193910

Summary: vt(4): add ability to restore default font via vidcontrol(1) [patch]
Product: Base System Reporter: Marcin Cieślak <saper>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: dumbbell, emaste, pi
Priority: --- Keywords: patch, vt
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to add PIO_VDFTFONT ioctl to vt(4) none

Description Marcin Cieślak 2014-09-24 22:24:58 UTC
Created attachment 147651 [details]
Patch to add PIO_VDFTFONT ioctl to vt(4)

I tried loading gallant.fnt which I did not
like and I was wondering how to come back to
the nice default font.

There does not seem to be the way to do this,
so please find below a simple patch to add
this functionality.

It adds a new ioctl PIO_VDFFONT to the vt(4)
driver. I hope I got the reference counting
on the vt_font_default structure right.

With this patch applied, "vidcontrol -f" restores
the built-in font.
Comment 1 commit-hook freebsd_committer freebsd_triage 2014-10-23 12:39:05 UTC
A commit references this bug:

Author: dumbbell
Date: Thu Oct 23 12:38:07 UTC 2014
New revision: 273544
URL: https://svnweb.freebsd.org/changeset/base/273544

Log:
  vt(4): Add PIO_VFONT_DEFAULT ioctl to restore the default builtin font

  To restore the default font using vidcontrol(1), use the "-f" flag
  without an argument:
      vidcontrol -f < /dev/ttyv0

  PR:		193910
  Differential Revision:	https://reviews.freebsd.org/D971
  Submitted by:	Marcin Cieslak <saper@saper.info>
  Reviewed by:	ray@, emaste@
  Approved by:	ray@
  MFC after:	1 week

Changes:
  head/sys/dev/vt/vt_core.c
  head/sys/sys/consio.h
  head/usr.sbin/vidcontrol/vidcontrol.1
  head/usr.sbin/vidcontrol/vidcontrol.c
Comment 2 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2014-10-23 12:52:27 UTC
Compared to your originl patch, I renamed the ioctl to PIO_VFONT_DEFAULT which is more readable IMHO.

Thank you Marcin for your contribution!
Comment 3 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2014-10-23 12:54:00 UTC
For the record, the associated review was here:
https://reviews.freebsd.org/D971
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-10-31 23:11:14 UTC
A commit references this bug:

Author: dumbbell
Date: Fri Oct 31 23:10:59 UTC 2014
New revision: 273921
URL: https://svnweb.freebsd.org/changeset/base/273921

Log:
  vt(4): Add PIO_VFONT_DEFAULT ioctl to restore the default builtin font

  To restore the default font using vidcontrol(1), use the "-f" flag
  without an argument:
      vidcontrol -f < /dev/ttyv0

  PR:		193910
  Differential Revision:	https://reviews.freebsd.org/D971
  Submitted by:	Marcin Cieslak <saper@saper.info>
  Reviewed by:	ray@, emaste@
  Approved by:	ray@
  MFC of:		r273544

Changes:
_U  stable/10/
  stable/10/sys/dev/vt/vt_core.c
  stable/10/sys/sys/consio.h
  stable/10/usr.sbin/vidcontrol/vidcontrol.1
  stable/10/usr.sbin/vidcontrol/vidcontrol.c