Tuesday, April 10, 2012

Fixing screen resolution issues in Ubuntu

About a year ago I got a new Dell laptop with integrated Intel video card. Beginning with Ubuntu 11.10 there was an issue. It would boot up and set the screen resolution to the maximum (1920x1080) but it would give me no options to reduce it. I use my laptop with projectors all the time, but I was unable to mirror my output because all I could get was 1920x1080. So I've been using Mint, thinking the next version would fix it. No dice though. So I dug in and figured out my issue. First of all, Ubuntu no longer creates an xorg.conf file in the /etc/X11 folder. However you can put a config file in there and Ubuntu will use it. So in order to get Ubuntu to generate an xorg.conf file, you run:
tward $ X :1 -configure
:1 specifies the display to use, :0 is default but you are (probably) already using that one. This should put xorg.conf.new in your home folder. Now you need to add modeline options to it, these tell it what to do with the monitor at various resolutions. To create these modelines use cvt (the etc.. part is my own).
tward $ cvt 800 600
# 800x600 59.86 Hz (CVT 0.48M3) hsync: 37.35 kHz; pclk: 38.25 MHz
Modeline "800x600_60.00" 38.25 <...etc...> 624 -hsync +vsync
Do this for each resolution you want to have and copy the lines into xorg.conf in the Monitor section for Monitor0.
Section "Monitor"
  Identifier   "Monitor0"
  VendorName   "Monitor Vendor"
  ModelName    "Monitor Model"

  Modeline "1280x1024_60.00" 109.00 <...etc...> 1063 -hsync +vsync
  Modeline "1024x768_60.00" 63.50 <...etc...> 798 -hsync +vsync
EndSection
Finally, you need to (maybe not??) add the resolution strings to the Screen section, Display SubSections where applicable:
Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
....
        SubSection "Display"
                Viewport   0 0
                Depth     1
                Modes "1920x1080" "1280x1024" "1152x865" "1024x768"
        EndSubSection
 EndSection
Reboot, or otherwise restart X and everything is now working.

No comments:

Post a Comment