From: "David S. Miller" <davem@redhat.com>
To: sten@blinkenlights.nl
Cc: linux-kernel@vger.kernel.org
Subject: Re: INIT_MMAP on sparc64
Date: Sun, 21 Oct 2001 18:15:23 -0700 (PDT) [thread overview]
Message-ID: <20011021.181523.112610375.davem@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.40-blink.0110211736030.19859-100000@deepthought.blinkenlights.nl>
In-Reply-To: <20011021.080432.71105870.davem@redhat.com> <Pine.LNX.4.40-blink.0110211736030.19859-100000@deepthought.blinkenlights.nl>
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; \
} \
next prev parent reply other threads:[~2001-10-22 1:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-21 15:10 INIT_MMAP on sparc64 Sten
2001-10-21 15:04 ` David S. Miller
2001-10-21 15:52 ` Sten
2001-10-22 1:15 ` David S. Miller [this message]
2001-10-22 15:14 ` Benjamin LaHaise
2001-10-22 22:39 ` Sten
2001-10-22 22:28 ` David S. Miller
2001-10-22 22:50 ` Sten
2001-10-22 22:39 ` David S. Miller
2001-10-22 23:00 ` Sten
2001-10-22 23:23 ` Jeff Garzik
2001-10-22 23:18 ` Mr. James W. Laferriere
2001-10-22 23:24 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011021.181523.112610375.davem@redhat.com \
--to=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sten@blinkenlights.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox