Commit Graph

138 Commits

Author SHA1 Message Date
chs
fd34ea77eb 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.
2017-06-01 02:45:05 +00:00
macallan
591de39665 rasops_reconfig(): don't clear flags we won't set here 2017-05-12 00:41:25 +00:00
macallan
b810592ab9 add RI_PREFER_ALPHA flag, for drivers that can draw such fonts by hardware 2017-04-22 15:05:02 +00:00
nonaka
148f109aa3 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.
2017-02-23 12:16:30 +00:00
jakllsch
1730769371 Add rasops15_putchar_aa() for greyscale fonts.
Based on rasops8_putchar_aa() and rasops32_putchar_aa().
2017-01-25 14:53:43 +00:00
mlelstv
c950730079 add "best match" algorithm to wsfont and use this instead of a private
function in rasops.
2015-04-18 11:23:58 +00:00
riastradh
fef866671e Don't leak f on failure. Noted by maxv@.
Compile-tested only, with zaurus.
2014-08-18 03:59:27 +00:00
tsutsui
b3d834c6ab Fix 1 bpp rasops copycols() op:
- fix inverted shift direction in MBL() and MBR() macro in BE case
   (used by GETBITS() and PUTBITS() in copycols() function in rasops_bitops.h)
 - make all bitmask values unsigned and use proper uint32_t types for
   bitmap variables (to avoid arithmetic right shift)
 - fix various botches in right-to-left copy op (logic is taken from hp300)

Tested on bwtwo(4) on NetBSD/sparc.
2013-12-02 14:05:51 +00:00
martin
799fb422ad Remove unused variables 2013-09-15 09:41:55 +00:00
martin
7c59522dbb Remove unused variable 2013-09-15 09:38:28 +00:00
macallan
936a44c065 rasops32_putchar_aa():
- underline the right characters
- make drawing slightly less horribly inefficient
- don't pretend to support a shadow fb
2013-07-31 19:58:23 +00:00
tsutsui
c789a2a4ba Fix another typo which causes decrement against a NULL pointer.
Also revert rev 1.9, which shut up gcc's "uninitialized variable"
warning that actually pointed out the typo correctly.  Oh well.
2013-05-21 15:57:21 +00:00
tsutsui
9bc6043a7c Fix fatal (but probably unused) typo in ri->ri_hwbits case in copycols. 2013-05-21 15:50:09 +00:00
kiyohara
2cce0817b5 Support little endian makestamp. 2013-04-21 04:28:05 +00:00
martin
cadfec0fa5 Ooops, backout local change not intended to be commited with the last change 2013-03-21 21:01:10 +00:00
martin
f02c188eea Add syntatic sugar to avoid hurting my eyes 2013-03-21 21:00:12 +00:00
macallan
98249f3c06 make anti-aliased character drawing work on hardware where stride != width * bytes per pixel 2012-10-23 15:12:59 +00:00
macallan
2320319a93 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
2012-04-19 06:57:39 +00:00
macallan
b75a7aad08 fix what has to be a thinko - I doubt there's much hardware out there that
uses BGR in 15/16 bit colour
2012-04-17 12:06:25 +00:00
macallan
2ed32c39b4 use memset() to clear character cells instead of being terribly slow 2012-01-25 20:18:04 +00:00
macallan
8b892b4cb6 rasops8_putchar_aa():
render glyphs scanline by scanline into a 64bit-aligned buffer, then memcpy()
it into video memory instead of writing directly.
This gives >10% speedup even on valkyriefb, likely more on PCIe framebuffers.
2012-01-25 16:38:27 +00:00
macallan
7f836eb389 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
2012-01-11 15:52:32 +00:00
macallan
d0517cd235 rasops8 expects the colour value replicated in every byte in devcmap[], so
fix that for r3g3b2
2012-01-04 20:17:05 +00:00
macallan
f692d005a8 add support for anti-aliased fonts in r3g3b2 2012-01-04 20:16:20 +00:00
macallan
1e50f31f65 use CHAR_IN_FONT() and WSFONT_GLYPH() macros 2012-01-04 17:01:52 +00:00
macallan
d5062c9e69 split putchar method into one for alpha fonts and one for bitmap fonts 2012-01-03 23:15:11 +00:00
macallan
0012d4bd2f add a macro to identify alpha fonts 2012-01-03 23:13:59 +00:00
macallan
5f8fd44534 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.
2011-12-28 08:36:46 +00:00
macallan
3d90099590 skip the multiplications for alpha values of 0 and 255, just use background
and foreground colours there
2011-12-27 06:24:40 +00:00
macallan
b7781c972a rename alpha variable to avoid conflict with a platform macro on alpha 2011-12-24 02:13:21 +00:00
macallan
99d1a7d487 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.
2011-12-22 04:52:45 +00:00
njoly
3b3de9f7ed Fix RASOPS_SMALL build 2011-07-25 18:02:47 +00:00
tsutsui
ca6f0203c1 Fix typo in comment. 2010-07-21 12:12:58 +00:00
tsutsui
ae9c6cd78f Put underline properly (not upperline) on CCW screen.
Tested on hpcarm WS003SH.
2010-06-13 01:55:24 +00:00
macallan
21bc7f3caa 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().
2010-05-06 04:30:18 +00:00
macallan
38ea318425 remove now redundant ri = ... lines in putchar() methods
Looks like none of my usual test builds used rasops2.c
2010-05-04 19:16:22 +00:00
nonaka
71c9ab4685 fix compile failure. 2010-05-04 12:36:37 +00:00
macallan
15a269471f 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
2010-05-04 04:57:34 +00:00
nonaka
b62fc9e203 Added Sharp W-ZERO3 series support. 2010-04-17 13:36:21 +00:00
macallan
294ad31cdd fix a bunch of typos, now 8 bit fonts work properly 2010-04-13 20:10:38 +00:00
macallan
8f881c7dd3 add support for shadow framebuffers
tested on sparc with a cg12
2010-04-08 16:45:53 +00:00
macallan
8953b23350 make RI_CENTER and RI_FULLCLEAR work with a shadow framebuffer 2010-01-21 05:32:18 +00:00
cegger
dc56dbbd97 ansify function definitions 2009-03-15 21:23:31 +00:00
dsl
82357f6d42 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.
2009-03-14 21:04:01 +00:00
dsl
454af1c0e8 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.)
2009-03-14 15:35:58 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
bjs
521d96c676 The stamp mutex is not unsafe, so remove this comment so people don't get the wrong idea. ok ad@ 2008-01-07 00:25:19 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
mjf
05619021ad Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
2007-07-28 20:28:56 +00:00
christos
fffc9c66c9 fix fallout from caddr_t changes. 2007-03-04 07:54:07 +00:00