Home | History | Annotate | Download | only in rasops
History log of /src/sys/dev/rasops/rasops.c
RevisionDateAuthorComments
 1.128  15-May-2022  uwe rasops: fix automagic box chars for stride > 1 on little endian

This makes DEC line drawing (acsc) work correctly for "iso" fonts of
large sizes, e.g. spleen16x32 on x86.
 1.127  15-May-2022  uwe rasops_mapchar: cosmetics, same object code.

Don't hide the important function call inside an if condition. Don't
reuse a variable, changing what it means in the middle of an
expression.
 1.126  15-May-2022  uwe rasops: make autogenerated box drawing chars actually used

Fix mapchar to use PICK_FONT() to match what putchar does. Otherwise
putchar will never get to see the glyph codes for the autogenerated
box drawing chars.
 1.125  24-Dec-2021  jmcneill wsfb: Prefer wide fonts when EDID data is available.

To give us a better chance of picking a readable font, prefer fonts that
will render at least 3mm wide instead of picking the font that will be
closest to that size.
 1.124  04-Oct-2021  rin rasops_reconfig: Do not abort even if font stride is not supported by
rasops_make_box_chars_*() functions; Stop using ri_optfont instead.

XXX
Add rasops_make_box_chars_24().
 1.123  02-Jul-2020  rin Remove pointless cast; dp is already uint32_t *.
No functional changes intended.
 1.122  10-Aug-2019  rin Misc style clean up's.
- Introduce and use proper macros.
- Use not ambiguous variable names.
- Unify similar functions as possible as I can.
- G/C unused headers.
- Use #include <dev/rasops/foo.h> instead of "foo.h"
No particular functional changes intended.
 1.121  10-Aug-2019  rin Set 4-bpp devcmap in a similar manner to non-RGB case of 8-bpp.
No functional changes since this is not in use (4-bpp is monochrome).
 1.120  09-Aug-2019  rin Correctly check whether character is in font in rasops_mapchar().
Also, make sure that in putchar functions for completeness.
 1.119  09-Aug-2019  rin Fix color range overflow; we cannot make bright colors more brighter.
 1.118  09-Aug-2019  rin When legacy Apple 4-bpp color palette is used, make green dark so that
kernel messages are printed nicely on white background.
 1.117  07-Aug-2019  rin Scaling dimensions of underline by font height.

Currently,
- offset of underline is fixed to 1-row from bottom of characters, and
- height of underline is fixed to 1.

Both are good for standard 8x16 fonts. However, it is too thin for
larger fonts, especially when used on display of high resolution.

Also, 1-row offset of underline is ugly for small fonts, e.g.,
spleen5x8.

Therefore, adjust offset and height as,
- no changes for standard 16-height fonts.
- scaling by font height for larger fonts.
- set offset to zero for fonts of height smaller than 16.
 1.116  07-Aug-2019  rin If RI_CLEAR is set, do not forget to clear real framebuffer.
 1.115  07-Aug-2019  rin Stop allocating ri_buf and ri_stamp dynamically. As commented in
rasops.h, it is not safe to use kmem_alloc(9) in rasops_init();
rasops routines can be used for early putchar, which means that
UVM is not fully initialized.

Should fix a problem reported by macallan:
http://mail-index.netbsd.org/tech-kern/2019/08/02/msg025327.html

Instead of using ri_buf, inline function rasops_memcpy32() is
introduced to fill 32bit data efficiently.

Instead of using ri_stamp (per device stamp), stamp_ri is
introduced to distinguish for which device stamp is calculated.
 1.114  07-Aug-2019  rin Simplify rasops_do_cursor():

- Use static masks similar to that used in rasops_bitops.h,
rather than generating them on the fly.
- Use pointer for proper type to avoid unnecessary casts.
 1.113  07-Aug-2019  rin Fix a critical bug for rasops_copyrows() introduced in rev. 1.90:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/rasops/rasops.c#rev1.90

When src < dst, we have to copy backward.
 1.112  07-Aug-2019  rin Depth 2 is monochrome.

IMO, it is impossible to support ANSI colors on 2-bpp display; fore-
and background can be same value even if they are different colors
logically.
 1.111  07-Aug-2019  rin Fix black color-attribution for depths 2 and 4.
 1.110  07-Aug-2019  rin Simplify calculation for 12-byte alignment.
No functional changes.
 1.109  07-Aug-2019  rin Use _KERNEL_OPT.
 1.108  02-Aug-2019  rin Real fix for 24-bpp color:
- When centering screen, locate effective base address of framebuffer to
both word and 24-bit color boundary.
- Consistently convert ri_devcmap to ``big endian'' if not RI_BSWAP.

Also, fix possible bug for 15/16-bpp with RI_BSWAP (not tested).
 1.107  02-Aug-2019  rin Fix unaligned writes to buffer, that are introduced in 1.105:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/rasops/rasops.c#rev1.105
 1.106  02-Aug-2019  rin Oops, for rasops_copycols(), we cannot use memmove even if src == dst.
On the other hand, memmove is safe for rasops_copyrows().
 1.105  31-Jul-2019  rin Provide buffer capable of single-row pixels in order to make things simpler.

XXX
Bump kernel version for rasops_info later.
 1.104  31-Jul-2019  rin G/C ri_delta.

XXX
Bump kernel version after other changes for struct rasops_info.
 1.103  31-Jul-2019  rin Switch to per-device stamp, and retire stamp_mutex.

XXX
Bump kernel version after other changes for struct rasops_info.
 1.102  31-Jul-2019  rin Misc clean-up's:
- protect private stuff in rasops.h by _RASOPS_PRIVATE
- staticify rasops_copycols() and rasops_isgray[]
- G/C unused extern int cold
 1.101  30-Jul-2019  rin branches: 1.101.2;
Try to improve performance when shadow framebuffer is present;
Use block copy from shadow fb to real fb, instead of repeating
the same operations to two fb's.
 1.100  30-Jul-2019  rin In rasops_copy{rows,cols}(), if src == dst, we have nothing to do.
Otherwise, we can use memcpy safely instead of memmove.
 1.99  30-Jul-2019  rin Fix catastrophe when ri_emustride != ri_stride in rasops_copyrows().
 1.98  30-Jul-2019  rin Treat highlighted and reversed text in the same manner to xterm.
 1.97  29-Jul-2019  rin Hmmm, color was still strange for 24bpp on little endian machine,
only when font width is 12.

We need to use different devcmap for that case, if we wish to share
codes for other depths/font widths as possible as we can.

XXX
What should we do for big endian? I have no big endian machines with
24bpp framebuffer...
 1.96  29-Jul-2019  rin Fix color on 24bpp screen for little endian.
 1.95  29-Jul-2019  rin Fix missing underlines on mono screen.
Style.
 1.94  28-Jul-2019  rin Cast attr to uint32_t before right shift to avoid undefined behavior.

Also, misc style/cosmetic changes for clarity.
 1.93  28-Jul-2019  martin Free kmem_alloc'd memory with kmem_free
 1.92  26-Jul-2019  rin Put back byte-wise copy to stop using memcpy, which
does not work for device memory on some platforms.

Pointed out by Jared, many thanks!
 1.91  26-Jul-2019  rin Add genfb(4) driver for mac68k grfbus.
1, 2, 4, 8, 15, and 32 color-depths are supported.

ANSI colors on console are functional for depth >= 4.

Graphic applications based on wsfb API should work, provided
they can correctly handle fbi_fboffset and your color depth.

wsfb driver of Xorg 1.20 and mlterm-fb (framebuffer version of
x11/mlterm) work fine for depth == 1 || depth >= 8.

For depth == 8 (256 colors), graphic applications require
colormap callback, which is currently supported for some
internal graphic adapters, and only Civic (found on Quadra
AV series) was tested. Register definition and its usage are
taken from Linux. You can easily support other adapters if
Linux supports that.

Have fun, and any problem reports are welcomed!
 1.90  26-Jul-2019  rin Replace manually unrolled loops with memcpy/memmove or simple loops.
Modern compilers are smart enough; there's no measurable changes in
performance even on MC68040 with optimization level -Os.

Also, convert loop of byte-wise copy into memset.
 1.89  26-Jul-2019  rin Misc creen up for rasops.c:

- sort headers
- return error value instead of panic
- use uintptr_t for cast pointer to integer
- use macros appropriately
- use __func__
- some consistency check ifndef DEBUG
- try to avoid undefined behaviors related to shift
- convert malloc/free to kmem_alloc/kmem_free
- convert MIN to uimin
- style
 1.88  25-Jul-2019  rin Misc cleen up:
- Make 32bit mask unsigned
- DPRINTF --> __nothing ifndef DEBUG_RASOPS
- "#ifdef DIAGNOSTIC if (x) panic(); #endif" --> KASSERT(!x);
- KNF

No functional changes intended.
 1.87  25-Jul-2019  rin For kUBSan, avoid undefined behaviors even if harmless.
No functional changes intended.

Requested by uwe.
 1.86  24-Jul-2019  rin Oops, revert unintentional changes.
 1.85  24-Jul-2019  rin Well, masks do not have to be updated every time in loop.
Calculate them in advance even if it may be bogus.
 1.84  24-Jul-2019  rin Simplify logic and tiny clean-up.
 1.83  24-Jul-2019  rin Avoid shift-count overflow to fix strange cursor behaviors on amd64
when font width is odd.
 1.82  24-Jul-2019  rin Use unsigned integers for binary data storage.
No functional changes intended.
 1.81  24-Jul-2019  rin Style:
- u_char --> uint8_t
- u_int*_t --> uint*_t

No functional changes.
 1.80  21-Jul-2019  rin Fix cursor movement for ri_xscale = 1, e.g., fontwidth = 8 and bpp = 1.
 1.79  04-Dec-2018  mlelstv rasops reused wscons attribute bits for internal control.
- make upper 4 attribute bits available for such use
- use wscons flag names instead of literal constants.
 1.78  29-Nov-2018  macallan rasops_do_cursor():
- simplify & sanitize the unaligned case
- use only 32bit accesses
... no longer crash with odd sized fonts in 8bit
 1.77  01-Jun-2017  chs branches: 1.77.8; 1.77.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.76  12-May-2017  macallan rasops_reconfig(): don't clear flags we won't set here
 1.75  22-Apr-2017  macallan branches: 1.75.2;
add RI_PREFER_ALPHA flag, for drivers that can draw such fonts by hardware
 1.74  23-Feb-2017  nonaka reset ri->ri_hwbits too if RI_CFGDONE is set.

prevent ri->ri_hwbits from moving to center every time rasops_reconfig() is
called when RI_CENTER is set.
 1.73  18-Apr-2015  mlelstv branches: 1.73.2; 1.73.4;
add "best match" algorithm to wsfont and use this instead of a private
function in rasops.
 1.72  18-Aug-2014  riastradh branches: 1.72.2;
Don't leak f on failure. Noted by maxv@.

Compile-tested only, with zaurus.
 1.71  19-Apr-2012  macallan branches: 1.71.2; 1.71.14;
add another convenience function:
rasops_get_cmap() which returns either the ANSI map or an R3G3B2 map,
depending on the rasops_info handed to it so drivers don't have to
duplicate this particular code snippet
 1.70  11-Jan-2012  macallan branches: 1.70.2; 1.70.6; 1.70.8;
make rasops_init()'s font selection code a bit less boneheaded by:
- actually trying to pick a font which gets as close as possible to the
requested terminal size
- accepting 0,0 as 'use system default' which can be changed by
options RASOPS_DEFAULT_WIDTH=100
options RASOPS_DEFAULT_HEIGHT=30
default is 80x25
- putting alpha and bitmap fonts in the same list and making wsfont_find()
aware of wether we support alpha fonts or not
- if supported, prefer alpha fonts over otherwise equally suitable bitmap
fonts
 1.69  04-Jan-2012  macallan rasops8 expects the colour value replicated in every byte in devcmap[], so
fix that for r3g3b2
 1.68  28-Dec-2011  macallan add a new flag for ri_flg to allow drivers to request an r3g3b2 devcmap
in 8 bit colour. Drivers are still responsible to generate an appropriate
colour map for the actual hardware.
For use with alpha blending which needs some sort of 'true' colour.
 1.67  22-Dec-2011  macallan support anti-aliased fonts ( as in, pre-rendered alpha maps ), for now only
in rasops32 although adding support in 15, 16 and 24 would be trivial.
Enabled only if the driver explicitly requests it by setting the
RI_ENABLE_ALPHA flag.
 1.66  21-Jul-2010  tsutsui branches: 1.66.8; 1.66.12;
Fix typo in comment.
 1.65  13-Jun-2010  tsutsui Put underline properly (not upperline) on CCW screen.
Tested on hpcarm WS003SH.
 1.64  06-May-2010  macallan Introduce a new flag for rasops_info to keep rasops_reconfig() from trying
to allocate memory. Use this when calling rasops_reconfig() before it is safe
to call kmem_alloc().
 1.63  04-May-2010  macallan autogenerate box drawing characters for fonts that don't have them, put them
into an alternate font pointed at by the recently added mappings in wsfont,
adapt all putchar() methods except the rotated ones to use them
XXX no attempt has been made to make this work with rotation
 1.62  17-Apr-2010  nonaka Added Sharp W-ZERO3 series support.
 1.61  21-Jan-2010  macallan branches: 1.61.2; 1.61.4;
make RI_CENTER and RI_FULLCLEAR work with a shadow framebuffer
 1.60  14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.59  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.58  28-Apr-2008  martin branches: 1.58.8; 1.58.14;
Remove clause 3 and 4 from TNF licenses
 1.57  09-Dec-2007  jmcneill branches: 1.57.10; 1.57.12; 1.57.14;
Merge jmcneill-pm branch.
 1.56  28-Jul-2007  mjf branches: 1.56.4; 1.56.6; 1.56.14; 1.56.16; 1.56.18;
Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
 1.55  02-Feb-2007  ober branches: 1.55.6; 1.55.14;
Updates to allow Zaurus screen to rotate 90 degrees to a usable state with the keyboard. Patch from peter@ copied from OpenBSD. Feedback and OK from matt@
 1.54  16-Nov-2006  christos branches: 1.54.2; 1.54.4;
__unused removal on arguments; approved by core.
 1.53  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.52  27-Feb-2006  jmcneill branches: 1.52.14; 1.52.16;
Fixup a performance problem in rasops_copyrows that I introduced during
the shadowfb merge.
 1.51  18-Feb-2006  jmcneill Add shadow framebuffer support.
 1.50  29-Jan-2006  dsl branches: 1.50.2; 1.50.4;
Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
 1.49  11-Dec-2005  christos branches: 1.49.2;
merge ktrace-lwp.
 1.48  02-May-2005  macallan branches: 1.48.2;
fixed tab width and formatting
 1.47  01-May-2005  macallan made rasops_allocattr_color() respect WS_DEFAULT_FG and WS_DEFAULT_BG instead of using white on black
 1.46  27-Feb-2005  perry branches: 1.46.2;
nuke trailing whitespace
 1.45  04-Feb-2005  perry de-__P
 1.44  08-Nov-2003  uwe branches: 1.44.2; 1.44.6; 1.44.8; 1.44.10; 1.44.12;
For the rasops-drawn cursor the fg/bg indices are bit inverted, so
provide complimentary colors in the upper 16 entries.
 1.43  03-May-2003  uwe branches: 1.43.2;
In rasops_copycols change bcopy to memmove. In that particular place
the src and dst are very likely to overlap, so using bcopy causes
garbage to be displayed
 1.42  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.41  04-Jul-2002  junyoung Rename rasops_alloc_cattr and rasops_alloc_mattr to
rasops_allocattr_color and rasops_allocattr_mono, respectively.
 1.40  04-Jul-2002  junyoung alloc_attr -> allocattr

Approved by Matthias Drochner.
 1.39  13-Mar-2002  ad branches: 1.39.4;
Reorganise the wsfont stuff slightly so that multiple display adapters
with different bit/byte order requirements can co-exist happily.
 1.38  15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.37  18-Sep-2001  wiz Give initiali[sz]e all the "i"s it deserves.
 1.36  12-Feb-2001  nathanw branches: 1.36.2; 1.36.4; 1.36.6;
Correct the ri_xorigin calculation for the RI_CENTER case again.

Original calculation (bits += (ri_stride - ri_emustride) / 2) was
incorrect because stride may be wider than visible width.

Fix in 1.33 (bits += (ri_width - ri_emustride) / 2) was incorrect
because units do not match; "bits" and "ri_emustride" are in bytes,
but "width" is in pels. Works by accident for 8bpp displays.

Change to bits += ((ri_width * bpp / 8) - ri_emustride) / 2
to correctly account for visible width and bpp.
 1.35  02-Feb-2001  marcus Now does character remapping depending on font encoding.
 1.34  21-Jan-2001  takemura Rasops supports 4bit depth.
 1.33  19-Dec-2000  nisimura Fix an error in xoffset calculation. Revealed in the case when
ri_width is less than ri_stride and screen is layouted RI_CENTERed.
 1.32  13-Jun-2000  ad Use my proper name.
 1.31  12-Jun-2000  sommerfeld Let this build on LP64 if DEBUG is defined.
 1.30  12-Apr-2000  pk branches: 1.30.2;
* Spell shift counts in decimal and masks in hex
* Optimize numerous array references
* Cleanup whitespace turds
 1.29  05-Apr-2000  nathanw Advance index into rasops_cmap for each color, not per triplet.
This makes highlighing and color possible on truecolor displays.
 1.28  04-Apr-2000  nathanw Fix computation of ri_xorigin in RI_CENTER case; convery from bytes to
pixels, not from bytes to bytes^2/pixel.
 1.27  14-Mar-2000  nisimura Resolve LP64 issues.
 1.26  06-Jan-2000  shin replace WSFONT_L2R by WSDISPLAY_FONTORDER_L2R to compile again.
 1.25  16-Dec-1999  ad Dispatch another nit.
 1.24  04-Dec-1999  drochner -use the right namespace for screen capabilities
-make attribute decomposing a bit more friendly if the caller doesn't
care about underlines
 1.23  02-Dec-1999  drochner -initialize the colormap completely at compile time, to allow drivers
to use it early
-now we can declare it "const" (as "rasops_isgray[]", while we are here)
-don't use the fg/bg colors in ...alloc_attr() if the WSATTR_WSCOLORS
flag was not given - use reasonable defaults instead
-add an opaque "ri_hw" member to "rasops_info", for driver use
 1.22  06-Nov-1999  enami Possible typo.
 1.21  05-Nov-1999  ad In rasops_do_cursor(), don't pull the mask from ri_devcmap[], just use ~0.
Needed to make cursor DTRT on NetBSD/hpcmips - from takemura.
 1.20  23-Oct-1999  ad - New option (RASOPS_SMALL) for the tight-fisted.
- Don't use int32_t/u_int32_t unless we must.
- Remove C++ single line comment delimeters that crept in.
- Remove defs pertaining to byte granularity 'ragged-edge' bitmasks.
- Move all declarations of per-depth initialization functions to rasops.h.
- Other minor cleanup.
 1.19  04-Oct-1999  ad branches: 1.19.2; 1.19.4; 1.19.6;
Use proper mask when RI_FORCEMONO is set and XORing cursor.
 1.18  17-Sep-1999  ad - Collapse forward and reverse cases in rasops_copyrows() into one
- Pull in opt_rasops.h so we know if clipping is enabled
- Some KNF
 1.17  17-Sep-1999  ad Clean up attribute allocation some more.
 1.16  26-Aug-1999  thorpej Small consistency nit.
 1.15  26-Aug-1999  thorpej Make monochrome attribte allocation a bit more obvious.
 1.14  25-Aug-1999  ad When clearing the entire display, point to the start of the framebuffer,
not start of console output. Also, do not advance by ri_delta every row.
 1.13  24-Aug-1999  ad - Change the semantics of rasops_init slightly
- Re-name rasops_setfont to rasops_reconfig
- Add some new run-time 'features'
- Bring all run-time 'features' under control of rasops_info::ri_flg
- Some cosmetic changes
 1.12  21-Jul-1999  ad - Style nits
- Kill some of the dainbramage in variable-depth copycols()
 1.11  15-Jun-1999  ad branches: 1.11.2;
- Don't even try to emulate WSATTR_HILIT on mono displays
- WSATTR_REVERSE is a capability of both mono/color
 1.10  15-Jun-1999  ad Fix stupid alignment bug. The 'slop' stuff is due for replacement with masks
RSN per the README.
 1.9  18-May-1999  ad Assign ownership & copyright to TNF. There is probably a procedure for this
that I am unaware of. Also some KNF.
 1.8  15-May-1999  ad Add diagnostic measures to check for missing font.
 1.7  15-May-1999  ad wsfont cookies <= 0 are invalid, not just those < 0.
 1.6  09-May-1999  ad In rasops_erasecols(), try word aligned case before halfword aligned.
 1.5  29-Apr-1999  ad Add cookie for wsfont to rasops_info.
 1.4  26-Apr-1999  ad Innumerable fixes and improvements. README contains list of remaining bugs
that need to be squashed.
 1.3  13-Apr-1999  ad Code cleanup. Add ri_bswap member to 'struct rasops_info' to indicate that
framebuffer endianness differs from CPU (for 15,16,32-bit displays).
 1.2  13-Apr-1999  ad Fixed licensing due to a foobar on my behalf.
 1.1  13-Apr-1999  ad Initial import of 'rasops', the new raster operations set for wscons/rcons.
 1.11.2.3  02-Aug-1999  thorpej Update from trunk.
 1.11.2.2  21-Jun-1999  thorpej Sync w/ -current.
 1.11.2.1  15-Jun-1999  thorpej file rasops.c was added on branch chs-ubc2 on 1999-06-21 01:19:00 +0000
 1.19.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.19.4.1  15-Nov-1999  fvdl Sync with -current
 1.19.2.4  12-Mar-2001  bouyer Sync with HEAD.
 1.19.2.3  11-Feb-2001  bouyer Sync with HEAD.
 1.19.2.2  05-Jan-2001  bouyer Sync with HEAD
 1.19.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.30.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.36.6.1  01-Oct-2001  fvdl Catch up with -current.
 1.36.4.4  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.36.4.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.36.4.2  16-Mar-2002  jdolecek Catch up with -current.
 1.36.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.36.2.5  18-Oct-2002  nathanw Catch up to -current.
 1.36.2.4  01-Aug-2002  nathanw Catch up to -current.
 1.36.2.3  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.36.2.2  08-Jan-2002  nathanw Catch up to -current.
 1.36.2.1  21-Sep-2001  nathanw Catch up to -current.
 1.39.4.1  15-Jul-2002  gehenna catch up with -current.
 1.43.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.43.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.43.2.4  04-Feb-2005  skrll Sync with HEAD.
 1.43.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.43.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.43.2.1  03-Aug-2004  skrll Sync with HEAD
 1.44.12.1  12-Aug-2007  bouyer Pull up following revision(s) (requested by mjf in ticket #11348):
Pull up following revision(s) (requested by mjf in ticket #11348):
sys/dev/ic/pcdisplay_subr.c: revision 1.33 via patch
sys/dev/ic/vga_raster.c: revision 1.29 via patch
sys/dev/ic/vga.c: revision 1.95 via patch
sys/dev/rasops/rasops.c: revision 1.56 via patch
sys/dev/isa/ega.c: revision 1.23 via patch
Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
Set the 'ri' pointer before use.
 1.44.10.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.44.10.1  12-Feb-2005  yamt sync with head.
 1.44.8.1  29-Apr-2005  kent sync with -current
 1.44.6.1  11-Aug-2007  bouyer Pull up following revision(s) (requested by mjf in ticket #11348):
sys/dev/ic/pcdisplay_subr.c: revision 1.33 via patch
sys/dev/ic/vga_raster.c: revision 1.29 via patch
sys/dev/ic/vga.c: revision 1.95 via patch
sys/dev/rasops/rasops.c: revision 1.56 via patch
sys/dev/isa/ega.c: revision 1.23 via patch
Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
Set the 'ri' pointer before use.
 1.44.2.1  12-Aug-2007  bouyer Pull up following revision(s) (requested by mjf in ticket #11348):
Pull up following revision(s) (requested by mjf in ticket #11348):
sys/dev/ic/pcdisplay_subr.c: revision 1.33 via patch
sys/dev/ic/vga_raster.c: revision 1.29 via patch
sys/dev/ic/vga.c: revision 1.95 via patch
sys/dev/rasops/rasops.c: revision 1.56 via patch
sys/dev/isa/ega.c: revision 1.23 via patch
Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
Set the 'ri' pointer before use.
 1.46.2.2  06-Aug-2007  ghen Pull up following revision(s) (requested by mjf in ticket #1815):
sys/dev/ic/pcdisplay_subr.c: revision 1.33 via patch
sys/dev/ic/vga_raster.c: revision 1.29 via patch
sys/dev/ic/vga.c: revision 1.95 via patch
sys/dev/rasops/rasops.c: revision 1.56 via patch
sys/dev/isa/ega.c: revision 1.23 via patch
Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
Set the 'ri' pointer before use.
 1.46.2.1  03-Jun-2005  riz branches: 1.46.2.1.2; 1.46.2.1.4;
Pull up revisions 1.47-1.48 (requested by martin in ticket #366):
1.47:
made rasops_allocattr_color() respect WS_DEFAULT_FG and WS_DEFAULT_BG instead of using white on black

1.48:
fixed tab width and formatting
 1.46.2.1.4.1  06-Aug-2007  ghen Pull up following revision(s) (requested by mjf in ticket #1815):
sys/dev/ic/pcdisplay_subr.c: revision 1.33 via patch
sys/dev/ic/vga_raster.c: revision 1.29 via patch
sys/dev/ic/vga.c: revision 1.95 via patch
sys/dev/rasops/rasops.c: revision 1.56 via patch
sys/dev/isa/ega.c: revision 1.23 via patch
Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
Set the 'ri' pointer before use.
 1.46.2.1.2.1  06-Aug-2007  ghen Pull up following revision(s) (requested by mjf in ticket #1815):
sys/dev/ic/pcdisplay_subr.c: revision 1.33 via patch
sys/dev/ic/vga_raster.c: revision 1.29 via patch
sys/dev/ic/vga.c: revision 1.95 via patch
sys/dev/rasops/rasops.c: revision 1.56 via patch
sys/dev/isa/ega.c: revision 1.23 via patch
Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
Set the 'ri' pointer before use.
 1.48.2.5  21-Jan-2008  yamt sync with head
 1.48.2.4  03-Sep-2007  yamt sync with head.
 1.48.2.3  26-Feb-2007  yamt sync with head.
 1.48.2.2  30-Dec-2006  yamt sync with head.
 1.48.2.1  21-Jun-2006  yamt sync with head.
 1.49.2.3  01-Mar-2006  yamt sync with head.
 1.49.2.2  18-Feb-2006  yamt sync with head.
 1.49.2.1  01-Feb-2006  yamt sync with head.
 1.50.4.1  22-Apr-2006  simonb Sync with head.
 1.50.2.1  09-Sep-2006  rpaulo sync with head
 1.52.16.2  10-Dec-2006  yamt sync with head.
 1.52.16.1  22-Oct-2006  yamt sync with head
 1.52.14.2  09-Feb-2007  ad Sync with HEAD.
 1.52.14.1  18-Nov-2006  ad Sync with head.
 1.54.4.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.54.2.1  30-Jul-2007  liamjfoy Pull up following revision(s) (requested by mjf in ticket #799):
sys/dev/ic/pcdisplay_subr.c: revision 1.33
sys/dev/wscons/wsdisplay_vcons.c: revision 1.12
sys/dev/wscons/wsdisplay_vcons.c: revision 1.13
sys/dev/ic/vga_raster.c: revision 1.29
sys/dev/pci/chipsfb.c: revision 1.10
sys/dev/ic/vga.c: revision 1.95
sys/dev/rasops/rasops.c: revision 1.56
sys/dev/isa/ega.c: revision 1.23
Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
Set the 'ri' pointer before use.
 1.55.14.1  15-Aug-2007  skrll Sync with HEAD.
 1.55.6.1  20-Aug-2007  ad Sync with HEAD.
 1.56.18.2  28-Jul-2007  mjf Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
 1.56.18.1  28-Jul-2007  mjf file rasops.c was added on branch matt-mips64 on 2007-07-28 20:28:58 +0000
 1.56.16.1  11-Dec-2007  yamt sync with head.
 1.56.14.1  26-Dec-2007  ad Sync with head.
 1.56.6.1  09-Jan-2008  matt sync with HEAD
 1.56.4.1  03-Aug-2007  jmcneill Pull in power management changes from private branch.
 1.57.14.4  11-Aug-2010  yamt sync with head.
 1.57.14.3  11-Mar-2010  yamt sync with head
 1.57.14.2  04-May-2009  yamt sync with head.
 1.57.14.1  16-May-2008  yamt sync with head.
 1.57.12.1  18-May-2008  yamt sync with head.
 1.57.10.1  02-Jun-2008  mjf Sync with HEAD.
 1.58.14.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.58.8.1  28-Apr-2009  skrll Sync with HEAD.
 1.61.4.3  05-Mar-2011  rmind sync with head
 1.61.4.2  03-Jul-2010  rmind sync with head
 1.61.4.1  30-May-2010  rmind sync with head
 1.61.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.61.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.66.12.2  29-Apr-2012  mrg sync to latest -current.
 1.66.12.1  18-Feb-2012  mrg merge to -current.
 1.66.8.2  23-May-2012  yamt sync with head.
 1.66.8.1  17-Apr-2012  yamt sync with head
 1.70.8.1  03-Nov-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1117):
sys/dev/rasops/rasops.c: revision 1.72
sys/dev/vme/if_ie_vme.c: revision 1.31
sys/dev/qbus/if_qe.c: revision 1.73
sys/altq/altq_jobs.c: revision 1.7
sys/net/if_gre.c: revision 1.160
sys/dev/ic/oosiop.c: revision 1.14
- Fix error branches in altq_jobs.c to avoid leaks, noted by maxv@.
- Fix leaks in oosiop_alloc_cb error branches, noted by maxv@.
While here, avoid a sketchy pointer cast that probably falls afoul of
strict aliasing rules. Compile-tested only, with hppa.
- Don't leak f on failurein rasops.c. Noted by maxv@.
Compile-tested only, with zaurus.
- Avoid leak in error branch in if_qe.c, noted by maxv@, compile-tested for
vax.
- Sizeof struct ievme, not sizeof size_t in if_ie_vme.c.
Noted by maxv@, compile-tested for sparc.
- Don't leak in gre_clone_create error branch.
Noted by maxv@, compile-tested for amd64.
 1.70.6.1  03-Nov-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1117):
sys/dev/rasops/rasops.c: revision 1.72
sys/dev/vme/if_ie_vme.c: revision 1.31
sys/dev/qbus/if_qe.c: revision 1.73
sys/altq/altq_jobs.c: revision 1.7
sys/net/if_gre.c: revision 1.160
sys/dev/ic/oosiop.c: revision 1.14
- Fix error branches in altq_jobs.c to avoid leaks, noted by maxv@.
- Fix leaks in oosiop_alloc_cb error branches, noted by maxv@.
While here, avoid a sketchy pointer cast that probably falls afoul of
strict aliasing rules. Compile-tested only, with hppa.
- Don't leak f on failurein rasops.c. Noted by maxv@.
Compile-tested only, with zaurus.
- Avoid leak in error branch in if_qe.c, noted by maxv@, compile-tested for
vax.
- Sizeof struct ievme, not sizeof size_t in if_ie_vme.c.
Noted by maxv@, compile-tested for sparc.
- Don't leak in gre_clone_create error branch.
Noted by maxv@, compile-tested for amd64.
 1.70.2.1  03-Nov-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1117):
sys/dev/rasops/rasops.c: revision 1.72
sys/dev/vme/if_ie_vme.c: revision 1.31
sys/dev/qbus/if_qe.c: revision 1.73
sys/altq/altq_jobs.c: revision 1.7
sys/net/if_gre.c: revision 1.160
sys/dev/ic/oosiop.c: revision 1.14
- Fix error branches in altq_jobs.c to avoid leaks, noted by maxv@.
- Fix leaks in oosiop_alloc_cb error branches, noted by maxv@.
While here, avoid a sketchy pointer cast that probably falls afoul of
strict aliasing rules. Compile-tested only, with hppa.
- Don't leak f on failurein rasops.c. Noted by maxv@.
Compile-tested only, with zaurus.
- Avoid leak in error branch in if_qe.c, noted by maxv@, compile-tested for
vax.
- Sizeof struct ievme, not sizeof size_t in if_ie_vme.c.
Noted by maxv@, compile-tested for sparc.
- Don't leak in gre_clone_create error branch.
Noted by maxv@, compile-tested for amd64.
 1.71.14.1  22-Aug-2014  martin Pull up following revision(s) (requested by riastradh in ticket #44):
sys/altq/altq_jobs.c 1.7
Fix error branches to avoid leaks, noted by maxv@.
sys/dev/ic/oosiop.c 1.14
Fix leaks in oosiop_alloc_cb error branches, noted by maxv@.
While here, avoid a sketchy pointer cast that probably falls afoul
of strict aliasing rules.
sys/dev/qbus/if_qe.c 1.73
Avoid leak in error branch, noted by maxv@, compile-tested for vax.
sys/dev/rasops/rasops.c 1.72
Don't leak f on failure. Noted by maxv@.
sys/dev/vme/if_ie_vme.c 1.31
Sizeof struct ievme, not sizeof size_t.
Noted by maxv@, compile-tested for sparc.
sys/net/if_gre.c 1.160
Don't leak in gre_clone_create error branch.
Noted by maxv@, compile-tested for amd64.
 1.71.2.1  03-Dec-2017  jdolecek update from HEAD
 1.72.2.2  28-Aug-2017  skrll Sync with HEAD
 1.72.2.1  06-Jun-2015  skrll Sync with HEAD
 1.73.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.73.2.2  26-Apr-2017  pgoyette Sync with HEAD
 1.73.2.1  20-Mar-2017  pgoyette Sync with HEAD
 1.75.2.1  19-May-2017  pgoyette Resolve conflicts from previous merge (all resulting from $NetBSD
keywork expansion)
 1.77.10.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.77.10.1  10-Jun-2019  christos Sync with HEAD
 1.77.8.1  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.101.2.1  15-Aug-2019  martin Pull up following revision(s) (requested by rin in ticket #56):

sys/dev/rasops/rasops.c: revision 1.120
sys/dev/rasops/rasops.h: revision 1.40
sys/dev/rasops/rasops.c: revision 1.121
sys/dev/rasops/rasops.h: revision 1.41
sys/dev/rasops/rasops.c: revision 1.122
sys/dev/rasops/rasops.h: revision 1.42
sys/dev/rasops/rasops.h: revision 1.43
sys/dev/rasops/rasops.h: revision 1.44
sys/dev/rasops/rasops.h: revision 1.45
sys/dev/rasops/rasops.h: revision 1.46
sys/dev/rasops/rasops.h: revision 1.47
sys/dev/rasops/rasops.h: revision 1.48
sys/dev/rasops/rasops32.c: revision 1.40
sys/dev/rasops/rasops32.c: revision 1.41
sys/dev/rasops/rasops32.c: revision 1.42
sys/dev/rasops/rasops32.c: revision 1.43
sys/dev/rasops/rasops32.c: revision 1.44
sys/dev/rasops/rasops32.c: revision 1.45
sys/dev/rasops/rasops32.c: revision 1.46
sys/dev/rasops/rasops1-4_putchar.h: revision 1.1
sys/dev/rasops/rasops1-4_putchar.h: revision 1.2
sys/dev/rasops/rasops1-4_putchar.h: revision 1.3
sys/dev/rasops/rasops1_putchar_width.h: revision 1.3
sys/dev/rasops/rasops1_putchar_width.h: revision 1.4
sys/dev/rasops/rasops1_putchar_width.h: revision 1.5
sys/dev/rasops/rasops1_putchar_width.h: revision 1.6
sys/dev/rasops/README: revision 1.7
sys/dev/rasops/rasops_putchar_aa.h: revision 1.5
sys/dev/rasops/rasops_putchar_aa.h: revision 1.6
sys/dev/rasops/rasops8.c: revision 1.45
sys/dev/rasops/rasops8.c: revision 1.46
sys/dev/rasops/rasops8.c: revision 1.47
sys/dev/rasops/rasops24.c: revision 1.40
sys/dev/rasops/rasops8.c: revision 1.48
sys/dev/rasops/rasops24.c: revision 1.41
sys/dev/rasops/rasops8.c: revision 1.49
sys/dev/rasops/rasops24.c: revision 1.42
sys/dev/rasops/rasops24.c: revision 1.43
sys/dev/rasops/rasops24.c: revision 1.44
sys/dev/rasops/rasops_masks.c: revision 1.10
doc/CHANGES: revision 1.2566
sys/dev/rasops/rasops24.c: revision 1.45
doc/CHANGES: revision 1.2567
sys/dev/rasops/rasops24.c: revision 1.46
sys/dev/rasops/rasops24.c: revision 1.47
sys/dev/rasops/rasops24.c: revision 1.48
sys/dev/rasops/rasops24.c: revision 1.49
sys/dev/rasops/rasops_bitops.h: revision 1.19
sys/dev/rasops/rasops_putchar_aa.h: file removal
sys/dev/wscons/wsdisplay_vcons.c: revision 1.40
sys/dev/rasops/rasops8.c: revision 1.50
sys/dev/rasops/rasops8.c: revision 1.51
sys/dev/rasops/rasops24.c: revision 1.50
sys/arch/luna68k/dev/omrasops.c: revision 1.21
sys/dev/rasops/rasops_bitops.h: revision 1.20
sys/dev/wsfb/genfb.c: revision 1.68
sys/dev/rasops/rasops_bitops.h: revision 1.21
sys/dev/wsfb/genfb.c: revision 1.69
sys/dev/rasops/rasops_putchar_width.h: revision 1.10
sys/dev/rasops/rasops_bitops.h: revision 1.22
sys/dev/rasops/rasops_putchar_width.h: revision 1.11
sys/dev/rasops/rasops_bitops.h: revision 1.23
sys/dev/rasops/rasops_putchar_width.h: revision 1.12
sys/dev/rasops/rasops_bitops.h: revision 1.24
sys/dev/rasops/rasops_putchar_width.h: revision 1.13
sys/dev/rasops/rasops_bitops.h: revision 1.25
sys/dev/rasops/rasops_putchar_width.h: revision 1.14
sys/dev/rasops/rasops_putchar_width.h: revision 1.15
sys/dev/rasops/rasops1.c: revision 1.32
sys/dev/rasops/rasops1.c: revision 1.33
sys/dev/rasops/rasops1.c: revision 1.34
sys/dev/rasops/rasops1.c: revision 1.35
sys/dev/rasops/rasops1.c: revision 1.36
sys/dev/rasops/rasops1.c: revision 1.37
sys/dev/rasops/rasops4.c: revision 1.21
sys/dev/rasops/rasops4.c: revision 1.22
sys/dev/rasops/rasops4.c: revision 1.23
sys/dev/rasops/rasops4.c: revision 1.24
sys/dev/rasops/rasops4.c: revision 1.25
sys/dev/rasops/rasops4.c: revision 1.26
sys/dev/rasops/rasops4.c: revision 1.27
sys/dev/rasops/rasops4.c: revision 1.28
sys/dev/wsfb/genfb.c: revision 1.70
sys/dev/rasops/rasops2.c: revision 1.27
sys/dev/rasops/rasops2.c: revision 1.28
share/man/man9/rasops.9: revision 1.18
sys/dev/rasops/rasops.c: revision 1.102
sys/dev/rasops/rasops2.c: revision 1.29
share/man/man9/rasops.9: revision 1.19
sys/dev/rasops/rasops.c: revision 1.103
sys/dev/rasops/rasops.c: revision 1.104
sys/dev/rasops/rasops.c: revision 1.105
sys/dev/rasops/rasops.c: revision 1.106
sys/dev/rasops/rasops.c: revision 1.107
sys/dev/rasops/rasops_putchar.h: revision 1.6
sys/dev/rasops/rasops.c: revision 1.108
sys/dev/rasops/rasops_putchar.h: revision 1.7
sys/dev/rasops/rasops.c: revision 1.109
sys/dev/rasops/rasops_putchar.h: revision 1.8
sys/dev/rasops/rasops2.c: revision 1.30
sys/dev/rasops/rasops2.c: revision 1.31
sys/dev/rasops/rasops15.c: revision 1.32
sys/dev/rasops/rasops2.c: revision 1.32
sys/dev/rasops/rasops15.c: revision 1.33
sys/dev/rasops/rasops2.c: revision 1.33
sys/dev/rasops/rasops15.c: revision 1.34
sys/dev/rasops/rasops15.c: revision 1.35
sys/dev/rasops/rasops15.c: revision 1.36
sys/dev/rasops/rasops.c: revision 1.110
sys/dev/rasops/rasops15.c: revision 1.37
sys/dev/rasops/rasops.c: revision 1.111
sys/dev/rasops/rasops15.c: revision 1.38
sys/dev/rasops/rasops.c: revision 1.112
sys/dev/rasops/rasops15.c: revision 1.39
sys/dev/rasops/rasops.c: revision 1.113
sys/dev/rasops/rasops.c: revision 1.114
sys/dev/rasops/rasops.c: revision 1.115
sys/dev/rasops/rasops_masks.h: revision 1.9
sys/dev/rasops/rasops.c: revision 1.116
sys/dev/rasops/rasops.c: revision 1.117
sys/dev/rasops/rasops.c: revision 1.118
sys/dev/rasops/rasops.c: revision 1.119
sys/dev/rasops/rasops.h: revision 1.39

Misc clean-up's:
- protect private stuff in rasops.h by _RASOPS_PRIVATE
- staticify rasops_copycols() and rasops_isgray[]
- G/C unused extern int cold
Switch to per-device stamp, and retire stamp_mutex.

Provide buffer capable of single-row pixels in order to make things simpler.

Factor out copy-paste. No functional changes.
When font is switched, not only putchar, but also other ri_ops can be
changed by backend driver, e.g., see rasops1.c:
https://nxr.netbsd.org/xref/src/sys/dev/rasops/rasops1.c#58
4 is 1 << 2, not 1 << 3...

Fix erasecols and do_cursor for font width >= 32 bits.
Also, some cosmetic clean-up's.

Oops, for rasops_copycols(), we cannot use memmove even if src == dst.
On the other hand, memmove is safe for rasops_copyrows().
Fix unaligned writes to buffer, that are introduced in 1.105:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/rasops/rasops.c#rev1.105

Support font width 32 on monochrome screen.

Remove duplicate substitution. Style. No functional changes.

Correct copy count. This affects ``left-to-right'' copy for region
including word boundary.

Fix a bug in shadow fb support for copycols on 1, 2, and 4bpp screen,
which was introduced in 1.18:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/rasops/rasops_bitops.h#rev1.18

Add general putchar functions for 2 and 4bpp.
Note that 1bpp continues to use its local version in rasops1.c,
which is much faster and simpler.

Cosmetic changes. No functional changes.

Reflect reality.

Notify size of shadow framebuffer if enabled.

Fix unaligned word write's to buffer, introduced in rev 1.42:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/rasops/rasops24.c#rev1.42

Real fix for 24-bpp color:
- When centering screen, locate effective base address of framebuffer to
both word and 24-bit color boundary.
- Consistently convert ri_devcmap to ``big endian'' if not RI_BSWAP.

Also, fix possible bug for 15/16-bpp with RI_BSWAP (not tested).

Protect rasops_copy{rows,cols}() by _RASOPS_PRIVATE.

Use _KERNEL_OPT.

Simplify calculation for 12-byte alignment.
No functional changes.

Fix black color-attribution for depths 2 and 4.

Depth 2 is monochrome.
IMO, it is impossible to support ANSI colors on 2-bpp display; fore-
and background can be same value even if they are different colors
logically.

Fix a critical bug for rasops_copyrows() introduced in rev. 1.90:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/rasops/rasops.c#rev1.90
When src < dst, we have to copy backward.

Simplify rasops_do_cursor():
- Use static masks similar to that used in rasops_bitops.h,
rather than generating them on the fly.
- Use pointer for proper type to avoid unnecessary casts.

Use "hp" instead of "hrp" consistently with other files.
No functional changes.

Stop allocating ri_buf and ri_stamp dynamically. As commented in
rasops.h, it is not safe to use kmem_alloc(9) in rasops_init();
rasops routines can be used for early putchar, which means that
UVM is not fully initialized.

Should fix a problem reported by macallan:
http://mail-index.netbsd.org/tech-kern/2019/08/02/msg025327.html

Instead of using ri_buf, inline function rasops_memcpy32() is
introduced to fill 32bit data efficiently.

Instead of using ri_stamp (per device stamp), stamp_ri is
introduced to distinguish for which device stamp is calculated.

Oops, revert an unintentional change for now.

If RI_CLEAR is set, do not forget to clear real framebuffer.

Modify struct rasops_info again (ride 9.99.4 bump).
- remove ri_buf and friends.
- remove ri_stamp and frieds.
- introduce ri_ul, which will be used for scaling underline with font.

Also add hack for ri_ul; adjust its size to obsoleted member, ri_delta,
which was only used rasops routines internally. Now, size and offsets of
all members of struct rasops_info become same with netbsd-9, -8, and -7,
again. So we can safelly pull up fixes to any release branches!

Scaling dimensions of underline by font height.

Currently,
- offset of underline is fixed to 1-row from bottom of characters, and
- height of underline is fixed to 1.
Both are good for standard 8x16 fonts. However, it is too thin for
larger fonts, especially when used on display of high resolution.
Also, 1-row offset of underline is ugly for small fonts, e.g.,
spleen5x8.
Therefore, adjust offset and height as,
- no changes for standard 16-height fonts.
- scaling by font height for larger fonts.
- set offset to zero for fonts of height smaller than 16.

Merge rasops_putchar_aa.h into rasops_putchar.h.

Support scaling underline dimensions by font height.

Separate general putchar for 1-4bpp from rasops_bitops:
- Support anti-aliasing for 2bpp, which works perfectly!
- Support scaling underline dimensions with font height.

We support anti-aliasing for depth 2.
Use switch appropriately.
- Stop showing struct rasops_info; readers can read the header itself.
- Correct description for optimized font widths.
- Remove strange blank line.

Try to improve formatting and naration.

Make rasops_erase{rows,cols}() public again; hp300/diofb uses them.
Pointed out by martin.

When legacy Apple 4-bpp color palette is used, make green dark so that
kernel messages are printed nicely on white background.

Fix color range overflow; we cannot make bright colors more brighter.

Correctly check whether character is in font in rasops_mapchar().
Also, make sure that in putchar functions for completeness.

Fix bug introduced in rev. 1.69:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/wsfb/genfb.c#rev1.69
is_bgr should be initialized to false. Otherwise, color becomes strange
for depths 24 and 32 unless backend explicitly set "is_bgr" property.

Set 4-bpp devcmap in a similar manner to non-RGB case of 8-bpp.
No functional changes since this is not in use (4-bpp is monochrome).

Misc style clean up's.
- Introduce and use proper macros.
- Use not ambiguous variable names.
- Unify similar functions as possible as I can.
- G/C unused headers.
- Use #include <dev/rasops/foo.h> instead of "foo.h"

No particular functional changes intended.

My work for rasops(9) was finished (hopefully).

I will send pull-up request for netbsd-9, if there are no new failures
reported within few days.

Fix format in order not to confuse changes2html script.
Minor improvements of wording for my entry.

When using stamp, drop attributions other than back and foreground
colors so that stamp is not updated unnecessarily.

RSS XML Feed