View Single Post
Old 06-20-12, 10:54 AM   #4
NVIDIA Corporation
aritger's Avatar
Join Date: Oct 2002
Posts: 53
Default Re: 320.17 can't detect video modes on Lenovo laptop

Hi Tim,

Sorry this change in behavior caught you off guard; the change is intentional, but there will be some growing pains while tools evolve to accomodate the new behavior.

For digital display devices, such as your laptop panel, the driver only sends it modetimings that the display device claims to support in its EDID. In drivers before 302.xx, the driver would lie and tell the X server and the rest of the system that it was driving whatever mode you asked for, even though under the hood the driver was sending one of the EDID modes to the display device. This discrepancy caused a variety problems and confusion (e.g., the mode advertised to the system could have a different refresh rate than what was actually being sent to the display device).

To make things more explicit, we altered the driver in 302.xx such that:

(a) The list of modes, advertised through nvidia-settings, the MetaMode syntax, RandR, etc, that can be driven to any display device is limited to what the driver will really send to the display device; in your example, this means the mode list will only contain 1920x1080.

(b) The MetaMode syntax is extended, such that you can separately configure the "ViewPortIn" and "ViewPortOut" to use in combination with any mode (we hope to eventually add RandR output properties for this, too).

With the display engine in NVIDIA GPUs, there are actually three different resolutions that are interesting: the resolution of the mode being sent to the display device, the resolution (and position) of the region within the mode in which to display pixels (this is "ViewPortOut"), and the resolution of the region within the X screen from which to fetch pixels (this is "ViewPortIn"). "ViewPortOut" would be used if you wanted your image to be smaller than the 1920x1080 mode (e.g., if you wanted a black border around your image, to do overscan compensation); that is probably not too interesting in your case. "ViewPortIn" can be used to configure a resolution smaller (or larger) than your mode and I think is what you want in your case.

E.g., if you want to display a 1024x768 resolution, scaled, on your 1920x1080 laptop panel:

"1920x1080 { ViewPortIn=1024x768 }"

If you want to aspect scale 1024x7868 (put black pillars on the left and right sides, so that the 1024x768 image keeps its aspect ratio):

"1920x1080 { ViewPortIn=1024x768, ViewPortOut=1440x1080+240+0 }"

If you want to center, rather than scale, the 1024x768 image within the 1920x1080 mode:

"1920x1080 { ViewPortIn=1024x768, ViewPortOut=1024x768+448+156 }"

The MetaMode syntax can have display device qualifiers and describe what you want on each display device. E.g., if you are connected to a VGA projector:

"DFP: 1920x1080 { ViewPortIn=1024x768 }, CRT: 1024x768"

Or have a 1920x1080 image scaled to fit the VGA projector:

"DFP: 1920x1080, CRT: 1024x768 { ViewPortIn=1920x1080 } "

Note that all of the above MetaModes can be specified on the nvidia-settings commandline, starting in 302.xx; e.g.,

nvidia-settings --assign CurrentMetaMode="DFP: 1920x1080, CRT: 1024x768 { ViewPortIn=1920x1080 }"

The syntax is pretty powerful and flexible, but it requires a little getting used to. We also have work to do to update the nvidia-settings GUI to be aware of all of this. We also hope to update nvidia-settings such that it presents more resolutions to the user, by automatically creating MetaModes such as the above. There is also some work to be done to make the above work better with Wine and SDL-based fullscreen games.

For more details, search for "ViewPortIn" in the README:

I hope that helps,
- Andy
Andy Ritger
NVIDIA Linux Graphics Driver Engineer
aritger is offline   Reply With Quote