Bill Jonas on Fri, 1 Sep 2000 14:30:45 -0400 (EDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] X Windows Configuration


With all the talk recently about X configuration, I saw this posting a
couple days ago and thought that it might prove useful, although it's
written and geared to XFree86 3.x.

Hopefully someone will find this helpful.  <g>

Bill
-- 
>Ever heard of .cshrc?             | "Linux means never having to delete
That's a city in Bosnia. Right?    |  your love mail." -- Don Marti
(Discussion in comp.os.linux.misc  |  http://www.billjonas.com/
on the intuitiveness of commands.) |  http://www.harrybrowne.org/

---------- Forwarded message ----------
Date: Tue, 29 Aug 2000 18:14:59 -0700
From: Rick Moen <rick@linuxmafia.com>
To: svlug@svlug.org
Subject: Re: [svlug] HOWTO: Fonts in Notebooks  SOLVED!!!

begin  Ivan Passos quotation:
 
> The problem was that the Modelines for 800x600 were NOT being loaded (due 
> to a bad Vert Frequency range config.), and the display was then
> configured to 640x480 (dumb that I am, I didn't notice that before ...
> >8-( ... ).

Ah.

Here's my technique for making a good v. 3.x XF86Config file:

Run through the xf86config utility, setting the frequency limits
deliberately wide and selecting the maximal set of modes allowed at the
maximal number of colour depths offered.  Allow it to write
/etc/X11/XF86Config.  Copy it to XF86Config-GENERATED, for safekeeping.

Open two root-user virtual terminals.  In both, cd to /etc/X11.  In one,
open XF86Config in your Editor of Choice.  Start massively pruning out
the many superfluous sections and comment lines.  Save.  When you're
done, there should be one each (only) of the following sections:

Files
Keyboard
Pointer
Monitor
Device
Screen

Delete all Device and Screen sections other than the ones most appropriate 
for your video chipset.  Know whether you're using the SVGA server or
one of the "accelerated" servers, and you'll be able to identify the 
superflous sections pretty easily.

The only commented-out lines to leave are the VideoRAM and Clocks lines
you'll probably find already there, commented out, plus the comment line
that directly precedes each Modeline.  

Delete the two Modelines and matching comment lines for 640x400, the
entire "low-res doublescan" section, and all Modelines (with matching
comment lines) for modes higher than you want to go.  (E.g., for a VAIO,
delete all Modeline pairs for modes higher than 1024x768.)  Save.

Go to the bottom of the file.  Decide what default colour depth you
want.  Hard-code it by either eliminating all other Subsection "Display" 
subparagraphs, or by inserting (e.g.) "DefaultColorDepth 16" as a new
line near the top of the Screen section.

For any Subsection "Display" that is of interest, edit the Modes line
to (1) eliminate modes you won't ever use, and (2) reverse the order of 
the modes.  That is, xf86config writes them in lowest-to-highest order,
which is dumb.  Mine initially said:

     Modes       "640x480" "800x600" "1024x768"

I changed it to

     Modes       "1024x768" "800x600" "640x480"

You may want to add "ViewPort  0 0" to any Subsection "Display" that is
of interest.  Save.

In your other virtual terminal, type

   X > xerrors 2>&1

Observe whether X (bare X, in this case, with no window manager) comes
up or not.  If it comes up or partially does so, kill the X server using
Ctrl-Alt-Bkspc.  Do "less xerrors".  This is the complete stdout +
stderrors output of the X server at its default colour depth and best
valid mode.
 
You'll see something like this.  Note the part I've highlighted:

XFree86 Version 3.3.6 / X Window System
(protocol Version 11, revision 0, vendor release 6300)
Release Date: January 8 2000
	If the server is older than 6-12 months, or if your card is newer
	than the above date, look for a newer version before reporting
	problems.  (see http://www.XFree86.Org/FAQ)
Operating System: Linux 2.2.15pre20 i686 [ELF] 
Configured drivers:
  SVGA: server for SVGA graphics adaptors (Patchlevel 1):
      NV1, STG2000, RIVA 128, RIVA TNT, RIVA TNT2, RIVA ULTRA TNT2,
      RIVA VANTA, RIVA ULTRA VANTA, RIVA INTEGRATED, GeForce 256,
      GeForce DDR, Quadro, ET4000, ET4000W32, ET4000W32i, ET4000W32i_rev_b,
      ET4000W32i_rev_c, ET4000W32p, ET4000W32p_rev_a, ET4000W32p_rev_b,
      ET4000W32p_rev_c, ET4000W32p_rev_d, ET6000, ET6100, et3000, pvga1,
      wd90c00, wd90c10, wd90c30, wd90c24, wd90c31, wd90c33, gvga, r128, ati,
      sis86c201, sis86c202, sis86c205, sis86c215, sis86c225, sis5597,
      sis5598, sis6326, sis530, sis620, sis300, sis630, sis540, tvga8200lx,
      tvga8800cs, tvga8900b, tvga8900c, tvga8900cl, tvga8900d, tvga9000,
      tvga9000i, tvga9100b, tvga9200cxr, tgui9400cxi, tgui9420, tgui9420dgi,
      tgui9430dgi, tgui9440agi, cyber9320, tgui9660, tgui9680, tgui9682,
      tgui9685, cyber9382, cyber9385, cyber9388, cyber9397, cyber9520,
      cyber9525, 3dimage975, 3dimage985, cyber9397dvd, blade3d, cyberblade,
      clgd5420, clgd5422, clgd5424, clgd5426, clgd5428, clgd5429, clgd5430,
      clgd5434, clgd5436, clgd5446, clgd5480, clgd5462, clgd5464, clgd5465,
      clgd6205, clgd6215, clgd6225, clgd6235, clgd7541, clgd7542, clgd7543,
      clgd7548, clgd7555, clgd7556, ncr77c22, ncr77c22e, cpq_avga, mga2064w,
      mga1064sg, mga2164w, mga2164w AGP, mgag200, mgag100, mgag400, oti067,
      oti077, oti087, oti037c, al2101, ali2228, ali2301, ali2302, ali2308,
      ali2401, cl6410, cl6412, cl6420, cl6440, video7, ark1000vl, ark1000pv,
      ark2000pv, ark2000mt, mx, realtek, s3_savage, s3_virge, AP6422, AT24,
      AT3D, s3_svga, NM2070, NM2090, NM2093, NM2097, NM2160, NM2200,
      ct65520, ct65525, ct65530, ct65535, ct65540, ct65545, ct65546,
      ct65548, ct65550, ct65554, ct65555, ct68554, ct69000, ct64200,
      ct64300, mediagx, V1000, V2100, V2200, p9100, spc8110, i740, i740_pci,
      i810, i810-dc100, i810e, Voodoo Banshee, Voodoo3, smi, generic
(using VT number 7)

XF86Config: /usr/X11R6/lib/X11/XF86Config
(**) stands for supplied, (--) stands for probed/default values
(**) XKB: keymap: "xfree86(us)" (overrides other XKB settings)
(**) Mouse: type: PS/2, device: /dev/psaux, buttons: 3
(**) Mouse: 3 button emulation (timeout: 50ms)
(**) SVGA: Graphics device ID: "NeoMagic 2160"
(**) SVGA: Monitor ID: "Sony LCD"
(**) FontPath set to "/usr/X11R6/lib/X11/fonts/misc/:unscaled,/usr/X11R6/lib/X11/fonts/100dpi/:unscaled,/usr/X11R6/lib/X11/fonts/75dpi/:unscaled,/usr/X11R6/lib/X11/fonts/Speedo/,/usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X11/fonts/freefont/"
(--) SVGA: PCI: NeoMagic NM2160 rev 1, Memory @ 0xfd000000, 0xfea00000
(--) SVGA: chipset:  NM2160
(--) SVGA: videoram: 2048k
(**) SVGA: Using 16 bpp, Depth 16, Color weight: 565
(--) SVGA: Maximum allowed dot-clock: 90.000 MHz
(**) SVGA: Mode "1024x768": mode clock =  85.000
                 ^^^^^^^^                 ^^^^^^
(**) SVGA: Mode "800x600": mode clock =  50.000
                 ^^^^^^^                 ^^^^^^
(**) SVGA: Mode "640x480": mode clock =  45.800
                 ^^^^^^^                 ^^^^^^
(--) SVGA: Virtual resolution set to 1024x768
(--) SVGA: NeoMagic MagicGraph 128XD (NM2160) chip
(--) SVGA: NM2160: Panel is a 1024x768 color TFT display
(--) SVGA: NM2160: Internal LCD only display mode
(--) SVGA: NM2160: Video modes are displayed in the upper-left corner
(--) SVGA: NM2160: Low resolution video modes are stretched
(--) SVGA: NM2160: MMIO registers at 0xFEA00000
(--) SVGA: NM2160: Linear framebuffer at 0xFD000000
(--) SVGA: NM2160: Using hardware cursor
(--) SVGA: Using XAA (XFree86 Acceleration Architecture)
(--) SVGA: XAA: Solid filled rectangles
(--) SVGA: XAA: Screen-to-screen copy
(--) SVGA: XAA: 8x8 color expand pattern fill
(--) SVGA: XAA: CPU to screen color expansion (TE imagetext, TE polytext)
(--) SVGA: XAA: Using 8 128x128 areas for pixmap caching
(--) SVGA: XAA: Caching tiles and stipples
(--) SVGA: XAA: Horizontal and vertical lines and segments
System: `/usr/X11R6/lib/X11/xkb/xkbcomp -w 1 -R/usr/X11R6/lib/X11/xkb -xkm -m us -em1 "The XKEYBOARD keymap compiler (xkbcomp) reports:" -emp "> " -eml "Errors from xkbcomp are not fatal to the X server" keymap/xfree86 compiled/xfree86.xkm'


The three lines I've highlighted identify the Modeline that X will
attempt to use for each cited mode.  The Modeline you ended up using
before killing X (in the example, the one for 1024x768) either gave
functional, stable-looking, good-looking, non-monitor-destroying results
on your monitor or it didn't.  ("Monitor-destroying" means the monitor
isn't quite synchronising on the signal sent by the video circuitry, but
is trying and not triggering protection circuitry, possibly because
there is none).

If it looks good, cool.  You've won, for that mode (e.g., 1024x768).  
You're going to want to keep that mode's Modeline, and delete all other
Modelines for the same mode (e.g., all other 1024x768 pairs).  

If it doesn't look good, you're going to want to eliminate that
Modeline, so you can go test the next candidate.  

In either case, switch back to the first virtual terminal (in which
you're editing XF86Config).  Find the bottom of the Monitor section,
just above the Device one.  Higher frequency Modelines ("better", if
they work) are towards the bottom; less-aggressive ones are towards the
top of the section.  X always tries Modelines from the bottom of the 
section moving up.  As mentioned earlier, it parses "Modes" lines 
left-to-right.

The "mode clock" figure I highlighted above will be the next number on
each Modeline immediately following the mode-numbers label.  E.g., the
"mode clock = 85" one for 1024x768, on my system, is this one:

# 1024x768 @ 76 Hz, 62.5 kHz hsync
Modeline "1024x768"    85    1024 1032 1152 1360   768  784  787  823

If the monitor had not synchronised (shown a good display) using that
Modeline, I would now at least comment out the line, if not remove it
along with its comment line.  I would then save, switch to the second
virtual terminal, re-run "X > xerrors 2>&1", and repeat the cycle,
eliminating 1024x768 Modelines until one worked.  That will logically
be the best 1024x768 Modeline, so I would then stop there and (if I 
cared) optimise 800x600.

Since the monitor _did_ synchronise, I eliminate all other 1024x768 
entries, and move on to 800x600.

In order to test the next-lower mode with minimal effort, I just 
duplicate the "Modes" line I'm using, comment one copy out for
safekeeping, and eliminate modes I don't want to try:

#Modes       "1024x768" "800x600" "640x480"
Modes       "800x600" "640x480"

Save.  Switch to the second virtual window.  Do the previously-described
series of steps for 800x600, instead of 1024x768.

The above may sound hairy and labour-intensive, but it isn't.  It
quickly arrives at an optimised XF86Config file that's about 10% of
the usual length, and much more comprehensible than usual.  And, if you
make errors and delete something you shouldn't, you've lost nothing
but a little time, because of your safety copy in XF86Config-GENERATED.
I've sometimes even copied Modelines out of that file into my working
draft, after deleting a few lines too many from the latter and saving
too hastily.

-- 
Cheers,                   "Teach a man to make fire, and he will be warm 
Rick Moen                 for a day.  Set a man on fire, and he will be warm
rick@linuxmafia.com       for the rest of his life."   -- John A.  Hrastar

_______________________________________________
svlug mailing list
svlug@lists.svlug.org
http://lists.svlug.org/mailman/listinfo/svlug


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug