Subject: Video corruption with VIA CLE266
To: None <tech-x11@netbsd.org>
From: Stephen Borrill <netbsd@precedence.co.uk>
List: tech-x11
Date: 08/01/2005 13:40:33
I'm trying to get X working on a mobo with embedded VIA CLE266 graphics 
(it's not an Epia, but it's similar). With NetBSD 2.0.2 and 3.0_BETA (i.e. 
XF86 4.4.0 and 4.5.0), I see a video corruption problem.

With NoAccel=False (default), large black bands appear, ghost windows 
appear when windows are moved and the title bars in TWM have transparent 
sections. With NoAccel=True, this corruption disappears, but a single 
black line appears that corrupts any window beneath it. The pointer is 
often corrupted too. With HWCursor=False and SWCursor=True, the thin line 
and pointer corruption are fixed. i.e. the corruption can be worked around 
at the expense of performance.

I had most success with 3.0_BETA. It fixes the corruption of the text 
consoles reported elsewhere. It also detected modes correctly. With 2.0.2 
modes weren't found and I had to hardwire refresh rates to get anything.

This is all using the via driver, I was unable to get the vesa driver to 
do anything sensible (with 2.0.2 it never found any modes, IIRC and with 
3.0_BETA it cleared the screen with a block cursor in the top left and the 
console could no longer be switched).

Any suggestions on how to fix the corruption (besides these workarounds)?

XF86Config here:
Section "ServerLayout"
 	Identifier     "XFree86 Configured"
 	Screen      0  "Screen0" 0 0
 	InputDevice    "Mouse0" "CorePointer"
 	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
 	RgbPath      "/usr/X11R6/lib/X11/rgb"
 	ModulePath   "/usr/X11R6/lib/modules"
 	FontPath     "/usr/X11R6/lib/X11/fonts/misc/"
 	FontPath     "/usr/X11R6/lib/X11/fonts/Speedo/"
 	FontPath     "/usr/X11R6/lib/X11/fonts/Type1/"
 	FontPath     "/usr/X11R6/lib/X11/fonts/CID/"
 	FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/"
 	FontPath     "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection
Section "Module"
 	Load  "extmod"
 	Load  "glx"
 	Load  "dbe"
 	Load  "record"
 	Load  "xtrap"
 	Load  "type1"
 	Load  "speedo"
EndSection
Section "InputDevice"
 	Identifier  "Keyboard0"
 	Driver      "keyboard"
EndSection

Section "InputDevice"
 	Identifier  "Mouse0"
 	Driver      "mouse"
 	Option	    "Protocol" "wsmouse"
 	Option	    "Device" "/dev/wsmouse"
EndSection

Section "Monitor"
 	Identifier   "Monitor0"
 	VendorName   "Monitor Vendor"
 	ModelName    "Monitor Model"
EndSection

Section "Device"
         ### Available Driver options are:-
         ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
         ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
         ### [arg]: arg optional
         #Option     "A2"                 	# [<bool>]
         Option     "NoAccel" "True"           	# [<bool>]
         Option     "HWCursor" "False"           	# [<bool>]
         Option     "SWCursor" "True"          	# [<bool>]
         #Option     "ShadowFB"           	# [<bool>]
         #Option     "Rotate"             	# [<str>]
         #Option     "UseBIOS"            	# [<bool>]
         #Option     "VideoRAM"           	# <i>
         #Option     "ActiveDevice"       	# [<str>]
         #Option     "LCDDualEdge"        	# [<bool>]
         #Option     "BusWidth"           	# [<str>]
         #Option     "Center"             	# [<bool>]
         #Option     "PanelSize"          	# [<str>]
         #Option     "TVDotCrawl"         	# [<bool>]
         #Option     "TVType"             	# [<str>]
         #Option     "TVOutput"           	# [<str>]
         #Option     "TVVScan"            	# [<str>]
         #Option     "TVHScale"           	# [<str>]
         #Option     "TVEncoder"          	# [<str>]
         #Option     "Refresh"            	# <i>
         #Option     "DisableVQ"          	# [<bool>]
         #Option     "DisableIRQ"         	# [<bool>]
         #Option     "Cap0Deinterlace"    	# [<str>]
         #Option     "Cap1Deinterlace"    	# [<str>]
         #Option     "Cap0FieldSwap"      	# [<bool>]
         #Option     "DRIXINERAMA"        	# [<bool>]
 	Identifier  "Card0"
 	Driver      "via"
 	VendorName  "Unknown Vendor"
 	BoardName   "Unknown Board"
 	BusID       "PCI:1:0:0"
EndSection

Section "Screen"
 	Identifier "Screen0"
 	Device     "Card0"
 	Monitor    "Monitor0"
 	DefaultDepth 16
 	SubSection "Display"
 		Viewport   0 0
 		Depth     1
 	EndSubSection
 	SubSection "Display"
 		Viewport   0 0
 		Depth     4
 	EndSubSection
 	SubSection "Display"
 		Viewport   0 0
 		Depth     8
 	EndSubSection
 	SubSection "Display"
 		Viewport   0 0
 		Depth     15
 	EndSubSection
 	SubSection "Display"
 		Viewport   0 0
 		Depth     16
 		Modes "1280x1024" "1024x786" "800x600" "640x480"
 	EndSubSection
 	SubSection "Display"
 		Viewport   0 0
 		Depth     24
 	EndSubSection
EndSection

-- 
Stephen