From owner-freebsd-current Tue Feb 25 11:22:16 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AEE3737B401 for ; Tue, 25 Feb 2003 11:22:12 -0800 (PST) Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [192.108.102.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id F146943F85 for ; Tue, 25 Feb 2003 11:22:11 -0800 (PST) (envelope-from wa1ter@myrealbox.com) Received: from myrealbox.com wa1ter@smtp-send.myrealbox.com [67.114.252.50] by smtp-send.myrealbox.com with NetMail SMTP Agent $Revision: 3.31 $ on Novell NetWare via secured & encrypted transport (TLS); Tue, 25 Feb 2003 12:22:16 -0700 Message-ID: <3E5BC265.8090009@myrealbox.com> Date: Tue, 25 Feb 2003 11:22:13 -0800 From: walt Organization: none User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3b) Gecko/20030213 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: patch for the nVidia driver and -CURRENT References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Maxime Henrion wrote: > --X1bOJ3K7DJ5YkBrT > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > > Hi all, > > > Recent interface changes made the nVidia driver unbuildable on -CURRENT. > The attached patch should make it work as it used to. Please let me > know if it doesn't. Yes! [Big kiss to Maxime] Thank you! The only thing I needed to do to make it work was to delete this line from nv-freebsd.h: #error This driver does not support FreeBSD 5.0/-CURRENT! As long as you are patching you may as well patch that one also, yes? > --X1bOJ3K7DJ5YkBrT > Content-Type: text/plain; charset=us-ascii > Content-Disposition: attachment; filename="nvidia.patch" > > diff -u NVIDIA_FreeBSD-1.0-3203/src/nv-freebsd.h nvidia/src/nv-freebsd.h > --- NVIDIA_FreeBSD-1.0-3203/src/nv-freebsd.h Wed Oct 30 15:30:58 2002 > +++ nvidia/src/nv-freebsd.h Tue Feb 25 00:00:48 2003 > @@ -86,6 +83,7 @@ > > #if __FreeBSD_version >= 500000 > #include > +#include > #include > #include > > @@ -306,7 +304,8 @@ > int nvidia_open_dev (struct nvidia_softc *); > int nvidia_close_ctl (dev_t, d_thread_t *); > int nvidia_close_dev (struct nvidia_softc *, dev_t, d_thread_t *); > -int nvidia_mmap_dev (struct nvidia_softc *, vm_offset_t); > +int nvidia_mmap_dev (struct nvidia_softc *, vm_offset_t, > + vm_offset_t *); > > #endif /* __NV_FREEBSD_H__ */ > > diff -u NVIDIA_FreeBSD-1.0-3203/src/nvidia_dev.c nvidia/src/nvidia_dev.c > --- NVIDIA_FreeBSD-1.0-3203/src/nvidia_dev.c Wed Oct 30 15:30:58 2002 > +++ nvidia/src/nvidia_dev.c Mon Feb 24 23:59:21 2003 > @@ -135,6 +135,7 @@ > int nvidia_dev_mmap( > dev_t dev, > vm_offset_t offset, > + vm_offset_t *paddr, > int nprot > ) > { > @@ -148,7 +149,7 @@ > nv = sc->nv_state; > > nv_lock_api(nv); > - status = nvidia_mmap_dev(sc, offset); > + status = nvidia_mmap_dev(sc, offset, paddr); > nv_unlock_api(nv); > > return status; > diff -u NVIDIA_FreeBSD-1.0-3203/src/nvidia_subr.c nvidia/src/nvidia_subr.c > --- NVIDIA_FreeBSD-1.0-3203/src/nvidia_subr.c Wed Oct 30 15:30:58 2002 > +++ nvidia/src/nvidia_subr.c Tue Feb 25 00:00:14 2003 > @@ -1401,7 +1405,8 @@ > > int nvidia_mmap_dev( > struct nvidia_softc *sc, > - vm_offset_t offset > + vm_offset_t offset, > + vm_offset_t *paddr > ) > { > nv_alloc_t *at; > @@ -1412,14 +1417,20 @@ > * are physical addresses and mapped into user-space directly. We can > * only do some basic sanity checking here. > */ > - if (IS_FB_OFFSET(nv, offset, PAGE_SIZE)) > - return atop(offset); > + if (IS_FB_OFFSET(nv, offset, PAGE_SIZE)) { > + *paddr = offset; > + return 0; > + } > > - if (IS_REG_OFFSET(nv, offset, PAGE_SIZE)) > - return atop(offset); > + if (IS_REG_OFFSET(nv, offset, PAGE_SIZE)) { > + *paddr = offset; > + return 0; > + } > > - if (IS_AGP_OFFSET(nv, offset, PAGE_SIZE)) > - return atop(offset); > + if (IS_AGP_OFFSET(nv, offset, PAGE_SIZE)) { > + *paddr = offset; > + return 0; > + } > > /* > * If the offset does not fall into any of the relevant apertures, we > @@ -1431,7 +1442,8 @@ > SLIST_FOREACH(at, &sc->alloc_list, list) { > if (offset >= at->address && > offset < at->address + at->size) > - return atop(vtophys(offset)); > + *paddr = vtophys(offset); > + return 0; > } > > return -1; > > --X1bOJ3K7DJ5YkBrT-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message