diff options
| author | tsutsui <tsutsui@NetBSD.org> | 2007-11-01 13:05:32 +0000 |
|---|---|---|
| committer | tsutsui <tsutsui@NetBSD.org> | 2007-11-01 13:05:32 +0000 |
| commit | a3bf2627a489d65e62a64ceb085fa98263bb29d7 (patch) | |
| tree | 244c53f077060e2d6f8c396651f98a77d0e75e4e /sys/dev | |
| parent | d43d1050815cf63d055966c999c03952ab6901e8 (diff) | |
Fix some random LCD corruption on cobalt:
- make sure to set HD_ROW1_ADDR before putting characters at the first line
in hd44780_ddram_redraw()
- use memmove(9) rather than bcopy(9) for possibly overlapped copies
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/hd44780_subr.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/ic/hd44780_subr.c b/sys/dev/ic/hd44780_subr.c index afd671b03b2..d4f0d766704 100644 --- a/sys/dev/ic/hd44780_subr.c +++ b/sys/dev/ic/hd44780_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: hd44780_subr.c,v 1.12 2007/10/19 11:59:52 ad Exp $ */ +/* $NetBSD: hd44780_subr.c,v 1.13 2007/11/01 13:05:32 tsutsui Exp $ */ /* * Copyright (c) 2002 Dennis I. Chernoivanov @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hd44780_subr.c,v 1.12 2007/10/19 11:59:52 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hd44780_subr.c,v 1.13 2007/11/01 13:05:32 tsutsui Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -161,10 +161,11 @@ hlcd_copycols(id, row, srccol, dstcol, ncols) ncols = hdscr->hlcd_sc->sc_cols - srccol; if (row > 0 && (hdscr->hlcd_sc->sc_flags & (HD_MULTILINE|HD_MULTICHIP))) - bcopy(&hdscr->image[hdscr->hlcd_sc->sc_cols * row + srccol], - &hdscr->image[hdscr->hlcd_sc->sc_cols * row + dstcol], ncols); + memmove(&hdscr->image[hdscr->hlcd_sc->sc_cols * row + dstcol], + &hdscr->image[hdscr->hlcd_sc->sc_cols * row + srccol], + ncols); else - bcopy(&hdscr->image[srccol], &hdscr->image[dstcol], ncols); + memmove(&hdscr->image[dstcol], &hdscr->image[srccol], ncols); } @@ -200,7 +201,7 @@ hlcd_copyrows(id, srcrow, dstrow, nrows) if (!(hdscr->hlcd_sc->sc_flags & (HD_MULTILINE|HD_MULTICHIP))) return; - bcopy(&hdscr->image[srcrow * ncols], &hdscr->image[dstrow * ncols], + memmove(&hdscr->image[dstrow * ncols], &hdscr->image[srcrow * ncols], nrows * ncols); } @@ -703,6 +704,7 @@ hd44780_ddram_redraw(sc, en, io) hd44780_ir_write(sc, en, cmd_clear()); hd44780_ir_write(sc, en, cmd_rethome()); + hd44780_ir_write(sc, en, cmd_ddramset(HD_ROW1_ADDR)); for (i = 0; (i < io->len) && (i < sc->sc_cols); i++) { hd44780_dr_write(sc, en, io->buf[i]); } |
