From owner-ports-jp@jp.freebsd.org  Mon Dec 25 23:36:15 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id XAA77069;
	Mon, 25 Dec 2000 23:36:15 +0900 (JST)
	(envelope-from owner-ports-jp@jp.FreeBSD.org)
Received: from mail.rdc1.kt.home.ne.jp (ha2.rdc1.kt.home.ne.jp [203.165.9.243])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id XAA77064
	for <ports-jp@jp.FreeBSD.org>; Mon, 25 Dec 2000 23:36:15 +0900 (JST)
	(envelope-from knu@iDaemons.org)
Received: from daemon.local.idaemons.org ([203.165.161.10])
          by mail.rdc1.kt.home.ne.jp (InterMail vM.4.01.02.00 201-229-116)
          with ESMTP
          id <20001225143607.QEMD10418.mail.rdc1.kt.home.ne.jp@daemon.local.idaemons.org>;
          Mon, 25 Dec 2000 06:36:07 -0800
Received: by daemon.local.idaemons.org (8.11.1/3.7W) id eBPEa7g66314; Mon, 25 Dec 2000 23:36:07 +0900 (JST)
Date: Mon, 25 Dec 2000 23:36:07 +0900
Message-ID: <86k88otvoo.wl@archon.local.idaemons.org>
From: "Akinori MUSHA" <knu@iDaemons.org>
To: taguchi@tohoku.iij.ad.jp
Cc: ports-jp@jp.FreeBSD.org
User-Agent: Wanderlust/2.5.4 (Smooth) SEMI/1.14.0 (Iburihashi) FLIM/1.14.0 (Ninokuchi) APEL/10.2 MULE XEmacs/21.1 (patch 12) (Channel Islands) (i386--freebsd)
Organization: Associated I. Daemons
X-PGP-Public-Key: finger knu@FreeBSD.org
X-PGP-Fingerprint: 081D 099C 1705 861D 4B70  B04A 920B EFC7 9FD9 E1EE
MIME-Version: 1.0 (generated by SEMI 1.14.0 - "Iburihashi")
Content-Type: text/plain; charset=ISO-2022-JP
Reply-To: ports-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: ports-jp 10548
Subject: [ports-jp 10548] x11-servers/XttXF86srv-common: chasing x11/XFree86's changes
Errors-To: owner-ports-jp@jp.freebsd.org
Sender: owner-ports-jp@jp.freebsd.org
X-Originator: knu@iDaemons.org

$B!!(Bx11-servers/XttXF*srv-* $B$K$D$$$F!"(B machine/console.h $B$NGQ;_$K(B
$B$h$j(B 5-CURRENT $B$G%3%s%Q%$%k$G$-$J$$$N$r=$@5$9$k%Q%C%A$r4^$a!"(B
$B$3$3?t%v7n4V$K(B x11/XFree86 $B$KF~$C$?%Q%C%A72$r%^!<%8$7$F$_$^$7$?!#(B

$B!!LdBj$,$J$1$l$P(B commit $B$7$?$$$H;W$$$^$9$,$h$m$7$$$G$7$g$&$+!)(B

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"We're only at home when we're on the run, on the wing, on the fly"

M Makefile
M distinfo
A files/patch-g
A files/patch-i
A files/patch-q
A files/patch-r
A files/patch-s
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/x11-servers/XttXF86srv-common/Makefile,v
retrieving revision 1.33
diff -u -r1.33 Makefile
--- Makefile	2000/10/08 07:21:02	1.33
+++ Makefile	2000/12/25 13:47:14
@@ -7,22 +7,28 @@
 
 PORTNAME?=	xtt-common
 PORTVERSION=	${VERSION}.${PATCHLEVEL}
+PORTREVISION=	1
 CATEGORIES=	x11-servers
 MASTER_SITES=	${MASTER_SITE_XFREE} \
 		http://X-TT.dsl.gr.jp/dists/1.x/${VERSION}/
-MASTER_SITE_SUBDIR=	3.3.6
+MASTER_SITE_SUBDIR=	${XFREE_VERSION}
 DISTFILES=	X336src-1.tgz xtt-${VERSION}.tgz
 
+PATCH_SITES=	${MASTER_SITE_XFREE:S,%SUBDIR%/source,${XFREE_VERSION}/fixes,}
+PATCHFILES=	fix-01-r128 fix-04-s3trio3d2x fix-05-s3trio3d fix-06-s3trio3d2x\
+		fix-07-s3trio64v2gx+netfinity fix-08-s3savage_ix+mx
+
 MAINTAINER=	taguchi@tohoku.iij.ad.jp
 
 RUN_DEPENDS+=	mkttfdir:${PORTSDIR}/print/perlftlib
 
+XFREE_VERSION=	3.3.6
 VERSION=	1.3
-PATCHLEVEL=	0
+PATCHLEVEL=	1
 SERVER?=	common
 INSTALLS_SHLIB=	yes
 .if !defined(USE_SHARED_WRKSRC) && defined(COMPILE_ALL_SERVERS_AT_ONCE)
-USE_SHARED_WRKSRC= YES
+USE_SHARED_WRKSRC=	YES
 .endif
 .if !defined(XDM_DES) && defined(USA_RESIDENT) && ${USA_RESIDENT} == NO
 MASTER_SITES+=	ftp://psych.psy.uq.oz.au/pub/X11R5/ \
@@ -55,8 +61,7 @@
 XTTTARBALL=	xtt-core.tar
 ADDPATCHES=	${XTTDIR}/contribute/xtt-xfsft-lib.patch
 DOCDIR=		${PREFIX}/share/doc/Xtt
-PATCH_DIST_ARGS= -d ${WRKDIR} --forward --quiet -E ${PATCH_STRIP}
-#PATCH_DIST_STRIP=	-p1
+PATCH_DIST_STRIP=	-p1
 
 .include <bsd.port.pre.mk>
 
Index: distinfo
===================================================================
RCS file: /home/ncvs/ports/x11-servers/XttXF86srv-common/distinfo,v
retrieving revision 1.10
diff -u -r1.10 distinfo
--- distinfo	2000/06/22 13:19:32	1.10
+++ distinfo	2000/12/25 12:47:34
@@ -1,3 +1,9 @@
 MD5 (xc/X336src-1.tgz) = bbfa360d10ce91ab37f24f197a31b485
 MD5 (xc/xtt-1.3.tgz) = f4c9efdb90d848701c305e2955149920
+MD5 (xc/fix-01-r128) = a62387e13b970c5a83e9a0822c30344f
+MD5 (xc/fix-04-s3trio3d2x) = 75569a9d49bb45b8ecb311ab3f8c2469
+MD5 (xc/fix-05-s3trio3d) = eb8fd33328c8b5fbd0410472339dee44
+MD5 (xc/fix-06-s3trio3d2x) = 79c4e3f340f1df5786649559d09c2378
+MD5 (xc/fix-07-s3trio64v2gx+netfinity) = 6b09cc9b7b3d89f18ea5e9591969b99c
+MD5 (xc/fix-08-s3savage_ix+mx) = 8df8d4b013de9e5f87d028b1bf2415a5
 MD5 (xc/Wraphelp.c) = IGNORE
Index: files/patch-g
===================================================================
RCS file: patch-g
diff -N patch-g
--- /dev/null	Mon Dec 25 23:23:28 2000
+++ patch-g	Mon Dec 25 21:37:07 2000
@@ -0,0 +1,9 @@
+Index: programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_accel.c
+@@ -39,6 +39,7 @@
+ 
+ #include <math.h>
+ #include <stdio.h>
++#include <sys/types.h>
+ #include <sys/mman.h>
+ #include <signal.h>
+ 
Index: files/patch-i
===================================================================
RCS file: patch-i
diff -N patch-i
--- /dev/null	Mon Dec 25 23:23:28 2000
+++ patch-i	Mon Dec 25 21:37:07 2000
@@ -0,0 +1,208 @@
+S3 Savage/MX and Savage/IX patches for XFree86 3.3.6 post fix-08
+
+http://www.probo.com/timr/savagemx.html
+
+from: Sun Oct 22 10:12:06 CEST 2000
+
+--- programs/Xserver/hw/xfree86/vga256/drivers/s3_savage/s3sav_cursor.c.orig	Sun Oct 22 09:52:21 2000
++++ programs/Xserver/hw/xfree86/vga256/drivers/s3_savage/s3sav_cursor.c	Fri Sep  1 22:12:56 2000
+@@ -250,7 +250,7 @@
+    /* VerticalRetraceWait(); */
+ 
+    /* turn cursor off */
+-   S3VHideCursor();
++   S3SAVHideCursor();
+ 
+    /* move cursor off-screen */
+    outb(vgaCRIndex, 0x46);
+--- programs/Xserver/hw/xfree86/vga256/drivers/s3_savage/s3sav_driver.c.orig	Sun Oct 22 09:52:21 2000
++++ programs/Xserver/hw/xfree86/vga256/drivers/s3_savage/s3sav_driver.c	Fri Sep 29 23:19:23 2000
+@@ -94,6 +94,7 @@
+ static void    S3SAVRestore();
+ static void    S3SAVAdjust();
+ static void    S3SAVFbInit();
++static int     S3SAVPitchAdjust();
+ void           S3SAVSetRead();
+ void           S3SAVAccelInit();
+ void           S3SAVInitialize2DEngine();
+@@ -721,12 +722,12 @@
+ 
+    /* Restore the desired video mode with CR67 */
+         
+-   outb(vgaCRIndex, 0x67);             
+ #if 0
++   outb(vgaCRIndex, 0x67);             
+    cr67 = inb(vgaCRReg) & 0xf; /* Possible hardware bug on VX? */
+-#endif
+    outb(vgaCRReg, 0x50 | cr67); 
+    usleep(10000);
++#endif
+    outb(vgaCRIndex, 0x67);             
+    outb(vgaCRReg, restore->CR67 & ~0x0c); /* Don't enable STREAMS yet */
+ 
+@@ -745,9 +746,11 @@
+    outb(vgaCRReg, restore->CR51);
+    
+    /* Memory timings */
+-   outb(vgaCRIndex, 0x36);             
++   outb(vgaCRIndex, 0x36);
+    outb(vgaCRReg, restore->CR36);
+-   outb(vgaCRIndex, 0x68);             
++   outb(vgaCRIndex, 0x60);
++   outb(vgaCRReg, restore->CR60);
++   outb(vgaCRIndex, 0x68);
+    outb(vgaCRReg, restore->CR68);
+    outb(vgaCRIndex, 0x69);
+    outb(vgaCRReg, restore->CR69);
+@@ -764,8 +767,11 @@
+    outb(vgaCRReg, restore->CR90);
+    outb(vgaCRIndex, 0x91);
+    outb(vgaCRReg, restore->CR91);
+-   outb(vgaCRIndex, 0xB0); /* Savage4 config3 */
+-   outb(vgaCRReg, restore->CRB0);
++   if( s3vPriv.chip == S3_SAVAGE4 )
++   {
++      outb(vgaCRIndex, 0xB0); /* Savage4 config3 */
++      outb(vgaCRReg, restore->CRB0);
++   }
+ 
+    outb(vgaCRIndex, 0x32);
+    outb(vgaCRReg, restore->CR32);
+@@ -981,6 +987,8 @@
+    save->CR53 = inb(vgaCRReg);
+    outb(vgaCRIndex, 0x58);
+    save->CR58 = inb(vgaCRReg);
++   outb(vgaCRIndex, 0x60);
++   save->CR60 = inb(vgaCRReg);
+    outb(vgaCRIndex, 0x66);
+    save->CR66 = inb(vgaCRReg);
+    outb(vgaCRIndex, 0x67);
+@@ -1135,10 +1143,29 @@
+ }
+ 
+ 
++/*
++ * This function adjusts the pitch to a multiple of 16 pixels.
++ */
++
++static int
++S3SAVPitchAdjust( void )
++{
++    int pitch = vga256InfoRec.virtualX;
++
++    if( pitch % 16 != 0 )
++    {
++	pitch = (pitch + 15) & ~15;
++
++	ErrorF("%s %s: %s: Display width padded to %d bytes.\n",
++	     XCONFIG_PROBED, vga256InfoRec.name, vga256InfoRec.chipset,
++	     pitch);
++    }
++    return pitch;
++}
++
++
+ /* 
+- * This is the main probe function for the virge chipsets.
+- * Right now, I have taken a shortcut and get most of the info from
+- * PCI probing.
++ * This is the main probe function for the Savage chipsets.
+  */
+ 
+ static Bool
+@@ -1511,6 +1538,8 @@
+    S3V.ChipLinearBase = vga256InfoRec.MemBase;
+    S3V.ChipLinearSize = vga256InfoRec.videoRam * 1024;
+ 
++   vgaSetPitchAdjustHook(S3SAVPitchAdjust);
++
+    return TRUE;   
+ }
+ 
+@@ -1782,9 +1811,9 @@
+    outb(vgaCRIndex, 0x3a);
+    tmp = inb(vgaCRReg);
+    if(!OFLG_ISSET(OPTION_PCI_BURST_ON, &vga256InfoRec.options)) 
+-      new->CR3A = tmp | 0x95;      /* ENH 256, no PCI burst! */
++      new->CR3A = tmp | 0x90;      /* ENH 256, no PCI burst! */
+    else 
+-      new->CR3A = (tmp & 0x7f) | 0x15; /* ENH 256, PCI burst */
++      new->CR3A = (tmp & 0x7f) | 0x10; /* ENH 256, PCI burst */
+ 
+    new->CR53 &= ~0x08;     /* Enables MMIO */
+    new->CR31 = 0x8c;     /* Dis. 64k window, en. ENH maps */    
+@@ -1806,12 +1835,22 @@
+ 
+    dclk = vga256InfoRec.clock[mode->Clock];
+    new->CR67 = 0x00;             /* Defaults */
+-   new->SR15 = 0x03 | 0x80; 
++   if( s3vPriv.chip != S3_SAVAGE2000 )
++      new->SR15 = 0x03 | 0x80; 
++   else
++      /* One-cycle writes broken on Savage2000? */
++      new->SR15 = 0x03;
+    new->SR18 = 0x00;
+    new->CR43 = 0x00;
+    new->CR45 = 0x00;
+    new->CR65 = 0x00;
+ 
++   outb(vgaCRIndex, 0x60);
++   new->CR60 = inb(vgaCRReg);
++
++   if( s3vPriv.chip == S3_SAVAGE_MX )
++       new->CR60 = 0x09;
++
+    outb(vgaCRIndex, 0x40);
+    new->CR40 = inb(vgaCRReg) & ~0x01;
+    
+@@ -1852,16 +1891,19 @@
+ 
+    {
+        if (vgaBitsPerPixel == 8) {
+-          if (dclk <= 110000) new->CR67 = 0x00; /* 8bpp, 135MHz */
+-          else new->CR67 = 0x10;                /* 8bpp, 220MHz */
++	  new->CR67 = 0x00;                /* 8bpp, 220MHz */
+           }
+        else if ((vgaBitsPerPixel == 16) && (vga256InfoRec.weight.green == 5)) {
+-          if (dclk <= 110000) new->CR67 = 0x20; /* 15bpp, 135MHz */
+-          else new->CR67 = 0x30;                /* 15bpp, 220MHz */
++	  if( s3vPriv.chip == S3_SAVAGE_MX )
++	    new->CR67 = 0x30;                /* 15bpp, 220MHz */
++	  else
++	    new->CR67 = 0x20;
+           }
+        else if (vgaBitsPerPixel == 16) {
+-          if (dclk <= 110000) new->CR67 = 0x40; /* 16bpp, 135MHz */
+-          else new->CR67 = 0x50;                /* 16bpp, 220MHz */
++	  if( s3vPriv.chip == S3_SAVAGE_MX )
++	    new->CR67 = 0x50;                 /* 16bpp, 220MHz */
++	  else
++	    new->CR67 = 0x40;
+           }
+        else if ((vgaBitsPerPixel == 24) || (vgaBitsPerPixel == 32)) {
+           new->CR67 = 0xd0;                     /* 24bpp, 135MHz */
+@@ -1967,8 +2009,12 @@
+    else
+       new->CR50 |= 0xC1; /* default to use GlobalBD */
+ 
+-   new->CR33 = 0x20;
++   if( s3vPriv.chip == S3_SAVAGE2000 )
++     new->CR33 = 0x08;
++   else
++     new->CR33 = 0x20;
+ 	 
++   new->std.CRTC[0x17] = 0xeb;
+ 
+    /* Now we handle various XConfig memory options and others */
+ 
+--- programs/Xserver/hw/xfree86/vga256/drivers/s3_savage/s3sav_driver.h.orig	Sun Oct 22 09:52:21 2000
++++ programs/Xserver/hw/xfree86/vga256/drivers/s3_savage/s3sav_driver.h	Sat Sep  2 02:57:01 2000
+@@ -25,7 +25,7 @@
+    unsigned char CR31, CR32, CR33, CR34, CR36, CR3A, CR3B, CR3C;
+    unsigned char CR40, CR42, CR43, CR45;
+    unsigned char CR50, CR51, CR53, CR58, CR5B, CR5D, CR5E;
+-   unsigned char CR65, CR66, CR67, CR68, CR69, CR6F; /* Video attrib. */
++   unsigned char CR60, CR65, CR66, CR67, CR68, CR69, CR6F; /* Video attrib. */
+    unsigned char CR86, CR88;
+    unsigned char CR90, CR91, CRB0;
+    unsigned char ColorStack[8]; /* S3 hw cursor color stack CR4A/CR4B */
Index: files/patch-q
===================================================================
RCS file: patch-q
diff -N patch-q
--- /dev/null	Mon Dec 25 23:23:28 2000
+++ patch-q	Mon Dec 25 21:37:07 2000
@@ -0,0 +1,21 @@
+--- programs/Xserver/hw/xfree86/etc/scanpci.c.orig	Fri Dec  3 04:43:47 1999
++++ programs/Xserver/hw/xfree86/etc/scanpci.c	Mon Dec  4 14:14:39 2000
+@@ -101,7 +101,17 @@
+ #endif
+ #if defined(__FreeBSD__) || defined(__386BSD__)
+ #include <sys/file.h>
+-#include <machine/console.h>
++#if defined(__FreeBSD__)
++#  include <osreldate.h>
++#  if __FreeBSD_version >= 410000
++#    include <sys/consio.h>
++#    include <sys/kbio.h>
++#  else
++#   include <machine/console.h>
++#  endif
++#else 
++#  include <machine/console.h>
++#endif
+ #ifndef GCCUSESGAS
+ #define GCCUSESGAS
+ #endif
Index: files/patch-r
===================================================================
RCS file: patch-r
diff -N patch-r
--- /dev/null	Mon Dec 25 23:23:28 2000
+++ patch-r	Mon Dec 25 21:37:07 2000
@@ -0,0 +1,43 @@
+--- programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h.ORIG    Mon Nov 27 13:29 :06 2000
++++ programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h Mon Nov 27 14:26:21 2000
+@@ -461,11 +461,21 @@
+ #   endif
+ #   ifdef SYSCONS_SUPPORT
+ #    define COMPAT_SYSCONS
+-#    if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#    if defined(__NetBSD__) || defined(__OpenBSD__)
+ #     include <machine/console.h>
+ #    else
+-#     include <sys/console.h>
+-#    endif /* __FreeBSD__ || __NetBSD__ || defined(__OpenBSD__) */
++#     if defined(__FreeBSD__)
++#        include <osreldate.h>
++#        if __FreeBSD_version >= 410000
++#          include <sys/consio.h>
++#          include <sys/kbio.h>
++#        else
++#          include <machine/console.h>
++#        endif /* FreeBSD 4.1 RELEASE or lator */
++#     else
++#      include <sys/console.h>
++#     endif
++#    endif
+ #   endif /* SYSCONS_SUPPORT */
+ #   if defined(PCVT_SUPPORT)
+ #    if !defined(SYSCONS_SUPPORT)
+@@ -496,8 +506,13 @@
+ #    include <dev/wscons/wsconsio.h>
+ #   endif /* WSCONS_SUPPORT */
+ #   if defined(__FreeBSD__)
+-#    undef MOUSE_GETINFO
+-#    include <machine/mouse.h>
++#    include <osreldate.h>
++#    if __FreeBSD_version >= 500013
++#     include <sys/mouse.h>
++#    else
++#     undef MOUSE_GETINFO
++#     include <machine/mouse.h>
++#    endif
+ #   endif
+     /* Include these definitions in case ioctl_pc.h didn't get included */
+ #   ifndef CONSOLE_X_MODE_ON
Index: files/patch-s
===================================================================
RCS file: patch-s
diff -N patch-s
--- /dev/null	Mon Dec 25 23:23:28 2000
+++ patch-s	Mon Dec 25 21:37:07 2000
@@ -0,0 +1,21 @@
+--- programs/Xserver/hw/xfree86/SuperProbe/OS_386BSD.c.ORIG     Mon Nov 27 14:29 :12 2000
++++ programs/Xserver/hw/xfree86/SuperProbe/OS_386BSD.c  Mon Nov 27 14:37:03 2000
+@@ -83,7 +83,17 @@
+ #  endif
+ #  ifdef SYSCONS_SUPPORT
+     /* both, Free and NetBSD have syscons */
+-#   include <machine/console.h>
++#   if defined(__FreeBSD__)
++#    include <osreldate.h>
++#    if __FreeBSD_version >= 410000
++#     include <sys/consio.h>
++#     include <sys/kbio.h>
++#    else
++#     include <machine/console.h>
++#    endif
++#   else 
++#    include <machine/console.h>
++#   endif
+ #  endif
+ # else
+ #  ifdef CODRV_SUPPORT
