Copyright Matrox Graphics Inc., 1994. All rights reserved.
Disclaimer: Matrox Graphics Inc. reserves the right to make changes in specifications at any time and without notice. The
information provided by this document is believed to be accurate and reliable. However; no responsibility is assumed by Matrox
Graphics Inc. for its use; nor for any infringements of patents or other tights of third parties resulting from its use. No license is
granted under any patents or patent
6-15
Figure 6-8: Page Read-Modify-Write/Anti-aliasing Cycle
Figure 6-9: MCTLWTST for Page ZI Cycles
Figure 6-10: Normal Request and Release of the Bus ..............................................................................
Figure 6-11: 1 gclk Release for Refresh ...................................................................................................
Figure 6-12: ATHENA Request for Data Transfer .................................................................................
Figure 6-13: ATHENA/Memory Connection 32 Bit No MUX
Figure 6-14: ATHENA/Memory Connection to 32 Bit RAMDAC
Figure 6-15: ATHENA/Memory Connection to 64 Bit RAMDAC
Figure 6-16: Horizontal Video Reset (eg. 1024x768) ..............................................................................
his chapter contains an overview of the Matrox MGA chipset features
and software products.
MGA
Product Overview
1.1 Introduction
Matrox
MGA
is a high-speed, high-resolution graphics accelerator series of products designed for the
power user. MGA is very suitable for GUI environments such as Microsoft Windows 3.1 and Windows
NT, IBM OS/2 PM,
color, real-time
MGA’s
64-bit graphics power, in combination with a 486 or Pentium-class PC is in our opinion the best
Unix X-Windows, and
3D,
and many other innovative hardware and software enhancements.
AutoCAD.
It offers ultra high resolution displays with true
graphics solution if you require true workstation-level performance at a reasonable price.
1 .1 .1
The Matrox ATHENA chip lies at the heart of
MGA
Chipset
MGA’s
powerful graphics capabilities. It offers an ISA
interface for ISA bus products, and a PCI interface for PCI systems. Several possible memory
configurations permit design of
8,16,
24, and 32 bits/pixel displays at resolutions up to 1600 x 1200
pixels. Figure l-1 shows a block diagram of a typical graphics display adapter which uses the MGA
ATHENA chip.
The
Host Processor Interface (ISA, PCI, EISA,
Figure l-l: Typical Implementation Block Diagram
chipset
functions as a stand-alone graphics controller that features an integrated VGA to offer both
MicroChannel,
VESA-VL, or proprietary)
VGA Mode and high-resolution Power Graphic mode operation. It contains a 32-location Command
FIFO and address and data processing units (APU, DPU). In addition, LINE, Trapezoid, and BITBLT
drawing operations are available, supported by DMA and Pseudo DMA transfers. These enhancements
make screen operations such as redrawing and scrolling appear instantaneous.
ATHENA is pin-compatible with the MGA ATLAS chip, so ATLAS-based designs can take advantage of
ATHENA’s additional features without modification to the board’s design.
Chapter 1: MGA Product Overview
1-2
MGA ATHENA Specification
Matrox Confidential
1 .1 .2Features
n
From 1 to 6 MB of frame buffer VRAM in configurations up to 32 bits/pixel
. VRAM block write operations for maximum speed
9
Photo-realistic true color display, and QCDP (Quality Color Dithering Process) for displays of less
than 24 bits/pixel
. Ultra-high resolution of 1600 x 1200, with 256 colors
. Workstation performance with speeds from 2 to 12 times faster than competitors’ boards
. 64-bit frame buffer data bus width
. Available Z-buffer option (2 to 4 MB DRAM)
. Hardware assisted Gouraud shading and depth-cued wireframe
. Integrated VGA, for full support of all DOS applications, eliminating the need for a separate VGA
card
. Integrated 3D graphics engine
. Integrated PCI interface
. Direct RAMDAC interface
. Fast, flicker-free refresh rates up to 120 Hz
. Support for ISA, VESA VL, Micro Channel, EISA, PCI, and other architectures
. Installation of up to four boards in a system
1 .1 .3Driver Support
MGA Power Drivers are available for Windows 3.1 and
Drivers’ package contains drivers for Windows NT,
AutoCAD
OS/2,
and
MicroStation
Rel. 11/12. The ‘MGA Supplementary
(with dual display).
We provide:
. Support for popular Windows and DOS design and presentation applications
n
DynaView
driver for AutoCAD Release 11 and 12 that includes real-time scroll bars, spy glass, and
bird’s eye view, etc.
w
Support for AutoCAD 12 for Windows, and
MicroStation
PC
. A 3D library which supports SXCI, with planned support for OPEN GL and HOOPS
1 .1 .4Windows Support
. Control Panel for Windows controls the
PixelTouch
hardware pan and zoom, Virtual Desktop, and
‘on the fly’ resolution switching (without rebooting Windows) through the use of
hotkeys.
n
Font anti-aliasing in hardware
. In addition to the drivers listed above, the ‘MGA Supplementary Drivers’ package also contains the
ConsistentColor
printed output, and the
compression ratios of up to 28:
Matrox Confidential
monitor calibration utility to ensure accuracy between your screen display and the
WinSqueeze!
on-the-fly JPEG file compression utility, which can achieve
1.
MGA ATHENA Specification
Introduction 1-3
1 .I .5Video Support
n MGA
9
The MGA
n
interfaces with the Matrox Marvel video capture/video windowing board.
VideoPro NTSC/PAL
animations, and
AutoCAD
Hardware-assisted Video for Windows
encoder provides output capability for recording presentations,
walk-throughs to tape.
(VfW)
and Indeo are supported.
1 .I .6Software Developer Support
. Software libraries (SXCI) are available for developers for the DOS and Windows 3.1 platforms,
with support planned for HOOPS and Open GL. SXCI is a complete
exploits
MGA’s
hardware acceleration capabilities.
2D/3D
API which fully
1 .I .7Documentation
Other documentation available for Matrox MGA products includes:
H
MGA
TITAN
Specification (103 l&MS)*
. MGA ATLAS Specification
. MGA
. MGA SDK Manual
DUBZC
Specification
(10330-MF)
(10348-MS)*
(10232-MS)*
A description of the Matrox MGA TITAN chip.
A description of the Matrox MGA ATLAS chip.
A description of the Matrox MGA DUBIC chip.
A user/reference manual for the MGA software
developer’s kit for DOS and Windows 3.1.
. MGA
n
DynaView /2D
Manual (10345MN)
MGA
Supplemantary
(10352-MN)
for
AutoCADA user/reference manual for the Matrox MGA
Drivers Manual
DynaView driver for
An installation/user manual which describes our
OS/2,
Windows NT, and
well as the MGA
AutoCAD
MicroStation
WinSqueeze!
and 3D Studio.
and ConsistentColor
PC drivers, as
programs for the Windows platform.
*
Like the ATHENA Specification, these are restricted documents. See your Matrox Sales representative
for more details.
The PCI Bus Specification from the PCI Special Interest Group contains additional information on
hardware implementation for the PCI architecture.
1-4
Chapter 1: MGA Product Overview
MGA ATHENA Specification
Matrox Confidential
Chapter 2: ATHENA Overview
T
his chapter introduces the Matrox
sections.
MGA ATHENA
chip and its component
2.1 Introduction
The Matrox ATHENA chip supports both VGA and Power Graphic mode displays. VGA mode supports
the VGA standard, while Power Graphic mode provides additional high-speed, ultra-high resolution
displays. You can switch between the two modes while using the same monitor for both. ATHENA can be
configured for PCI bus systems, or for ISA (and other) bus systems.
The ATHENA chip is a stand-alone graphics controller which is composed of several sections that work
together to accomplish the many tasks required of them. The ATHENA sections are listed below, and
discussed in the following sections of this chapter.
n
Bus Interface
. VGA
. Bus Interface FIFO (BFIFO)
. Address Processing Unit (APU)
w
Data Processing Unit (DPU)
n ZIALU
--
2.1
Bus Interface
.I
This section of ATHENA implements the interface with the host. Two bus interfaces are supported: an
ISA interface and a PCI interface for the PCI bus.
The Bus Interface section includes:
o
All of the control circuitry for the ISA and PCI buses
0
PCI control, decoding, and re-mapping circuitry
0
Configuration registers
0
I/O buffers @-location FIFO for
0
Byte-alignment circuitry; 32-to-8 bit access conversion for VGA and I/O
0
The data path (data and addresses) from the host
writable
devices; 4-location FIFO for ILOAD operations)
2.1.2 VGA
This section implements the VGA functions, and includes:
0
The VGA core, which interfaces directly with the frame buffer in VGA mode
Q
The circuitry for video refresh in Power Graphic mode (see
address generation, data transfer requests, and video control
Section
circuitry
6.3.6),
which
includes
-
2.1.3
Bus Interface FIFO (BFIFO)
0
This section implements the Command FIFO from the host to the drawing engine. All access to
the drawing registers passes through this 32-location FIFO, which holds the data as well as the
address of the targeted register in the drawing engine.
This section of ATHENA generates the sequencing of the drawing operations. Each drawing operation is
broken down into a sequence of read and write commands which are sent to the DPU. The APU includes:
a Generation of the sequence for each drawing operation, and the addresses and mask
0
Processing of the slope for vectors and trapezoid edges
r~
Rectangle clipping
2.1.5
Data Processing Unit (DPU)
This section manipulates the data according to the currently-selected operation. It also converts read and
write commands from the APU into memory cycles to the frame buffer. The DPU includes:
Q
Generation of memory cycles
Q
Host compress, decompress, and data formatting
P
The funnel shifter for data alignment
0
The Boolean ALU
0
Anti-aliasing
a The patterning and dithering circuitry
o
The Data FIFO for BitBLlT operations
0
The color expansion circuitry for character drawing
o
The depth
comparitor
2.1.6 ZI ALU
This section implements the ALU for linear interpolation for Z and for Gouraud shading (R,G,B).
2.2 Frame Buffer
ATHENA can interface directly with the VRAM and DRAM. Memory combinations of
256Kx8
VRAM, 256Kx16 VRAM, and 256Kx16 DRAM are supported in order to permit design of
different display configurations. This allows ATHENA to support 8, 16, 24 and 32 bits/pixel formats and
resolutions up to 1600x1200.
VRAM is used for the frame buffer itself. Since VRAM has two ports, the serial port of the VRAM is
used for the screen refresh while the random port is devoted to drawing operations. Useful VRAM
functions such as split data transfer, block mode, and write/bit are all exploited.
128Kx8
VRAM,
2-4Chapter 2: ATHENA Overview
MGA ATHENA Specification
Matrox Confidential
Chapter 3: Operation Modes
T
his chapter explains the VGA and Power Graphic operation modes of
the Matrox MGA ATHENA chip. The Power Graphic mode description
contains explanations of the memory configuration, frame buffer formats,
drawing operations, initialization, configuration, and reset.
3.1 VGA Mode
ATHENA’s VGA contains all of the functions and support logic required to implement the IBM VGA,
EGA, and CGA display adapter and
level.
Since ATHENA is register-compatible with VGA, EGA, CGA and MDA/Hercules adapters, all display
modes for these adapters can be supported. As with most display adapters, a BIOS is required to
configure ATHENA for each display mode.
As well as the standard control registers required by the various display adapters, ATHENA uses
auxiliary registers to enable enhanced modes and emulation functions.
MDA/
Hercules graphics card standards at a register-compatible
3.1 .I
In all alphanumeric modes,
backgrounds to a single color and allows bits
FlexFont
FlexFont
is an available option. When enabled, it forces the character
D4-D6
of the attribute byte to be used for character font
selection. Up to eight character fonts can be displayed simultaneously. The character fonts are
programmable and are stored in Dynamic Memory Plane 2.
3.1.2 Enhanced Modes
ATHENA enhances some display modes, and provides new high-resolution 256 and 16-color VGA
modes.
The ATHENA chip permits high resolution VGA display modes of 640x400,640x480, 800x600, or
1024x768 pixels with 256 simultaneous colors, both interlaced and non-interlaced. ATHENA also
permits 16 color resolutions of up to 1024x768 interlaced and non-interlaced. Bits in the ATHENA
auxiliary registers are used to enable these modes. Otherwise, the programming for these modes is
similar to that for VGA modes
VGA mode
13h
can be enhanced to provide up to 16 pages at 320x200 resolution with 256 colors
13h
and
12h.
(standard VGA supports only one page). The CPU can access two pages simultaneously, and the others
are selected for access using page select bits in ATHENA’s auxiliary ports. The CRTC start address
register is used to select a page to display, or to scroll through all pages.
3-2Chapter 3: Operation Modes
MGA ATHENA Specification
Matrox Confidential
3.1.3 Display Adapter Support
Four modes of ATHENA VGA operation and emulation are available: VGA, EGA, CGA, and
MDA/Hercules.
The VGA and EGA CRTC’s are fully implemented and are used to perform the operations of a 6845
CRTC for the CGA and MDA/Hercules modes.
The control registers of the CGA and MDA/Hercules adapters are fully supported in the ATHENA
hardware. When a control register bit is changed, a trap interrupt (NMI) is generated. The interrupt
handler then interprets the control register’s contents and sets up the VGA CRTC to perform the required
operation. In addition, the chip can be configured to allow software emulation to override any or a
11 of
the hardware functions to permit support of special display modes.
3.1.4Differences Between ATHENA Ports and IBM VGA Display Adapter Ports
There are differences between ATHENA’s VGA mode and the IBM display adapters that it emulat
es.
Some ports are changed from write-only to read/write to simplify emulation. Other ports have been
deleted because they aren’t required. The list below describes the differences.
3.1.4.1
Hercules Mode Port Differences
The 6845 CRTC is replaced by the EGA or VGA CRTC. Hardware emulation of the 6845 requires
software assistance and is enabled through the trap and emulation control registers.
The mode control and configuration registers are now read/write.
3.1.4.2
CGA Mode Port Differences
The 6845 CRTC is replaced by the EGA or VGA CRTC. Hardware emulation of the 6845 requires
software assistance and is enabled through the trap and emulation control registers.
The mode control and color select ports are now read/write.
3.1.4.3
EGA Mode Port Differences
The CRTC registers are now read/write. Otherwise, the CRTC is identical to the IBM EGA CRTC when
the EGA CRTC mode is selected. The VGA CRTC can be selected when ATHENA is in EGA mode.
The attributes controller registers are now read/write. The address and data registers of the sequencer and
graphics controller are also read/write.
Graphics position registers A and B have been deleted and replaced by read-only ports for the feature
control and miscellaneous registers. Graphics position A is fixed at 0 and B is fixed at 1, according to
standard EGA programing practice.
3.1.4.4
VGA Mode
Port
Differences
In VGA mode, ATHENA is register compatible with the IBM VGA. The light pen set and clear ports
remain accessible. The EGA CRTC can be selected when ATHENA is in VGA mode.
Matrox Confidential
MGA ATHENA Specification
VGA Mode 3-3
3.2 Power Graphic Mode
Power Graphic mode employs hardware-coded graphical acceleration to improve the speed of GUI
(Graphical User Interface) environments.
3.2.1 Memory Configurations
Several hardware memory configurations are supported in Power Graphic mode. These configurations
can further be organized by the fbm (frame buffer mode) field of the OPMODE register. The three basic
configurations are:
1.
Support of up to 2 MB of VRAM and 2 MB of DRAM using
supports 8, 16, and 32 bit/pixel displays.
2.
Support of up to 4 MB of VRAM and 2 MB of DRAM using
configuration supports 8, 16, and 32 bit/pixel displays.
3.
Support of up to 6 MB of VRAM and 4 MB of DRAM. This configuration supports 24 or 32
01xX,
bit/pixel displays. Use fbm =
depending on the amount of available memory and whether the
frame buffer is configured as 24 or 32 bits.
l
:+ Note: In No DUBIC mode (see page 6-
fbm = 0, 1,2, and 3 may be used. Note that fbm =
17),
only Banks 0, 1,2, and 3 are supported. Therefore, only
8,9,
and 11 to 15 are undefined.
128Kx8
128Kx8
VRAM. This configuration
and
256Kx8
VRAM. This
In all cases, the resolution depends on the amount of available memory. Section 6.3, ‘VRAM Interface’
contains tables that show which fbms can be used with which hardware configurations. The following
figures show the memory mapping of the hardware memory configurations.
Memory Configuration Tables:
Intensity:
(1)
----------------.
OOOOOOh
1
OFFFFFh
----------------_
1
1FFFFFh
___-_-___-_-___-_
200000h
I
3FFFFFh
--------------_-_
Z-Depth: Memory Bank:
(1) (2)
.-.
___----__- _----- /
.-.
.-----__-___-__-
OOOOOOh
I
1FFFFFh
Figure 3-1:
f’bm
(3)
VRAM 1
DRAM 5
= 0
Intensity:
(1)
__-_-_-___________________________
OOOOOOh
1
OFFFFFh
______------______________________
IOOOOOh
11
1FFFFFh
_____________-___-________________
Z-Depth: Memory Bank:
(1) (2)
OOOOOOh
OFFFFFh
(3)
VRAM 0
VRAM 1
Figure 3-2: fbm = 1
3-4
Chapter 3: Operation Modes
MGA ATHENA Specification
Matrox Confidential
Intensity: Z-Depth: Memory Bank:
(1)
OOOOOOh
(1) (2)
(3)
VRAM
2
Intensity: Z-Depth: Memory Bank:
(1)
____-_----------
OOOOOOh
07FFFFh
----------------
OSOOOOh
(1) (2)
(3)
VRAM 3
VRAM 2
I
27FFFFh
----------------
200000h
__-_-____-__-_--
OOOOOOh
VRAM
3FFFFFh1FFFFFh
400000h
I
5FFFFFh
-_-____-_-____-__-________________
DRAM
Figure 3-3: fbm = 2
Intensity: Z-Depth:
(1)(1) (2)
Memory Bank:
(3)
----------------
400000h
3
______
j_______
SFFFFFh
600000h
--
5
~!%~mF
---------------700000h
b77FFFFI
----------------
OOOOOOh
I I
DRAM
I
1FFFFFh
_--------_---_-!OOOOOh
b27FFFFh
_---------------
VRAM 3
I
5
(4)
Figure 3-4: fbm = 3
Intensity: Z-Depth: Memory Bank:
(1)
OOOOOOh
1FFFFFh
-___---__----
200OOOh
(1) (2)
_____ --- _____
-_
VRAM2-4
(3)
(5)
400000h
+
SFFFFFh
___-___-_---____--_---------------
Figure 3-5: fbm = 4
Matrox Confidential
3FFFFFh
______---_---
4OOOOOh
57FFFFh
-___-_-_----580000h
1
SFFFFF
--_--___-_----
600000h
I
7FFFFFh
------__-___-_
MGA ATHENA Specification
__-----____---.
-_-------_---_
OOOOOOh
J
1FFFFFh
___-_--___-_-_
Figure 3-6:
Power Graphic Mode 3-5
VRAM 2 - 3
VRAM 4 - 3
VRAM 4 - 3
DRAM 7
DRAM 5
f’bm
= 5
(5)
(5)
(5)
Intensity: Z-Depth: Memory Bank:
(1) (2)
(3)
.____________--
Intensity: Z-Depth:
(1)
_-_--____-_---__
OOOOOOh
1FFFFFh
-----------L---200OOOh
(1) (2)
____-___-__-__
Memory Bank:
(3)
VRAM2-4
(5)
VRAM2-3
(5)
v
3FFFFFh
__-__-______-___.
40OOOOh
I
SFFFFFh
-________-------.
600000h
I
7FFFFFh
--_-_____-------.
Figure 3-7: fbm = 6
OOOOOOh
I
I
FFFFFh
_____--_--___--
VRAM2-3
(5)
DRAM 5
DRAM 8
LB?FFFFh--
400OOOh
I
SFFFFFh
_-__--____-_-___
600000h
I
7FFFFFh
__-____--_____-_
800ooo
_--- Gs7EFH
880000h
I
9FFFFFh
___--____-__----
VRAM 4 - 3
___--------_--
OOOOOOh
DRAM 5
I
1FFFFFh
_____-_____--__
200000
w!?27FEFl
DRAM 8
DRAM 8
Figure 3-8: fbm = 7
(5)
Notes: (Figures 3-l to 3-9):
All addresses are hexadecimal byte addresses. These addresses correspond to pixel addresses in
(1)
8 bits/pixel mode.
Depth addresses indicate which memory is used as depth buffer space when 3D drawing is
(2)
enabled.
‘Memory Bank’ indicates the type of memory used, as well as which bank of memory is used in
(3)
this space. Refer to Section 6.3 for details on the frame buffer modes.
This part of the frame buffer can’t be used for display.
(4)
3-6Chapter 3: Operation Modes
MGA ATHENA Specification
Matrox Confidential
Intensity: Z-Depth: Memory Bank:
(1)
----
~~~-~-~h
OFFFFFh
----------------
1OOOOOh
1FFFFFh
----------------------------------
2OOOOOh
I
3FFFFFh
----__--__-_________--------------.
400000h
(1) (2)
---- r----------------I,
---------------
OOOOOOh
J
I
OFFFFFh
I
(3)
VRAM 2
-------------------------
V.M
2
v..M
3
(4)
(4)
Notes (continued):
(5)
Depending on the number of chips/banks populated in this section, any data, or possibly only
24-bit data may be stored in this section of memory.
(6)
Depending on the number of chips/banks populated in this section, and if bank 7 is populated,
any data, or possibly only 24-bit data may be stored in this section of memory.
(7)
Also visible at
680OOOh -
Figure 3-9:
6FFFFFh.
f%m
DRAM
= 10
5
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode 3-7
3.2.2 Pixel Format
The pixel slice is 64 bits long and is organized as shown below. In all cases, the least significant bit is 0.
The Alpha part of the color refers to a section of the pixel which is not used to drive the RAMDAC. In
the following illustrations, ‘A’ refers to Buffer A and ‘B’ to Buffer B when a double buffer mode is
selected. ANTI refers to anti-aliased pixels, and MONO is a monochrome pixel slice.
In all cases the data is true color; however in 8 bits/pixel and 4 bits/pixel formats, pseudo color can be
used when shading and anti-aliasing are not used.
The figure on the next page shows how the data is organized for each pixel (for all supported pixel
depths).
3-8Chapter 3: Operation Modes
MGA ATHENA Specification
Matrox Confidential
31
2416
80
32
bp
16
bxv
Doub Buff
16 bpP
8
bp
31
3
7
--‘I
ALPHA
0
7
ALPHAREDGREENBLUE
24
B
A
0303030 303030 3
RED
0 7
1680
B
A
15
s
3
0
GREEN
07
3
REDGREENBLUE
4
A
10
0404
B
5
BLUE
0
A
0
0
0
4
bp
Figure 3-11: Pixel Data
When performing direct frame buffer access, 32-bit access depends on the format of the memory at this
location. Data is organized as follows for the various pixel sizes:
31
32
m
16
bpp
Doub Buff
16
bpp
8
bpp
Doub Buff
8
h-v
4bpp
Doub Buff
282420
POB POA POB POA PO3 POA POB POA
PI
PIB
P3
I
P3B P3A P2B P2A PI3 PIA
1612840
PO
PlA
P2
POB
PI
I
I
PO
POA
PO
I
POB POA
I
ANTI
//
\
‘\
MONOP31
P7 P6 PS P4 P3 P2 PI PO
PO
Figure 3-12: 32-bit Access
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode 3-9
In addition to the direct frame buffer access format, the following formats are supported for ILOAD and
IDUMP
operations in 1, 24, and 32-bit/pixel modes. These formats are selected by the RGB (hbgr) and
compress (hcprs) fields of the Drawing Control (DWGCTL) register:
First Word
Second Word
32
As direct frame buffer access
2431 16
ALPHA
RED1
GREEN2
24
16
23 815 0
BLUEGREENRED
BLUE0GREEN0
RED2
BLUE1
8
REDO
GREEN1
0
7
bltmod hbgr
BFCOL 0
BMONO 0
BMONO 1
BUCOL 1
BUCOL 1
hcprs
0
0
1
Second Word
First Word
Second Word
Third Word
BLUE3
ALPHA
BLUE1
GREEN3RED3
BLUEGREENRED
REDO
GREEN0
GREEN2BLUE2RED1
RED3
GREEN3BLUE3RED2
Figure 3-13: ILOAD/IDUMP Formats /
BLUE3
BLUE0
GREEN1
1,24,32
BUCOL 0
BUCOL 0
bpp
0
1
3-10
Chapter 3: Operation Modes
MGA ATHENA Specification
Matrox Confidential
3.2.3Overview of Drawing Operations
The following three groups of drawing operations are supported by ATHENA:
n
LINE: Used for vectors. These operations can be auto-initialized. In this case, the Brezenham
parameters are automatically computed by ATHENA. Brezenham parameters can also be provided
directly by the host processor.
n
TRAP: Used for rectangle fills (1 operand BITBLTs) and 3D tile drawing.
n
BITBLT: Used for copy and other operations (2 operand BITBLTs with or without expansion).
All of these drawing operations support several attributes in order to perform different type of actions.
The attributes include: line style, patterning, block mode, raster, antialiasing, Gouraud shading, depth
buffer, and others.
The following table summarizes how the drawing engine registers must be initialized for these basic
operations:
REGISTERS
opcode eventar0arl
AUTO INIT Xend
LINE END 2b err
LINEINIT 2b2b-a-Sdy
DRAW END 2b err
TRAPINIT
END
BITBLT INIT sea
END X
dY1
dY1err1-IdXl I
eol
ssasea
XX
ar2
Yend
2b-2a
2b-2a
2b-2a
-IdXl I
dr0 drl
dr4 dr5dr6dr7 (Red)
dr8 dr9
ar3 ar4ar5ard dr12 dr13 dr14
Xstar Ystar startZdMZdD
Xend Yend XX ZdMZdD
start
X
eor
-IdXrl dYr
em -IdXrl dYr
syinc
syinc
start
X X ZdXZdY
dr2
ZdMZdD
X ZdMZdD , ’ 0
zdx ZdY
dr3 (2)
drl0 drll(Gr.)
dr15
(Blue) length SGN
linessigns
linessigns
0
signs
asigns
signs
0
signs
0
signs
(1
dX
= Xend - Xstart
dY
= Yend - Ystart
a = max(
b = min(
ZdM
= Increment along major axis
ZdD
= Increment along diagonal axis
ZdX
= Increment along X axis
ZdY
= Increment along Y axis
IdxlJdyl)
Idxl,ldyl)
eor=dXr>=O?-dXr:dXr+dYr-1
eol =
dX1 >=
0 ? -
dX1: dX1
+
dYl -1
Where xl = left edge; xr = right edge
sea
= source and address
ssa
= source start address
= source current address
sea
Table 3-l: Initialization of Drawing Registers
Every time a drawing engine operation is started, the following steps must be taken:
1.
Since all drawing registers are accessed through the FIFO, check that there is enough room in the
FIFO.
2.
Initialize all the drawing registers, preferably starting with the ‘K’ flag registers (see Note (2)
,
^
following Table
3.
Start the drawing engine when you write the last register by offsetting the register by
4-5),
since some degree of parallelism can be achieved doing this.
100h.
Ma trox Confidential
MGA ATHENA Specification
Power Graphic Mode
3-11
3.2.4
DMA and Pseudo DMA
ATHENA supports two operating modes in which both the address and data are sent via the data bus:
DMA
Pseudo DMA
A DMA channel on the host system is used to sequence operations.
The host processor must sequence all access through the DMAWIN memory
space (see Chapter 4).
In both cases, the address of the modified register is generated internally by the ATHENA chip.
Additional operation modes are available for both DMA and Pseudo DMA:
DMA
DMA General Purpose Write
DMA Vector Write
DMA BLIT WriteDMA BLIT Write
DMA General Purpose Write
Pseudo DMA
DMA General Purpose Write
DMA Vector Write
DMA BLIT Read
The first double word (dw) transferred is loaded into the Address Generator. This dw contains the
addresses of the next four drawing registers to be written, and the next four dw transfers contain the data
to be written to those four registers.
When each dw of data is transferred, the Address Generator will send the appropriate 7-bit address to the
Bus FIFO. When the fourth (final) address has been used, the next double word transfer reloads the
Address Generator.
A direct access to a drawing register during a Pseudo DMA General Purpose write resets the Address
Generator state machine to the ‘LD ADR-GEN’ state. The following Pseudo DMA write transfer must
contain the addresses of the data for the next four drawing registers. The cycle is illustrated below.
Figure 3-15: DMA Gen. Purpose Transfer Buffer Structure
DMA Vector Write
The first double word transferred is loaded into the Address Generator. This dw contains one bit of
‘address select’ for each of the next 32 vector vertices to be sent to the drawing registers. These 32 bits
are called the vector tags. The next 32 double word transfers contain the XY address data to be written to
the drawing registers.
When the tag bit is set to zero (0), the address generator will force the address to that of the XYStart
register without setting the bit to start the drawing engine. When the tag bit is set to one
generator will force the address to that of the
XYEnd
register with the flag set to start the drawing engine.
(l),
the address
When each dw of data is transferred, the Address Generator checks the associated tag bit and sends the
appropriate 7-bit address to the Bus FIFO. When the
32nd
(final) tag has been used, the next double word
transfer reloads the Address Generator with the next 32 vector tags.
A direct access to a drawing register during a Pseudo DMA VECTOR resets the Address Generator state
machine to the ‘LD ADR-GEN’ state. The following Pseudo DMA write transfer must contain the vector
tags for the next XY coordinate data.
The cycle is illustrated below.
When Vn = 0, addn = XY-START address
(IOh)
When Vn = 1, addn = XY-END address + START DWG ENG (5 lh)
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode 3-13
0 LD ADR-GEN
r
1
FIFODATA
n FIFO DATA
132FIyDATA
;,
31
v3 1
”
I
I * I
Vn
I I I
0
vo
3813231
add0
YO
16
15
0
x0
Figure 3-16: DMA Vector Sequence
31
1
2
31
n
31
32
33 v31
I
n
YO
Yl
Y2
16
IS
Yn
Y30
Y31
I
I I *
x0
Xl
x2
0
Xn
x30
x31
vo
3-
34
35
Chapter 3: Operation Modes
14
Figure
YO
Yl
x0
Xl
x2
3-17:
DMA Vector Transfer Buffer Structure
MGA ATHENA Specification
Matrox Confidential
DMA BLIT Write
The DMA BLIT write is hard coded, so there’s no reason to load the Address Generator. The result is that
every transfer consists of data only.
When each dw of data is transferred, the Address Generator sends the srcregblit register address to the
Bus FIFO. The address generator state machine is not used for this type of DMA.
All pixels expected by the drawing engine must be transferred, otherwise it could jam. The total number
of dword transfers needed to complete the BLIT operation depends on, among other factors:
. The size of the window to be drawn (upper left comer coordinate, length in X and Y)
. The number of bits per pixel (8, 16, or 32)
The cycle is illustrated below. No address is required for data transfer during DMA blits, so ‘add’ is
‘don’t care’.
-+O
FIFO DATA
38
add
Figure 3-18: DMA BLIT Write Sequence
31
0
1
2
3
4
5
32 31
data
data0
data 1
data2
data3
data4
data5
0
0
6
7
Ma trox Confidential
data6
data7
Figure 3-19: DMA BLIT Write Transfer Buffer Structure
MGA ATHENA Specification
Power Graphic Mode 3-15
DMA BLIT Read
As specified earlier, the DMA BLIT Read mode is available for Pseudo DMA only, and is used to dump
pixels from a window of the screen to system memory. Each double word that’s transferred may contain
4, 2, or 1 pixel(s), depending on the configuration (8, 16, or 32 bits per pixel, respectively).
The coordinate of the upper left comer and the length in X and Y are a few of the parameters that are
required by the graphic engine for this operation.
A
Important Note:
It is extremely important that the number of dwords dumped accounts for all of the pixels that are to be
transferred. The last
dwordfor
each scan line of pixels may contain insignificant information in the case
of 8 or 16 bit/pixel modes if the number of transferred pixels is not evenly divisible by 4 (for 8 bpp
modes) or by 2 (for 16 bpp modes).
l Z.+ If the window to be drawn is not aligned at the beginning of a slice, the insignificant pixels to the
left of the window are effectively disregarded, and the slice alignment begins at the start of the
window.
The following illustration shows the case of an 8 bits/pixel mode transfer that is 42 pixels wide:
I
Slice 0
l-
I Slice 1 . . .
.
.
.
-
Slice 10
P40
P41 x x
P40 P4I
x x
~
These insignificant pixels must
still be sent as part of the slice.
3.2.4.1
+
DMA
The ATHENA chip’s DMA capabilities can only be used with the AT (ISA) interface.
ATHENA supports only DMA I/O write transfers. The goal is use the host’s DMA controller to transfer a
block from the system memory into ATHENA’s Bus FIFO (only the Bus FIFO is accessed during DMA
write). This provides a means to write to drawing registers for specific drawing operations.
Only
16-bit
DMA transfers are supported. The total number of transfers must be an integral number of
double words, to align with ATHENA’s internal 32-bit data bus. The words are accumulated before
sending double words to the Bus FIFO. The memory block to be transferred must be aligned on a double
word boundary.
3-16Chapter 3: Operation Modes
MGA ATHENA Specification
Matrox Confidential
Table 3-2: DMA Access
Types
To initiate a DMA transfer, take the following steps:
1.
Ensure that ‘dmaact’ and ‘pseudodma’ (OPMODE register bits 1 and 0) are not active (active if
2.
Program the dmamod bits (OPMODE register bits 2 and 3) to one of three modes listed below
‘
1’).
(keep dmaact and pseudodma at ‘0’):
D
DMA General Purpose Write
o
DMA BLIT Write
u
DMA Vector Write
The function of the dmamod bits is explained later on.
3.
Program the host DMA controller.
4.
Start the DMA transfer by setting dmaact to ‘ 1’ (keep pseudodma at ‘0’).
Once dmaact is set, ATHENA will request DMA service by asserting DRQ. The requests will continue
until the terminal count is reached. If the Bus FIFO becomes full during the DMA transfer, the request
will stop automatically and resume when there is space available in the Bus FIFO.
When the DMA transfer is in progress, any access to the following devices is forbidden:
vgaen = ‘0’ and pseudodma = ‘ 1’)
Access to other MGA resources is still possible, however.
Dmaact will be automatically reset after the last transfer, when the DMA terminal count (TC) is sampled
active.
DRQ is normally n-i-state. When dmaact is active, DRQ is driven to the appropriate state. This allows for
resource sharing in a system with multiple
MGAs.
Only one MGA can have dmaact active at any time.
When dmaact becomes inactive due to TC, ATHENA will have been driving DRQ low, then it will
tri-state the signal.
It’s possible to generate an interrupt when a DMA terminal count occurs. For more information, refer to
Section 3.2.6.
,-
1
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode 3-17
3.2.4.2
Pseudo DMA
The goal of Pseudo DMA is the same as that of DMA, with the only difference being that read transfers
are possible. Instead of using the DMA controller, Pseudo DMA transfers are ‘move string’ instructions
in the DMAWIN memory space (offset
OOOOh -
lBFFh, vgaen = ‘0’ and pseudodma = ‘1’).
Only double word accesses (read or write) are allowed in the DMAWIN memory space. When
performing Pseudo DMA transfers, all of the MGA map is available, except the VRAMWIN memory
space, which is disabled.
Write
lkansfers
To transfer a block of data from the system memory to the Bus FIFO of the ATHENA chip, the steps
listed below must be followed:
1.
Make sure that ‘dmaact’ and ‘pseudodma’ are not active.
2.
Program the dmamod bits to one of the three modes listed below (keep dmaact and pseudodma at
‘0’):
0
DMA General Purpose Write
0
DMA BLIT Write
o
DMA Vector Write
a) If DMA BLIT Write is used, program all affected drawing registers. Note that all writes to the
drawing registers must be double word accesses.
b) If DMA BLIT Write is used, send the ILOAD opcode to the drawing engine.
3.
Set ‘pseudodma’ to ‘ 1’ (keep dmaact at ‘0’).
4.
Transfer system memory data to the MGA DMAWIN memory space, with ‘move string’ or ‘read and
write’ instructions.
5.
Reset ‘pseudodma’ to ‘0’ at the end of the block transfer.
As long as the Bus FIFO isn’t full, and if the
nowait
bit of the OPMODE register is set to
‘I’,
then no
wait will be generated for write cycles to the DMAWIN memory space. When the Bus FIFO is full, there
is one more dword location, which is the Byte Accumulator of the host section. Once the Byte
Accumulator and the Bus FIFO are full, the next write to the DMAWIN space will be put in waiting as
long as the Byte Accumulator data isn’t loaded in the Bus FIFO.
If the CHRDY ready signal is kept inactive for more than 64 gclks, the STATUS register bferrsts bit will
be set. This will cause an interrupt if the proper interrupt enable is set. If CHRDY is still inactive after
128 gclks, the host section will abort the write cycle by reasserting CHRDY and by resetting the Byte
Accumulator full flag.
For DMA BLIT Write operations, the drawing engine will fetch data until all pixels have been loaded,
once the
ILOAD
opcode is sent, and if the Bus FIFO isn’t empty.
3-18
Chapter 3: Operation Modes
MGA ATHENA Specification
Matrox Confidential
Read
Pansfers
To dump screen data to the system memory, take these steps:
1.
Make sure that ‘dmaact’ and ‘pseudodma’ are not active.
2.
Program the dmamod bits to DMA BLIT Read (keep dmaact and pseudodma at ‘0’).
3.
Program all affected drawing registers. Note that all writes to the drawing registers must be double
word accesses.
4.
Set ‘pseudodma’ to ‘ 1’ (keep dmaact at ‘0’).
5.
Send the
6.
Transfer data from the DMAWIN memory space to the system memory, with ‘move string’ or ‘read
IDUMP
opcode to the drawing engine.
and write’ instructions.
7.
Reset ‘pseudodma’ to ‘0’ at the end of the dump.
Once the IDUMP opcode is sent to the drawing engine, it begins fetching pixels from the
VRAMs.
During a read in the DMAWIN memory space, CHRDY will be deactivated (ISA bus system), or a retry
will be generated
(PC1
system) if the data from the drawing engine isn’t ready. When the data is
available, it will be latched in the host section of ATHENA, and the access is completed. A new request
will be sent to the drawing engine for the next dword when the last byte, the last word, or the current
dword is being read, depending on whether ATHENA is 8, 16, or 32-bit. The latched dword will be
present until all bytes are read.
If the access takes more than 64 gclks, the bferrsts bit will be set in the STATUS register. This may cause
an interrupt if the proper interrupt enable is set. If an access takes more than 128 gclks, the host section
will abort the read cycle by reasserting CHRDY.
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode 3-19
3.2.5
Programming the CRTC for Power Graphic Mode
This section explains the video parameters required for the Power Graphic display modes.
3.2.5.1Registers
In Power Graphic mode (for all resolutions and pixel depths), the video parameters that are programmed
in the registers are always based on a video clock that is divided by 8.
+Note:
When you change any video parameters, it is important to halt the video operation circuitry of
the VRAM chips to prevent the
VRAMs
from entering an unrecoverable state. The ‘Screen Off’ bit
in the Clocking Mode sequencer register (Address lFC5, Index 01, Bit 5) will force the screen to
blank and halt the VRAM circuitry mentioned above. This bit must be maintained to ‘off’ for at
least 10
j.t.s
after the last video parameter modification.
The CRTC-CTRL register is used as specified. Table 3-3 shows the registers that are implicated in
programming the video for the Power Graphic modes.
3.2.5.2
Interlace Modes
In Power Graphic mode, the hardware can only be properly programmed in interlace modes at specific
memory pitches (768, 1024, and 1280). For other pitches, the hardware must be programmed in such a
way that the display area is less than the memory pitch.
It is not possible to have a horizontal resolution greater than 1280 pixels in interlace mode.
3.2.5.3
Hardware Panning
Panning is achieved by programming a start address that is equivalent to the desired region. The start
address is programmed in two VGA CRTC registers and one auxiliary register. Panning must be done on
a multiple of 16 pixels.
-
3.2.5.4 Hardware Zooming
Zooming by lx, 2x, and 4x is supported.
Zooming in the X direction is performed by the clock generator. For the CRTC, this is seen simply as a
division of the video clock. However, the CRTC registers that control the horizontal signals must be
reprogrammed properly (relative to the divided clock) to deliver the same frequency to the monitor.
It’s important to note that if you wish to maintain a constant image between each zoom switch, the
horizontal parameters must be exact multiples. For this reason, multiples of 32 must be used for each
parameter (front porch, sync, etc.), even if you zoom by lx.
To zoom in the Y direction, you must reprogram the Maximum Scan Line register in the CRTC. This will
affect the way that the CRTC address counter generates line addresses.
The dt request module must also operate in non-automatic line wrap mode (refer to Bit 2 of the
CRTC-CTRL Power Graphic mode register description on page 5-61) when not zooming by lx.
3-20Chapter 3: Operation Modes
MGA ATHENA Specification
Ma trox Confidential
3.2.5.5
Programming Constraints
In order to have a correct image on the screen, you must respect different constraints when calculating
the video parameters. The videodelay field of the CRTC-CTRL register can be programmed for
3,4,5,
11, 24, or 28 vidclks. The video parameters must be calculated so that at least one of the six possible
values of videodelay meets the three constraints. Unexpected video results could occur otherwise.
Section
CRTC
AUX
SEO
Index Name
00 Horizontal Total
Horizontal Display Enable End
01
Horizontal Blanking Start
02
Horizontal Blanking End
03
04
Horizontal Retrace Start
Horizontal Retrace End
05
06 Vertical Total
Overflow
07
Preset Row Scan
08
09
Maximum Scan Line
OA Cursor Start
OB Cursor End
OC
Start Address High
OD
Start Address Low
OE
Cursor Position High
OF
Cursor Position Low
Vertical Retrace Start
10
Vertical Retrace End
11
12
Vertical Display Enable End
Offset
13
14
Underline Location
15
Vertical Blanking Start
Vertical Blanking End
16
17
Mode Control
18
Line Compare
Mode Control Register
00
02
Emulation Control Register
OA
CRTC Extended Address Register
OD
Interlace Support Register
OE
Vertical Sync Adjust Register
Clocking Mode
01
Miscellaneous Output Register
07 06
D5 04 03 02 DI DO
S
S
S
S
S
0
S
S
S
S
0
0
0
0
S
S
X
X
S
S
S
S
0
S
S
S
1
xxx
0 x x x x x x x
s x x 1 x x s s
x s x x x x x x
s
s s s s s s
S
S
S
S
S
0
0
S
S
0
0
S
S
S
S
0
0
1
S
0
X
X
S
S
S
S
X
X
X
X
S
S
X
S
S
S
S
S
0
0
S
S
S
S
X
X
1
1
S
S
S
S
S
S
S
1
0
Z
1
X
X
S
S
X
X
S
S
S
S
X
S
S
0
1
111
1
0
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S
0
0
Z
Z
X
X
X
X
S
S
S
S
X
X
X
X
S
S
S
S
S
S
S
S
X
X
S
S
S
S
0
S
0
000
S
S
S
S
S
S
S
S
0
Z
X
X
S
S
X
X
S
S
S
S
X
S
S
X
1
xxs x x x x
s
s x 0 s s x
S
S
S
S
S
S
S
S
0
Z
X
X
S
S
X
X
S
S
S
S
X
S
S
X
1
s
x
se
Legend:
0
1
X
S
Z
Ma trox Confidential
The bit must always be programmed to 0
The bit must always be programmed to 1
The bit can be programmed to either 0 or 1
The bit works as specified
The bit is used by the zoom in the Y direction
Table 3-3: Power Graphic Mode Video Registers
MGA ATHENA Specification
Power Graphic Mode 3-21
The following formula explains how to calculate the three constraints. The drawing engine response
(in video clocks) is:
dw-eng-res
Constraint #l : Videodelay
Constraint
Constraint
3.2.5.6
#2:
Videodelay
#3:
Videodelay
Frame Buffer Alignment
int(925ns*videofrequency+0.9)
=
>= Horizontal
>=
dw-eng-res+
=<
Horizontal blank+
8
FrontPorch+2-3
l-l
5/s
I-dw-eng-res-3
When ‘No DUBIC’ mode is selected, the frame buffer display must be arranged in such a way that bank
switching appends during the blank (between two lines).
For example:
Assume that we want to display
1280x1024~8
using two
1MB
banks. The bank transition occurs
after 1M pixels:
1048576
pixels
/
pixels/line
1280 =
819.2
lines
Round this up to 8 19 lines, and up-front padding will have to be added in order to ensure that the
bank transition takes place between two lines:
-.
1048576
pixels
-
pixels/line
( 1280 *
819) =
lines
256
pixels
This means that the frame buffer will have to be started at address 256 (rather than at address 0).
This produces the following results:
. The CRTC start address must be 256, rather than 0.
n
The drawing operation must be moved by 256 pixels. This can be done automatically
by the drawing engine for the destination address by initializing YDSTORG to 256.
Note that this will affect the value loaded in CYBOT and CYTOP. For source addresses
this adjustment will have to be done manually.
n
Off-screen memory is reduced by 256 bytes.
3-22
Chapter 3: Operation Modes
MGA ATHENA Specification
-
Matrox Confidential
With
DUBIC
No
DUBIC
Frame
Buffer
Offscreen
OOOOOOh
Unused
OOOlOOh
Frame
Buffer
140OOOh
140100h
Offscreen
I
Figure 3-20: Memory Org.
3.2.5.7
Overscan
The hardware can support the
overscan
feature, but using it will reduce the length of the blank period.
200OOOh
(1280x1024~8 -
two 1M Banks)
This reduced blank will have a direct impact on your ability to meet the constraints of the video delay. It
might be possible to lose the zoom feature at low resolutions, or even the integrity of the display itself if
the
overscan
3.2.6
Interrupts
ATHENA supports interrupts for both ISA and
9
In the ISA configuration, ATHENA can generate two types of interrrupts: edge interrupts, and level
interrupts. The choice of interrupts is system-dependent, and is programmed by the
is large.
PC1
configurations.
CONFIG
register’s levelirq bit. In the Power Graphic modes, several interrupt sources exist:
Ma trox Confidential
MGA ATHENA Specification
Power Graphic Mode 3-23
InterruDt
I
Picking Interrupt
Vertical Sync Interrupt
Description
This interrupt is generated when a cycle is aborted.
It is useful during software
This interrupt is generated when a terminal count
occurred at the end of a DMA transfer.
This interrupt is generated when a pixel is written
by the drawing engine.
This interrupt is generated at every vertical sync.
Note:
The vertical sync interrupt behaves differently than
the others, because two other bits must be set for it
to be enabled. Bit 7 of the AUX-DATA register,
and Bit 5 of the Vertical Retrace End register
(lFB5/1FD5, Index 11) must be set before the
vertical sync interrupt can be enabled.
Note:
This interrupt must be cleared by accessing Bit 4 of
the Vertical Retrace End register
Index 11).
Table 3-4: Interrupt Sources
debming
(lFBYlFD5,
and testing.
. In the
PC1
configuration, ATHENA uses only one interrupt line (INTA), and is a single function
device. In order to integrate the DUBIC interrupts, the other external interrupts, and the current
TITAN interrupt, a new register has been added.
In the
PC1
configuration, the interrupts must be programmed as level interrupts (levelirq) in the
CONFIG
register.
Three registers are used for interrupt control:
STATUS
IEN
ICLEAR
This register indicates the status of each of the interrupt sources.
This register is used to individually enable each of the four interrupt sources.
n
This register is used to individually reset each of the four interrupt sources. Note that
there is no bit in this register to clear the vertical sync interrupt, which is cleared by
accessing Bit 4 of the Vertical Retrace End register
(lFBWFD5,
Index 11).
3.3 Access Restrictions to Some Resources
Consideration must be given to several resource access restrictions (which vary depending on how the
ATHENA chip is used in a system). Refer to the information on bus sizing in Sections 6.2.1.3 and 6.2.2.1.
3-24
Chapter 3: Operation Modes
MGA ATHENA Specification
Ma trox Confidential
3.4 Initialization and Configuration
3.4.1 Configuration Elements
Note: In the lists which follow, H indicates that a field is hard-reset. All others are soft-reset. When
MGA is powered up, ATHENA’s
DSTx
registers are loaded with the following configuration elements:
pcbrev<3:0>
product<3:0>
rambank<8:0>
vgabank0
ramspeed< 1
hyperpgc
1
:O>
:O>
expdev
tram
As well, ATHENA’s host interface section receives these configuration elements:
H
H
configc
H driverdy
1
:O>
H vgaen
H above 1 meg
H biosen (indirectly, H mapsel<2:0>
according to vgaen)
Poseidon
H isa
The following configuration elements are not programmed at power up:
The following configuration elements from the ATHENA host interface affect the VGA, and are not
programmed at power up. All the other elements are VGA-standard, and are taken care of by the BIOS.
H levelirqH vesafeatH hrsten
H vrsten
Ma trox Confidential
MGA ATHENA Specification lnitializa tion and Configuration
3-25
3.4.3
Booting in Power Graphic Mode
The following operations take place during the Power Graphic mode boot procedure:
1.
In a
PC1
system, the
2.
The card is detected
3.
Configuration straps/switches are read
4.
Depending on the configuration information and the selected hardware mode, the following
PC1
configuration space is initialized by the system boot prodecure.
non-initialized configuration elements must be programmed at power up with respect to:
0
ATHENA host interface
o
ATHENA drawing engine
Q
Video interface (DUBIC if present)
Q
RAMDAC
Q CLOCK GEN
0
VGA-CRTC
3.5 Mode Switching
3.5.1
Switching From VGA Mode to Power Graphic Mode
If the system has no DUBIC, disregard any step that mentions the DUBIC chip.
1.
Make a call to the BIOS to select VGA Mode 3.
2.
Disable VGA Mode.
-
Once the VGA has been disabled, reset the vgaen bits in ATHENA’s
3.
Disable interrupts from DUBIC.
+
Note: If you’ll be returning to Power Graphic mode later, make a note of the current value of
CONFIG
register.
DUBIC’s DUB-SEL register.
-
Set DUBIC’s DUB-SEL register to 40h.
4.
Stop the enhanced mode sequencer.
-
Set the softreset bit in ATHENA’s RESET register, then wait 1.5
5.
Set DUBIC to Power Graphic mode.
-
Reset the blankdel and vga-en bits in DUBIC’s DUB-CTL register.
6.
Restart the Power Graphic sequencer.
psec.
-
-
Reset the softreset bit in ATHENA’s RESET register, then wait 1.5
7.
Restore the value of the DUB-SEL register of the DUBIC.
8.
Restart Initialization of Power Graphic mode.
3-26Chapter 3: Operation Modes
MGA ATHENA Specification
psec.
Ma trox Confidential
3.52
Switching From Power Graphic Mode to VGA Mode
If the system has no DUBIC, disregard any step that mentions the DUBIC chip.
1.
Disable the interrupts from DUBIC.
Note : If you’ll be returning to Power Graphic mode later, make a note of the current value of
DUBIC’s DUB-SEL register.
-
Set DUBIC’s DUB-SEL register to 40h.
2.
Stop the Power Graphic sequencer.
-
Set the softreset bit in ATHENA’s RESET register, then wait 1.5
3.
Place DUBIC in VGA mode.
-
Set the srate bit in DUBIC’s DUB-CTL register. If the bus mouse is enabled, set SRATE = 18. If
psec.
the laser printer port is enabled, set SRATE = 2
-
Set the blankdel and
4.
Restart the Power Graphic mode sequencer.
-
Reset the softreset bit in ATHENA’s RESET register, then wait 1.5
vga-en
bits of DUBIC’s DUB-CTL register.
psec.
5.
Place the RAMDAC in VGA mode. Program the appropriate registers as shown below:
For the
BT485
RAMDAC:
Command register 0 = 0000 0000 b
Command register 1 = 0000 0000 b
Command register 2 = 0000 0000 b
Command register 3 = 0000 0000 b
For the BT482 RAMDAC:
Command register A = 0000 0000 b
Command register B = 0001 1110 b
Command register C = 0000 0000 b
6.
Program the Lookup Table (LUT) for VGA
7.
Activate VGA Mode
-
Set the vgaen and biosen bits of ATHENA’s
8.
Restore the value of DUBIC’s DUB-SEL register.
CONFIG
register.
9.
Make a call to the BIOS to select a VGA mode (for example: Mode 3 for text).
Ma trox Confidential
MGA ATHENA Specification
Mode Switching 3-27
3.6 Power up and Reset
It’s possible to reset ATHENA with a hard or soft reset. Both methods are explained in the following
subsections.
3.6.1 Hard Reset
A hard reset results when a low pulse is applied to the reset pin of the ATHENA chip. The minimum
pulse width required is 8
On a hard reset, the following resources are reset:
. VGA section
n
Drawing engine
’
Bus FIFO
. Host section
n
All registers
As well, external configurations are loaded into registers, as appropriate.
Three rules must be followed for proper chip reset:
l.ts.
-
1.
In the
PC1
configuration, no host access must occur within the first two
2.
LDCLK, GCLK, and PCLK must be active during reset.
3.
You must ensure that a PLL or clock oscillator oscillates within
specificiations
PCLKs
of a hard reset.
when the power-up
reset ends.
3.6.2 Soft Reset
A soft reset results when bit 0 of the RESET register is set to ‘ 1 ‘, then reset to ‘0’. On a soft reset,
external strapping is not loaded.
The soft reset also initializes the Bus FIFO and all of the drawing engine. The values of the drawing
registers are lost.
On the host section, some register bits are hard reset only. See Chapter 5 for more details. On the control
section of the host, only three state machines are affected by the soft reset:
n
IDUMP state machine
. DMA state machine
n
ADRGEN state machine
.-
3-28
Chapter 3: Operation Modes
MGA ATHENA Specification
Matrox Confidential
3.6.3 Configuring ATHENA in a Board-level Design
,
The ATHENA requires that configuration information be placed on the VDc63:0> bus during reset. The
configuration information defines the available resources as well as the mode in which ATHENA will
operate. More specifically, the following types of information are contained in the configuration bits:
Information used internally to control the operation of the ATHENA
8/16-bit,
etc.)
There are two types of configuration bits:
n
Soft configuration bits are read and used by software
n
Hard configuration bits are loaded directly into internal registers
Upon reset, the contents of
l
:+ Note that the destination registers must be read before any direct access to the frame buffer, or
VD<3
1 :0> are sent to
DST0<3
1
:O>;
VDc63:32> is sent to DST 1 c3 1
:O>.
drawing engine operation is performed, in order to obtain valid data.
Configuration bus VDc63:0>
A summary of the configuration bus follows, along with a table which defines each of the configuration
bits.
'i3
HHHHHlllHSSSSliillOlllllllHsssssssssss
56555
48,;'
40,139
32,131
s
H s
24,23
s
5
s s s s s 0 0 0 0 1 0 0 1 I 1 H I I 0 0
16,;s
II
8,7
0,
I
Figure 3-21: Configuration Bus
Legend:
0,l
Hard bits which must be set to the indicated value upon reset.
H
Hard bits which are loaded directly into internal registers upon reset.
i
Soft bits which software must read from the bus, invert, and then load into the appropriate internal
register.
I
Hard bits which are automatically inverted and then loaded into an internal register upon reset.
*
*
R Reserved bits:
S
Soft bits which software must read from the bus. These bits are not stored internally.
S
Soft bits which software must read from the bus and then load into the appropriate internal register.
Hard bits (H, I) which are loaded into other registers should be read from those destination registers, not
from
DSTO/DST
*
Since the bit is inverted, a pull-up will initialize it to 0, and a pull-down will initialize it to 1.
Matrox Confidential
1.
MGA ATHENA Specification
Power up and Reset
3-29
VD Bus
Bit
4:o
5
15:6
18:16
19
23:20
24
32:25
34:33
35
36
37
38
47139
48
49
50nodubic<O>
52:5
53
54
63:55
55
56
57above 1 meg
58
61:59mapsel
63:62
Definition
Internal
vgaen0
InternalHard
PCB Revision
block8/
Product ID
vgabank0Hard
rambank
ramspeed
rambank
HiResI
vgaen 1
testwren
Internal
200MHz
nodubic<l>
1
hyperpg
expdevSoft
tramSoft
Internal (Host):
isa
pci
driverdy
configHard
HaraYSoft
Configuration
Hard
Hard
Soft
Soft
Soft
Soft (s)Read from board
Soft
Soft
Soft
Hard
Hard
Hard
Soft
Soft (i)
Hard
Soft
Hard(H) Host (CONFIG<28>)
Hard
Hard
Hard
Hard(H) Host (CONFIG<26:24>)
6)
(H)
Where Used
(H)
Internally (See Figure 3-21 for values)
Host (CONFIG<10:9>), VGA
(H)
(H)
Internally (See Figure 3-21 for values)
Read from board
Host
(0
w
6)
(s)
6)
(H)
(1)
@-I)
(9
(1)
(S)
(9
(S)
(1)
(1)
(1)
(H)
(OPMODE<27>)
Read from board
Host (OPMODE<l
Read from board
Read from board
Read from board
Host
(CONFIG< 0:9>)
Host
(TEST<9>)
Internally (See Figure 3-21 for values)
Host (CONFIG<2>)
Host
Note: To ensure compatibility with future software, bits
enabled high (‘ I’) during reset.
3-30
Chapter 3: Operation Modes
MGA ATHENA Specification
VD<49:48>
and
VD<39>
should be
Ma trox Confidential
3.6.3.1
Special Considerations
for PCI
Since the coarse decoding is done by the
PC1
interface module, the host-module decoding section of
ATHENA is not used. This means that ATHENA will always be configured the same way:
3.6.4 Reset Field Definitions
The reset fields listed in the Table 3-5 are explained in detail below:
Internal
These bits are read from
VD<4:0>
on reset. These lines must present the value 19h during
reset.
vgaen<l:O>
Internal
DST<S>,CONFIGclO> VGA enable. Refer to the CONFIG register description in
Chapter 5 for more details.
VGAENO and VGAENl are used to enable/disable the VGA. Only one bit is used at a
time (the other one is tied to GND). The following table shows how the internal bits are
initialized at reset:
. When VGAENO is used, the
n
When VGAENl is used, the
should be used with the
may cause problems with the fixed decoding of the
VGAENI
00
0
1
This field is read from
VD<37,5>.
46E8
46E8
PC1
interface, since
VGAENO
1
0
feature is enabled when the VGA is turned on.
feature is not enabled with the VGA. VGAENl
PC1
incorporates auto-configuration which
46E8
feature.
en46E8CONFIG<10,9>
0
1
0
00
1
1
1
1
This field is read from VDc15:6> on reset. These lines must present the value 027h
during reset.
Ma trox ConfidentialMGA ATHENA Specification
Power up and Reset
3-31
PCB
Revision
DSTO<l8: 16>
Indicates the revision of the PCB. Refer to the
description in Chapter 5 for more details.
k
DSTl-0
register
block81
<19>
Product ID
These bits are read from
OPMODE<27>.
Indicates VRAM support for
VD<19: 16>
on reset.
&bit
block mode transfers.
Refer to the OPMODE register description in Chapter 5 for more details.
DST0<23:20>Indicates the Product ID/Platform. Refer to the
DSTl-0
register
description in Chapter 5 for more details.
1
Product ID
llxx
101x
100x
0110
0111
0101
Product
Reserved (do not use)
To be defined (future platforms)
Platform
ISA Bus
VL Bus
MCA Bus
PC1
Bus
-
vgabank0
These bits are read from
OPMODEcl l>
VGA Bank 0. Refer to the OPMODE register description in Chapter 5
for more details.
This bit is read from
VD<24>
VD<23:20>
on reset.
on reset, and stored here.
-
3-32Chapter 3: Operation Modes
MGA
ATHENA Specification
Matrox Confidential
rambank
<8:0>
DST1<0>, DST0<3 1:25>
Refer to the
DSTl-0
register description in Chapter 5 for more details.
DST1<3>
indicates the presence (when ‘1’) of Banks l-8.
ramspeed
<l:O>
Value
XXXXXXXXl
XXXXXXXlX
xxxxxxlxx
xxxxxlxxx
xxxxlxxxx
XXXlXXXXX
xxlxxxxxx
xlxxxxxxx
hxxxXXxx
These bits are read from
DST
1~2: l>
description in Chapter 5 for more details. These bits are read from
Bank Description
0
8xl28Kx8
1
8xl28Kx8
2
6or8x256Kx8VRAM
3
6or8x256Kx8VRAM
4
6~256Kx8VRAM
5
4 x 256K x
6
Reserved
7
2 x128K x 8 DRAM - Patch DRAM
f3
4x64Kor256Kx
VD<32:25>, VD<35>
VRAM
VRAM
16 DRAM - Reserved
16DRAM
on reset.
Indicates the speed of the on-board memory. Refer to the DST 1-O register
VD<34:33>
Note: All memory must be the same speed.
on reset.
HiRes/
testwren
Reserved
Internal
200MHz
DSTl<4>
1600 x 1200. Refer to the DST
This bit is read from
DST 1 c6>
Indicates that the board is capable of displaying at a resolution of
1-O
register description in Chapter 5 for more details.
Value
0
1
Meaning
Board
supports
Board does not support 1600 x 1200
VD<36>
1600 x 1200
on reset
Must be pulled up. See the TEST register description on page 5-50 for more
details. This bit is read from VDc38> on reset.
These bits, which are read from VDc39> on reset, should be pulled high during reset.
These lines are read from
VD<47:40>
on reset. They must present the data
DFh
during
reset.
This bit indicates the presence of a 200 MHz RAMDAC. Refer to the CONFIG register
description in Chapter 5 for more details.
Matrox Confidential
MGA ATHENA Specification
Power up and Reset
3-33
nodubic
<l:O>
CONFIG<5:4>.These bits indicate the configuration of the VRAM serial port. Refer to
the
CONFIG
register description for more details.
hYPerPg
expdev
tram
isa
OPMODE<25:24>Support for Hyper Page mode. Refer to the OPMODE register
description in Chapter 5 for more details.
These bits are read from
DST
1~20: 19>
CONFIG<
and load them here.
16>
Expansion device. Refer to the CONFIG register description in Chapter 5
VD<52:5 l>
during reset. Software must read these bits from
for more details.
Read from
VD<53>
during reset. Software must read this bit from
DST1<21>
and load it
here.
OPMODE<26>Type of VRAM. Refer to the OPMODE register description in Chapter
5 for more details.
Read from VDc54> during reset. Software must read this bit from
DST1<22>
and load it
here.
CONFIG<28>ISA bus identification. Refer to the
CONFIG
register description in
Chapter 5 for more details.
pci
abovelmeg
driverdy
mapsel
<2:0>
Sampled from VDc55> on reset, this bit assumes the external strapping configuration
value.
CONFIGc27>In conjunction with the
Refer to the
sampled from
CONFIG< 2>
CONFIG
VD<56>
register description in Chapter 5 for more details. The value
on reset is inverted and stored in this bit.
Mapped above 1 MB. Refer to the CONFIG register description in
Chapter 5 for more details. The value sampled from
isa
bit, determines the type of host interface.
VD<57>
on reset is inverted and
stored in this bit.
CONFIG<8>Drive channel ready. Refer to the
5 for more details. The value sampled from
CONFIG
VD<58>
register description in Chapter
on reset is inverted and stored here.
CONFIG<26:24>Select base address of MGA board in system. Refer to the CONFIG
register description in Chapter 5 for more details. The value is sampled from
VD<61:59>
on reset and loaded here.
config
CONFIG< :O>
Configuration bits. Refer to the CONFIG register description in Chapter
5 for more details. This value is sampled from
3-34Chapter 3: Operation Modes
VD<63:62>
MGA ATHENA Specification
-
on reset and loaded here.
Matrox Confidential
Chapter 4: Memory Mapping
T
his chapter summarizes the memory map for the ATHENA in both the
ISA and PC/ configurations, and provides an overview of the
mapping for the VGA i/O and mouse port registers.
I/O
space
4.1
ISA and PCI Configurations
The ATHENA chip supports two bus configurations:
PC1
(Peripheral Component Interconnect) and ISA
(Industry Standard Architecture, often called ‘AT-bus’). The major differences between these
configurations are that the ATHENA memory mapping is different for PCI, and the
PC1
configuration
includes space that is reserved for system configuration (the ISA configuration has no ‘configuration
space’).
-
4.1
The configuration space is supported only for
Configuration Space Mapping
.I
PC1
devices. When modes other than
PC1
are selected, this
space (and its registers) are invisible and unused. The entire configuration space is decoded by ATHENA.
All extensions to Power Graphic mode are mapped in the memory space, as well as in the VGA frame
buffer and in the VGA BIOS.
Address
OAOOOOh-OBFFFFh
OCOOOOh-OC7FFFh
OACOOOh-OAFFFFh
OC8000h-OCBFFFh
OCCOOOh-OCFFFFh
ODOOOOh-OD3FFFh
OD40OOh-OD7FFFh
OD8000h-ODBFFFh
ODCOOOh-ODFFFFh
Table 4-2: ATHENA ISA Interface Memory Mapping
Device DecodedCondition (1)
VGA frame buffer
VGA BIOS ROM
MGA Power
Graphic
,t
,,
,,
,,
,,
,,
If vgaen is active.
If biosen is active.
Mode
If
disabled
If MAPSEL2 is selected.
If MAPSEL3 is selected.
If
If
If
If
MAPSELl
MAPSEL4
MAPSELS
MAPSEL6
MAPSEL7
is selected
or
VMAPSEL = 1 (2)
is selected.
is selected.
is selected.
is selected.
and
the VGA is
(1) Refer to the CONFIG register description in Chapter 5 for information on the control bits
used to select the map options.
(2) VMAPSEL is located at I/O address
Refer to Table 4-4 for the Power Graphic Mode memory mapping for both the ISA and
4-2Chapter 4: Memory Mapping
MGA ATHENA Specification
3CF,
Index 6, Bit 3.
either
PC1
interfaces.
Matrox Confidential
-
4.2.2 PCI Interface
The memory mapping for
Address Offset Range
OOOAOOOOh-OOOBFFFFh
nnnnOOOOh-nnnn7FFFh
or
nnnn8OOOh-nnnnFFFFh
mmmmOO00h-mmmm3FFFh
mmmm4000h-mrnmm7FFFh
or
mmmm8000h-mmmmBFFFh
or
mmmmCOO0h-mmmmHTFh
Table 4-3: ATHENA
(1) The exact location in the memory space depends on the ROMBASE register. Because
ATHENA is decoded as a VGA device, the ROM should be mapped at
system BIOS as specified in the PCI Bus Specification.
(2) The exact location in the memory space depends on the
offset range that is not identified in Table 4-5 should be
considered as reserved.
(1)
The address offsets provided are relative to the MGA Power Graphic mode base memory address, as
shown in Table 4-2.
(2)
The Category refers to the special characteristics of each register. The following categories are defined:
D
F
K
V
(3)
When a register is accessed in this range, this indicates to the drawing engine to start a drawing cycle.
(4)
A read from port
write to this register after a
This register is a drawing engine dynamic register. This means that the contents of the
register may be modified by a drawing cycle. You must wait until the drawing engine is
idle before you can read dynamic registers.
The data for this register is passed through the Command FIFO. The Command FIFO
contents are sent to the drawing engine only when it is ready to use them. This is the
method used to synchronize the software with the drawing engine (no access to drawing
engine registers should be attempted when the FIFO is full). This means that it is
guaranteed that a register will be written only when the FIFO is empty. A register should
only be read when the FIFO is empty, in order to be sure that the contents of that register
are stable.
These registers can be initialized when the memory sequencer is not idle. It is then
preferable to initialize them first (when required) in order to achieve higher performance.
These BYTE registers are in the VGA module. They are accessed in the same way as the
VGA I/O port, except that they are memory mapped.
lFBA/lFDAh
resets this port to the Attributes Address register. The first read or
lFBA/lFDAh
reset accesses the attributes index, and the next read or
write accesses the palette. Subsequent reads or writes to this register toggle between index and palette.
(5)
DO=0
of the MISC-OUT register sets the CRTC registers to
DO=1
of the MISC-OUT register sets the CRTC registers to
(Notes continue on the next page)
4-6Chapter 4: Memory Mapping
1FBXh
1FDXh
MGA ATHENA Specification
and the input status 1 to
1FBA.
and the input status 1 to 1
Matrox Confidential
FDAh.
(6)
See the VGA SUBSYS register description for more information.
(7)
Reset
Values. The following table lists register reset values that were too wide for the previous table:
I
Byte
-
I
O$Kset
(1)
lC90
lE44
lE50
lE54OPMODE
Name
YDST
TEST
CONFIG
I
~~~~~X~OXXXXXXXXXXX~XXXX~XXXXXXX~
0000
OOOH
0000
0000
HHHH
0000
0000
0000
0000 0000
0000
0000
Legend
X = Undefined
H = Sampled on hard reset
(8) Alternate addresses of lFB4h/lFD4h.
(9) Alternate addresses of lFBS/lFDSh.
Reset Value
0000 OOHO 0000 0000 b
OOOH
0000
OHHH
HO00
0000
0000
OOHH
0000
b
b
(10) This register only exists in the
PC1
configuration.
Ma trox Confidential
MGA ATHENA Specification
Memory Space Mapping 4-7
4.3
l/O
Mapping
Two different devices are mapped in the I/O space: the VGA I/O registers, and the mouse port. The I/O
mapping remains the same for the ISA and
Port Name
238h
Mouse data register (6)R
23Ah Mouse control register (6)
23Bh
Mouse configuration register (no write effect) (6)W
23Ch
Mouse data register (6)R
23Eh Mouse control register (6)
23Fh
Mouse configuration register (no write effect) (6)W
3BOh
(3)
3Blh
(4)
3B2h
(3)
3B3h
(4)
3B4h
CRTC-ADDR
3B5h CRTC-DATA
3B6h
(3)
3B7h
(4)
3B8h
HER-MODE
3B9h
HER-LP-SET
3BAh
MISC-ISTATl
FEAT-CTL
3BBh
HER-LP-CLR
3BFh
HER-CONF
3COh
ATTR_ADDR (1)
3C 1 h
Am-DATA
3C2h
MISCJSTATO
MISC-OUT
3C3h
MISCJSTATOR
MISC-OUT
3C4h
SEQ-ADDR
3C5h SEQ-DATA
3C6h
Pixel Mask Register (7)
3C7h
Pixel Read Address Register (7)W
DAC-STATUS
1C8h
K9h
3CAh FEAT-CTL
3CDh
Palette Write Address Register (7)
16/8-bit
Color Palette Data (7)
3CB h
ReservedW4
3CCh MISC-OUT
Reserved
3CEh
GCTL-
3CFh
GCTL-
ADDR
DATA
(2)
(2)
(2)
PC1
configurations.
(continued on the next page)
Decoded as:
Access Hercules CGA EGA VGA
4
4
4
4
4
44
4
II
d
4
R4
W44
II
4
R
R44
W
W
R
R
444
R
W
II
444
4
4
4
II
4
d
4
44
44
44
44
4
4
44
4
44
4
44
4
II
1,
4
4
4
4
4
4
II
Chapter 4: Memory Mapping
4-8
MGA ATHENA SpecificationMatrox Confidential
Decoded as:
Port Name
3DOh(3)
3Dlh
3D2h
3D3h
3D4h
3D5h
3D6h
3D7h
3D8h
3D9h CGA-COL-SL
3DAh
3DBh
3DCh
3DDh Reserved
3DEh
3DFh
S6E8h
(4)
(3)
(4)
CRTC-ADDR
CRTC-DATA
(3)
(4)
CGA-MODE
MISCJSTATl
FEATJI’L
CGA-LP-CLR
CGA-LP-SET
AUX-ADDR
AUX-DATA
3B0
to
EXPSL/
3DF
Video Subsystem Access/Setup
102h
Video Subsystem Enable (5)
(8)
(2)
(2)
(2)
Enable
(5)
Access Hercules CGA EGA VGA
44
4
d4
44
44
44
44
44
4
d
R44
W
4
44
4444
4
444
W444
W4
d
II
II
d
d
4
44
4
4
4
d
4
4
-\I
II
4
(1)
A read from Port
to this register after a
3BA/3DAh
3BA/3DAh
Table 4-6:
resets this port to the attributes address register. The first read/write
reset accesses the attributes index, and the next read/write
I/O
Mapping
accesses the palette. Subsequent reads or writes to this register toggle between index and palette.
(2)DO=0
(3)
(4)
(5)
of the miscellaneous output register sets: CRTC registers to 3BXh; input status 1 to 3BA.
DO=1
of the miscellaneous output register sets: CRTC registers to 3DXh; input status 1 to 3DA.
Alternate addresses of
Alternate addresses of
In the
PC1
configuration, these locations are only decoded for write operations. Snooping is
3B4/3D4h.
3B5/3D5h.
always enabled. In the ISA configuration, these locations are decoded only when the ‘VGAENO’
bit is sampled active on reset, otherwise, they are not decoded.
(6)
For more details refer to the OPMODE register description for bits 8 and 9 contained in
Chapter 5. Refer to the MGA
(7)
In the
PC1
configuration, snooping is enabled on these locations if ‘vgasnoop’ is active.
DUBZC
Specification for more information about these registers.
Otherwise, normal access is performed.
(8)
In the
PC1
configuration, external expansion space is never enabled during an I/O cycle.
+..a
Note that the
3BO-3BB,
3BF-3C5, and 3CA-3DF ranges are always decoded when VGA is
enabled, even when there is no register located at a specific address. The 3BC-3BE range is never
decoded.
Matrox Confidential
MGA ATHENA Specification
I/O Mapping 4-9
-
Chapter 5: Register Descriptions
T
his chapter contains a description of each of the Power Graphic and
VGA mode registers of the ATHENA chip, listed in address order for each
mode.
Note that Tables 4-5 and 4-6 list all of the registers in address order. In
addition, lists of all registers (and the Power Graphic mode register fields)
are presented in alphabetical order at the back of this manual.
Power Graphic Mode register descriptions contain a (double-underlined) header which indicates the
register’s mnemonic abbreviation and its full name. Below the header, the memory address
example), attributes, and reset value for the register are provided. Next, an illustration of the register
identifies the locations of all the bits, which are then described in detail below the illustration.
-
<address>
Reserved field3
FIELD1 . Detailed description of the
22 to 0.
FIELD2. Detailed description of the
FIELD3. Detailed description of the cfield3> field, which comprises bits
26 to 24.
Reserved: Writing has no effect.
Attributes
%
g
Sample Power Graphic Mode Register Description
W-F
Reset Value
<value>
field1
cfieldl>
<field2>
field, which comprises bits
field, which is bit 23.
(lCO0
for
Memory Address
The addresses of all the Power Graphic mode registers are provided in Chapter 4.
Attributes
The Power Graphic mode attributes are:
R: Read Only
W: Write Only
R/W: Read and Write
D: Dynamic. The contents of the register may be modified by a drawing cycle. Before such registers
can be read, the drawing engine must be idle.
F: FIFO. Data for this type of register is passed through the Command FIFO. The contents of the
Command FIFO are used by the drawing engine only when the drawing engine is ready to access
them. This is the method used to synchronize the software with the drawing engine (no access to the
drawing engine registers should be attempted when the FIFO is full). This also means that a
register is guaranteed to be written only when the FIFO is empty. The drawing engine registers
should only be read when the FIFO is empty to make sure that the contents of the register are stable.
K: These registers can be initialized when the memory sequencer isn’t idle, so it’s preferable to
initialize them first (when required) to achieve higher performance.
-
5-2Chapter 5: Register Descriptions
MGA ATHENA SpecificationMa trox Confidential
Reset Value
The reset values for the Power Graphic mode registers can be expressed as hexadecimal or binary values.
Most bits are reset on both soft and hard reset. Some bits are reset on hard reset only (those bits are
underlined when they appear in the register description header next to
A detailed description of the function of data bit 0.
A detailed description of the function of data bit 1.
A detailed description of the function of the data field which contains bits 2 and 3, etc.
ATHENA VGA Mode register descriptions contain a (single-underlined) header which indicates the
register’s name and type (such as CRT Controller or Sequencer, etc.). Below the header, the memory
address (1 COO for example), I/O address, and the offset index for the register are indicated. Next, an
illustration of the register identifies the locations of all the bits, which are then described in detail below
the illustration.
Memory Address
This address is an offset from the Power Graphic mode base memory address. The memory addresses can
be read, write, color, or monochrome, as indicated. Note that some of the VGA mode registers have no
memory address and some have no index.
I/O Address
These addresses are I/O ports. The I/O addresses can be read, write, color, or monochrome, as indicated.
Index
This is the indexed address of the specific register.
WAIT CYCLE: Specifies that ATHENA will perform continuous address/data stepping.
This bit is always read as 1.
Reserved: This field is always read as 0.
vgasnoop
<5>
Reserved
<4:2>
memspace
R/w
cl>
iospace
R/wco>
VGA
SNOOPing.
Controls how ATHENA will handle access to the
PC1
system palette
register (as described in Section 3.10 of the PCI Local Bus Specification, Revision 2.0).
. 0: Respond to a palette access.
n
1: Enable special snooping behavior.
Reserved: This field is always read as 0.
Device response to
MEMory
SPACE access. This bit controls all memory spaces
(EPROM, VGA frame buffer, and Power Graphic mode memory space).
n
0: Disable the device response
n
1: Enable the device response
Device response to I/O SPACE access. This bit controls all I/O space (VGA I/O, and
Mouse port).
n
0: Disable the device response
n
1: Enable the device response
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode Register Descriptions
5-5
CLASS
Configuration
Space Address 08
Class Code
Attributes R
Reset Value
class<31:9>
revision
<8:0>
0000 0011
SO00
0000 0000 0000 0000 OOOOb
class
revision
II
31
30 29 28 27 26 25 24 23 222120
Device CLASS. Identifies the generic function of the device and a specific register-level
programming interface according to the
field according to the value of the
vgaen
0
1
Value
038OOOh
030OOOh
REVISION. Contains the current board revision. This value is always read as 0.
19 18 17 16 15 14131211109
PC1
specification. Two values can be read in this
CONFIG
Meaning
Other display controller
Super VGA-compatible controller
register’s vgaen field in the host interface:
87
6
5
4
3
2
1
0
HEADER
Configuration
Space Address OCAttributes R
Reset Value
0000 0000 0000 0000 0000 0000 0000 OOOOb
Reservedheader
Reserved
<31:24>
header
~23: 16>
Reserved
CEO>
7
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved: This field is always read as
HEADER layout. Specifies the layout of bytes
space. Also specifies that the current device is a single function device. This field is
always read as
Reserved: This field is always read as
OOh.
I
OOh.
OOOOh.
Reserved
I
1514
13 12111098765432
10h
through 3Fh in the configuration
Header
1
0
-
5-6Chapter 5: Register Descriptions
MGA ATHENA Specification
Ma&ox Confidential
Terminator Base Address
Configuration
Space Address 10Attributes
TERMBASE
R/w
Reset Value
0000 0000 0000 0000 0000 0000 0000 OOOOb
termbaseReserved
II
31
30 29
28 27 26 252423 222120
termbase
<31: 14>
TERMinator
(Power Graphic) BASE Address. Specifies the base address of the Power
Graphic mode memory space. Mapping in this
itself. Refer to Chapter 4 for more information.
EPROM BASE address. Specifies the base address of the EPROM. This field’s attribute
changes, depending on the value of the
Reserved: This field is always read as
ROM
the
CONFIG
ENable.
Enable the ROM. This field’s attribute changes, depending on the value of
register’s biosen field:
biosen ROMEN Attribute
RO. Read as 0
0
1
Rnv
CONFIG
OOOOh.
register’s biosen field:
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode Register Descriptions
5-7
INTCTRL
Configuration
Space Address 3C
Reset Value000000000000000000000001 1111 llllb
Attributes
Interrupt Control
W
Reserved
<31:16>
intpin R
<15:8>
intline
<7:0>
FUW
Reserved
intpinintline
1-7
31
30 29 28 27
26 25 24
Reserved: This field is always read as
Selected
INTerrupt PINS.
interrupt pin.
INTerrupt
LINE routing. This R/W field is used to communicate interrupt line routing
information. It is initialized at power-up to identify for the device drivers which device
interrrupt pin has been connected to which system interrupt controller pin. The value
is defined as ‘unknown’ or ‘no connection’ to the interrupt controller.
23 222120
191817
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OOOOh.
This field is always read as lh, since INTA is used as the
Operation
and also affects the operation of the VRAM interface section.
lCO0
CODe:
Function
Line
Trapeziod
Bitblit
Attributes
W-F
Reset
Value
0000 0000 h
E
%+j
Reserved
g % atype
opcod
The opcod field defines the operation selected by the drawing engine,
opcod
Subfinction
AUTO
WRITE LAST
AUTO, WRITE LAST
VRAM -> VRAM
HOST -> VRAM
VRAM -> HOST
Value
0000
0001
0010
0011
0100 TRAP
1000
1001
1010
Mnemonic
LINE-OPEN
AUTOLINE-OPEN
LINE-CLOSE
AUTOLINE
BITBLT
ILOAD
IDUMP
CLOSE
_
All other opcodes are reserved and should not be used.
atYPe
<5:4>
5-10Chapter 5: Register Descriptions
Access TYPE: The
performed.
I++
Value Mnemonic VRAM Access
atype
field is used to define the type of access to the VRAM that is
MGA ATHENA Specification
-..
Ma trox Confidential
Drawing control register (continued)
DWGCTL
blockm
<6>
linear
<7>
hop
49: 16>
BLOCK Mode: Specifies whether or not the destination will be written in block
mode.
n
0 Normal write access
. 1 Block mode write selected
LINEAR mode: Specifies if the BITBLIT source is linear or XY.
. 0 XY bitblit
n 1 Linear bitblit
Boolean Operation between a source and a destination. The table below shows the
various functions performed by the Booleen ALU in 1, 8, 16, and 32 bits/pixel modes.
During block mode operations, bop must be set to 1100 (Ch).
hop
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
, 1111
Function
0
-(D I S)
D&-S
-S
(-D)
&S
-D
DAS
-(D & S)
D&S
-(D A S)
D
D I -S
S
(-D) I S
DIS
1
trans
<23:20>
TRANSlucidity:
by writing one over ‘n’ pixels. The trans field specifies the following transparency
patterns (where 1 is opaque and 0 is transparent):
Matrox Confidential
Specifies the percentage of opacity of the object. The opacity is realized
MGA ATHENA Specification
Power Graphic Mode Register Descriptions
5-11
DWGCTL (continued)
Drawing control register
alphadit
<24>
ALPHA
DIThering
0 0 0 0
11111111
1111
r--l
1111
0011
10 10
0000
10 10
0000
El
0111
10000000
0010
0000
El
10 11
00001000
0 0 0 0
0010
Lx
and shading enabled : Specifies whether the RED shader is used to
0001
10 100 10 1
10 10
0 10 1
0
0100
pq
0000
0 10 1
0000
Ll
1000
0 0 0 0
0100
0 0 0 0
0001
q
1100
01000000
0001
0000
:a
0010
0 10 110 10
0101
1010
1
0 10 1
0000
10 10
0000
rl
I1 0 101
1001
00010000
0100
0000
El
1101
00000001
0 0 0 0
0100
~
generate the Alpha channel in 32 bits/pixel mode.
9
0:
forcolc3 1:24>
is used
1 1 1 1
0 0 0 0
0 0 0 0
0000
0000
0110
0 0 0 00 10 1
0000
0 10 1
0
10 10
0 0 0 0
0 0 10
l----l
0000
1000
/
1110
0010
0000
1000
0000
bltmod
<26:25>
zdrwen
<25>
. 1:
DRk28: 15
BLiT MODe
is used
selection: This field must be valid for BLITs without anti-aliasing:
b&mod
Value Mnemonic Usage
00
01
10
BMONOSource operand is monochrome in 1 bits/pixel .
BPLANSource operand is monochrome from one plane.
BFCOLSource operand is color. Source is formatted when it
comes from the host. Fast clipping can be used
11
during VRAM to VRAM
BUCOLSource operand is color. Source is in 32 bits/pixel
BLITs.
when it comes from the host. Fast clipping can’t be
used during VRAM to VRAM BLITs.
This field must contain the value BFCOL in order to handle the line style properly for line
drawing using line style.
Z
DRaW
comparision
ENabled:
This field is shared with another field (see bltmod,
above). It must be valid for drawing using depth. This bit specifies whether or not Z
comparision is used.
n
0 Don’t use depth comparision
-
n
1 Use depth comparision
5-12Chapter 5: Register Descriptions
MGA ATHENA Specification
Matrox Confidential
Drawing control register (continued)
DWGCTL
zlte
<26>
afor
<27>
hbgr
<27>
Z written when Less Than or Equal: This field is shared with another field. It must be
valid for drawing using depth. This bit specifies whether Z is written when it is equal.
. 0 Pixel is updated if depth is
<
. 1 Pixel is updated if depth is 5
Anti-aliasing
FOReground
color selected: This field is shared with the hgbr field. It must
be valid when anti-aliasing is selected. This bit performs the first color selection for the
anti-aliasing.
n
0
DR5<22: 15>, DR9<22: 15>,
n 1
FORCOLc23:0>
is used
and DR
13~22: 1%
are used
Host data in BGR format: This field is shared with the afor field.
For ILOAD when bltmod = BUCOL
n 0 Source data is in
BGR format
. 1 Source data is in RGB format
abac
<28>
For ILOAD when bltmod = BMONO
n
0 Source data is in
endian
format
. 1 Source data is in Windows format
Anti-aliasing
BACkground
color selected: This field is shared with the hcprs field. It
must be valid when anti-aliasing is selected. This bit performs the second color selection
for the anti-aliasing.
n
0 Current pixel is selected
n 1
BACKCOL<23:0>
is selected
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode Register Descriptions
5-13
DWGCTL
hcprs
<28>
Host data is
color
BLITs
ComPReSsed:
This field is shared with the
when the source data comes from the host and the data is in 24-bit true color
format.
. 0 Source data is 32 bit/pixel
n
1 Source data is 24 bit/pixel
Drawing control register (continued)
abac
field. It must be valid for
-
pattern
<29>
transc
<30>
Reserved
<31,24,15:8>
PA’ITERNing
enable: This bit specifies whether patterning is enabled when performing
BLIT operations.
n
0 Patterning is disabled
. 1 Patterning is enabled
This bit also specifies whether the two banks are to be cleared in parallel when block
mode is enabled when
fbm
=
01Xx.
Note that when the two banks are cleared in parallel,
the fringes aren’t processed correctly, and so must be processed separately.
n 0 One bank only
. 1 Two banks in parallel
TRANSparency Color enabled: This field must be valid for
BLITs
with color expansion.
This bit specifies whether the background color is written.
. 0 Background color is opaque
Pixel WIDTH: Specifies the pixel width for drawing.
<l:O>
fhC
Frame Buffer Configuration: Specifies if the double buffer is used when drawing.
<3:2>
Attributes W- F
Reserved
19 181716
pwidth
Value
Mnemonic Mode
00
01
10
11
PW8
PW16
PW32
-
m
Value Mnemonic Mode
8 bits/pixel
16 bits/pixel
32 bits/pixel
Reserved
Reset
151413121110987654
Vale
0000 0000 h
fbc pwidth
Ill---l
32
1
0
Reserved
<31:4>
00
01
10
11
SBUFFull pixel width
-
DBUFA Buffer A
DBUFB Buffer B
Reserved
When the system is in double-buffer mode, and pwidth specifies 8 bits/pixel (4 bits per
buffer) or 32 bits/pixel (16 bits per buffer), the plane write mask must be used in order to
prevent modification of the pixels in the other corresponding buffer. When pwidth
specifies 16 bits/pixel, only the targeted buffer will be modified. In this case, the plane
write mask must not be used with ZI drawing when fbm = 10.
Reserved: Writing has no effect.
Ma&ox
Confidential
MGA ATHENA Specification
Power Graphic Mode Register Descriptions
5-15
MCTLWTST
Memory control wait state
Memory Address
I
31
mctlwtst
<31:0>
Memory
memory sequencer. For each part of the memory cycle, a different 2-bit subfield is used.
The contents of this register depend on of the type and speed of the RAM, and on the
board configuration. Each subfield is defined as follows:
Description
DEFAULTDFLT
RAS SETUP
RAS HOLD
CAS SETUP
HOST DELAYHOST-D
CAS HOLD
READ CAS HOLD
HYPER READ CAS HOLD
Z READ CAS HOLDZRC-HD
RAS PRECHARGE
ZI RAS HOLD
HYPER READ RAS PRECHARGEHRR-PR
Z RAD HOLD
SWITCH BUS
WAIT
LAST PIXELLP
1 CO8
30 29 28
27 26 25
ConTroL WaiT STate
mctlwtst<x+ 1
001 gclk
01
10
11
Attributes
24 23 222120
L
:x>
2 gclks
3 gclks
4 gclks
W-
F
Reset Value
FWFFFFF
h
mctlwtst
19 18 17 1615
1
register: Specifies the number of wait states added to the
is the default value to use, except for BUCOL ILOADs. In the latter case,
C4001010h
lCl0
VRAMs):
(one more gclk for BUCOL ILOAD access)
C4OOlllOh
prior to the BUCOL ILOAD execution. It’s put
when the BUCOL ILOAD execution has finished.
Attributes
R- D
DSTl-0
dsti0
<31 :o>
dstil
<63:32>
Reset Value
63
DeSTination
Loaded from vdc63:0>
dstil
In register: The
32 31
dsti0
dsti0
and dstil fields are used to load configuration data on
reset. The destination registers are normally used by the drawing engine. They are
readable, however, since their values are initialized from the data bus on reset (breset).
Note that the registers must be read before any direct access to the frame buffer or
drawing engine operation is performed in order to obtain valid data.
For more information on the definition of each bit on power up, refer to Section 3.6,
This field is used by the Depth Mask ALU as the source operand.
Z
MaSK:
ENable:
Attributes W-F
Reserved
Reset Value XXXX XXXX h
5%
Ei i;i
II
plnzmsk
Il-----lII
zcol
These bits are used to select the plane on the ZTAG RAM.
When 0, ZTAG RAM writes are inhibited; when 1, ZTAG RAM writes are
enabled (refer to Section 6.3.3 for more information).
Z
COLor
select in
BLOCK
mode: This bit is used to load the ZTAG with 0 or 1 when in
block mode.
Reserved: Writing has no effect.
Notes:
Since the ZTAG is used as a tag for the depth buffer, the following values are typically
used:
Operation
Z drawing
Z clear (all)
Z clear (partial)
Normal drawing;
zcolblkzcolplnzmsk
X
1
1
X00000000
0000
11111111
pixslapixslb
1111
where ‘pixsla’ and ‘pixslb’ are used to select which pixels in the depth buffer are updated
in this group of 16 pixels. A pixel (as shown in the following illustration) is written when
both the ‘col’ and the plnzmsk related to it are ‘ 1’.
plnzmsk
3 2 1 0
5-
18
Chapter 5: Register Descriptions
MGA ATHENA Specification
Matrox Confidential
Plane write mask
PLNWT
Memory Address
I
31
plnwrmsk
<31:0>
PLaNe WRite MaSK:
operations. During intensity buffer write operations, the contents of this register are
transmitted to the
edge of
w
0 = Inhibit write
n
In 8 and 16 bits/pixel modes, some bits have to be replicated. Refer to Figure 3-8 for the
definition of the slice for each mode.
+Note:
1ClC
Attributes
W-F
Reset
Value
XXXX XXXX h
plnwt
20
30 29 28 27 26 25 24 23 22
19 18 17 1615 14 13 121110
21
Specifies the plane or planes to be protected during any write
VRAMs
through the
vd<63:0>
bus where they are latched on the falling
RAS/.
1 = Permit write
When performing a drawing operation with Z when fbm = 10, the plane write
mask must not be used, since the mask will affect both Z (depth) and I (intensity) plane
masking.
98
7
654
3
2
1
0
Ma trox ConfidentialMGA ATHENA Specification
Power Graphic Mode Register Descriptions5-19
Background Color
BCOL
Memory Address 1
backcol
<31:0>
C20
Attributes W-FReset Value
XXXX XXXX h
backcol
30 29 28 27 26 25 24 23 222120
31
BACKground COLor:
The backcol field is used by the color expansion module to
19 18 171615 14 13 1211109
8
765
generate the source pixels when the background is selected. As well, the backcol field is
used as the background color for anti-aliased characters.
In 8 and 16 bits/pixel modes, some bits have to be replicated. Refer to Figure 3-10 for the
definition of the slice for each mode.
the source pixels when the foreground is selected. As well, forcol is used as foreground
color for anti-aliased characters.
In 8 and 16 bits/pixel modes some bits have to be replicated. Refer to Figure 3-10 for the
definition of the slice for each mode.
BACKground
Z value: The backz field is used with primitives that use the Z buffer.
When the ZTAG bit specifies a background depth value, the backz register is selected
instead of the destination register to perform the
The forcol field is used by the color expansion module to generate
comparision.
backz
5-20
Chapter 5: Register Descriptions
MGA ATHENA Specification
-
Matrox Confidential
Source register
SRCO,SRCl, SRC2, SRC3
Memory Address
127
lC30
lC34
lC38
lC3C
scrcreg3
srcreg<l27:0> SouRCe REGister:
n
For LINE with the RPL or RSTR attribute, the source register is used to store the line
style. The funcnt field of the SHIFT register points to the selected source register bit
which is being used as the linestyle for the current pixel. The following illustration
shows how the linestyle is stored in the source register.
127
. . .
Attributes W-FD
9695
scrcreg2
64
Reset
63
scrcreg 1
Value
32
31
The Source register is used for all drawing operations.
Pattern direction
. . .. . .
stylelen
I
I
t
Pixel 2 . . .
Pixel 1 (funcnt)
b
linestyle
XXXX XXXX h
0
scrcreg0
0
. . .
1
. For TRAP with the RPL or RSTR attribute, the source register is used to store the
pattern. The following format is used:
srcreg3
127
70707070707070707070707070707070
line7
9
For all BITBLT operations, and for TRAP or LINE using depth mode, the source
96 95
line6
srcreg2
line5line4
64 63
line3line2
srcregl
32 31
line1
srcreg0
0
line0
register is used internally for intermediate data.
. The source register is used internally for intermediate data for all BITBLT operations.
Ma trox Confidential
MGA ATHENA Specification
Power Graphic Mode Register Descriptions
5-21
XYSTRT
X Y start address
Memory Address
31
30 29
The XYSTRT register is not a physical register. It is simply an alternative way to load
registers AR5, AR6, XDST and YDST.
The XY STRT register is only used for LINE and AUTOLINE. XY STRT does not require
initialization for polylines because all the registers affected by XYSTRT are updated to
the endpoint of the vector at the end of the AUTOLINE.
When XYSTRT is written, the following registers are affected:
.
X-STARTclS:O>
n
X-START<lS:O>
.
Y-START<1 5:0>
. 0
--> sellin
1
C40
28 27 26 25 24 23 22
Attributes
Y STARTX START
-
--> xdst<l5:0>
-->
ar5<17:0> (sign extended)
-->
ydst<23:0>
W-FKD
Reset
Value
XXXX XXXX h
-
212019 18 17 1615141312111098765432
(sign extended)
0
1
x-start
<15:0>
y-start
<31:16>
n
1
-->
newy
.
Y-START<lS:O> --> ar6<17:0>
X
STARTing
coordinate: x-start contains the X coordinate of the starting point of the
(sign extended)
vector. It is a 16-bit signed value in two’s complement notation.
Y
STARTing
coordinate: y-start contains the Y coordinate of the end point of the vector.
This coordinate is always XY (this means that to use the XYSTRT register the linearizer
must be used). It is a 16-bit signed value in two’s complement notation.
5-22Chapter 5: Register Descriptions
MGA ATHENA Specification
-
Matrox Confidential
X Y end address
XYEND
Memory Address
x-end
<15:0>
y-end
<31:16>
lC44
r-
31
30 29 28 27 26 25 24
Attributes W-FKD
Y-END
23 222120
19 18 17 16
II
15 141312111098765432
Reset Value XXXX XXXX h
X-END
The XYEND register is not a physical register. It is just an alternative way to load
registers
AR0
and AR2.
XYEND register is only used for AUTOLINE drawing.When XYEND is written, the
following registers are affected:
n
X-END<lS:O>
n
Y_ENDcl5:0> --> ar247:0>
X
ENDing
coordinate: x-end contains the X coordinate of the end point of the vector. It is
--> arOc17:0>
(sign extended)
(sign extended)
a 16-bit signed value in two’s complement notation.
Y
ENDing
coordinate: y-end contains the Y coordinate of the end point of the vector. It is
a 16-bit signed value in two’s complement notation.
1
0
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode Register Descriptions5-23
SHIFT
Funnel shifter control
Memory Address
Illllllll
funcnt
x-off
<3:0>
Y-Off
<6:4>
<6:0>
FUNnel
w
. For BLIT operations, this register is incremented by the slice value to select source bits.
pattern X
pattern. This offset must be in the range O-7 (bit 3 is always 0).
pattern Y
pat tern.
lC50
Reserved
31
30 29 28 27 26 25 24 23 222120
Attributes W-FKD
fifcntfunoff
I
19 18 17 16 15 14 13121110
1
stylelen
Reset Value
Resewed
98
7
XXXX XXXX h
funct
6 5 4 3 2 1 0
L--.-J-
y-off
x-off
COUNT value: This field is used to drive the funnel shifter bit selection.
For LINE operations, this is a countdown register. This register is used to initialize and
select the first bit of the line style.
OFFset:
OFFset:
This field is used for TRAP operations to specify the X offset in the
This field is used for TRAP operations to specify the Y offset in the
-
Reserved
<15:7>
funoff
<21:16>
fifcnt
<25:22>
stylelen
<22: 16>
Reserved
<31:26>
Reserved: Writing has no effect.
F’UNnel
shifter
OFFset:
For BLIT operations, this field is used to specify a bit offset in
the funnel shifter count. In this case, funoff is interpreted as a 6-bit signed value.
FIFO
COUNT: For BLIT operations, this field is used by the sequencer to determine how
many source slices are available. In this case, the field does not need to be initialized.
line STYLE
LENgth:
For LINE operations, this field specifies the linestyle length.
Reserved: Writing has no effect.
5-24
Chapter 5: Register Descriptions
MGA ATHENA Specification
Matrox Confidential
Sign
SGN
Memory Address
sdydxl
<o>
scanleft
co>
lC58
Attributes
W-FKD
Reset Value
XXXX XXXX h
Reserved
31
30 29 28 27 26 25 24 23 222120
19 18 17 16
r--I
15141312111098765432
I I
1
sdydxl’
Sign of Delta Y minus Delta X: This bit is shared with scanleft. It is defined for LINE
drawing only and specifies the Major axis. This bit is automatically initialized during
AUTOLINE operations.
n 0 Major axis is Y
. 1 Major axis is X
Horizontal SCAN direction
used for TRAP and BLIT drawing. The
direction in a BLT or filled trapezoid.
LEFT
(1) vs RIGHT (0): This bit is shared with sdydxl. It is
scanleft
bit is set according to the X scanning
0
sdxl
cl>
sdy
<2>
Reserved
<4:3>
sdxr
<5>
Normally, this bit is always programmed to zero except for BITBLT when bltmod =
BPLAN or BFCOL.
Sign of delta X (line draw or left trapezoid edge): The sdxl bit specifies the X direction
for a line draw (opcod = LINE) or the X direction when plotting the left edge in a filled
trapezoid draw. This bit is automatically initialized during
9
0 delta X is positive
n
1 delta X is negative
AUTOLINE
operations.
Sign of delta Y: The sdy bit specifies the Y direction of the destination address. This bit is
automatically initialized during AUTOLINE operations.
. 0 delta Y is positive
. 1 delta Y is negative
Reserved: Writing has no effect.
Sign of delta X (right trapezoid edge): The sdxr bit specifies the X direction of the right
edge of a filled trapezoid.
. 0
. 1 delta X is negative
Reserved
Reserved: Writing has no effect.
<31:6>
Matrox Confidential
de1
ta X is positive
MGA ATHENA Specification
Power Graphic Mode Register Descriptions5-25
LEN
Length
Memory Address
‘
length
<15:0>
LENGTH: The length bit is a 16-bit unsigned value.
Reserved
<31:16>
lC5C
Attributes W-FKD
Reserved
II
31
30 29 28 27 26 25 24 23 222120
. The length field doesn’t require initialization for
w
For a vector draw, length is programmed with the number of pixels to be drawn.
19 18 17 1615 1413 121110987654
auto-init
Reset Value
length
vectors.
XXXX XXXX h
3
2
1
0
. For Blits and trapezoid fills, length is programmed with the number of lines to be filled
or
BLITed.
Reserved: Writing has no effect.
AR0
Memory Address
ar0
<17:0>
Multi-purpose address register 0
1
C60
Reserved
31
30 29 28 27 26 25 24 23 222120
Address Register 0: The
n
For AUTOLINE, this register holds the X end address (see the XYEND register
Attributes W-FKDReset
ar0
19 18
1716
15 14 13 121110987654
arO
field is an l&bit signed value in two’s complement notation.
Value
XXXX XXXX h
description on page 5-23).
9
For LINE, it holds 2 x ‘b’.
. For a filled trapezoid, it holds
. For a BLIT,
. This register is not used for LINE without Auto initialization.
. For TRAP, it holds the minor axis increment . In BLIT algorithms,
1C74
Attributes W-FKD
Reserved
30 29 28 27 26 25 24
23 222120
ar5
field is an
Reset
Value
ar5
II
19 18
l&bit
ar5
holds the X start address (see the XYSTRT register
15 14 13 121110
1716
signed value in two’s complement notation.
98
XXXX XXXX h
7
65432
1
0
on page 5-22). At the end of AUTOLINE the register is loaded with the X end, so it is
not necessary to reload the register when drawing a polyline.
IdYrl.
ar5
holds the pitch of the source operand
‘syinc’
(See Table 3-l).
A negative pitch value specifies that the source is scanned from bottom to top while a
positive pitch value specifies a top to bottom scan.
Reserved
-
<31: 18>
Multi-purpose address register 6
Memory Address
ar6
<17:0>
Reserved: Writing has no effect.
AR6
1C78
Attributes W-FKD
Reserved
30 29 28 27 26 25 24 23 222120
31
19 18
II
1716
Reset
15 14 13 121110
I
Value
ar6
98
XXXX XXXX h
76543
2
1
0
Address Register 6: This field is an 1%bit signed value in two’s complement notation. It
is sign extended to 24 bits before being used by the ALU.
. At the begining of AUTOLINE, ar6 holds the Y start address (see the XYSTRT register
description on page 5-22). During AUTOLINE processing, this register is loaded with
the signed Y displacement. At the end of
AUTOLINE
the register is loaded with the Y
end, so it is not necessary to reload the register when drawing a polyline.
. This register is not used for LINE without Auto initialization.
. For TRAP, it holds the major axis increment
n
This register is not used for BLIT operations.
Reserved
Reserved: Writing has no effect. These bits return all zeroes when read.
~31: 18>
Matrox Confidential
MGA ATHENA Specification
‘dYr’.
Power Graphic Mode Register Descriptions
5-29
PITCH
Memory
pitch
Memory Address
iY
<12:0>
lC8C
Attributes
W-m
Reset Value XXXX XXXX h
iv
I
31
30 29 28 27
26 25 24 232221
20
191817161514 13
121110
9876
5432
Y Increment: This field is a 13-bit unsigned value. The Y increment value is a pixel unit,
and it must be a multiple of 32 (the five LSB
= 0). This field specifies the increment to be
added to or subtracted from ydst between two destination lines. This field is also used as
the multiplicator factor for linearizing the iy register.
It should be noted that only a few values are supported for linearization. If the pitch
selected can’t be linearized, the ylin bit should be used to disable the linearization
operation. The following table provides the supported pitch for linearization:
Pitch
512
640
768
800
1024
iY
0001000000000
0001010000000
0001100000000
0001100100000
0010000000000
Pitch
1152
1280
1536
1600
iY
0010010000000
0010100000000
0011000000000
0011001000000
I
1
0
Reserved
<14: 13>
ylin
<15>
Reserved
<31:16>
Reserved: Writing has no effect.
Y
LINearization:
n
0 Linearize the address
w
1 Don’t linearize the address
This bit specifies if the address must be linearized or not.
Reserved: Writing has no effect.
5-30Chapter 5: Register Descriptions
MGA ATHENA Specification
Matrox Confidential
Y address register
YDST
Memory Address 1
Reset Value XXXXXXX 0 XXXXXXXXXXXXXXXXXXXXXXXX b
ydst
<23:0>
Y
as a signed value in two’s complement notation. Two formats are supported: linear format
and XY format. The current format is selected by ylin.
When XY format is used, ydst represents the Y coordinate of the address. The valid range
is -32768 to
before being used.
When linear format is used, ydst must be programmed as follows:
The ydst field contains the current Y coordinate of the destination address
+32767 (16-bit
ydst
c--
(Y coordinate) x PITCH >> 5
signed). The XY value is always converted to a linear value
ydst
newy
<24>
Reserved
<28:25>
The Y coordinate range is from -32768 to
+32767
(16-bit signed) and the pitch range is
from 32 to 6144. Pitch is also a multiple of 32.
n
Before starting a vector draw, ydst must be loaded with the Y coordinate of the starting
point of the vector. This can be done by accessing the
XY-START
register. This
register does not require initialization for polyline operations.
n
Before starting a BLIT, ydst is loaded with the Y coordinate of the starting corner of the
destination rectangle.
n
For trapezoids, this register must be loaded with the Y coordinate of the first scanned
line of the trapezoid.
NEW Y: The newy field is a l-bit field which is always set every time the register is
written by the processor (bit 24 of the data bus is discarded). This bit is cleared when
ydstorg is added to ydst. This bit is used to inhibit the linearization of an address which
has already been linearized. This bit is also set when the host accesses the XYSTRT
register.
Reserved: Writing has no effect.
sellin
<31:29>
SELected LINe.
transparency functions. During linearization, this field is loaded with the three LSB of
ydst. If no linearization occurs, then those bits have to be initialized correctly if one of the
above-mentioned functions is to be used.
Matrox Confidential
The
sellin
field is used to perform the dithering, patterning, and
Clipper Y top boundary: The cytop field contains an unsigned 27-bit value which is
interpreted as a positive pixel address and compared with the current ydst. The value of
Value
XXXX XXXX h
the ydst field must be greater than or equal to cytop to be inside the drawing window.
This register must be programmed with a linearized line number:
cytop = (TOP LINE NUMBER) x PITCH + YDSTORG
This register must be loaded with a multiple of 32 (the five LSB = 0).
Note that since the cytop value is interpreted as positive, any negative ydst value is
automatically outside the clipping window. There is no way to disable clipping.
Clipper Y
interpreted as a positive pixel address and compared with the current ydst. The value of
the ydst field must be less than or equal to cybot to be inside the drawing window.
This register must be programmed with a linearized line number:
This register must be loaded with a multiple of 32 (the five LSB = O).There is no way to
disable clipping.
Reserved
Reserved: Writing has no effect.
<31:27>
1
C9C
Reserved
30
29 28
cybot = (BOTTOM LINE NUMBER) x PITCH + YDSTORG
Attributes
27 26 25 2423222120
BOTtom
boundary: The cybot field contains an unsigned 22-bit value which is
W-FK
19
18 17 1615 14
Reset
Value
XXXX XXXX h
cybot
13 121110987654
32
1
0
Clipper X minimum boundary
Memory Address
cxleft
<12:0>
Clipper X LEFT boundary: The cxleft field contains an unsigned 13-bit value which is
interpreted as a positive pixel address and compared with the current xdst. The value of
31
lCA0
30
29 28 27 26 25 24 23
xdst must be greater than or equal to cxleft to be inside the drawing window.
Note that since the cxleft value is interpreted as positive, any negative xdst value is
automatically outside the clipping window. There is no way to disable clipping.
Reserved
Reserved: Writing has no effect.
<31: 13>
Attributes W-FK
Reset
Value
Reservedcxleft
222120
19 18 17 16
15 14 1312111098765432
CXLEF’t=
XXXX XXXX h
1
0
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode Register Descriptions
5-33
CXRIGHT
Clipper X maximum boundary
Memory Address
cxright
<12:0>
Reserved
<31: 13>
L
31
I.
1 CA4
30 29 28
5
27 26
a..
Attributes W-FK
Reserved
25 24 23 22
a
"
21
.31a
Reset
II
20
19 18 17 16 15 141312111098765432
'
1
n'3
8
1‘
11
Value
cxright
8
XXXX XXXX h
8
8j
1:
1
0
8
Clipper X RIGHT boundary: The cxright field contains an unsigned 13-bit value which is
interpreted as a positive pixel address and compared with the current xdst. The value of
xdst must be less than or equal to cxright to be inside the drawing window. There is no
way to disable clipping.
Reserved: Writing has no effect.
FXLEK
Memory Address
fxleft
CEO>
Reserved
<31:16>
X address register (left)
I
CAM
Attributes W-FKD
Reset
Value
XXXX XXXX h
Reserved
II
31
30 29 28 27 26 25
Filled object X
boundary of any filled object being drawn. It is a 16-bit signed value in two’s
complement notation.
n
The fxleft field is not used for line drawing.
. During filled trapezoid drawing, fxleft is updated during the left edge scan.
. During a BLIT operation, fxleft is static, and specifies the left pixel boundary of the
area being written to.
Reserved: Writing has no effect.
24 23 222120
LEFI’
coordinate: The fxleft field contains the X coordinate of the left
19
18 17 1615 14 13
12111098
7
65432
1
0
-
5-34Chapter 5: Register Descriptions
MGA ATHENA Specification
Ma trox Confidential
X address register (right)
FXRIGHT
Memory Address
I
fxright
<15:0>
Reserved
<31:16>
Filled object X RIGHT coordinate: The fxright field contains the X coordinate of the
right boundary of any filled object being drawn. It is a 16-bit signed value in two’s
complement notation.
. The fxright field is not used for line drawing.
. During filled trapezoid drawing, fxright is updated during the right edge scan.
. During a BLIT operation, fxright is static, and specifies the right pixel boundary of the
Reserved: Writing has no effect.
1CAC
Reserved
31
30 29 28 27 26 25 24
area being written to.
Attributes
23 222120
W-FKD
19 18 17 16
I
1514
Reset
13 121110
Value
XXXX XXXX h
fxrig ht
98765432
1
0
X Destination address register
Memory Address
lCB0
Attributes
Reserved
31
30 29 28 27 26 25 24
xdst
<15:0>
X coordinate of the destination address: The xdst field contains the running X coordinate
of the destination address. It is a 16-bit signed value in two’s complement notation.
W-FKD
23 222120
19 18 17 16
1514
Reset
13 121110
Value
XXXX XXXX h
xdst
98765432
XDST
1
0
. Before starting a vector draw, xdst must be loaded with the X coordinate of the starting
point of the vector. At the end of a vector xdst contains the address of the last pixel of
the vector. This can also be done by accessing the XYSTRT register.
. This register does not require initialization for polyline operations.
n
For trapezoids and
BLITs,
this register is automatically loaded from fxleft and fxright
. For LINE with 2, the DRO register holds the current 2 value for the currently drawn
n
CC0
Attributes
W-FD
Reset Value
XXXX XXXX h
dr0
For TRAP with 2, the DRO register is used to scan the left edge of the trapezoid. This
register must be initialized with its starting 2 value. In this case, DRO is a signed 17.15
value in two’s complement notation.
pixel. This register must be initialized with the starting Z value. In this case, DRO is a
signed 17.15 value in two’s complement notation.
For LINE with anti-aliasing, DRO holds the fraction of the pixel covered by the line
which is used by the blender. The register must be initialized with 1 (for the first part)
or 0 (for the second part). In this case, DRO is a signed 16.16 value in two’s
complement notation.
DRI
Memory Address
drl<31:0>
Data ALU register 1
KC4
Attributes W-FD
Reset
Value
XXXX XXXX h
drl
31
30 29 28 27 26 25 24 23 222120
1I,L
Data ALU Register 1:
. The DRl output is used as the current depth value. Because Z should never be negative,
a negative value is interpreted as an overflow and data is saturated before being used.
. For TRAP and LINE with Z, the DRl register holds the current Z value for the
currently drawn pixel. This register does not require initialization. In this case, DRl is a
signed 17.15 value in two’s complement notation.
. For LINE with anti-aliasing,
which is used by the blender. This register does not require initialization. In this case,
DRl is a signed 16.16 value in two’s complement notation.
19 18 17 1615 14 13 12111098765432
DRl
holds the fraction of the pixel covered by the line
I
1
0
1
-
5-36Chapter 5: Register Descriptions
MGA ATHENA Specification
-..
Matrox Confidential
Data ALU register 2
DR2
Memory Address
I
31
dr2<31:0>
Data ALU Register 2:
. For TRAP with Z, the DR2 register holds the Z increment value along the X axis. In
. For LINE with Z, the DR2 register holds the Z increment value along the major axis. In
n
lCC8
Attributes W-F
Reset Value
XXXX XXXX h
dr2
30 29 28 27 26 25 24 23 222120
19 18 17 1615 14
I
13 12111098
7
654
32
1
0
this case, DR2 is a signed 17.15 value in two’s complement notation.
this case, DR2 is a signed 17.15 value in two’s complement notation.
For LINE with anti-aliasing, DR2 holds the pixel coverage increment value along the
major axis. In this case, DR2 is a signed 16.16 value in two’s complement notation.
I
Data ALU register 3
Memory Address
31
30 29 28 27 26 25 24 23 222120
dr3<31:0>
Data ALU Register 3:
n
For TRAP with Z, the DR3 register holds the Z increment value along the Y axis. In
this case, DR3 is a signed 17.15 value in two’s complement notation.
. For LINE with Z, the DR3 register holds the Z increment value along the diagonal axis.
In this case, DR3 is a signed 17.15 value in two’s complement notation.
9
For LINE with anti-aliasing, DR3 holds the pixel coverage increment value along the
diagonal axis. In this case, DR3 is a signed 16.16 value in two’s complement notation.
1CCC
Attributes W-F
19 18 17 1615 141312
dr3
Reset
1110987
Value
XXXX XXXX h
432
65
DR3
1
0
Matrox Confidential
MGA ATHENA Specification
Power Graphic Mode Register Descriptions
5-37
DR4
Data ALU register 4
Memory Address
dr4
<23:0>
Reserved
<31:24>
1
CD0
Attributes
Reserved
Ii
31
30 29 28 27 26 25 24 23 222120
VFD
19 18
dr4
1716
15 14 13 1211109
Reset
Value
8
76543
XXXX XXXX h
2
1
Data ALU Register 4: DR4 holds a signed 9.15 value in two’s complement notation.
n
For TRAP with Z, the DR4 register is used to scan the left edge of the trapezoid for the
red color (Gouraud shading). This register must be initialized with its starting red color
value.
w
For LINE with Z, the DR4 register holds the current red color value for the currently
drawn pixel. This register must be initialized with the starting red color.
Reserved: Writing has no effect.
0
DR5
Memory Address
1 CD4
Attributes W- FDReset
Reserved
31
30 29 28 27 26 25 24
dr5 <23:0>Data ALU Register 5:
n
The DR5 output is used as the current red value. Because intensity should never be
negative, a negative value is interpreted as an overflow and data is saturated before
being used.
. For TRAP and LINE with Z, the DR5 register holds the current red color value for the
currently drawn pixel. This register does not require initialization.
Reserved
<31:24>
Reserved: Writing has no effect.
Data ALU register 5
Value
XXXX XXXX h
dr5
23 222120
DR5
holds a signed 9.15 value in two’s complement notation.