Commit Graph

232 Commits

Author SHA1 Message Date
rin 4acff240b3 Remove pointless cast; dp is already uint32_t *.
No functional changes intended.
2020-07-02 07:49:44 +00:00
tsutsui 17178623de Fix "Alignment Fault 3" kernel failure of NetBSD/zaurus 8.1 GENERIC.
#ifdef switch per kernel config options in definition of device driver
structure in header files could be problematic.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/31/msg000079.html

Should be pulled up to netbsd-8 and netbsd-9.
2019-11-02 01:14:57 +00:00
rin f48f7ada9d When using stamp, drop attributions other than back and foreground
colors so that stamp is not updated unnecessarily.
2019-08-14 00:51:10 +00:00
rin b09e761aad 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.
2019-08-10 01:24:17 +00:00
rin b38a7d7bb7 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).
2019-08-10 01:20:47 +00:00
rin 850a4385d6 Correctly check whether character is in font in rasops_mapchar().
Also, make sure that in putchar functions for completeness.
2019-08-09 12:05:51 +00:00
rin c9639cda70 Fix color range overflow; we cannot make bright colors more brighter. 2019-08-09 11:42:03 +00:00
rin a059deea37 When legacy Apple 4-bpp color palette is used, make green dark so that
kernel messages are printed nicely on white background.
2019-08-09 11:08:20 +00:00
rin a2fa447484 Make rasops_erase{rows,cols}() public again; hp300/diofb uses them.
Pointed out by martin.
2019-08-07 16:14:51 +00:00
rin 59700af2a2 Separate general putchar for 1-4bpp from rasops_bitops:
- Support anti-aliasing for 2bpp, which works perfectly!
- Support scaling underline dimensions with font height.
2019-08-07 12:36:36 +00:00
rin 95644fe49d Merge rasops_putchar_aa.h into rasops_putchar.h.
Support scaling underline dimensions by font height.
2019-08-07 12:33:48 +00:00
rin 666df74e48 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.
2019-08-07 12:27:49 +00:00
rin ca8a0eeb06 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!
2019-08-07 12:09:30 +00:00
rin bda37e3f34 If RI_CLEAR is set, do not forget to clear real framebuffer. 2019-08-07 11:57:40 +00:00
rin eb6bc0279c Oops, revert an unintentional change for now. 2019-08-07 11:48:43 +00:00
rin cb91b3e7f8 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.
2019-08-07 11:47:33 +00:00
rin 863001fee1 Use "hp" instead of "hrp" consistently with other files.
No functional changes.
2019-08-07 11:13:20 +00:00
rin eb669fe192 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.
2019-08-07 11:08:44 +00:00
rin a4518b6fa2 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.
2019-08-07 11:03:14 +00:00
rin 3d33a820c4 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.
2019-08-07 10:59:51 +00:00
rin 2c6a5988d1 Fix black color-attribution for depths 2 and 4. 2019-08-07 10:55:51 +00:00
rin 3b6b72f1f3 Simplify calculation for 12-byte alignment.
No functional changes.
2019-08-07 10:53:41 +00:00
rin 39d7d91dd0 Use _KERNEL_OPT. 2019-08-07 10:51:57 +00:00
rin c1e991c827 Protect rasops_copy{rows,cols}() by _RASOPS_PRIVATE. 2019-08-03 06:29:52 +00:00
rin e9f5314169 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).
2019-08-02 23:24:37 +00:00
rin 5a0cb99821 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
2019-08-02 23:05:42 +00:00
rin 1b1ed879d1 Reflect reality. 2019-08-02 05:04:02 +00:00
rin 7d183a9d7c Cosmetic changes. No functional changes. 2019-08-02 04:40:53 +00:00
rin 382c4fd56f 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.
2019-08-02 04:39:09 +00:00
rin de761cac07 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
2019-08-02 04:35:54 +00:00
rin 30a5976abf Correct copy count. This affects ``left-to-right'' copy for region
including word boundary.
2019-08-02 04:31:54 +00:00
rin 74ef01f914 Remove duplicate substitution. Style. No functional changes. 2019-08-02 04:26:44 +00:00
rin 78bb3b6cca Support font width 32 on monochrome screen. 2019-08-02 04:23:20 +00:00
rin 047ebc979d 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
2019-08-02 04:22:04 +00:00
rin e443b82013 Oops, for rasops_copycols(), we cannot use memmove even if src == dst.
On the other hand, memmove is safe for rasops_copyrows().
2019-08-02 04:18:15 +00:00
rin 0001821edb Fix erasecols and do_cursor for font width >= 32 bits.
Also, some cosmetic clean-up's.
2019-08-01 03:43:54 +00:00
rin ee592ed7db 4 is 1 << 2, not 1 << 3... 2019-08-01 03:38:12 +00:00
rin 2e6049298e Factor out copy-paste. No functional changes. 2019-07-31 05:08:10 +00:00
rin 3756b93ecc Provide buffer capable of single-row pixels in order to make things simpler.
XXX
Bump kernel version for rasops_info later.
2019-07-31 04:45:44 +00:00
rin ebc0ff002d Reduce memcpy. 2019-07-31 02:26:40 +00:00
rin 97146aa277 G/C ri_delta.
XXX
Bump kernel version after other changes for struct rasops_info.
2019-07-31 02:09:02 +00:00
rin 47620aeb91 Switch to per-device stamp, and retire stamp_mutex.
XXX
Bump kernel version after other changes for struct rasops_info.
2019-07-31 02:04:14 +00:00
rin a917215102 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
2019-07-31 00:14:25 +00:00
rin 423223aaf9 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.
2019-07-30 15:29:40 +00:00
rin 257204f139 Support shadow framebuffer for 24bpp screen. 2019-07-30 15:23:23 +00:00
rin 86edcbc3eb In rasops_copy{rows,cols}(), if src == dst, we have nothing to do.
Otherwise, we can use memcpy safely instead of memmove.
2019-07-30 14:41:10 +00:00
rin 802532feb0 Fix catastrophe when ri_emustride != ri_stride in rasops_copyrows(). 2019-07-30 14:33:04 +00:00
rin e7904a5aea Treat highlighted and reversed text in the same manner to xterm. 2019-07-30 12:20:24 +00:00
rin 61147d9ba4 Try to fix problem reported by ryoon:
http://mail-index.netbsd.org/source-changes-d/2019/07/29/msg011516.html

There are apparent bugs for shadow framebuffer. Sorry for the breakage.
2019-07-29 17:22:19 +00:00
rin 6167e473a1 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...
2019-07-29 16:17:29 +00:00