gfxdump version 0.0.1:

Program for dumping graphics chips registers on Linux and Windows 9X.

Copyright (C) 1999 by yvind Aabling, Oyvind.Aabling@uni-c.dk.

At this point, only the graphics chips/cards listed below
are supported, but the program has been prepared for expansion
to dump registers of any graphics cards known to XFree86:

* Tseng Labs: ET6000,
* ATI Technologies: Mach 64 (including Rage, Rage II and Rage PRO variants),
* ATI Technologies: Rage 128.

Compilation on Linux: gcc -O2 -o gfxdump gfxdump.c

Compilation on Windows 9X: gcc -O2 -o gfxdump.exe gfxdump.c

The included gfxdump.exe has been compiled with
gcc 2.8.1 in the MingW32 environment on Windows 98.


To run this program, the following files *must*
be present in the current working directory:

Linux: The compiled program (gfxdump) and the .reg files.

Win9X: The executable (gfxdump.exe), the .reg files and mapdev.vxd.

On Linux, gfxdump must be called as root,
on Win9X, call gfxdump.exe from a DOS box.


Usage for GATOS (the short story):

* Call "gfxdump" to list all graphics cards (PCI and AGP).
* Call "gfxdump -a -b -e +dac <pciaddr> <outfile>" to dump
  the registers for the PCI/AGP card at <pciaddr> to <outfile>.
* Send the <outfile> to the GATOS team.

Examples:

(two ATI graphics cards present here):
# ./gfxdump
0:15:0 : 1002:4756 (ATI Technologies)
1:0:0  : 1002:4742 (ATI Technologies)

(dump registers of the first card to dump1.dat):
# ./gfxdump -a -b -e +dac 0:15:0 dump1.dat


Usage (the long story):

First call "gfxdump" (without arguments) to list all
graphics cards (PCI and AGP), or call "gfxdump -v"
to list all PCI/AGP cards in the system,
then call "gfxdump [flags] <pciaddr> [<outfile>]" to
dump selected registers for a particular graphics card.


gfxdump
	prints the PCI address, VendorID:DeviceID and
	vendor name of all graphics cards in the system.

gfxdump -v
	same, except that PCI address and VendorID:DeviceID are
	printed also for all non-graphics cards present in the system.

gfxdump [-a] [-e] [(+|-)<group>] <pciaddr> [outfile]
	dump selected register groups for the specified PCI or AGP card.

General program flags:

-e	Print everything about each register.
	Default	is to print only the register address and value.

Register selection flags:

-a	Dump all registers.
-<grp>	Include registers in <grp>.
+<grp>	Exclude registers in <grp>.

<pciaddr>	A PCI or AGP card address is of the form bus:card:func,
	often "1:0:0" for an AGP card, and "0:#:0" for a PCI card in slot #.

Note, that calling "gfxdump <pciaddr>", i.e. without any '-a'
or '-<grp>' options causes gfxdump to dump no registers.

Also note, that the sequence in which '-a' and
'[+-]<grp>' options are specified *does* matter.

The defined register groups for a chip can be seen in
VGA.reg (for the VGA registers) and in the relevant
<chip>.reg file for the chip specific registers.


Examples:


List all graphics cards (ATI AGP card present @ 1:0:0):
# ./gfxdump
1:0:0 : 0x1002:0x5246 (ATI Technologies)


Also list non-graphics cards:
# ./gfxdump -v
0:0:0  : 0x8086:0x7180
0:1:0  : 0x8086:0x7181
0:7:0  : 0x8086:0x7110
0:7:1  : 0x8086:0x7111
0:7:2  : 0x8086:0x7112
0:7:3  : 0x8086:0x7113
0:14:0 : 0x104B:0x8130
1:0:0  : 0x1002:0x5246 (ATI Technologies)


Dump all registers except the DAC registers:
# ./gfxdump -a -e +dac 1:0:0
IO_03C0  =       20  138    GEN   ATCIDX
IO_03C2  =       00  131    GEN   InputStatus0
IO_03C4  =       00  167    GEN   TSIDX
...
MMR_1CA0 = 00000000  8-10   3D    MISC_3D_STATE_CNTL_REG
MMR_1D34 = 00000000  8-13   2D    CONSTANT_COLOR_C
MMR_1D44 = FFFFFFFF  8-13   3D    PLANE_3D_MASK_C


Dump capture and overlay registers only:
# ./gfxdump -e -cap -ov 1:0:0
MMR_0400 = 0019025D  M-3    OV    OV0_Y_X_START
MMR_0404 = 020D04F8  M-3    OV    OV0_Y_X_END
MMR_0408 = 00000000  M-3    OV    OV0_EXCLUSIVE_HORZ
...
MMR_09E0 = 00000042  M-50   CAP   CAP1_BUF_STATUS
MMR_09E8 = 10001000  M-51   CAP   CAP1_DWNSC_XRATIO
MMR_09EC = 00000000  M-51   CAP   CAP1_XSHARPNESS

regaddr    regvalue  docref group registername


Output columns:
regaddr		Register access method and address.
regvalue	Register value.
docref		Page reference to relevant register docs.
		These are not 100% accurate, and the page refs for
		the VGA registers are for the Tseng ET6000 databook.
group		Register group, exclude registers in group GROUP with option
		+group, include with -group (or "-a" to get everything ;-).
registername	Name of the register.


Special Copyrights:

AsmMacros.h and pci.c are from XFree86 3.3.*,
and are under the XFree86 copyright.

The Windows9X memory mapping VxD, mapdev.vxd and it's header file
mapdev.h are Copyright (c) 1996 Vireo Software, Inc., and are reused with
permission from Karen Hazzah <KHazzah@melita.com>, see mapdev.copyright.


yvind Aabling, <Oyvind.Aabling@uni-c.dk>
