« freeze | Main | movable type 2.5 / mt search »

squaring those two white circular things in yer head

So, you score yourself a spiffy new monitor[1] for your desk at work, which apparently does 2048x1536 at 80Hz (1600x1200's so 20th century, right ?). My video card (a Matrox G450) says it'll do the same. Unfortunately, XFree86 v4 only seems to do modeline computation (based on what a DDC-capable monitor tells it) up to 1920x1440. What to do ?

Well, after a bit of poking around I found Andy Ritger's GTF-based modeline generator thingy, which seems to do the trick. So, having compiled gtf.c, it says :

% ./gtf

usage: ./gtf x y refresh [-v|--verbose] [-f|--fbmode] [-x|-xf86mode]

            x : the desired horizontal resolution (required)
            y : the desired vertical resolution (required)
      refresh : the desired refresh rate (required)
 -v|--verbose : enable verbose printouts (traces each step of the computation)
  -f|--fbmode : output an fbset(8)-style mode description
 -x|-xf86mode : output an XFree86-style mode description (this is the default
                if no mode description is requested)

Ok, then :

% ./gtf 2048 1536 80

  # 2048x1536 @ 80.00 Hz (GTF) hsync: 128.64 kHz; pclk: 364.31 MHz
  Modeline "2048x1536_80.00"  364.31  2048 2216 2440 2832  1536 1537 1540 1608  -HSync +Vsync

Well, nearly. I tried this out and it didn't work, because the dotclock setting was too high - my video card's dotclock seems to be 360MHz, according to /var/log/XFree86.0.log :

[ ... ]

(==) MGA(0): Using gamma correction (1.0, 1.0, 1.0)
(==) MGA(0): Min pixel clock is 12 MHz
(==) MGA(0): Max pixel clock is 360 MHz
(II) MGA(0): Compaq P1220: Using hsync range of 30.00-130.00 kHz
(II) MGA(0): Compaq P1220: Using vrefresh range of 50.00-160.00 Hz
(II) MGA(0): Clock range:  12.00 to 360.00 MHz

[ ... ]

Let's try that again, at 79Hz, say :

% ./gtf 2048 1536 79

  # 2048x1536 @ 79.00 Hz (GTF) hsync: 126.95 kHz; pclk: 359.53 MHz
  Modeline "2048x1536_79.00"  359.53  2048 2216 2440 2832  1536 1537 1540 1607  -HSync +Vsync

Right. So now we can whack that Modeline into the Section "Monitor" part of /etc/X11/XF86Config-4 :

Section "Monitor"
  Identifier      "Compaq P1220"
  HorizSync       30-130
  VertRefresh     50-160
  Option          "DPMS"

  # 2048x1536 @ 79.00 Hz (GTF) hsync: 126.95 kHz; pclk: 359.53 MHz
  Modeline "2048x1536"  359.53  2048 2216 2440 2832  1536 1537 1540 1607  
-HSync +Vsync
EndSection

...and then we make sure the Section "Screen" part has an entry telling it to try 2048x1536, something like this, at the end of it :

SubSection "Display"
  Depth           24
  Modes           "2048x1536_79.00" "1920x1440" "1856x1392" "1792x1344" "1600x1200" ...etc.
EndSubSection

...and fire it up. Look for something like this...

(--) MGA(0): Virtual size is 2048x1536 (pitch 2048)
(**) MGA(0): Mode "2048x1536": 359.5 MHz, 127.0 kHz, 79.0 Hz

...without any errors nearby about the settings being bogus (in which case it'll have tried the next resolution down). Now, press one of the monitor setting buttons, 'cause it oughta tell you what the refresh rate is. I ended up with 78.3Khz, which is good enough (VESA recommends 72Hz, but you already knew that, I guess).

The next thing you might want to do is to twiddle the dpi settings of your X server to match your spiffy new resolution, if only so you can act all indignant at people who design web pages for Mac displays (72dpi) or Windows ones (96 dpi - "large fonts" mode is 120dpi, and you might've run into similar frustrations[2]). 1600x1200 on a 21 inch monitor is almost exactly 100dpi, while 2048x1536 on the same sized monitor seems to be about 120dpi. On Debian at least (perhaps it's the same on RedHat, I can't remember), the X login managers (xdm, kdm, gdm, etc.) all seem to force the display to 100dpi, regardless of resolution (the default used to be 75dpi). There are two ways of doing this :

  1. you can add another line to the Section "Monitor" part of /etc/X11/XF86Config-4 :

    DisplaySize     width height

    ...where width and height are in millimetres (I haven't measured the new monitor yet, I'll get to that tomorrow). Then you need to edit your login manager's config. For kdm, it'll be in /etc/kde3/kdm/Xservers :

    :0 local@tty1 /etc/X11/X  -dpi 100 -nolisten tcp vt7

    ...so just remove -dpi 100 from there, and restart kdm.

  2. Alternatively, you could just do the maths to work out how many dots per inch your spiffy new resolution gives you, and put it right there in/etc/kde3/kdm/Xservers.

So there you go. You may have noticed that I didn't cover the question of why you'd want to run your monitor at a resolution like this - personally I like the idea of being able to fit as much on the screen as possible, but this reasoning doesn't seem to cut it with a lot of people...

Footnotes:

[1] It's a bit of a shame that they decided to put the USB ports at the back of the monitor...what were they thinking ?

[2] I actually had a piece of Windows software from Adobe (who you'd expect to know better) that came with my camera, and when I fired it up with Windows set to "large fonts" mode, it popped up a dialog saying something to the effect of "bugger off, I don't support large fonts mode. come back when you've changed to small fonts".

* 20:21 * geek