# Lenovo T420s (Nvidia Quatro 4200M) resolution problem



## da1 (Jul 8, 2011)

Hi guys,

Lately I was given a Lenovo T420s and after making the primary stuff work, I came down to the resolution. For the moment I have a 8.2-STABLE amd64 FreeBSD and my xorg.conf looks like:


```
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	Screen      1  "Screen1" RightOf "Screen0"
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/local/lib/xorg/modules"
	FontPath     "/usr/local/lib/X11/fonts/misc/"
	FontPath     "/usr/local/lib/X11/fonts/TTF/"
	FontPath     "/usr/local/lib/X11/fonts/OTF"
	FontPath     "/usr/local/lib/X11/fonts/Type1/"
	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
	Load  "extmod"
	Load  "record"
	Load  "dbe"
	Load  "glx"
	Load  "dri"
	Load  "dri2"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/sysmouse"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Monitor"
	Identifier   "Monitor1"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "SWcursor"           	# [<bool>]
        #Option     "HWcursor"           	# [<bool>]
        #Option     "NoAccel"            	# [<bool>]
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "UseFBDev"           	# [<bool>]
        #Option     "Rotate"             	# [<str>]
        #Option     "VideoKey"           	# <i>
        #Option     "FlatPanel"          	# [<bool>]
        #Option     "FPDither"           	# [<bool>]
        #Option     "CrtcNumber"         	# <i>
        #Option     "FPScale"            	# [<bool>]
        #Option     "FPTweak"            	# <i>
        #Option     "DualHead"           	# [<bool>]
	Identifier  "Card0"
	Driver      "nv"
	VendorName  "nVidia Corporation"
	BoardName   "GF108 [Quadro NVS 4200M]"
	BusID       "PCI:1:0:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "DefaultRefresh"     	# [<bool>]
        #Option     "ModeSetClearScreen" 	# [<bool>]
	Identifier  "Card1"
	Driver      "vesa"
	VendorName  "Intel Corporation"
	BoardName   "2nd Generation Core Processor Family Integrated Graphics Controller"
	BusID       "PCI:0:2:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen1"
	Device     "Card1"
	Monitor    "Monitor1"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection
```

There are several problems:
1) If I use the "nvidia" driver (installed from ports) in xorg.conf, I get a reboot.
2) if I use the official nVidia package, I get a reboot.
3) if I use the "nv" driver, it works, but max resolution is 1024x768 
I also tried adding "modeline", "mode" and "virtual screen"

```
# 1280x1024 @ 60.00 Hz (GTF) hsync: 63.60 kHz; pclk: 108.88 MHz
Modeline "1280x1024_60.00" 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync
# 1600x900 @ 60.00 Hz (GTF) hsync: 55.92 kHz; pclk: 119.00 MHz
Modeline "1600x900_60.00" 119.00 1600 1696 1864 2128 900 901 904 932 -HSync +Vsync
```

From my point of view, there is a glitch somewhere between the nvidia driver and the card (or OS).

Ideas anyone?


----------



## wblock@ (Jul 8, 2011)

The keyword here is "Optimus".  The BIOS might let you disable the Intel video and use just the nVidia.


----------



## da1 (Jul 8, 2011)

It's currently like that.


----------



## wblock@ (Jul 8, 2011)

Then remove or comment out the Intel Device and Screen sections, and the Screen1 part of ServerLayout.


----------



## da1 (Jul 8, 2011)

No go because the nv driver does not support Nvidia NVS 4200M and the nvidia driver from the prots, crashes the system (same with the driver from Nvidia's official website).

I also tried using the Intel video card (from the BIOS) and generating a new xorg.conf but that was a no go too (works. but max resolution is 1024x768).


----------



## wblock@ (Jul 8, 2011)

The KMS Intel driver may be available with 9-CURRENT sometime in the next few months.  Other than that, contact nVidia and ask them why their binary driver doesn't work.


----------



## da1 (Jul 8, 2011)

Cannot go with 9-CURRENT because it doesn't boot at all . About contacting Nvidia I might just do it, why not .


----------



## DutchDaemon (Jul 8, 2011)

Their forums are usually quite responsive, so try that first.


----------



## DNAeon (Sep 17, 2011)

Hello guys,

Sorry to bring back such old topic again in the forums, but it seems that the NVIDIA forums didn't actually show much responsiveness about the issue 

Did someone manage to start up X on the T420s with the NVIDIA driver, or at least with a resolution higher than 1280x768 ?

Thanks for your feedback.

Regards,
Marin


----------



## da1 (Sep 17, 2011)

Ow, sorry to not have updated the thread but I managed to get full resolution with the nvidia driver from the ports but with the Graphic Device set to "Discrete Graphic" in BIOS and NOT to "NVIDIA Optimus". With the latter, the kernel panics because of the Nvidia driver. I have nothing special in xorg.conf except that I am using the nvidia driver.


----------



## DNAeon (Sep 18, 2011)

Hello da1,

Glad that you managed to make it work! 

I've set Graphic Device to "Discrete Graphic" in the BIOS and installed x11/nvidia-driver from Ports.

The nvidia module is kldload'ed, and I've created an xorg.conf file using `Xorg -configure`, then started X using the created file, but I'm only able to see the NVIDIA logo appearing for a second then my screen goes blank and that's it...

If I use nvidia-xconfig to create the xorg.conf file X does not start at all.

Is there something else that I'm missing?

Would you mind sharing your xorg.conf file as well?

BTW, I'm running -CURRENT from yesterday, cause I had lots of issues installing 8.2-RELEASE on that laptop - network, keyboard and other issues running 8.2..

Best regards,
Marin


----------



## DNAeon (Sep 18, 2011)

Hi again,

Update on the issue.

When I try to use the xorg.conf file created by `Xorg -configure` and then start X using `Xorg -config <new-xorg.conf-file>` I get only the NVIDIA logo and the screen goes blank.

But, when I've copied the newly created file to /etc/X11/xorg.conf and used `startx` everything started up successfully 

Just to have this here, in case someone else has the same issue 

Thanks for the help, guys - now everything is running just fine on my laptop! 

Best regards,
Marin


----------



## da1 (Sep 18, 2011)

DNAeon said:
			
		

> When I try to use the xorg.conf file created by `Xorg -configure` and then start X using `Xorg -config <new-xorg.conf-file>` I get only the NVIDIA logo and the screen goes blank.



This is normal because the behavior you are expecting needs a -retro flag to the Xorg -conf xorg.conf cmd. Section 5.4.2 Configuring X11 covers this point . Try [cmd=""]Xorg -conf xorg.conf -retro[/cmd] and you will get what you want .


----------



## DNAeon (Sep 18, 2011)

da1 said:
			
		

> This is normal because the behavior you are expecting needs a -retro flag to the Xorg -conf xorg.conf cmd. Section 5.4.2 Configuring X11 covers this point . Try [cmd=""]Xorg -conf xorg.conf -retro[/cmd] and you will get what you want .



BTW, did you manage to get your Fn keys working? 

I've tried the examples given in acpi_ibm(4), but didn't have much luck with it.

Regards,


----------



## da1 (Sep 19, 2011)

I think another thread would be the way to go about the Fn key problem since this thread is graphic-card related.
As a side note, Fn+F4 work (well, kind of anyway because I can suspend the laptop but cannot wake it up again) and Fn+ThinkLight works too.


----------

