diff options
author | Gareth Hughes <gareth@users.sourceforge.net> | 2001-01-31 18:24:57 +0000 |
---|---|---|
committer | Gareth Hughes <gareth@users.sourceforge.net> | 2001-01-31 18:24:57 +0000 |
commit | c76a35b3c86bdd64340bad88d6bd065ea9a4e6f3 (patch) | |
tree | 5bc78d404f41505c335930366e02da6addc7663d | |
parent | 5f15407b9cfe89274557aa4b94aae89bb1688713 (diff) |
Put PRIMEND write after DMAPADs to prevent race condition.
-rw-r--r-- | linux/mga_dma.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/linux/mga_dma.c b/linux/mga_dma.c index a20f5e44..0c15c71f 100644 --- a/linux/mga_dma.c +++ b/linux/mga_dma.c @@ -1158,10 +1158,6 @@ void mga_do_dma_flush( drm_mga_private_t *dev_priv ) tail = primary->tail + dev_priv->primary->offset; - mga_flush_write_combine(); - - MGA_WRITE( MGA_PRIMEND, tail | MGA_PRIMNOSTART | MGA_PAGPXFER ); - BEGIN_DMA( 1 ); DMA_BLOCK( MGA_DMAPAD, 0x00000000, @@ -1171,6 +1167,9 @@ void mga_do_dma_flush( drm_mga_private_t *dev_priv ) ADVANCE_DMA(); + mga_flush_write_combine(); + MGA_WRITE( MGA_PRIMEND, tail | MGA_PRIMNOSTART | MGA_PAGPXFER ); + head = *primary->head; DRM_DEBUG( " head = 0x%06lx\n", head - dev_priv->primary->offset ); @@ -1209,7 +1208,6 @@ void mga_do_dma_wrap( drm_mga_private_t *dev_priv ) tail = primary->tail + dev_priv->primary->offset; mga_flush_write_combine(); - MGA_WRITE( MGA_PRIMEND, tail | MGA_PRIMNOSTART | MGA_PAGPXFER ); spin_lock_irqsave( &primary->lock, flags ); @@ -1265,7 +1263,6 @@ static void mga_dma_service( int irq, void *device, struct pt_regs *regs ) DRM_DEBUG( " tail = 0x%06x\n", tail - dev_priv->primary->offset ); mga_flush_write_combine(); - MGA_WRITE( MGA_PRIMADDRESS, head | MGA_DMA_GENERAL ); MGA_WRITE( MGA_PRIMEND, tail | MGA_PRIMNOSTART | MGA_PAGPXFER ); } |