summaryrefslogtreecommitdiffstats
path: root/sys/dev/rasops
AgeCommit message (Collapse)AuthorFilesLines
2021-01-09Include the optimized putchar functions only if RASOPS_SMALL is notfcambus1-4/+4
defined, as was previously the case. OK kettenis@
2020-12-21Only enable rasops1_putchar8() and rasops1_putchar16() optomizations onkettenis1-5/+5
big-endian architectectures. These functions assume big-endian bit order whereas rasops1_putchar() assumes native-endian bit order. Since ssdfb(4) assumes little-endian bit order and is the only consumer of these interfaces on little-endian platforms, go with the rasop1_putchar() convention for now. ok mpi@
2020-07-23Fix comments to match code; OK fcambus@tim1-3/+3
2020-07-20Fix various whitespace and formatting issues in rasops(9).fcambus3-16/+12
2020-07-17Merge the two if blocks checking if the font in use contains a givenfcambus1-8/+3
character in rasops_mapchar(). OK kn@, cheloha@
2020-07-15Optimize character rendering in 32bpp mode, with unrolled rows andfcambus1-25/+111
pairwise foreground / background pixel rendering. This does double-pixel rendering for the common font widths (8, 12, 16, and 32 pixels wide), resulting in a significant speed-up. No regression noticed on 32-bit architectures. Tested by weerd@, and by abieber@ on macppc. From John Carmack, thanks!
2020-07-11Optimize rasops_vcons_copyrows() so write-only framebuffer consolesfcambus1-10/+25
only redraw the characters that differ between the start and end positions. This makes scrolling significantly faster. From John Carmack, thanks! OK jcs@
2020-06-16Remove old commented out line and fix indent.mortimer1-3/+2
clang-10 complains about the misleading indentation. ok patrick@
2020-05-25change wsdisplay attribute type from long to uint32_tjsg9-107/+107
miod explained it was initially a long as it was thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. suggested and reviewed by miod@
2020-05-25rename wsdisplay alloc_attr() to pack_attr()jsg2-18/+18
Suggested by John Carmack. miod agrees a rename would make sense and explained it was initially thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. ok mpi@
2019-03-24Revert rasops32_putchar() changes introduced in revision 1.8.fcambus1-8/+5
This significantly speeds up character plotting on inteldrm and radeondrm, and also on efifb(4) since the driver now remaps the framebuffer in write combining mode. OK kettenis@, jcs@
2019-03-18Modify rasops_list_font_cb() to not filter out fonts with differentfcambus1-5/+1
sizes than the currently used one. This allows getting a list of all loaded fonts when using the WSDISPLAYIO_LSFONT ioctl. On top of allowing to see all fonts which are currently loaded when invoking the -l option of wsfontload(8), it also removes the confusion as to why we might reach the WSDISPLAY_MAXFONTCOUNT limit faster than expected when loading more fonts. OK sthen@
2019-01-09Enable Spleen in wsfont and modify the font selection logic at runtimefcambus1-6/+15
in rasops(9) to allow selecting larger fonts when available. Summary of the changes: - Enable spleen8x16 for all architectures, replacing bold8x16_iso1. - Enable spleen12x24 on all arches but sparc64, replacing gallant12x22. - Enable spleen16x32 and spleen32x64 on amd64, i386, and arm64 for GENERIC kernels. - Modify the font selection logic in rasops(9) so the 16x32 and 32x64 fonts are selected if at least 120 columns can be displayed. Screens with widths equal or larger than 1920px will use the 16x32 font, and screens with widths equal or larger than 3840px the 32x64 one. OK kettenis@, ratchov@, deraadt@
2018-12-26Remove the rasops24_erasecols and rasops24_eraserows functions fromfcambus1-225/+1
rasops(9). We only build rasops24 functions on amd64 (for EFI support in QEMU) and on armv7 and arm64, and we can safely use the generic functions on those platforms, like we do for all other color depths. No other platform uses rasops24, Miod explains why here [1]. No performance regression observed when testing with QEMU in EFI mode. [1] https://marc.info/?l=openbsd-ppc&m=118664346819989&w=2 OK kettenis@
2018-09-22Only clear the character backing store when the RI_CLEAR flag is set.kettenis1-5/+7
ok deraadt@
2018-08-27Add an interface that allows drivers to claim a framebuffer and checkkettenis2-2/+40
whether another driver has already claimed a framebuffer. Use this in radeondrm(4) and simplefb(4) to prevent the latter from attaching if radeondrm(4) is attached to the hardware that provides the framebuffer set up by the firmware. ok mlarkin@
2018-08-25The current rasops cursor implementation simply inverts the appropriatekettenis1-17/+44
framebuffer pixels by doing an XOR with an all-ones bit pattern. This means the code has to read from the framebuffer which can be very slow. Add an implementation that simply redraws the character covered by the cursor with the foreground and background color swapped. While this doesn't necessarily have the same visual result, most people probably won't notice the difference (let's see). Use this implementation when the RI_WRONLY or the RI_VCONS flags are set. ok fcambus@
2018-05-03Use the default background attribute when erasing rows in doswitch andjsg1-8/+8
scrollback. Fixes use of an uninitialised attribute value in scrollback. Patch from miod@ ok kettenis@
2018-04-27rasops: implement scrollbackjcs2-17/+87
activate it for efifb and inteldrm ok kettenis
2018-04-20oops, snapshot tests not ready yetderaadt2-87/+17
2018-04-20syncderaadt2-17/+87
2018-01-23Fix underline rotation on CCW (quarter counter-clockwise) rotatedfcambus1-1/+3
screens. The "underline" was actually drawn above text. OK jcs@
2017-12-23Remove dead assignment.fcambus1-4/+1
Now that we call rasops_putchar_rotated(), we don't need ri anymore. OK kettenis@
2017-09-07In copycols() remove useless code that modifies the uninitializedbluhm1-4/+2
sp variable. Its value is not used, it is overwritten later on. found by clang -Wuninitialized; OK deraadt@
2017-08-22Update inaccurate comment: rasops_copycols() doesn't use bcopy()fcambus1-3/+3
anymore, but either memmove() or slow_bcopy(). OK nayden@
2017-08-17Implement counter-clockwise rotation.kettenis2-18/+27
ok bcook@, stsp@
2017-08-13Fix rotation in combination wth vcons support by callingkettenis1-3/+3
rasops_putchar_rotated() within the other rotation support functions. ok patrick@
2017-05-16when allocating a new screen, only copy the current buffer contentsjcs1-2/+2
to it for visible screens (i.e., the console). initialize other virtual screens with just blank character cells. ok mpi
2017-02-20memcpy a character row at a time to the framebuffer, rather thanjcs1-5/+8
sending pixel by pixel greatly speeds up the text framebuffer on some EFI implementations, such as shaving 10 seconds off a boot under VMWare Fusion ok deraadt
2016-12-15Remove rasops2 (2-bit color depth) functions, they are unused.fcambus4-485/+7
It seems unlikely that any future new platform will ever need them. OK mpi@
2016-09-26Avoid calculating offset several times. This was done for a few functions already, but not all of them.fcambus1-9/+17
OK natano@
2015-09-07Make it possible to use RI_WRONLY for the aframebuffer during early boot.kettenis2-7/+120
In this case, the caller has to provide the backing store for the screen contents by setting the ri_bs member of "struct rasops_info". The screen contents are retained if the rasops_info descriptor is later reinitialized after adding the RI_VCONS flag. ok yasuoka@, deraadt@
2015-09-01uses sizes for free()deraadt1-5/+6
2015-06-21Don't leak mem if wsfont_rotate() fails.jca1-4/+2
Problem reported by Maxime Villard, ok miod@
2015-03-14Remove some includes include-what-you-use claims don'tjsg1-2/+1
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-01-27remove the second void * argument on tasks.dlg1-5/+5
when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
2014-12-22Replace switch workq with taskq, using the blambert@ method (tm).krw2-10/+13
Tested with non-drm and wsfb systems. ok kettenis@ miod@
2014-12-19Use <sys/endian.h> instead of <machine/endian.h>guenther6-14/+12
ok dlg@ mpi@ bcook@ millert@ miod@
2014-12-13yet more mallocarray() changes.doug1-3/+5
ok tedu@ deraadt@
2014-11-20Fix previous.landry1-1/+3
Build failure reported by Sebastien Marie testing & ok phessler@
2014-11-20oops, mangled the prototypederaadt1-1/+2
2014-11-20Rename slow_ovbcopy() to slow_bcopy(), since ovbcopy means nothing toderaadt1-10/+7
the young kids and old greybeards who know that bcopy has always handled the ov case.
2014-07-12add a size argument to free. will be used soon, but for now default to 0.tedu1-4/+4
after discussions with beck deraadt kettenis.
2013-10-20No longer store fonts added with the WSDISPLAYIO_LDFONT ioctl into themiod2-2/+55
wsdisplay softc. Instead, since the knowledge about available fonts lies in the parent driver itself, introduce a list_font wsdisplay_accessop which queries a font index, suitable to use within the WSDISPLAYIO_LSFONT ioctl. With this in place: - there is no global wsdisplay limit on the number of fonts loaded. Such a limit will be enforced by the display drivers themselves. - built-in kernel fonts will now appear in the list of fonts. Grow a list_font accesop for rasops, which relies upon wsfont_enum(), which is turned into something useful (and abortable if you do not need to iterate further). Not used by any rasops driver yet.
2013-10-20Add a load_font accessop to rasops, to allow for fonts to be loaded andmiod2-2/+87
selected. All rasops fonts are managed by wsfont, which allows a font to be loaded on a rasops device and used on another. Currently not plumbed in any driver yet. This is work in progress.
2013-10-18Make sure that, when a particular mapchar() can't find a proper glyph for themiod1-4/+4
requested character in the font it is using, it suggests a question mark character, instead of a space, so that the existence of the non-representable character becomes visible. Note that this is consistent with pcdisplay which suggests a diamond for missing glyphs.
2013-08-20Define WS_DEFAULT_FG and WS_DEFAULT_BG as default colors (black on white forkettenis1-3/+3
sparc/sparc64, white on black for everybody else), and use them to construct a default color attribute in the rasops(4) code. ok miod@
2013-06-28Add support for write-only framebuffers. This makes the code that copieskettenis2-5/+36
rows and columns redraw the destination area instead of reading pixel values from the framebuffer. This can be a considerable performance win. Only works together with RI_VCONS. ok miod@
2013-06-11Replace all ovbcopy with memmove; swap the src and dst arguments tooderaadt1-5/+5
ok otto
2013-05-17Implement wsmoused support based on the new multiple screen support. Onlykettenis2-8/+26
works if the RI_VCONS flag is specified when initializing a rasops_info descriptor.