*BSD News Article 18204


Return to BSD News archive

Xref: sserve comp.windows.x.i386unix:2421 comp.os.386bsd.bugs:1088
Newsgroups: comp.windows.x.i386unix,comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!munnari.oz.au!bruce.cs.monash.edu.au!merlin!mel.dit.csiro.au!its.csiro.au!dmssyd.syd.dms.CSIRO.AU!metro!news
From: dawes@physics.su.OZ.AU (David Dawes)
Subject: Fix for line bugs that crash XF86_SVGA on 386BSD
Message-ID: <1993Jul10.083541.18631@ucc.su.OZ.AU>
Followup-To: comp.windows.x.i386unix
Sender: news@ucc.su.OZ.AU
Nntp-Posting-Host: physics.su.oz.au
Organization: School of Physics, University of Sydney, Australia
Date: Sat, 10 Jul 1993 08:35:41 GMT
Lines: 257

Included here is a patch for XFree86-1.3 which fixes the line drawing bugs
that cause the SVGA server to crash on 386BSD.  This patch (and other
late fixes) can also be found in the file README.late which is available
from ftp.physics.su.oz.au:/XFree86 and export.lcs.mit.edu:/contrib/XFree86.

An updated XF86_SVGA binary and libvga256.a for 386BSD are available
(courtesy of Rich Murphey) from XFree86.cdrom.com in pub/XFree86/XFree86-1.3
and shortly on the usual mirror sites.  The files are:

  README-1.3u1
  XFree86-1.3u1-XF86_SVGA.tar.gz
  XFree86-1.3u1-libvga256.tar.gz

There will be no updated binaries for other OSs because the problem is
not serious on them.

The bugs were:

1. In the non-SpeedUp version of the 0-width diagonal line code.  This
is the same bug that was reported (with a fix) by Andrew Cagney
<acagney@macadam.mpce.mq.edu.au> a week ago.

2. In the non-SpeedUp version of the 0-width horizontal line code.

3. In the SpeedUp version of the 0-width diagonal line code.

4. In the SpeedUp version of the 0-width horizontal line code.


None of these bugs are OS-dependent, but they only appear to cause a server
crash on 386BSD.  This is because it is more strict then the others about
writing outside the 64k VGA memory area.

None of these bugs show up when the virtual width is set to 1024.

The two SpeedUp bugs are not fixed in this patch (because the fixes are
more extensive than the others, and they require more testing).  Those
fixes will be part of the next release of XFree86.  Instead, this patch
disables the line SpeedUp when the virtual width is not 1024.


Note: this source patch is only of use if you are building XFree86-1.3
from source.  If you use the LinkKit, get the updated libvga256.a.

David
-----------------------------------------------------------------------------
*** mit/server/ddx/x386/vga256/vga/vga.c-1.3	Tue Jul  6 01:08:00 1993
--- mit/server/ddx/x386/vga256/vga/vga.c	Tue Jul  6 01:14:15 1993
***************
*** 26,31 ****
--- 26,33 ----
   */
  
  
+ #define VGA256_PATCHLEVEL 1
+ 
  #include "X.h"
  #include "input.h"
  #include "scrnintstr.h"
***************
*** 203,209 ****
  #ifdef MONOVGA
    ErrorF("  VGA2 (monochrome VGA):\n      ");
  #else
!   ErrorF("  VGA256 (256 colour SVGA):\n      ");
  #endif
    n = 0;
    c = 0;
--- 205,212 ----
  #ifdef MONOVGA
    ErrorF("  VGA2 (monochrome VGA):\n      ");
  #else
!   ErrorF("  VGA256 (256 colour SVGA) patchlevel %d:\n      ",
!          VGA256_PATCHLEVEL);
  #endif
    n = 0;
    c = 0;
*** mit/server/ddx/x386/common/x386.h-1.3	Wed Jul  7 14:15:01 1993
--- mit/server/ddx/x386/common/x386.h	Wed Jul  7 14:16:19 1993
***************
*** 126,132 ****
   */
  #ifndef SPEEDUP_ANYWIDTH
  #define SPEEDUP_ANYWIDTH	(SPEEDUP_FILLRECT | SPEEDUP_BITBLT | \
!                                  SPEEDUP_LINE | SPEEDUP_FILLBOX)
  #endif
  
  /*
--- 126,132 ----
   */
  #ifndef SPEEDUP_ANYWIDTH
  #define SPEEDUP_ANYWIDTH	(SPEEDUP_FILLRECT | SPEEDUP_BITBLT | \
!                                  SPEEDUP_FILLBOX)
  #endif
  
  /*
*** mit/server/ddx/x386/vga256/enhanced/fLineBres.s-1.3	Tue Jul  6 01:06:38 1993
--- mit/server/ddx/x386/vga256/enhanced/fLineBres.s	Tue Jul  6 13:26:14 1993
***************
*** 104,110 ****
  	ADD_L	(CONTENT(e3),e)
  .L3:	ADD_L	(signdx,addrb)
  	CMP_L	(CONTENT(GLNAME(vgaWriteBottom)),addrb)
! 	JBE	(.L4)
  	CMP_L	(CONTENT(GLNAME(vgaWriteTop)),addrb)
  	JAE	(.L9)
  	LOOP	(.writeloopC)
--- 104,111 ----
  	ADD_L	(CONTENT(e3),e)
  .L3:	ADD_L	(signdx,addrb)
  	CMP_L	(CONTENT(GLNAME(vgaWriteBottom)),addrb)
! 	/* was JBE */
! 	JB	(.L4)
  	CMP_L	(CONTENT(GLNAME(vgaWriteTop)),addrb)
  	JAE	(.L9)
  	LOOP	(.writeloopC)
***************
*** 159,165 ****
  	ADD_L	(CONTENT(e3),e)
  .L6:	ADD_L	(signdx,addrb)
  	CMP_L	(CONTENT(GLNAME(vgaWriteBottom)),addrb)
! 	JBE	(.L7)
  	CMP_L	(CONTENT(GLNAME(vgaWriteTop)),addrb)
  	JAE	(.L10)
  	LOOP	(.writeloopS)
--- 160,167 ----
  	ADD_L	(CONTENT(e3),e)
  .L6:	ADD_L	(signdx,addrb)
  	CMP_L	(CONTENT(GLNAME(vgaWriteBottom)),addrb)
! 	/* was JBE */
! 	JB	(.L7)
  	CMP_L	(CONTENT(GLNAME(vgaWriteTop)),addrb)
  	JAE	(.L10)
  	LOOP	(.writeloopS)
*** fLineH.s-1.3	Sat Jul 10 03:27:42 1993
--- fLineH.s	Sat Jul 10 03:27:59 1993
***************
*** 85,100 ****
  	INC_L		(addrl)
  	DEC_L		(len)
  .L14:	TEST_L		(CONST(3),addrl)
! 	JZ		(.L8)
  	MOV_B		(xorvb,REGIND(addrl))
  	INC_L		(addrl)
  	DEC_L		(len)
  .L15:	TEST_L		(CONST(3),addrl)
! 	JZ		(.L8)
  	MOV_B		(xorvb,REGIND(addrl))
  	INC_L		(addrl)
  	DEC_L		(len)
! 	CMP_L		(CONTENT(GLNAME(vgaWriteTop)),addrl)
  	JB		(.L8)
  	PUSH_L		(addrl)
  	CALL		(GLNAME(vgaWriteNext))
--- 85,100 ----
  	INC_L		(addrl)
  	DEC_L		(len)
  .L14:	TEST_L		(CONST(3),addrl)
! 	JZ		(.L8A)
  	MOV_B		(xorvb,REGIND(addrl))
  	INC_L		(addrl)
  	DEC_L		(len)
  .L15:	TEST_L		(CONST(3),addrl)
! 	JZ		(.L8A)
  	MOV_B		(xorvb,REGIND(addrl))
  	INC_L		(addrl)
  	DEC_L		(len)
! .L8A:	CMP_L		(CONTENT(GLNAME(vgaWriteTop)),addrl)
  	JB		(.L8)
  	PUSH_L		(addrl)
  	CALL		(GLNAME(vgaWriteNext))
***************
*** 163,178 ****
  	INC_L		(addrl)
  	DEC_L		(len)
  .LX14:	TEST_L		(CONST(3),addrl)
! 	JZ		(.LX8)
  	XOR_B		(xorvb,REGIND(addrl))		/**/
  	INC_L		(addrl)
  	DEC_L		(len)
  .LX15:	TEST_L		(CONST(3),addrl)
! 	JZ		(.LX8)
  	XOR_B		(xorvb,REGIND(addrl))		/**/
  	INC_L		(addrl)
  	DEC_L		(len)
! 	CMP_L		(CONTENT(GLNAME(vgaWriteTop)),addrl)
  	JB		(.LX8)
  	PUSH_L		(addrl)
  	CALL		(GLNAME(vgaReadWriteNext))
--- 163,178 ----
  	INC_L		(addrl)
  	DEC_L		(len)
  .LX14:	TEST_L		(CONST(3),addrl)
! 	JZ		(.LX8A)
  	XOR_B		(xorvb,REGIND(addrl))		/**/
  	INC_L		(addrl)
  	DEC_L		(len)
  .LX15:	TEST_L		(CONST(3),addrl)
! 	JZ		(.LX8A)
  	XOR_B		(xorvb,REGIND(addrl))		/**/
  	INC_L		(addrl)
  	DEC_L		(len)
! .LX8A:	CMP_L		(CONTENT(GLNAME(vgaWriteTop)),addrl)
  	JB		(.LX8)
  	PUSH_L		(addrl)
  	CALL		(GLNAME(vgaReadWriteNext))
***************
*** 235,241 ****
  	STOS_B
  	DEC_L		(len)
  .LS14:	TEST_L		(CONST(3),addrl)
! 	JZ		(.LS8)
  	MOV_B		(REGIND(addrl),AL)
  	XOR_B		(xorvb,AL)		/**/
  	AND_B		(andvb,AL)
--- 235,241 ----
  	STOS_B
  	DEC_L		(len)
  .LS14:	TEST_L		(CONST(3),addrl)
! 	JZ		(.LS8A)
  	MOV_B		(REGIND(addrl),AL)
  	XOR_B		(xorvb,AL)		/**/
  	AND_B		(andvb,AL)
***************
*** 242,254 ****
  	STOS_B
  	DEC_L		(len)
  .LS15:	TEST_L		(CONST(3),addrl)
! 	JZ		(.LS8)
  	MOV_B		(REGIND(addrl),AL)
  	XOR_B		(xorvb,AL)		/**/
  	AND_B		(andvb,AL)
  	STOS_B
  	DEC_L		(len)
! 	CMP_L		(CONTENT(GLNAME(vgaWriteTop)),addrl)
  	JB		(.LS8)
  	PUSH_L		(addrl)
  	CALL		(GLNAME(vgaReadWriteNext))
--- 242,254 ----
  	STOS_B
  	DEC_L		(len)
  .LS15:	TEST_L		(CONST(3),addrl)
! 	JZ		(.LS8A)
  	MOV_B		(REGIND(addrl),AL)
  	XOR_B		(xorvb,AL)		/**/
  	AND_B		(andvb,AL)
  	STOS_B
  	DEC_L		(len)
! .LS8A:	CMP_L		(CONTENT(GLNAME(vgaWriteTop)),addrl)
  	JB		(.LS8)
  	PUSH_L		(addrl)
  	CALL		(GLNAME(vgaReadWriteNext))
--
------------------------------------------------------------------------------
 David Dawes <dawes@physics.su.oz.au>    DoD#210      | Phone: +61 2 692 2639
 School of Physics, University of Sydney, Australia   | Fax:   +61 2 660 2903
------------------------------------------------------------------------------