summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorJose Fonseca <jrfonseca@users.sourceforge.net>2002-05-29 18:45:39 +0000
committerJose Fonseca <jrfonseca@users.sourceforge.net>2002-05-29 18:45:39 +0000
commit322a767359e45446b53d84be2604b584ddc4d0d2 (patch)
tree806cebda69ea6cf48918491136447675186c07ce /linux
parente111a0ce88bb54d819fa1d22f7244304c8004332 (diff)
Do not add commands to the end of each buffer to disable busmastering, so
that it's possible to queue buffers while the engine is running. This code was put instead on mach64_do_dma_idle so that the busmastering is disabled when giving control to the X server.
Diffstat (limited to 'linux')
-rw-r--r--linux/mach64_dma.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/linux/mach64_dma.c b/linux/mach64_dma.c
index bdaa97d4..ae78d2c1 100644
--- a/linux/mach64_dma.c
+++ b/linux/mach64_dma.c
@@ -188,6 +188,7 @@ int mach64_do_wait_for_dma( drm_mach64_private_t *dev_priv )
int mach64_do_dma_idle( drm_mach64_private_t *dev_priv ) {
int ret;
+ u32 reg;
/* wait for completion */
if ( (ret = mach64_do_wait_for_idle( dev_priv )) < 0 ) {
@@ -196,6 +197,13 @@ int mach64_do_dma_idle( drm_mach64_private_t *dev_priv ) {
return ret;
}
+ /* FIXME: Is this necessary? It's not done in the Bus Mastering sample code. In fact the opposite it's done... */
+ reg = MACH64_READ( MACH64_BUS_CNTL );
+ MACH64_WRITE( MACH64_BUS_CNTL, reg | MACH64_BUS_MASTER_DIS | MACH64_BUS_EXT_REG_EN );
+
+ /* restore SRC_CNTL to disable busmastering */
+ MACH64_WRITE( MACH64_SRC_CNTL, 0 );
+
/* clean up after pass */
mach64_do_release_used_buffers( dev_priv );
return 0;
@@ -829,12 +837,6 @@ static int mach64_do_dispatch_real_dma( drm_mach64_private_t *dev_priv )
p[idx++] = cpu_to_le32(DMAREG(MACH64_LAST_DISPATCH_REG));
p[idx++] = cpu_to_le32(dev_priv->sarea_priv->last_dispatch);
#endif
- reg = MACH64_READ( MACH64_BUS_CNTL );
- reg |= MACH64_BUS_MASTER_DIS | MACH64_BUS_EXT_REG_EN;
- p[idx++] = cpu_to_le32(DMAREG(MACH64_BUS_CNTL));
- p[idx++] = cpu_to_le32(reg);
- p[idx++] = cpu_to_le32(DMAREG(MACH64_SRC_CNTL));
- p[idx++] = cpu_to_le32(0);
bytes += (idx-start)*sizeof(u32);
}