# Wrong resolution in Xorg



## tingo (Apr 14, 2013)

Run FreeBSD 9.1-STABLE:

```
root@kg-v7# uname -a
FreeBSD kg-v7.kg4.no 9.1-STABLE FreeBSD 9.1-STABLE #0: Sun Jan  6 20:09:55 CET 2013
    root@kg-v7.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
```
On a machine with  built-in nVidia graphics

```
root@kg-v7# pciconf -lv | grep -B 4 VGA
vgapci0@pci0:2:0:0:	class=0x030000 card=0x82f21043 chip=0x084910de rev=0xa2 hdr=0x00
    vendor     = 'nVidia Corporation'
    device     = 'C77 [GeForce 8200]'
    class      = display
    subclass   = VGA
```
I am currently using these versions:

```
xf86-video-nv-2.1.18_1
xorg-server-1.7.7_6,1
```
When I start Xorg, it reports that I'm running in 1920x180 mode:

```
tingo@kg-v7$ DISPLAY=:0.0 xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 1920 x 1920
VGA0 connected 1920x1080+0+0 531mm x 298mm
   1920x1080      60.0*+   60.0  
   1680x1050      60.0  
   1600x900       60.0  
   1280x1024      75.0     60.0  
   1280x800       59.8  
   1152x864       75.0  
   1280x720       60.0  
   1024x768       75.0     60.0  
   832x624        74.6  
   800x600        75.0     60.3  
   640x480        75.0     59.9  
   720x400        70.1  
DVI0 disconnected
```
but my monitor (BenQ GL2450HM) disagrees; the real mode is 1680x1050. And I side with the monitor here. Anyone seen this before?
When I check /var/log/Xorg.0.log, it looks like my monitor is correctly detected:

```
(--) NV(0): DDC detected a CRT:
(II) NV(0): Manufacturer: BNQ  Model: 78a6  Serial#: 21573
(II) NV(0): Year: 2012  Week: 30
(II) NV(0): EDID Version: 1.3
(II) NV(0): Analog Display Input,  Input Voltage Level: 0.700/0.300 V
(II) NV(0): Sync:  Separate  Composite  SyncOnGreen
(II) NV(0): Max Image Size [cm]: horiz.: 53  vert.: 30
(II) NV(0): Gamma: 2.20
(II) NV(0): DPMS capabilities: Off; RGB/Color Display
(II) NV(0): Default color space is primary color space
(II) NV(0): First detailed timing is preferred mode
(II) NV(0): redX: 0.631 redY: 0.351   greenX: 0.334 greenY: 0.615
(II) NV(0): blueX: 0.157 blueY: 0.051   whiteX: 0.313 whiteY: 0.329
(II) NV(0): Supported established timings:
(II) NV(0): 720x400@70Hz
(II) NV(0): 640x480@60Hz
(II) NV(0): 640x480@75Hz
(II) NV(0): 800x600@60Hz
(II) NV(0): 800x600@75Hz
(II) NV(0): 832x624@75Hz
(II) NV(0): 1024x768@60Hz
(II) NV(0): 1024x768@75Hz
(II) NV(0): 1280x1024@75Hz
(II) NV(0): 1152x864@75Hz
(II) NV(0): Manufacturer's mask: 0
(II) NV(0): Supported standard timings:
(II) NV(0): #0: hsize: 1280  vsize 800  refresh: 60  vid: 129
(II) NV(0): #1: hsize: 1280  vsize 720  refresh: 60  vid: 49281
(II) NV(0): #2: hsize: 1280  vsize 1024  refresh: 60  vid: 32897
(II) NV(0): #3: hsize: 1600  vsize 900  refresh: 60  vid: 49321
(II) NV(0): #4: hsize: 1680  vsize 1050  refresh: 60  vid: 179
(II) NV(0): #5: hsize: 1920  vsize 1080  refresh: 60  vid: 49361
(II) NV(0): Supported detailed timing:
(II) NV(0): clock: 148.5 MHz   Image Size:  531 x 298 mm
(II) NV(0): h_active: 1920  h_sync: 2008  h_sync_end 2052 h_blank_end 2200 h_border: 0
(II) NV(0): v_active: 1080  v_sync: 1084  v_sync_end 1089 v_blanking: 1125 v_border: 0
(II) NV(0): Serial No: P7C08203019
(II) NV(0): Ranges: V min: 50 V max: 76 Hz, H min: 30 H max: 83 kHz, PixClock max 210 MHz
(II) NV(0): Monitor name: BenQ GL2450H
(II) NV(0): EDID (in hex):
(II) NV(0):     00ffffffffffff0009d1a67845540000
(II) NV(0):     1e1601030e351e782eba45a159559d28
(II) NV(0):     0d5054a56b80810081c08180a9c0b300
(II) NV(0):     d1c001010101023a801871382d40582c
(II) NV(0):     4500132a2100001e000000ff00503743
(II) NV(0):     30383230333031390a20000000fd0032
(II) NV(0):     4c1e5315000a202020202020000000fc
(II) NV(0):     0042656e5120474c32343530480a00b8
(--) NV(0): Trying load detection on VGA0 ... found one!
(II) NV(0): EDID vendor "BNQ", prod id 30886
(II) NV(0): Using EDID range info for horizontal sync
(II) NV(0): Using EDID range info for vertical refresh
(II) NV(0): Printing DDC gathered Modelines:
(II) NV(0): Modeline "1920x1080"x0.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz)
(II) NV(0): Modeline "800x600"x0.0   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz)
(II) NV(0): Modeline "640x480"x0.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz)
(II) NV(0): Modeline "640x480"x0.0   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz)
(II) NV(0): Modeline "720x400"x0.0   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz)
(II) NV(0): Modeline "1280x1024"x0.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz)
(II) NV(0): Modeline "1024x768"x0.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz)
(II) NV(0): Modeline "1024x768"x0.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz)
(II) NV(0): Modeline "832x624"x0.0   57.28  832 864 928 1152  624 625 628 667 -hsync -vsync (49.7 kHz)
(II) NV(0): Modeline "800x600"x0.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz)
(II) NV(0): Modeline "1152x864"x0.0  108.00  1152 1216 1344 1600  864 865 868 900 +hsync +vsync (67.5 kHz)
(II) NV(0): Modeline "1280x800"x0.0   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync (49.7 kHz)
(II) NV(0): Modeline "1280x720"x60.0   74.48  1280 1336 1472 1664  720 721 724 746 -hsync +vsync (44.8 kHz)
(II) NV(0): Modeline "1280x1024"x0.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz)
(II) NV(0): Modeline "1600x900"x60.0  119.00  1600 1696 1864 2128  900 901 904 932 -hsync +vsync (55.9 kHz)
(II) NV(0): Modeline "1680x1050"x0.0  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync (65.3 kHz)
(II) NV(0): Modeline "1920x1080"x60.0  172.80  1920 2040 2248 2576  1080 1081 1084 1118 -hsync +vsync (67.1 kHz)
(II) NV(0): EDID vendor "BNQ", prod id 30886
(II) NV(0): Probing for EDID on I2C bus 2...
(II) NV(0): I2C device "I2C2:ddc2" registered at address 0xA0.
(II) NV(0):   ... none found
(II) NV(0): Output VGA0 connected
(II) NV(0): Output DVI0 disconnected
(II) NV(0): Using exact sizes for initial modes
(II) NV(0): Output VGA0 using initial mode 1920x1080
(II) NV(0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
(--) NV(0): Virtual size is 1920x1920 (pitch 2048)
(**) NV(0):  Driver mode "1920x1080": 148.5 MHz (scaled from 0.0 MHz), 67.5 kHz, 60.0 Hz
(II) NV(0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz)
(**) NV(0):  Driver mode "1920x1080": 172.8 MHz (scaled from 0.0 MHz), 67.1 kHz, 60.0 Hz
(II) NV(0): Modeline "1920x1080"x60.0  172.80  1920 2040 2248 2576  1080 1081 1084 1118 -hsync +vsync (67.1 kHz)
(**) NV(0):  Driver mode "1680x1050": 146.2 MHz (scaled from 0.0 MHz), 65.3 kHz, 60.0 Hz
(II) NV(0): Modeline "1680x1050"x60.0  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync (65.3 kHz)
(**) NV(0):  Driver mode "1600x900": 119.0 MHz (scaled from 0.0 MHz), 55.9 kHz, 60.0 Hz
(II) NV(0): Modeline "1600x900"x60.0  119.00  1600 1696 1864 2128  900 901 904 932 -hsync +vsync (55.9 kHz)
(**) NV(0):  Driver mode "1280x1024": 135.0 MHz (scaled from 0.0 MHz), 80.0 kHz, 75.0 Hz
(II) NV(0): Modeline "1280x1024"x75.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz)
(**) NV(0):  Driver mode "1280x1024": 108.0 MHz (scaled from 0.0 MHz), 64.0 kHz, 60.0 Hz
(II) NV(0): Modeline "1280x1024"x60.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz)
(**) NV(0):  Driver mode "1280x800": 83.5 MHz (scaled from 0.0 MHz), 49.7 kHz, 59.8 Hz
(II) NV(0): Modeline "1280x800"x59.8   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync (49.7 kHz)
(**) NV(0):  Driver mode "1152x864": 108.0 MHz (scaled from 0.0 MHz), 67.5 kHz, 75.0 Hz
(II) NV(0): Modeline "1152x864"x75.0  108.00  1152 1216 1344 1600  864 865 868 900 +hsync +vsync (67.5 kHz)
(**) NV(0):  Driver mode "1280x720": 74.5 MHz (scaled from 0.0 MHz), 44.8 kHz, 60.0 Hz
(II) NV(0): Modeline "1280x720"x60.0   74.48  1280 1336 1472 1664  720 721 724 746 -hsync +vsync (44.8 kHz)
(**) NV(0):  Driver mode "1024x768": 78.8 MHz (scaled from 0.0 MHz), 60.0 kHz, 75.0 Hz
(II) NV(0): Modeline "1024x768"x75.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz)
(**) NV(0):  Driver mode "1024x768": 65.0 MHz (scaled from 0.0 MHz), 48.4 kHz, 60.0 Hz
(II) NV(0): Modeline "1024x768"x60.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz)
(**) NV(0):  Driver mode "832x624": 57.3 MHz (scaled from 0.0 MHz), 49.7 kHz, 74.6 Hz
(II) NV(0): Modeline "832x624"x74.6   57.28  832 864 928 1152  624 625 628 667 -hsync -vsync (49.7 kHz)
(**) NV(0):  Driver mode "800x600": 49.5 MHz (scaled from 0.0 MHz), 46.9 kHz, 75.0 Hz
(II) NV(0): Modeline "800x600"x75.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz)
(**) NV(0):  Driver mode "800x600": 40.0 MHz (scaled from 0.0 MHz), 37.9 kHz, 60.3 Hz
(II) NV(0): Modeline "800x600"x60.3   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz)
(**) NV(0):  Driver mode "640x480": 31.5 MHz (scaled from 0.0 MHz), 37.5 kHz, 75.0 Hz
(II) NV(0): Modeline "640x480"x75.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz)
(**) NV(0):  Driver mode "640x480": 25.2 MHz (scaled from 0.0 MHz), 31.5 kHz, 59.9 Hz
(II) NV(0): Modeline "640x480"x59.9   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz)
(**) NV(0):  Driver mode "720x400": 28.3 MHz (scaled from 0.0 MHz), 31.5 kHz, 70.1 Hz
(II) NV(0): Modeline "720x400"x70.1   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz)
(**) NV(0): Display dimensions: (530, 300) mm
(**) NV(0): DPI set to (92, 162)
```
There aren't any errors in the log file:

```
tingo@kg-v7$ grep EE /var/log/Xorg.0.log
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(II) Loading extension MIT-SCREEN-SAVER
```


----------



## SirDice (Apr 15, 2013)

I would really suggest using x11/nvidia-driver. It's a much better driver with a lot better support.


----------



## tingo (Apr 15, 2013)

But there are many nvidia-drivers (-304, -173, -96, -71) in ports. How do I know which one I need?


----------



## volatilevoid (Apr 15, 2013)

tingo said:
			
		

> But there are many nvidia-drivers (-304, -173, -96, -71) in ports. How do I know which one I need?


You go to the NVIDIA homepage and then to the driver download area - select your card and see that 310.44 supports your card -> x11/nvidia-driver is the right one.


----------



## jem (Apr 18, 2013)

tingo said:
			
		

> But there are many nvidia-drivers (-304, -173, -96, -71) in ports. How do I know which one I need?



The -173, -96 and -71 versions are those after which NVIDIA dropped support for certain older cards.

The 8 series is still supported by the latest driver, at least the 8600m GT in my laptop is.


----------



## tingo (Apr 19, 2013)

FWIW, nvidia-driver (currently using 304.64) works correctly. I would like to get the nv driver working correctly too.


----------



## volatilevoid (Apr 20, 2013)

tingo said:
			
		

> FWIW, nvidia-driver (currently using 304.64) works correctly. I would like to get the nv driver working correctly too.


Is there a specific reason why you would like to use an inferior driver (other than because it's open source)? It doesn't even have 3D acceleration.


			
				volatilevoid said:
			
		

> *(suggested by me earlier)* If you want to use an open source driver, I'd suggest looking into x11-drivers/xf86-video-nouveau. Unfortunately, the FreeBSD version is a bit out of date and has no 3D acceleration either. For 2D acceleration, you need a patch, see the pkg-message.


Never mind my suggestion to the xf86-video-nouveau driver. Didn't see the IGNORE line in the Makefile:

```
# also doesn't work with mesa (libGL) version higher then 7.4.x
IGNORE= Not supported, missing kernel support. use the nvidia driver.
```
So, bottom line is: stick to the proprietary driver.


----------



## tingo (Apr 20, 2013)

volatilevoid said:
			
		

> Is there a specific reason why you would like to use an inferior driver (other than because it's open source)? It doesn't even have 3D acceleration.



Open source is a very big reason to use stuff, IMHO. If the nv driver could be coerced into giving the correct resolution, the driver itself is good enough; I don't need 3D acceleration on this machine. Other advantages of the nv driver compared to the Nvidia driver: it doesn't need the linux kernel module or linux_base, it works without the need for a kernel module (nvidia.ko).



			
				volatilevoid said:
			
		

> So, bottom line is: stick to the proprietary driver.



I will if I must, but I prefer not to. Get it?


----------



## kpedersen (Apr 20, 2013)

With the correct build options set in the port, the binary Nvidia driver can be built without the Linux compat requirement (I think it is strange that the default is to depend on Linux to be honest).


----------



## KNOStic (Apr 27, 2013)

There is one truly harrowing thing though about the NVidia driver. It clobbers libGL.so.1 and libglx.so, meaning that if I use a liveCD on machines that have other video cards in them, things are seriously broken.

Whose dumb idea was it to clobber existing files rather than having the driver and executables call what they want directly? I've read that others have tried various ideas such as libmap.conf or setting LD_LIBRARY_PATH, but so far nothing has come of any of these suggestions. As a result, I'm stuck with the nv driver which doesn't support many newer NVidia cards, and provides 800x600 resolution VESA if I'm lucky. Looks pretty bad on a wide screen.

What would really be neat would be some kind of script which could detect the presence of an NVidia card in the machine and set up the appropriate links before X starts up.


----------

