Ok, I've merged the current DRI CVS tree from freedesktop.org into the kernel, and as a result I now have another (pretty obvious) diff for back-merging into DRI. I hope somebody with commit access will do this.
The merge has three parts: - a real fix for an i830_irq.c misfeature, where the DRI code initializes counters and a wait-queue _after_ having enabled interrupts. Yeah, there shouldn't be any events pending since the thing should be quiescent and we just cleared the interrupt sources, but it's still not good practice. So move the clearing to the pre-irq-install. - Update the Kconfig file for the SiS driver to the new realities of not needing the SISFB driver to compile. This is probably not an issue for anybody who compiles the out-of-kernel version, since they won't be using the kernel configurator, but it's an easier merge, and it's obviously correct. - whitespace fixes. The DRI tree had a number of whitespace fixes to the i810 driver that I merged into the kernel - but whenever I merged a whitespace change I made sure to merge the _proper_ whitespace. No mixed space/tab crud at the beginning of lines. As a result, I now have a pure whitespace diff that I try to push back into the DRI tree. All of these should be totally obvious patches, but they may apply with some offset because I edited out the other parts of the merge. Can somebody apply them or indicate why they shouldn't be applied. [ The whitespace noise should be fine, since there should be no issues with merging this back into XF86 - since all development to the files involved happens either in the kernel tree or in the DRI tree. So it shouldn't cause any merge issues down the line - it only helps merging with the kernel. I obviously don't know what the merge issues are for the *BSD versions.. ] Ok? Linus --- diff --- ### ### Fix counter and waitqueue setup to happen _before_ interrupts can come in. ### diff -u dri-kernel/i830_irq.c v2.5/linux/drivers/char/drm/i830_irq.c --- dri-kernel/i830_irq.c 2003-07-29 03:11:48.000000000 -0700 +++ v2.5/linux/drivers/char/drm/i830_irq.c 2003-09-25 08:57:07.551573782 -0700 @@ -186,6 +185,9 @@ I830_WRITE16( I830REG_HWSTAM, 0xffff ); I830_WRITE16( I830REG_INT_MASK_R, 0x0 ); I830_WRITE16( I830REG_INT_ENABLE_R, 0x0 ); + atomic_set(&dev_priv->irq_received, 0); + atomic_set(&dev_priv->irq_emitted, 0); + init_waitqueue_head(&dev_priv->irq_queue); } void DRM(driver_irq_postinstall)( drm_device_t *dev ) { @@ -193,9 +195,6 @@ (drm_i830_private_t *)dev->dev_private; I830_WRITE16( I830REG_INT_ENABLE_R, 0x2 ); - atomic_set(&dev_priv->irq_received, 0); - atomic_set(&dev_priv->irq_emitted, 0); - init_waitqueue_head(&dev_priv->irq_queue); } void DRM(driver_irq_uninstall)( drm_device_t *dev ) { ### ### Fix Kconfig file for SiS driver - it now works without SISFB ### diff -u dri-kernel/Kconfig v2.5/linux/drivers/char/drm/Kconfig --- dri-kernel/Kconfig 2003-08-15 03:31:54.000000000 -0700 +++ v2.5/linux/drivers/char/drm/Kconfig 2003-09-25 08:30:36.172304441 -0700 @@ -75,9 +75,9 @@ config DRM_SIS tristate "SiS video cards" - depends on DRM && AGP && FB_SIS + depends on DRM && AGP help Choose this option if you have a SiS 630 or compatibel video chipset. If M is selected the module will be called sis. AGP - and SiS FB support is required for this driver to work. + support is required for this driver to work. ### ### Various whitespace fixes: don't mix spaces and tabs ### at the beginning of lines ### diff -u dri-kernel/i810_dma.c v2.5/linux/drivers/char/drm/i810_dma.c --- dri-kernel/i810_dma.c 2003-08-14 18:05:24.000000000 -0700 +++ v2.5/linux/drivers/char/drm/i810_dma.c 2003-09-24 17:10:18.000000000 -0700 @@ -90,7 +83,7 @@ /* In use is already a pointer */ used = cmpxchg(buf_priv->in_use, I810_BUF_FREE, I810_BUF_CLIENT); - if (used == I810_BUF_FREE) { + if (used == I810_BUF_FREE) { return buf; } } @@ -108,7 +101,7 @@ /* In use is already a pointer */ used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, I810_BUF_FREE); - if (used != I810_BUF_CLIENT) { + if (used != I810_BUF_CLIENT) { DRM_ERROR("Freeing buffer thats not in use : %d\n", buf->idx); return -EINVAL; } @@ -194,7 +187,7 @@ return -EINVAL; down_write(¤t->mm->mmap_sem); - retcode = DO_MUNMAP(current->mm, + retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual, (size_t) buf->total); up_write(¤t->mm->mmap_sem); @@ -252,7 +245,7 @@ drm_i810_private_t *dev_priv = (drm_i810_private_t *) dev->dev_private; - if (dev_priv->ring.virtual_start) { + if (dev_priv->ring.virtual_start) { DRM(ioremapfree)((void *) dev_priv->ring.virtual_start, dev_priv->ring.Size, dev); } @@ -327,7 +320,7 @@ u32 *hw_status = (u32 *)(dev_priv->hw_status_page + my_idx); int i; - if (dma->buf_count > 1019) { + if (dma->buf_count > 1019) { /* Not enough space in the status page for the freelist */ return -EINVAL; } @@ -439,7 +432,7 @@ DRM_DEBUG("Enabled hardware status page\n"); /* Now we need to init our freelist */ - if (i810_freelist_init(dev, dev_priv) != 0) { + if (i810_freelist_init(dev, dev_priv) != 0) { dev->dev_private = (void *)dev_priv; i810_dma_cleanup(dev); DRM_ERROR("Not enough space in the status page for" @@ -476,7 +469,7 @@ /* This is a v1.2 client, just get the v1.2 init data */ DRM_INFO("Using POST v1.2 init.\n"); if (copy_from_user(init, (drm_i810_init_t *)arg, - sizeof(drm_i810_init_t))) { + sizeof(drm_i810_init_t))) { return -EFAULT; } } else { @@ -504,7 +497,7 @@ int retcode = 0; /* Get only the init func */ - if (copy_from_user(&init, (void *)arg, sizeof(drm_i810_init_func_t))) + if (copy_from_user(&init, (void *)arg, sizeof(drm_i810_init_func_t))) return -EFAULT; switch(init.func) { @@ -515,15 +508,15 @@ * It will someday go away. */ retcode = i810_dma_init_compat(&init, arg); - if (retcode) + if (retcode) return retcode; dev_priv = DRM(alloc)(sizeof(drm_i810_private_t), DRM_MEM_DRIVER); if (dev_priv == NULL) - return -ENOMEM; + return -ENOMEM; retcode = i810_dma_initialize(dev, dev_priv, &init); - break; + break; default: case I810_INIT_DMA_1_4: @@ -534,10 +527,10 @@ } dev_priv = DRM(alloc)(sizeof(drm_i810_private_t), DRM_MEM_DRIVER); - if (dev_priv == NULL) - return -ENOMEM; + if (dev_priv == NULL) + return -ENOMEM; retcode = i810_dma_initialize(dev, dev_priv, &init); - break; + break; case I810_CLEANUP_DMA: DRM_INFO("DMA Cleanup\n"); @@ -1027,7 +1020,7 @@ if (used == I810_BUF_CLIENT) DRM_DEBUG("reclaimed from client\n"); - if (buf_priv->currently_mapped == I810_BUF_MAPPED) + if (buf_priv->currently_mapped == I810_BUF_MAPPED) buf_priv->currently_mapped = I810_BUF_UNMAPPED; } } @@ -1039,7 +1032,7 @@ drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { + if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { DRM_ERROR("i810_flush_ioctl called without lock held\n"); return -EINVAL; } @@ -1064,7 +1057,7 @@ if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex))) return -EFAULT; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { + if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { DRM_ERROR("i810_dma_vertex called without lock held\n"); return -EINVAL; } @@ -1099,7 +1092,7 @@ if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear))) return -EFAULT; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { + if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { DRM_ERROR("i810_clear_bufs called without lock held\n"); return -EINVAL; } @@ -1123,7 +1116,7 @@ DRM_DEBUG("i810_swap_bufs\n"); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { + if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { DRM_ERROR("i810_swap_buf called without lock held\n"); return -EINVAL; } @@ -1382,7 +1375,7 @@ DRM_DEBUG("%s\n", __FUNCTION__); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { + if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { DRM_ERROR("i810_flip_buf called without lock held\n"); return -EINVAL; } diff -u dri-kernel/radeon.h v2.5/linux/drivers/char/drm/radeon.h --- dri-kernel/radeon.h 2003-08-26 08:44:00.000000000 -0700 +++ v2.5/linux/drivers/char/drm/radeon.h 2003-09-24 17:10:18.000000000 -0700 @@ -124,7 +124,7 @@ if ( dev_priv->page_flipping ) { \ radeon_do_cleanup_pageflip( dev ); \ } \ - radeon_mem_release( filp, dev_priv->gart_heap ); \ + radeon_mem_release( filp, dev_priv->gart_heap ); \ radeon_mem_release( filp, dev_priv->fb_heap ); \ } \ } while (0) ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel