Date: Wed, 4 Jul 2001 23:11:37 -0400 From: "Alexander N. Kabaev" <kabaev@mail.ru> To: freebsd-multimedia@FreeBSD.org Cc: anholt@teleport.com Subject: XFree86 4.1.0 DRI patch for -CURRENT Message-ID: <20010704231137.A31583@kan.dnsalias.net>
next in thread | raw e-mail | index | archive | help
Attached is a patch which, when applied to the bsd-2-0-0-0 branch
from dri.sourceforge.net, allows DRI kernel modules to compile on
todays -CURRENT.
I was able to test Matrox driver with my G400 card only and your
mileage can vary if you are using other supported card.
Index: drm_bufs.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_bufs.h,v
retrieving revision 1.10.2.16
diff -u -r1.10.2.16 drm_bufs.h
--- drm_bufs.h 2001/06/05 13:51:23 1.10.2.16
+++ drm_bufs.h 2001/07/05 02:47:34
@@ -40,6 +40,7 @@
#include <vm/pmap.h>
#include <vm/vm_extern.h>
#include <vm/vm_map.h>
+#include <vm/vm_param.h>
#endif
#include "drmP.h"
@@ -1028,6 +1029,7 @@
#endif
#ifdef __FreeBSD__
vm_offset_t virtual, address;
+ struct vmspace *vms = p->p_vmspace;
#endif
drm_buf_map_t request;
int i;
@@ -1073,7 +1075,8 @@
#endif
#ifdef __FreeBSD__
- retcode = vm_mmap(&p->p_vmspace->vm_map,
+ virtual = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ);
+ retcode = vm_mmap(&vms->vm_map,
&virtual,
round_page(map->size),
PROT_READ|PROT_WRITE, VM_PROT_ALL,
@@ -1099,7 +1102,8 @@
#endif
#endif
#ifdef __FreeBSD__
- retcode = vm_mmap(&p->p_vmspace->vm_map,
+ virtual = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ);
+ retcode = vm_mmap(&vms->vm_map,
&virtual,
round_page(dma->byte_count),
PROT_READ|PROT_WRITE, VM_PROT_ALL,
Index: drm_fops.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_fops.h,v
retrieving revision 1.4.2.6
diff -u -r1.4.2.6 drm_fops.h
--- drm_fops.h 2001/05/07 15:49:53 1.4.2.6
+++ drm_fops.h 2001/07/05 02:47:35
@@ -41,7 +41,11 @@
drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, struct proc *p)
{
+#if __FreeBSD_version >= 500021
+ uid_t uid = p->p_ucred->cr_svuid;
+#else
uid_t uid = p->p_cred->p_svuid;
+#endif
pid_t pid = p->p_pid;
drm_file_t *priv;
@@ -113,7 +117,11 @@
} else {
priv = (drm_file_t *) DRM(alloc)(sizeof(*priv), DRM_MEM_FILES);
bzero(priv, sizeof(*priv));
+#if __FreeBSD_version >= 500021
+ priv->uid = p->p_ucred->cr_svuid;
+#else
priv->uid = p->p_cred->p_svuid;
+#endif
priv->pid = p->p_pid;
priv->refs = 1;
priv->minor = m;
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010704231137.A31583>
