diff options
author | phk <phk@FreeBSD.org> | 2012-06-17 21:02:48 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2012-06-17 21:02:48 +0000 |
commit | 1b14ff5075853dd7586ce666e2f199178fa9c674 (patch) | |
tree | 1ab32d38ad0f664e958ea4e62f0df581ceba4a4e /sys/dev/fb | |
parent | 77d92cc9de1dc6c64aa709bb77a4cf4e3febea75 (diff) | |
download | FreeBSD-src-1b14ff5075853dd7586ce666e2f199178fa9c674.zip FreeBSD-src-1b14ff5075853dd7586ce666e2f199178fa9c674.tar.gz |
On certain newer Intel Atom based motherboards, for instance the
D2500CC which I have, syscons in text-mode fails to show the expected
contents due to write errors into video-memory.
At least one of the causes is that we copy from syscons internal buffer
to the video memory with optimized bcopy(9) which uses >16bit operations.
Until now, 32bit and wider operations have always worked on the video
memory, but since I cannot find a single source which says that this
SHALL work, and since these chipsets/bugs are now out there, this
commit changes syscons to always use 16bit copies on i386 & amd64.
This may be relevevant for PR's:
166262
166639
and various other bug reports floating elsewhere on the net, but
I lack hardware to test those.
Diffstat (limited to 'sys/dev/fb')
-rw-r--r-- | sys/dev/fb/fbreg.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h index 623e37c..ac9a6c3 100644 --- a/sys/dev/fb/fbreg.h +++ b/sys/dev/fb/fbreg.h @@ -35,9 +35,16 @@ /* some macros */ #if defined(__amd64__) || defined(__i386__) -#define bcopy_io(s, d, c) bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_toio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_fromio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) + +static __inline void +copyw(uint16_t *src, uint16_t *dst, size_t size) +{ + while (size--) + *dst++ = *src++; +} +#define bcopy_io(s, d, c) copyw((void*)(s), (void*)(d), (c)) +#define bcopy_toio(s, d, c) copyw((void*)(s), (void*)(d), (c)) +#define bcopy_fromio(s, d, c) copyw((void*)(s), (void*)(d), (c)) #define bzero_io(d, c) bzero((void *)(d), (c)) #define fill_io(p, d, c) fill((p), (void *)(d), (c)) #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) |