From: "Michel Dänzer" <michel@daenzer.net>
To: Jon Smirl <jonsmirl@yahoo.com>
Cc: dri-devel <dri-devel@lists.sourceforge.net>,
linux-kernel@vger.kernel.org
Subject: Re: [Dri-devel] 2.6 kernel change in nopage
Date: Thu, 01 Jan 2004 13:03:38 +0100 [thread overview]
Message-ID: <1072958618.1603.236.camel@thor.asgaard.local> (raw)
In-Reply-To: <20031231182148.26486.qmail@web14918.mail.yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 586 bytes --]
On Wed, 2003-12-31 at 19:21, Jon Smirl wrote:
> The headers for nopageXX calls just changed.
>
> struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int
> unused);
> changed to:
> struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int
> *type);
>
> The DRM drivers need to be adjusted. This probably impacts the BSD builds.
No, this is Linux specific.
How does this patch look?
--
Earthling Michel Dänzer | Debian (powerpc), X and DRI developer
Software libre enthusiast | http://svcs.affero.net/rm.php?r=daenzer
[-- Attachment #2: drm-nopage.diff --]
[-- Type: text/x-patch, Size: 6417 bytes --]
Index: drmP.h
===================================================================
RCS file: /cvs/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v
retrieving revision 1.85
diff -p -u -r1.85 drmP.h
--- drmP.h 5 Nov 2003 08:13:52 -0000 1.85
+++ drmP.h 1 Jan 2004 12:02:05 -0000
@@ -806,18 +819,10 @@ extern int DRM(flush)(struct file *
extern int DRM(fasync)(int fd, struct file *filp, int on);
/* Mapping support (drm_vm.h) */
-extern struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access);
-extern struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access);
-extern struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access);
-extern struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access);
+extern struct page *DRM(vm_nopage)( DRM_NOPAGE_ARGS );
+extern struct page *DRM(vm_shm_nopage)( DRM_NOPAGE_ARGS );
+extern struct page *DRM(vm_dma_nopage)( DRM_NOPAGE_ARGS );
+extern struct page *DRM(vm_sg_nopage)( DRM_NOPAGE_ARGS );
extern void DRM(vm_open)(struct vm_area_struct *vma);
extern void DRM(vm_close)(struct vm_area_struct *vma);
extern void DRM(vm_shm_close)(struct vm_area_struct *vma);
Index: drm_os_linux.h
===================================================================
RCS file: /cvs/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h,v
retrieving revision 1.19
diff -p -u -r1.19 drm_os_linux.h
--- drm_os_linux.h 4 Nov 2003 00:46:05 -0000 1.19
+++ drm_os_linux.h 1 Jan 2004 12:02:05 -0000
@@ -52,6 +52,13 @@ typedef void irqreturn_t;
#define DRM_AGP_KERN struct agp_kern_info
#endif
+/** Page fault handler arguments */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+#define DRM_NOPAGE_ARGS struct vm_area_struct *vma, unsigned long address, int *type
+#else
+#define DRM_NOPAGE_ARGS struct vm_area_struct *vma, unsigned long address, int unused
+#endif
+
/** Task queue handler arguments */
#define DRM_TASKQUEUE_ARGS void *arg
Index: drm_vm.h
===================================================================
RCS file: /cvs/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h,v
retrieving revision 1.26
diff -p -u -r1.26 drm_vm.h
--- drm_vm.h 12 Sep 2003 20:00:59 -0000 1.26
+++ drm_vm.h 1 Jan 2004 12:02:05 -0000
@@ -69,15 +69,14 @@ struct vm_operations_struct DRM(vm_sg_
*
* \param vma virtual memory area.
* \param address access address.
- * \param write_access sharing.
+ * \param type pointer to variable holding the type of fault
+ * (unused before kernel 2.6.1).
* \return pointer to the page structure.
*
* Find the right map and if it's AGP memory find the real physical page to
* map, get the page, increment the use count and return it.
*/
-struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access)
+struct page *DRM(vm_nopage)( DRM_NOPAGE_ARGS )
{
#if __REALLY_HAVE_AGP
drm_file_t *priv = vma->vm_file->private_data;
@@ -134,6 +133,10 @@ struct page *DRM(vm_nopage)(struct vm_ar
baddr, __va(agpmem->memory->memory[offset]), offset,
atomic_read(&page->count));
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+ if (type)
+ *type = VM_FAULT_MINOR;
+#endif
return page;
}
vm_nopage_error:
@@ -147,15 +150,14 @@ vm_nopage_error:
*
* \param vma virtual memory area.
* \param address access address.
- * \param write_access sharing.
+ * \param type pointer to variable holding the type of fault
+ * (unused before kernel 2.6.1).
* \return pointer to the page structure.
*
* Get the the mapping, find the real physical page to map, get the page, and
* return it.
*/
-struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access)
+struct page *DRM(vm_shm_nopage)( DRM_NOPAGE_ARGS )
{
drm_map_t *map = (drm_map_t *)vma->vm_private_data;
unsigned long offset;
@@ -171,6 +173,10 @@ struct page *DRM(vm_shm_nopage)(struct v
if (!page)
return NOPAGE_OOM;
get_page(page);
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+ if (type)
+ *type = VM_FAULT_MINOR;
+#endif
DRM_DEBUG("shm_nopage 0x%lx\n", address);
return page;
@@ -262,14 +268,13 @@ void DRM(vm_shm_close)(struct vm_area_st
*
* \param vma virtual memory area.
* \param address access address.
- * \param write_access sharing.
+ * \param type pointer to variable holding the type of fault
+ * (unused before kernel 2.6.1).
* \return pointer to the page structure.
*
* Determine the page number from the page offset and get it from drm_device_dma::pagelist.
*/
-struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access)
+struct page *DRM(vm_dma_nopage)( DRM_NOPAGE_ARGS )
{
drm_file_t *priv = vma->vm_file->private_data;
drm_device_t *dev = priv->dev;
@@ -288,6 +293,10 @@ struct page *DRM(vm_dma_nopage)(struct v
(offset & (~PAGE_MASK))));
get_page(page);
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+ if (type)
+ *type = VM_FAULT_MINOR;
+#endif
DRM_DEBUG("dma_nopage 0x%lx (page %lu)\n", address, page_nr);
return page;
@@ -298,14 +307,13 @@ struct page *DRM(vm_dma_nopage)(struct v
*
* \param vma virtual memory area.
* \param address access address.
- * \param write_access sharing.
+ * \param type pointer to variable holding the type of fault
+ * (unused before kernel 2.6.1).
* \return pointer to the page structure.
*
* Determine the map offset from the page offset and get it from drm_sg_mem::pagelist.
*/
-struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access)
+struct page *DRM(vm_sg_nopage)( DRM_NOPAGE_ARGS )
{
drm_map_t *map = (drm_map_t *)vma->vm_private_data;
drm_file_t *priv = vma->vm_file->private_data;
@@ -326,6 +334,10 @@ struct page *DRM(vm_sg_nopage)(struct vm
page_offset = (offset >> PAGE_SHIFT) + (map_offset >> PAGE_SHIFT);
page = entry->pagelist[page_offset];
get_page(page);
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+ if (type)
+ *type = VM_FAULT_MINOR;
+#endif
return page;
}
next parent reply other threads:[~2004-01-01 12:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20031231182148.26486.qmail@web14918.mail.yahoo.com>
2004-01-01 12:03 ` Michel Dänzer [this message]
2004-01-01 12:10 ` Arjan van de Ven
2004-01-01 12:23 ` Michel Dänzer
2004-01-01 12:28 ` Arjan van de Ven
2004-01-01 14:27 ` Michel Dänzer
2004-01-01 15:06 ` William Lee Irwin III
2004-01-01 20:19 ` Linus Torvalds
2004-01-01 20:57 ` Nigel Cunningham
2004-01-01 22:57 ` Linus Torvalds
2004-01-10 21:54 ` Michel Dänzer
2004-01-10 22:08 ` Arjan van de Ven
2004-01-11 0:15 ` Michel Dänzer
2004-01-01 13:33 ` William Lee Irwin III
2004-01-01 13:50 ` Michel Dänzer
2004-01-01 14:13 ` William Lee Irwin III
2004-01-01 17:55 ` Alan Cox
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=1072958618.1603.236.camel@thor.asgaard.local \
--to=michel@daenzer.net \
--cc=dri-devel@lists.sourceforge.net \
--cc=jonsmirl@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome