Re: [Dri-devel] [PATCH] [BUGFIX] Linux agpgart version check

Leif Delgass <[email protected]>
Newsgroups gmane.comp.xfree86.expert,gmane.comp.video.dri.devel
Message-ID <Pine.LNX.4.44.0212101652290.18995-200000@istanbul.retinalburn.dnsalias.net>
On Tue, 10 Dec 2002, Dave Jones wrote:

> On Tue, Dec 10, 2002 at 04:21:03PM -0500, Leif Delgass wrote:
>  > --- xc/programs/Xserver/hw/kdrive/linux/agp.c	9 Apr 2001 16:27:42 -0000	1.1.1.1
>  > +++ xc/programs/Xserver/hw/kdrive/linux/agp.c	10 Dec 2002 20:51:02 -0000
>  > @@ -120,9 +120,16 @@
>  >  	KdReleaseGART(-1);
>  >  
>  >  #if defined(linux)
>  > -	/* Should this look for version >= rather than version == ? */
>  > -	if (agpinf.version.major != AGPGART_MAJOR_VERSION &&
>  > -	    agpinf.version.minor != AGPGART_MINOR_VERSION) {
>  > +	/* Per Dave Jones, evey effort will be made to keep the
>                            ^^^^^
> 
> Silly typo. 8)
> 
>         Dave

D'oh.  Thanks...here it is again with the the subject line fixed too, just
in case it missed anyone's filter.  ;)

-- 
Leif Delgass 
http://www.retinalburn.net
agp-version-check.diff (text/plain, 2.3 KB)
Index: xc/programs/Xserver/hw/kdrive/linux/agp.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/kdrive/linux/agp.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 agp.c
--- xc/programs/Xserver/hw/kdrive/linux/agp.c	9 Apr 2001 16:27:42 -0000	1.1.1.1
+++ xc/programs/Xserver/hw/kdrive/linux/agp.c	10 Dec 2002 20:51:02 -0000
@@ -120,9 +120,16 @@
 	KdReleaseGART(-1);
 
 #if defined(linux)
-	/* Should this look for version >= rather than version == ? */
-	if (agpinf.version.major != AGPGART_MAJOR_VERSION &&
-	    agpinf.version.minor != AGPGART_MINOR_VERSION) {
+	/* Per Dave Jones, every effort will be made to keep the
+	 * agpgart interface backwards compatible, so allow all
+	 * future versions.
+	 */
+	if (
+#if (AGPGART_MAJOR_VERSION > 0) /* quiet compiler */
+	    agpinf.version.major < AGPGART_MAJOR_VERSION ||
+#endif
+	    (agpinf.version.major == AGPGART_MAJOR_VERSION &&
+	     agpinf.version.minor < AGPGART_MINOR_VERSION)) {
             fprintf(stderr, 
                     "Kernel agpgart driver version is not current" 
                     " (%d.%d vs %d.%d)\n", 
Index: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v
retrieving revision 1.5
diff -u -r1.5 lnx_agp.c
--- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c	11 Sep 2002 00:57:49 -0000	1.5
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c	10 Dec 2002 20:51:03 -0000
@@ -89,9 +89,16 @@
 	xf86ReleaseGART(-1);
 
 #if defined(linux)
-	/* Should this look for version >= rather than version == ? */
-	if (agpinf.version.major != AGPGART_MAJOR_VERSION &&
-	    agpinf.version.minor != AGPGART_MINOR_VERSION) {
+	/* Per Dave Jones, every effort will be made to keep the 
+	 * agpgart interface backwards compatible, so allow all 
+	 * future versions.
+	 */
+	if (
+#if (AGPGART_MAJOR_VERSION > 0) /* quiet compiler */
+	    agpinf.version.major < AGPGART_MAJOR_VERSION ||
+#endif
+	    (agpinf.version.major == AGPGART_MAJOR_VERSION &&
+	     agpinf.version.minor < AGPGART_MINOR_VERSION)) {
 		xf86DrvMsg(screenNum, X_ERROR,
 			"GARTInit: Kernel agpgart driver version is not current"
 			" (%d.%d vs %d.%d)\n",
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.