having Virtual be smaller than Mode size?

Luc Verhaegen libv at skynet.be
Thu Jan 26 11:47:18 PST 2006


On Thu, Jan 26, 2006 at 11:05:25AM -0600, Jason Pepas wrote:
> Hi,
> 
> It would be nice to be able to do this:
> 
> SubSection "Display"
>     Modes "1280x1024"
>     Virtual 1024 768
> EndSubSection
> 
> Basically, I want to run an LCD screen a lower than native resolution, but 
> rather than having the LCD screen scale the image up to full screen size and 
> have a nasty, fuzzy look, I would rather just use less of the screen real 
> estate with black bars around the edges, and maintain the razor sharp look of 
> the native resolution.
> 
> Why is this useful?  I have a box which is infrequently accessed locally but 
> is often accessed remotely through VNC.
> 
> Would this be as simple as removing an "if" statement which prevents Virtual 
> from being smaller than the current Mode, and possibly adding some offsets to 
> center the screen?
> 
> -jason pepas
> 
It should be possible to play with the fields of a modeline to produce 
this effect.

For instance: gtf 1280 1024 60 produces the following:

# 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

This can be altered to 

Modeline "1024x768Centered"  108.88  1024 1360 1496 1712  768 1025 1028 1060  -HSync +Vsync 

This way blanking takes up the rest of the space. This does get us a the 
visible area in the upper right corner.

For the horizontal timing:
1024 1360 1496 1712

This is to be interpreted as:
HDisplay (blanking) HSyncStart (sync) HSyncEnd (blanking) HTotal.

HTotal is where the new visible area starts, which is HDisplay long.

We have 688 pixels of blanking and 136 worth of sync. We can shift that 
sync to the right, reduce the blanking after the visible area and 
increase the blanking before the visible area:

1024 1300 1436 1712

My test CRT here requires further adjustment to make that seem as 
perfectly centered though.

Same thing for the vertical timing:
768 1025 1028 1060 becomes 768 915 918 1060

So the final modeline becomes:

Modeline "1024x768Centered"  108.88  1024 1300 1436 1712  768 915 918 1060  -HSync +Vsync

This does require a driver capable of doing proper modesetting though.

Luc Verhaegen.



More information about the xorg mailing list