Commit e2f0176d authored by Linus Torvalds's avatar Linus Torvalds

Merge with DRI CVS tree

parent 82edf0ac
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#define __NO_VERSION__ #define __NO_VERSION__
#include "drmP.h" #include "drmP.h"
int DRM(irq_busid)(struct inode *inode, struct file *filp, int DRM(irq_busid)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
...@@ -41,8 +42,20 @@ int DRM(irq_busid)(struct inode *inode, struct file *filp, ...@@ -41,8 +42,20 @@ int DRM(irq_busid)(struct inode *inode, struct file *filp,
if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p))) if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
return -EFAULT; return -EFAULT;
dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum)); dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum));
if (dev) p.irq = dev->irq; if (!dev) {
else p.irq = 0; DRM_ERROR("pci_find_slot failed for %d:%d:%d\n",
p.busnum, p.devnum, p.funcnum);
p.irq = 0;
goto out;
}
if (pci_enable_device(dev) != 0) {
DRM_ERROR("pci_enable_device failed for %d:%d:%d\n",
p.busnum, p.devnum, p.funcnum);
p.irq = 0;
goto out;
}
p.irq = dev->irq;
out:
DRM_DEBUG("%d:%d:%d => IRQ %d\n", DRM_DEBUG("%d:%d:%d => IRQ %d\n",
p.busnum, p.devnum, p.funcnum, p.irq); p.busnum, p.devnum, p.funcnum, p.irq);
if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p))) if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
......
...@@ -74,7 +74,7 @@ do { \ ...@@ -74,7 +74,7 @@ do { \
ret = -EBUSY; \ ret = -EBUSY; \
break; \ break; \
} \ } \
schedule_timeout(max(HZ/100,1)); \ schedule_timeout((HZ/100 > 1) ? HZ/100 : 1); \
if (signal_pending(current)) { \ if (signal_pending(current)) { \
ret = -EINTR; \ ret = -EINTR; \
break; \ break; \
......
...@@ -157,9 +157,18 @@ void mga_do_dma_flush( drm_mga_private_t *dev_priv ) ...@@ -157,9 +157,18 @@ void mga_do_dma_flush( drm_mga_private_t *dev_priv )
{ {
drm_mga_primary_buffer_t *primary = &dev_priv->prim; drm_mga_primary_buffer_t *primary = &dev_priv->prim;
u32 head, tail; u32 head, tail;
DMA_LOCALS; u32 status = 0;
int i;
DMA_LOCALS;
DRM_DEBUG( "\n" ); DRM_DEBUG( "\n" );
/* We need to wait so that we can do an safe flush */
for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
status = MGA_READ( MGA_STATUS ) & MGA_ENGINE_IDLE_MASK;
if ( status == MGA_ENDPRDMASTS ) break;
udelay( 1 );
}
if ( primary->tail == primary->last_flush ) { if ( primary->tail == primary->last_flush ) {
DRM_DEBUG( " bailing out...\n" ); DRM_DEBUG( " bailing out...\n" );
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment