Re: INIT_MMAP on sparc64

From: David S. Miller (davem@redhat.com)
Date: Sun Oct 21 2001 - 20:15:23 EST


DRI works perfectly fine in my current sources, patches below.

Wrt the 3.5MB size limitation, use modules man.

diff -u --recursive --new-file --exclude=CVS --exclude=.cvsignore vanilla/linux/drivers/char/drm/drm_drv.h linux/drivers/char/drm/drm_drv.h
--- vanilla/linux/drivers/char/drm/drm_drv.h Fri Sep 14 14:04:07 2001
+++ linux/drivers/char/drm/drm_drv.h Thu Oct 18 09:03:58 2001
@@ -1047,6 +1047,25 @@
 
         atomic_inc( &dev->counts[_DRM_STAT_UNLOCKS] );
 
+#if __HAVE_KERNEL_CTX_SWITCH
+ /* We no longer really hold it, but if we are the next
+ * agent to request it then we should just be able to
+ * take it immediately and not eat the ioctl.
+ */
+ dev->lock.pid = 0;
+ {
+ __volatile__ unsigned int *plock = &dev->lock.hw_lock->lock;
+ unsigned int old, new, prev, ctx;
+
+ ctx = lock.context;
+ do {
+ old = *plock;
+ new = ctx;
+ prev = cmpxchg(plock, old, new);
+ } while (prev != old);
+ }
+ wake_up_interruptible(&dev->lock.lock_queue);
+#else
         DRM(lock_transfer)( dev, &dev->lock.hw_lock->lock,
                             DRM_KERNEL_CONTEXT );
 #if __HAVE_DMA_SCHEDULE
@@ -1061,6 +1080,7 @@
                         DRM_ERROR( "\n" );
                 }
         }
+#endif /* !__HAVE_KERNEL_CTX_SWITCH */
 
         unblock_all_signals();
         return 0;
diff -u --recursive --new-file --exclude=CVS --exclude=.cvsignore vanilla/linux/drivers/char/drm/drm_vm.h linux/drivers/char/drm/drm_vm.h
--- vanilla/linux/drivers/char/drm/drm_vm.h Thu Oct 18 19:06:21 2001
+++ linux/drivers/char/drm/drm_vm.h Sat Oct 20 04:40:42 2001
@@ -531,10 +531,17 @@
                         vma->vm_flags |= VM_IO; /* not in core dump */
                 }
                 offset = DRIVER_GET_REG_OFS();
+#ifdef __sparc__
+ if (io_remap_page_range(vma->vm_start,
+ VM_OFFSET(vma) + offset,
+ vma->vm_end - vma->vm_start,
+ vma->vm_page_prot, 0))
+#else
                 if (remap_page_range(vma->vm_start,
                                      VM_OFFSET(vma) + offset,
                                      vma->vm_end - vma->vm_start,
                                      vma->vm_page_prot))
+#endif
                                 return -EAGAIN;
                 DRM_DEBUG(" Type = %d; start = 0x%lx, end = 0x%lx,"
                           " offset = 0x%lx\n",
diff -u --recursive --new-file --exclude=CVS --exclude=.cvsignore vanilla/linux/drivers/char/drm/ffb_drv.c linux/drivers/char/drm/ffb_drv.c
--- vanilla/linux/drivers/char/drm/ffb_drv.c Sun Aug 12 11:23:32 2001
+++ linux/drivers/char/drm/ffb_drv.c Thu Oct 18 09:03:58 2001
@@ -1,4 +1,4 @@
-/* $Id: ffb_drv.c,v 1.15 2001/08/09 17:47:51 davem Exp $
+/* $Id: ffb_drv.c,v 1.16 2001/10/18 16:00:24 davem Exp $
  * ffb_drv.c: Creator/Creator3D direct rendering driver.
  *
  * Copyright (C) 2000 David S. Miller (davem@redhat.com)
@@ -45,16 +45,16 @@
 #define DRIVER_PRESETUP() do { \
         int _ret; \
         _ret = ffb_presetup(dev); \
- if(_ret != 0) return _ret; \
+ if (_ret != 0) return _ret; \
 } while(0)
 
 /* Free private structure */
 #define DRIVER_PRETAKEDOWN() do { \
- if(dev->dev_private) kfree(dev->dev_private); \
+ if (dev->dev_private) kfree(dev->dev_private); \
 } while(0)
 
 #define DRIVER_POSTCLEANUP() do { \
- if(ffb_position != NULL) kfree(ffb_position); \
+ if (ffb_position != NULL) kfree(ffb_position); \
 } while(0)
 
 /* We have to free up the rogue hw context state holding error or
@@ -66,7 +66,9 @@
         int idx; \
                                                                         \
         idx = context - 1; \
- if (fpriv && fpriv->hw_state[idx] != NULL) { \
+ if (fpriv && \
+ context != DRM_KERNEL_CONTEXT && \
+ fpriv->hw_state[idx] != NULL) { \
                 kfree(fpriv->hw_state[idx]); \
                 fpriv->hw_state[idx] = NULL; \
         } \
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 23 2001 - 21:00:29 EST