Add a BUS_DMASYNC_PREWRITE call against tile's DMA address descriptors.

Fixes mangled screen on recent kernels.
Tested on my R5K IP32 and on R10K IP32 by Jorge Acereda Macia on port-sgimips.
This commit is contained in:
tsutsui 2008-07-30 17:24:27 +00:00
parent 9acf218ba1
commit a8858674e9
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: crmfb.c,v 1.25 2008/05/08 02:10:59 jmcneill Exp $ */
/* $NetBSD: crmfb.c,v 1.26 2008/07/30 17:24:27 tsutsui Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca>
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: crmfb.c,v 1.25 2008/05/08 02:10:59 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: crmfb.c,v 1.26 2008/07/30 17:24:27 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -304,6 +304,8 @@ crmfb_attach(struct device *parent, struct device *self, void *opaque)
for (i = 0; i < (sc->sc_tiles_x * sc->sc_tiles_y); i++) {
p[i] = ((uint32_t)v >> 16) + i;
}
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmai.map, 0, sc->sc_dmai.size,
BUS_DMASYNC_PREWRITE);
sc->sc_scratch = (char *)KERNADDR(sc->sc_dma) + (0xf0000 * sc->sc_tiles_x);
sc->sc_linear = (paddr_t)DMAADDR(sc->sc_dma) + 0x100000 * sc->sc_tiles_x;