From owner-ports-jp@jp.FreeBSD.org Sat Jan 24 17:59:02 2004
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id i0O8x2r32647;
	Sat, 24 Jan 2004 17:59:02 +0900 (JST)
	(envelope-from owner-ports-jp@jp.FreeBSD.org)
Received: from smtp.fancy.ocn.ne.jp (fancy.ocn.ne.jp [210.190.142.179])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet id i0O8x1C32635
	for <ports-jp@jp.freebsd.org>; Sat, 24 Jan 2004 17:59:01 +0900 (JST)
	(envelope-from chi@bd.mbn.or.jp)
Received: from chino.localhost (p018-dnb22tutuji.miyagi.ocn.ne.jp [61.208.242.146])
	by smtp.fancy.ocn.ne.jp (Postfix) with ESMTP
	id D940B5C32; Sat, 24 Jan 2004 17:58:59 +0900 (JST)
Posted-Date: Sat, 24 Jan 2004 14:47:37 JST
To: ports-jp@jp.FreeBSD.org
Cc: yokota@freebsd.org
Cc: chi@bd.mbn.or.jp
From: chi@bd.mbn.or.jp (Chiharu Shibata)
X-Mailer: mnews [version 1.22] 1999-12/19(Sun)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="-=-mnews-multipart-=-"
Message-Id: <20040124085859.D940B5C32@m-kg282p.ocn.ne.jp>
Reply-To: ports-jp@jp.FreeBSD.org
Precedence: list
Date: Sat, 24 Jan 2004 17:58:59 +0900
X-Sequence: ports-jp 14542
Subject: [ports-jp 14542] graphics/kix bugfix
Sender: owner-ports-jp@jp.FreeBSD.org
X-Originator: chi@bd.mbn.or.jp
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+040115


---=-mnews-multipart-=-
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit

$B$3$s$K$A$O!"<FED$G$9!#(B
$B$I$3$XJs9p$7$h$&$+$5$s$6$sLB$C$?$N$G$9$,!":G=*E*$K$O(Bports$B2=$5$l$?$h$&$J(B
$B$N$G!"$3$N(BML$B$H(Bsyscons$B%a%s%F%J!<$N2#ED$5$s08$KAw$C$F$$$^$9!#(B

kix$B%9%/%j!<%s%;!<%P$G$9$,!"7kO@$+$i$$$&$H:,K\E*$J%P%0$,$"$j$^$9!#(B
$BEv=i(Bmisc/31297$B$H$7$F(Bsend-pr$B$5$l$?$b$N$,!V(BMillenium$B$@$H(B800x600$B$GF0$+$J$$!W(B
$B$H$$$&%D%C%3%_$,F~$C$F(B800x600$B%b!<%I$,:o=|$5$l!"$=$N8e(Bports/46766$B$H$7$F:F(B
$BDs=P$5$l$F(Bcommit->PR close$B!"$H$$$&N.$l$N$h$&$G$9$,!"$3$l$O(B
$B!V(BMillenium$B$@$+$iF0$+$J$$!W$H$+!V(B800x600$B$@$+$iF0$+$J$$!W(B
$B$H$$$&$N$G$O$J$/$F!"(B
$B!X(BGVRAM window$B%5%$%:0J>e$N2hA|$NE>Aw$G$O%P%s%/@ZBX$($,I,MW!Y(B
$B$G$"$k$3$H$rA4$/9MN8$7$F$J$$$+$i$G$9!#(B

$BE:IU$N%Q%C%A$N$h$&$K=$@5$9$k$3$H$G!"(BThinkPad560$B$G$N@5>oF0:n$r3NG'$7$^$7$?!#(B
$B$D$$$G$K(BPC-9821$B$G$bF0$/$h$&$K$7$F$"$j$^$9(B(^^;;
-- 
$B<FED(B $B@i=U(B($B!i(B) chi@bd.mbn.or.jp
    $B%[!<%`%Z!<%8$N(BURL$B$,JQ$o$j$^$9(B! <http://www32.ocn.ne.jp/~chi/>
---=-mnews-multipart-=-
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Description: kix.diff
Content-Disposition: attachment; filename="kix.diff"

--- kix_saver.c.orig	Sat Jan  4 23:37:49 2003
+++ kix_saver.c	Sat Jan 24 14:00:50 2004
@@ -51,7 +51,7 @@
 
 static u_char   buf[MAX_X_SIZE * (MAX_Y_SIZE + 1)];
 static u_char	*vid;
-static int		scrnmode, width, height, bpl;
+static int		banksize, scrnmode, width, height, bpl;
 
 typedef struct {
 	int	x, y;
@@ -263,20 +263,23 @@
 static int
 kix_saver(video_adapter_t *adp, int blank)
 {
-	int i;
+	int i, pl, len;
 
     if (blank) {
 		if (blanked <= 0) {
+			pl = splhigh();
 			set_video_mode(adp, scrnmode);
 
 			bpl = adp->va_line_width;
 			blanked++;
 			vid = (u_char *) adp->va_window;
+			banksize = adp->va_window_size;
 
 			load_palette(adp, palette);
+			splx(pl);
 
-			memset(vid, 0, width*height);
-			memset(buf, 0, width*height);
+			(*vidsw[adp->va_index]->clear)(adp);
+			bzero(buf, width*height);
 
 			init_kix();
 		}
@@ -297,7 +300,16 @@
 		for (i=0;i<NUM_KIX; i++) {
 			draw_line(lines[i].p1.x, lines[i].p1.y, lines[i].p2.x, lines[i].p2.y, 1+hue);
 		}
-		memcpy(vid, buf, width*height);
+		len = bpl * height;
+		for (i=0; len>banksize; i += banksize) {
+			set_origin(adp, i);
+			bcopy(buf+i, vid, banksize);
+			len -= banksize;
+		}
+		if (len > 0) {
+			set_origin(adp, i);
+			bcopy(buf+i, vid, len);
+		}
 
     } else {
 		blanked = 0;
@@ -313,8 +325,14 @@
     video_info_t    info;
 
 	/* Find suitable screenmode */
-	if (!get_mode_info(adp, M_VESA_CG640x480, &info)) {
+	if (!get_mode_info(adp, M_VESA_CG800x600, &info)) {
+		scrnmode = M_VESA_CG800x600;
+	} else if (!get_mode_info(adp, M_VESA_CG640x480, &info)) {
 		scrnmode = M_VESA_CG640x480;
+	} else if (!get_mode_info(adp, M_PC98_PEGC640x480, &info)) {
+		scrnmode = M_PC98_PEGC640x480;
+	} else if (!get_mode_info(adp, M_PC98_PEGC640x400, &info)) {
+		scrnmode = M_PC98_PEGC640x400;
 	} else if (!get_mode_info(adp, M_VGA_CG320, &info)) {
 		scrnmode = M_VGA_CG320;
 	} else {

---=-mnews-multipart-=---
