I was able to do this using a custom EDID in the screen, either by adding this to xorg.conf screen section:
Option "CustomEDID" "DFP-0:/path/to/file/custom_edid.bin"
Or by generating a config:
sudo nvidia-xconfig --custom-edit="CRT-0:/my/monitor.bin"
Now the big question, How to produce an acceptable EDID .bin?
On Windows XP, I had to install two applications: PowerStrip (which is referenced on Wikipedia article about EDID)
The other application we will need is Phoenix EDID Designer.
With PowerStrip, we will get detailed timing info from the current display mode; basically the required information is shown in this article and it sums up to the following:
1) In WinXP, the timings are somewhere in an advanced settings tab. You need:
Horiz Front Porch, Vert Front Porch,
Horiz Back Porch, Vert Back Porch,
Horiz Front Active, Vert Front Active,
Horiz Scan (or Sync) Width, Vert Scan Width,
Horiz Sync Polarity, Vert Sync Polarity,
and Pixel Clock.
2) In your /etc/X11/xorg.conf there is a place for modeline that looks something like
Code:
Modeline "1768x992" 74.48 1768 1336 1472 1664 992 721 724 746 -hsync +vsync
Just an example. Do not use this one.
The modeline is in a format of
Code:
Modeline "somenamehere" <dotclock> <H1> <H2> <H3> <H4> <V1> <V2> <V3> <V4> <HP> <VP>
where dotclock = Pixel Clock
H1=Horiz Front Active
H2=H1+Horiz Front Porch
H3=H2+Horiz Sync Width
H4=H3+Horiz Back Porch
V1=Vert Front Active
V2=V1+Vert Front Porch
V3=V2+Vert Sync Width
V4=V3+Vert Back Porch
HP=Horiz Sync Polarity [-hsync/+hsync]
VP=Vert Sync Polarity [-vsync/+vsync]
Simple formulas, but it took me weeks of searching to find out how to convert windows timings to a Linux modeline.
For my particular LG42LH30FR LCD TV, the resulting modeline is:
Modeline "1080p" 172.8 1920 2040 2248 2576 1080 1081 1084 1118 -hsync +vsync
I added this to my monitor section but it didn't work, which is why I went to add a custom EDID.
Now to create the EDID
Open the Phoenix EDID Designer, basically I imported an EDID from the Windows Registry, and I used that as a base to modify, this is because I didn't know how to populate the "Color/ Established Timings" section, so prepopulation gave me hopefully sensible values (well its working for me, maybe it was luck), anyhow, click the read-only/modify button which allows edition, the important things to modify
General:
Add whatever you want here
Basic Display Parameters:
Video Input Definition -> Digital
Display Type -> RBG color
sRGB -> check
gamma value: somewhere over 250 would be ok
Standard Timings: (i disabled everything except timing id #1)
H. Active Pixels (use the value obtained from PowerStrip, for full hd it should be 1920)
refresh rate (for me its 60Hz)
Detailed Timings:
set all blocks to "unused" except block #1:
Pixel Clock: (use from PS obtained info)
H/V Active Pixel : from PS info
H/V Blank : from PS info. this is actually **Front Porch**
H/V Sync Offset: from PS info. this is actually **Back Porch**
H/V Sync width: from PS info
Done. Now save the resulting file somewhere, you can open it, it's a text file.
You need one additional step to convert it to a required 128 byte .bin EDID file; basically I will point to the main article describing the transformation, but summarizing you'll have to
strip everything from the file except the hexadecimal matrix of digits
- Compile this:
#include <stdio.h>
int main()
{
while (!feof(stdin))
{
unsigned char i;
scanf("%02X ", &i);
printf("%c", i);
}
return 0;
}
And run:
# gcc comp.c -o comp
# ./comp < custom_edid.dat > custom_edid.bin
Done! Restart your Ubuntu (after adding the custom edid configuration option explained at the beginning of the post) and now on Nvidia X Server Settings, you should be able to set to your custom resolution.