Commit Graph

48 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron
81788a2b59 vt_vga: Give only the character part of term_char_t to vga_get_cp437()
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
2014-08-23 07:02:57 +00:00
Jean-Sébastien Pédron
523473b8f7 vt_vga: Remove a "FIXME" comment; the issue was solved in r270338
MFC after:	1 week
2014-08-22 17:05:41 +00:00
Jean-Sébastien Pédron
ccd5615a33 vt(4): The offset to center the text area is per-window now
The previous global offset, based on the last loaded font, had no
meaning for other windows. This caused a shifted text area, often partly
out-of-screen.

MFC after:	1 week
2014-08-22 15:36:57 +00:00
Jean-Sébastien Pédron
ab06c77688 vt(4): Give the window to vd_bitblt_text_t callback
... instead of both the buffer and the font. Again, this simplifies the
API.

MFC after:	1 week
2014-08-22 15:16:41 +00:00
Jean-Sébastien Pédron
3235c9eb55 vt(4): Store cursor bitmap & colors in struct vt_device
This removes the need to specify them to each call to vd_bitblt_text_t
and, therefore, simplifies the API.

MFC after:	1 week
2014-08-22 14:31:53 +00:00
Jean-Sébastien Pédron
37fcd2911e vt_vga: Clip the draw area to never draw offscreen
This fixes a bug when two windows use different fonts, but a longer-term
solution is required. The dirty area should be stored as pixels, not
character cells, because such coordinates don't have the same meaning in
all windows, when using different fonts.

MFC after:	1 week
2014-08-22 10:49:51 +00:00
Jean-Sébastien Pédron
bdcaf97c3e vt(4): Add new vd_bitblt_text_t callback, and implement it for vt_vga
Compared to the deprecated vd_bitbltchr_t callback, vd_bitblt_text_t
receives:
    o  the whole text buffer
    o  the dirty area
    o  the mouse cursor (map, position, colors)

This allows the backend to perform optimization on how to draw things.
The goal is to remove vd_bitbltchr_t and vd_putchar_t, once all driver
are converted (only vt_vga is included in this commit).

In vt_vga, this allows to draw the text and the cursor in one pass,
without ever reading from video memory (because it has all the context).
The main benefit is the speed improvement: no more slideshow during
boot!

Other bugs fixed in vt_vga are:
    o  left-most characters are drawn properly (the left-most pixels were
       missing with bold characters and some wide letters such as 'm')
    o  no more black square around the cursor
    o  no cursor flickering when the text is scrolling

There are still many problems to fix: the known issues are marked with
"FIXME" inside the code.

MFC after:	1 week
2014-08-22 08:22:40 +00:00
Jean-Sébastien Pédron
0c1c6af438 vt_vga: When clearing video memory, don't read from it
The goal is to clear the video memory, in case an application drew to
it. So the content shouldn't be loaded in the latches, it can't be
trusted anyway.

This improves a bit the window switch speed.

MFC after:	1 week
2014-08-21 20:10:05 +00:00
Jean-Sébastien Pédron
19e2ce2d83 vt(4): Colors are indexed against a console palette, not a VGA palette
Rename vt_generate_vga_palette() to vt_generate_cons_palette() and
change it to build a palette where the color index is the same than in
terminal escape codes, not the VGA index. That's what TCHAR_CREATE()
uses and passes to vt(4).

The main differences between both orders are:
    o  Blue and red are swapped (1 <-> 4)
    o  Yellow and cyan are swapped (3 <-> 6)

The problem remained unnoticed, because the RGB bit indexes passed to
vt_generate_vga_palette() were reversed. This inversion was cancelled
by the colors inversions in the generated palette. For instance, red
(0xff0000) and blue (0x0000ff) have bytes in opposite order, but were
swapped in the palette. But after changing the value of blue (see last
paragraph), the modified color was in fact the red one.

This commit includes a fix to creator_vt.c, submitted by Nathan
Whitehorn: fb_cmsize is set to 16. Before this, the generated palette
would be overwritte. This fixes colors on sparc64 with a Creator3D
adapter.

While here, tune the palette to better match console colors and improve
the readability (especially the dark blue).

Submitted by:	nwhitehorn (fix to creator_vt.c)
MFC after:	1 week
2014-08-10 17:04:10 +00:00
Nathan Whitehorn
0f3ec4da2f Retire vd_maskbitbltchr. The same functionality can be obtained by testing
for mask != NULL in vd_bitbltchr, which all implementations of vd_bitbltchr()
were doing anyway.
2014-08-07 21:00:16 +00:00
Nathan Whitehorn
f051baa008 Set fb_pbase properly on PowerPC in the case where we have to guess at
the right register bank for the framebuffer. Disable the assigned-addresses
path on SPARC since it is just a hack for IBM PPC systems and was neither
relevant for nor worked on SPARC anyway.
2014-08-06 18:13:09 +00:00
Nathan Whitehorn
9ed297c83c Retire various intertwined bits of fbd(4) and vt_fb, in particular the
pixel modification indirection. No actual drivers use it and those that
might (e.g. creatorfb) use custom implementations of vd_bitbltchr().
2014-08-06 00:35:48 +00:00
Aleksandr Rybalko
34cb8c9fb5 Fix vt_vga driver to draw not-8-bit-aligned fonts correctly.
Still one bug here: mouse left some gaps on track when moving left.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-08-03 11:01:35 +00:00
Nathan Whitehorn
2661dd32df Don't assume that the framebuffer driver is using vt_fb_blank() when blanking
the screen during init.

MFC after:	1 week
2014-08-02 17:45:08 +00:00
Nathan Whitehorn
232490c660 Make mmap() of the console device when using ofwfb work like other supported
framebuffer drivers. This lets ofwfb work with xf86-video-scfb and makes
the driver much more generic and less PCI-centric. This changes some
user-visible behavior and will require updates to the xorg-server port
on PowerPC when using ATI graphics cards.
2014-07-29 23:11:05 +00:00
Nathan Whitehorn
35e6436e38 Fix embarassing typos I made.
Submitted by:	rayddteam
2014-07-17 12:47:34 +00:00
Nathan Whitehorn
351e92cc2d Allow efifb to be used with xf86-video-scfb. This is important for EFI
systems without either a CSM or real graphics drivers, such as my Lenovo
Haswell laptop.

This provides working X with the small complication of a console cursor
permanently overlaid on the upper-left corner of the screen that will be
dealt with later.

Also remove some redundant screen clearing.
2014-07-16 18:52:21 +00:00
Nathan Whitehorn
60d7ea3d32 Allow console drivers active from early boot to be used with xf86-video-scfb,
rather than only drivers attached later on. This involves a small amount of
code duplication with dev/fb/fbd.c, which will fixed later on.

Also improve performance of vt_blank() by making it not read from the
framebuffer unnecessarily.
2014-07-16 18:49:46 +00:00
Nathan Whitehorn
b85beee188 On my Lenovo laptop, the firmware maps the EFI framebuffer with MTRRs set
to uncacheable. This leads to execrable console performance. Once PMAP is
up, remap the framebuffer as write-combining. This reduces boot time on my
laptop by 60% when booting with EFI.

MFC after:	2 weeks
2014-07-14 17:42:22 +00:00
Marcel Moolenaar
e7d939bda2 Remove ia64.
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
2014-07-07 00:27:09 +00:00
Nathan Whitehorn
00cf40b0ca Use common vt_fb parts in ofwfb as far as we are able without sacrificing
performance.

MFC after:	2 weeks
2014-07-07 00:12:18 +00:00
Aleksandr Rybalko
a401c53acb Rename vt(4) vga module to dismiss interference with syscons(4) vga module.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-06-18 22:10:10 +00:00
Ed Maste
4163c83ff6 Correct unicode map for VGA ROM character 0x0e
The character is a beamed pair of sixteenth notes, so should be U+266C
not U+266B (beamed eighth notes).
2014-06-10 01:19:48 +00:00
Aleksandr Rybalko
bf03576620 Remove driver as unused.
MFC after:	7 days
Sponsored by:	The FreeBSD Foundation
2014-05-29 12:29:58 +00:00
Nathan Whitehorn
0ee4b22d75 Port over mmap routine from syscons. This lets X11 work on PowerPC with vt.
The last obstacle to switching PowerPC entirely to vt is that the Playstation 3
framebuffer driver needs to be ported over. This only applies for powerpc64,
however.
2014-05-11 02:16:08 +00:00
Nathan Whitehorn
015ac42e4b Make ofwfb not be painfully slow. This reduces the time for a verbose boot
on my G4 iBook by more than half. Still 10% slower than syscons, but that's
much better than a factor of 2.

The slowness had to do with pathological write performance on 8-bit
framebuffers, which are almost universally used on Open Firmware systems.
Writing 1 byte at a time, potentially nonconsecutively, resulted in many
extra PCI write cycles. This patch, in the common case where it's writing
one or several characters in an 8x8 font, gangs the writes together into
a set of 32-bit writes. This is a port of r143830 to vt(4).

The EFI framebuffer is also extremely slow, probably for the same reason,
and the same patch will likely help there.
2014-05-11 01:58:56 +00:00
Nathan Whitehorn
bdf49e3953 Make ofwfb actually work again. Apparently the API it was written against
still exists but is now silently ignored by the VT core. At least xboxfb
needs similar changes.
2014-05-11 01:19:55 +00:00
Aleksandr Rybalko
7273a5307a No need to assign fields required and checked on probe.
Sponsored by:	The FreeBSD Foundation
2014-05-08 13:38:29 +00:00
Aleksandr Rybalko
f3d2e242ec Switch vga drivers to use names and new vt(4) driver probe method.
Sponsored by:	The FreeBSD Foundation
2014-05-05 22:12:46 +00:00
Aleksandr Rybalko
5a0e08fb31 Revert r264997 and r265026. It is not required anymore.
Sponsored by:	The FreeBSD Foundation
2014-05-05 22:10:31 +00:00
Aleksandr Rybalko
ac7073a9d5 Add vt(4) driver name for ofwfb driver.
Sponsored by:	The FreeBSD Foundation
2014-05-05 21:49:31 +00:00
Aleksandr Rybalko
4dde16408c Switch fb and efifb drivers to use names and new vt(4) driver probe method.
Sponsored by:	The FreeBSD Foundation
2014-05-05 21:48:19 +00:00
Nathan Whitehorn
43336b6385 No EFI on i386. This unbreaks the i386 VT kernel build. 2014-04-27 20:36:19 +00:00
Nathan Whitehorn
7ff9cf1d06 Disable vga if EFI framebuffer present. vt(9) should handle this internally
based on efifb's higher priority, but it doesn't, and this at least lets
us build a kernel that boots on both BIOS and EFI systems for now.
2014-04-27 02:19:53 +00:00
Rui Paulo
916d4d8692 Need to include machine/fdt.h. 2014-04-05 23:20:49 +00:00
Aleksandr Rybalko
1da9f0d73a o Add new vd_driver method to do bitblt with mask, named vd_maskbitbltchr.
o Move vd_bitbltchr vga's driver method to vd_maskbitbltchr.
o Implement new vd_bitbltchr method for vga driver. (It do single write for 8
	pixels, have to be a bit faster).

MFC after:	7 days
Sponsored by:	The FreeBSD Foundation
2014-03-28 22:04:27 +00:00
Ed Maste
d1d4f00e9a Update EFI framebuffer handoff from loader
Sponsored by:	The FreeBSD Foundation
2014-03-27 19:43:38 +00:00
Ed Maste
58df20d29d Use the existence of module metadata to indicate framebuffer presence 2014-03-14 19:37:37 +00:00
Aleksandr Rybalko
1a89eaf224 Add efifb driver. Driver uses the data passed by UEFI compatible loader/BIOS and
enable to use framebuffer created by those loader.
2014-03-05 14:37:45 +00:00
Aleksandr Rybalko
06716ffd17 Implement vd_drawrect and vd_setpixel for vt(9)'s VGA driver.
Sponsored by:	The FreeBSD Foundation
2014-02-07 12:39:58 +00:00
Aleksandr Rybalko
9e497e7b04 Add two new vt(9) driver methods: vd_drawrect and vd_setpixel.
Implement vd_drawrect and vd_setpixel for vt_fb driver.

Sponsored by:	The FreeBSD Foundation
2014-02-06 15:12:44 +00:00
Justin Hibbits
17661cc725 Micro-optimize 8-bit blanking. This is the same as in ofw_syscons.
Reviewed by:	ray
MFC after:	1 week
2014-01-29 15:50:01 +00:00
Aleksandr Rybalko
5beb07abdd Style(9) fix.
No functional changes.

Sponsored by:	The FreeBSD Foundation
2014-01-20 23:36:16 +00:00
Aleksandr Rybalko
c3fbb0d11a Update xboxfb driver to actual state.
NOTE: Not tested.

Sponsored by:	The FreeBSD Foundation
2014-01-15 12:35:28 +00:00
Aleksandr Rybalko
92762d566e Restore VGA mode on vt switch. It fix VESA mode left by Xorg on exit.
Sponsored by:	The FreeBSD Foundation
2014-01-08 14:42:26 +00:00
Robert Millan
57a9b881a3 Fix build of vt_xboxfb. 2014-01-08 14:36:35 +00:00
Aleksandr Rybalko
7a1a32c4ef o Add virtual terminal mmap request handler.
o Forward termianl framebuffer ioctl to fbd.
o Forward terminal mmap request to fbd.
o Move inclusion of sys/conf.h to vt.h.

Sponsored by:	The FreeBSD Foundation
2013-12-23 18:09:10 +00:00
Aleksandr Rybalko
27cf7d04ef Merge VT(9) project (a.k.a. newcons).
Reviewed by:	nwhitehorn
MFC_to_10_after:	re approval

Sponsored by:	The FreeBSD Foundation
2013-12-05 22:38:53 +00:00