<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Linear addressing and 16bpp/24bpp/32bpp modes </TITLE>
</HEAD>
<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">

<A HREF="cirrus.html"><EM> Information for Cirrus Chipset Users</EM></A>
 <b>:</b> <EM>Linear addressing and 16bpp/24bpp/32bpp modes </EM><BR>
<b>Previous:</b> <A HREF="cirrus4.html"><EM>Mode issues </EM></A><BR>
<b>Next:</b> <A HREF="cirrus6.html"><EM>The ``cl64xx'' Driver</EM></A>


<HR NOSHADE>
  <H2><A NAME="5"></A>5. Linear addressing and 16bpp/24bpp/32bpp modes </H2>

<p>Currently the framebuffer code 16-bit, 24-bit, and 32-bit pixels  in 
the SVGA
server requires linear addressing.  Option 
"linear" can be specified in a
depth-specific screen section to enable linear addressing; a MemBase
setting (in the device section) is probably also required (although they
are both automatically selected with PCI cards, like 5446, 546x, and some
543x based cards). There
are a number of different card configurations.</p>
<p>If you have a 542x/543x on the ISA bus, and you have 16Mb or more of
system memory, linear addressing is impossible. 16bpp is out, sorry.
If you have less than 14Mb of memory, you may be able to map the
framebuffer at 14Mb, using `<code>MemBase 0x00e00000</code>'. That's five zeros
after the `e'. Unfortunately many ISA cards don't support linear
addressing.</p>
<p>If you have a 5424/26/28/29 on VESA local bus, the situation is more
complicated. There are two different types of cards w.r.t. linear
addressing:
<ul>
<li>Cards that can only map in the lower 16Mb, like cards on the ISA bus.
This is the case with most cards. The same
restrictions apply (i.e. you must have less than 16Mb of memory).</li>
<li>Cards that connect address line A26 and always map at 64Mb + 14Mb or
64Mb. In
this case specify `<code>MemBase 0x04e00000</code>' or `<code>MemBase
0x04000000</code>'. This assumes you have a VLB motherboard implementation
that implements A26. Alternatively the card may map to 0x2000000, and
recent cards like the 5429 usually map to 0x03e00000 (62Mb).</li>
</ul>

You will probably have to rely on trial and error. If you have less
than 16Mb memory, the `wrong' membase setting will result in no graphics
being displayed, but you can probably exit with ctrl-alt-backspace.</p>
<p>If you have &gt;= 16Mb memory, the first type of card (and even the second
type with a stupid VLB motherboard) will result in a crash (probably a
spontaneous hard reboot).</p>
<p>It may be possible to find out the type by visual inspection. If the card
has a pin at A26, it is likely to map beyond 64Mb. To do this, take the card
out. At the VESA local bus pins (this is the smaller strip of connector pins
at the non-slot side of the card), consider the right side (this is the side
of the board where all the chips are mounted). There are 45 pins here. They
are numbered 1 to 45, from the inside (i.e. the one nearest to the card end
is 45). Counting from the inside, the 17th pin is probably not present, then
there are pins at 18-20. The 21st is A30, the 22nd is A28 and the 23rd is
A26. So, if we have no pins at at 21-23, the card doesn't map beyond 64Mb. If
there's only a gap of two pins at 21 and 22 (or they are both present) and
there's a pin at 23, the card does probably map beyond 64Mb. If there's a
little logic near that pin on the card, it's more likely.</p>
<p>With a 543x on the local bus things are simpler (the Cirrus Logic windows
drivers use it), but it is not quite without problems.</p>
<p>With a card on the PCI bus, there is a PCI configuration register that holds
the framebuffer base address, which is read automatically by the driver
if a PCI card is detected. The `scanpci' program 
can read out the PCI configuration and show the base address.</p>
<p>On the VESA local bus, most 543x cards have a default mapping address of
64Mb, with jumper options for 2048Mb and 32Mb. This is probably described in
the documentation that came with the card, or look in the MS-Windows system.ini
file (something with linearaddr = &lt;offset in megabytes&gt;). These different
settings were added by Cirrus Logic after finding that many VLB motherboard
implementations don't implement different address pins. The driver assumes
a default of 64Mb if MemBase isn't specified. A few examples for MemBase:
<blockquote><code>
<pre>
	MemBase	0x02000000	32Mb
	MemBase	0x04000000	64Mb
	MemBase	0x80000000	2048Mb
</pre>
</code></blockquote>
</p>
<p>Finally, for 546X cards, you are in luck:  there are no "issues" to worry
about.  The '6X will always use linear addressing and memory-mapped I/O,
and will use the memory addresses up near 4GB.  Yay for PCI!</p>

<p>The 16bpp and 32bpp modes are now fully accelerated, thanks to XAA. On
more recent chips like the 5436/46 and the 546X, 24bpp is also fully
accelerated.
So although 
there are now up to 4 times as many bits to display, the X server shouldn't
feel overly sluggish.  Note also that the 24bpp and 32bpp modes are only 
supported on a limited set of cards, and with at least 2Mb of memory.</p>
<p>In the <code>XF86Config</code> <code>"Screen"</code> section, a
<code>"Display"</code> subsection must be
defined for each depth that you want to run, with separate Modes
and virtual screen size. Example (2Mb of video memory):
<blockquote><code>
<pre>
Section "screen"
    SubSection "Display"
	Depth 8
	Virtual 1280 1024
	ViewPort 0 0
	Modes "640x480" "800x600" "1024x768"
	Option "linear"
    EndSubSection
    SubSection "Display"
	Depth 16
	Virtual 1024 992
	ViewPort 0 0
	Modes "640x480" "800x600" "1024x768"
	Option "linear"
    EndSubSection
    SubSection "Display"
	Depth 32
	Virtual 832 600
	ViewPort 0 0
	Modes "640x480" "800x600"
	Option "linear"
    EndSubSection
EndSection
</pre>
</code></blockquote>
</p>

 <HR NOSHADE>
<A HREF="cirrus.html"><EM> Information for Cirrus Chipset Users</EM></A>
 <b>:</b> <EM>Linear addressing and 16bpp/24bpp/32bpp modes </EM><BR>
<b>Previous:</b> <A HREF="cirrus4.html"><EM>Mode issues </EM></A><BR>
<b>Next:</b> <A HREF="cirrus6.html"><EM>The ``cl64xx'' Driver</EM></A>



</BODY>
</HTML>
