summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/Makefile.kernel2
-rw-r--r--linux/i810_dma.c2
-rw-r--r--linux/mga_dma.c26
-rw-r--r--linux/mga_state.c9
4 files changed, 23 insertions, 16 deletions
diff --git a/linux/Makefile.kernel b/linux/Makefile.kernel
index a169473a..e262213a 100644
--- a/linux/Makefile.kernel
+++ b/linux/Makefile.kernel
@@ -9,7 +9,7 @@
# Note 2! The CFLAGS definitions are now inherited from the
# parent makes..
#
-# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.5 2000/02/14 06:27:25 martin Exp $
+# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.6 2000/06/17 00:03:34 martin Exp $
L_TARGET := libdrm.a
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index 94f35b61..96b7a44f 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -211,7 +211,7 @@ static int i810_unmap_buffer(drm_buf_t *buf)
if(buf_priv->currently_mapped != I810_BUF_MAPPED) return -EINVAL;
down(&current->mm->mmap_sem);
- retcode = do_munmap((unsigned long)buf_priv->virtual,
+ retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual,
(size_t) buf->total);
buf_priv->currently_mapped = I810_BUF_UNMAPPED;
buf_priv->virtual = 0;
diff --git a/linux/mga_dma.c b/linux/mga_dma.c
index 25e3622c..28e8811c 100644
--- a/linux/mga_dma.c
+++ b/linux/mga_dma.c
@@ -572,10 +572,12 @@ int mga_dma_schedule(drm_device_t *dev, int locked)
{
drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
drm_device_dma_t *dma = dev->dma;
+ int retval = 0;
if (test_and_set_bit(0, &dev->dma_flag)) {
atomic_inc(&dma->total_missed_dma);
- return -EBUSY;
+ retval = -EBUSY;
+ goto sch_out_wakeup;
}
DRM_DEBUG("%s\n", __FUNCTION__);
@@ -591,7 +593,8 @@ int mga_dma_schedule(drm_device_t *dev, int locked)
atomic_inc(&dma->total_missed_lock);
clear_bit(0, &dev->dma_flag);
DRM_DEBUG("Not locked\n");
- return -EBUSY;
+ retval = -EBUSY;
+ goto sch_out_wakeup;
}
DRM_DEBUG("I'm locked\n");
@@ -621,12 +624,12 @@ int mga_dma_schedule(drm_device_t *dev, int locked)
}
}
+sch_out_wakeup:
if(test_bit(MGA_IN_FLUSH, &dev_priv->dispatch_status) &&
- dev_priv->next_prim->num_dwords == 0 &&
atomic_read(&dev_priv->pending_bufs) == 0) {
- /* Everything has been processed by the hardware */
+ /* Everything has been processed by the hardware */
clear_bit(MGA_IN_FLUSH, &dev_priv->dispatch_status);
- wake_up_interruptible(&dev_priv->flush_queue);
+ wake_up_interruptible(&dev_priv->flush_queue);
}
if(test_bit(MGA_IN_GETBUF, &dev_priv->dispatch_status) &&
@@ -641,7 +644,7 @@ int mga_dma_schedule(drm_device_t *dev, int locked)
}
clear_bit(0, &dev->dma_flag);
- return 0;
+ return retval;
}
static void mga_dma_service(int irq, void *device, struct pt_regs *regs)
@@ -956,11 +959,11 @@ static int mga_flush_queue(drm_device_t *dev)
}
if(dev_priv->next_prim->num_dwords != 0) {
- set_bit(MGA_IN_FLUSH, &dev_priv->dispatch_status);
current->state = TASK_INTERRUPTIBLE;
add_wait_queue(&dev_priv->flush_queue, &entry);
+ set_bit(MGA_IN_FLUSH, &dev_priv->dispatch_status);
+ mga_dma_schedule(dev, 0);
for (;;) {
- mga_dma_schedule(dev, 0);
if (!test_bit(MGA_IN_FLUSH,
&dev_priv->dispatch_status))
break;
@@ -1093,14 +1096,15 @@ int mga_flush_ioctl(struct inode *inode, struct file *filp,
}
if(lock.flags & _DRM_LOCK_FLUSH || lock.flags & _DRM_LOCK_FLUSH_ALL) {
- drm_mga_prim_buf_t *temp_buf =
- dev_priv->prim_bufs[dev_priv->current_prim_idx];
+ drm_mga_prim_buf_t *temp_buf;
+
+ temp_buf = dev_priv->current_prim;
if(temp_buf && temp_buf->num_dwords) {
set_bit(MGA_BUF_FORCE_FIRE, &temp_buf->buffer_status);
mga_advance_primary(dev);
- mga_dma_schedule(dev, 1);
}
+ mga_dma_schedule(dev, 1);
}
if(lock.flags & _DRM_LOCK_QUIESCENT) {
mga_flush_queue(dev);
diff --git a/linux/mga_state.c b/linux/mga_state.c
index 0f7da2c7..723ccc53 100644
--- a/linux/mga_state.c
+++ b/linux/mga_state.c
@@ -546,7 +546,6 @@ static void mga_dma_dispatch_vertex(drm_device_t * dev, drm_buf_t * buf)
10 + 15 * MGA_NR_SAREA_CLIPRECTS);
PRIM_OVERFLOW(dev, dev_priv, primary_needed);
mgaEmitState(dev_priv);
-
do {
if (i < sarea_priv->nbox) {
DRM_DEBUG("idx %d Emit box %d/%d:"
@@ -572,7 +571,6 @@ static void mga_dma_dispatch_vertex(drm_device_t * dev, drm_buf_t * buf)
PRIMADVANCE(dev_priv);
} while (++i < sarea_priv->nbox);
}
-
if (buf_priv->discard) {
if (buf_priv->dispatched == 1)
AGEBUF(dev_priv, buf_priv);
@@ -748,10 +746,15 @@ static void mga_dma_dispatch_swap(drm_device_t * dev)
DRM_DEBUG("%s\n", __FUNCTION__);
primary_needed = nbox * 5;
- primary_needed += 60;
+ primary_needed += 65;
PRIM_OVERFLOW(dev, dev_priv, primary_needed);
PRIMGETPTR(dev_priv);
+ PRIMOUTREG(MGAREG_DMAPAD, 0);
+ PRIMOUTREG(MGAREG_DMAPAD, 0);
+ PRIMOUTREG(MGAREG_DWGSYNC, 0x7100);
+ PRIMOUTREG(MGAREG_DWGSYNC, 0x7000);
+
PRIMOUTREG(MGAREG_DSTORG, dev_priv->frontOffset);
PRIMOUTREG(MGAREG_MACCESS, dev_priv->mAccess);
PRIMOUTREG(MGAREG_SRCORG, dev_priv->backOffset);