Bug 17954 - xserver xf86Crtc.c add monitor Option "ZoomModes"
Summary: xserver xf86Crtc.c add monitor Option "ZoomModes"
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: Other All
: medium enhancement
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
Keywords: patch
Depends on: 17953
Blocks: 17955
  Show dependency treegraph
Reported: 2008-10-07 12:52 UTC by vdb128
Modified: 2013-03-27 21:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

xf86Crtc.c: new Option "UserModes" sets M_T_USERDEF modes. (2.52 KB, patch)
2008-10-07 12:52 UTC, vdb128
no flags Details | Splinter Review
add monitor Option "ZoomModes" "name name ..." (3.21 KB, patch)
2011-08-30 21:43 UTC, vdb128
no flags Details | Splinter Review
xorg.conf manual page description (975 bytes, patch)
2011-08-30 21:47 UTC, vdb128
no flags Details | Splinter Review
monitor Option "ZoomModes": xserver code and manual page description (5.58 KB, patch)
2012-11-11 21:47 UTC, vdb128
no flags Details | Splinter Review
Add monitor Option "ZoomModes". (5.46 KB, patch)
2013-03-11 16:59 UTC, vdb128
no flags Details | Splinter Review

Description vdb128 2008-10-07 12:52:47 UTC
Created attachment 19455 [details] [review]
xf86Crtc.c: new Option "UserModes" sets M_T_USERDEF modes.

This extension reintroduces zoom support, the mode switching 
through the Ctrl+Alt+Keypad-{Plus,Minus} keypress.  The user zoom mode 
list is defined in the monitor section and thus relates to an output.  
For example:

  Option "PreferredMode" "1600x1200@60"
  Option "UserModes" "1600x1200@50 1280x1024 1280x1024"

gives the list 1600x1200@60, 1600x1200@50, 1280x1024 75Hz, 1280x1024 59.9Hz.  
The actual list follows from the screen modes which are a copy of the 
compat_output probed_modes, usually the smallest width*height detected 

An improvement might be to synchronize zoom modes of multiple outputs 
instead of cloning the selected compat_output mode.  This would require 
a change in or around xf86OutputFindClosestMode().  

Example log messages: 
(II) RADEON(0): Printing probed modes for output DVI-0
Modeline "1600x1200@60"x60.0  144.00  1600 1628 1788 1920  1200 1201 1204 1250 (75.0 kHz UuP)
Modeline "1600x1200"x60.0  162.00  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync (75.0 kHz d)
Modeline "1600x1200"x59.9  161.00  1600 1712 1880 2160  1200 1203 1207 1245 -hsync +vsync (74.5 kHz e)
Modeline "1600x1200@50"x50.0  120.00  1600 1628 1788 1920  1200 1201 1204 1250 (62.5 kHz u)
Modeline "1400x1050"x74.8  155.80  1400 1464 1784 1912  1050 1052 1064 1090 +hsync +vsync (81.5 kHz d)
Modeline "1400x1050"x60.0  122.00  1400 1488 1640 1880  1050 1052 1064 1082 +hsync +vsync (64.9 kHz d)
Modeline "1280x1024"x75.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz ud)
Modeline "1280x1024"x59.9  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync (63.7 kHz eu)
Comment 1 Corbin Simpson 2010-03-19 22:02:26 UTC
This patch no longer applies and also is a bit disingenuous in its functionality. Could you respin this patch?
Comment 2 Matt Turner 2010-12-03 12:39:48 UTC
Please send this patch to xorg-devel@lists.x.org for a review. It's not going to be applied without a review.
Comment 3 vdb128 2011-08-30 21:43:30 UTC
Created attachment 50742 [details] [review]
add monitor Option "ZoomModes" "name name ..."

This patch adds support for the

  Option "ZoomModes" "1600x1200 1280x1024 1280x1024 640x480"

in a monitor section.  The code tries to match each mode name and 
sets the M_T_USERDEF mode type bit if found.  A mode will not be 
rematched so specifying a name twice selects the next, usually lower 
refresh rate, mode.

The option value is a string of mode names delimited by spaces.  As 
such, name tokenization is done at output enable time.  Ideally 
this should be done when parsing the Xorg.conf file.  A check of 
xserver/hw/xfree86/parser/{Flags.c Monitor.c scan.c xf86Optrec.h} 
shows 2 other possibilities:

1. Allow a new keyword ZoomModes followed by multiple mode names.  This
  would be a port of the Screen/Display/Modes code.

2. Allow generic options to be followed by multiple arguments.  This 
  requires either a char *opt_val[MAXVALS] thus introducing a compile 
  time maximum, a linked list of values, or a flexible array using 
  e.g. a char *opt_val[].  

These alternatives are not forward compatible since an older X server 
will fail to parse such constructs.  The option keyword extension is 
the logical choice but seems not worth the added complexity.  

Since enabling and disabling outputs is not a common event nor time 
critical the subideal form, the string of mode names, seems the best 
Comment 4 vdb128 2011-08-30 21:47:24 UTC
Created attachment 50743 [details] [review]
xorg.conf manual page description
Comment 5 vdb128 2012-11-11 21:47:15 UTC
Created attachment 69915 [details] [review]
monitor Option "ZoomModes": xserver code and manual page description

Perhaps some might recall the xorg.conf Modes statement:

Section "Screen"
  Identifier "Screen0"
  Subsection "Display"
    Modes    "1600x1200" "1280x1024" "1280x1024" "640x480"
    ViewPort 0 0

which defined the screen modes list.  All modes were available via the 
Ctrl+Alt+Keypad-{Plus,Minus} key combination and the first mode of the 
list was the initial mode.  Multiple output device support was added 
and monitor video modes are since then stored per output.  In the 
process the monitor Option "PreferredMode" appeared but mode switching 
was dropped.  

This patch adds support for the Option "ZoomModes" in a monitor 

Section "Monitor"
  Identifier "a21inch"
  Option "PreferredMode" "1600x1200"
  Option "ZoomModes" "1600x1200 1280x1024 1280x1024 640x480"

The option's effect is to search for and mark once each named mode in 
the output modes list.  So the specification order is free and the zoom 
modes order follows the order of the output modes list.  

This option has its use for monitor and television setups.  It allows 
for easy switching between 60 Hz and 50 Hz modes even when a monitor
refuses to display the input signal.
Comment 6 vdb128 2013-03-11 16:59:40 UTC
Created attachment 76345 [details] [review]
Add monitor Option "ZoomModes".
Comment 7 vdb128 2013-03-27 21:12:56 UTC
   2967391..ac4c2ab  master -> master

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.