Bug 13089

Summary: [RANDR, dual head] set monitor's position incorrect
Product: xorg Reporter: WuNian <nian.wu>
Component: App/xrandrAssignee: Wang Zhenyu <zhenyu.z.wang>
Status: RESOLVED NOTABUG QA Contact: Xorg Project Team <xorg-team>
Severity: trivial    
Priority: low CC: eric
Version: gitKeywords: patch
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description WuNian 2007-11-04 19:15:35 UTC
I tested on GM965(Lenovo T61, LVDS's preffered mode 1280x800) and connected one
monitor(preffered mode 1024x768) via VGA port. (same test env. with bug #13088)

Test steps:
root@x-gm965:~/media# xinit &
root@x-gm965:~/media# xrandr --output VGA --pos 400x800
root@x-gm965:~/media# xrandr --output LVDS --pos 200x700

After above steps, the LVDS do not be moved, the VGA will be moved to 200x100. This is incorrect. Below is the xrandr output:

root@x-gm965:~/media# xrandr -q
Screen 0: minimum 320 x 200, current 1224 x 868, maximum 2048 x 2048
VGA connected 1024x768+200+100 (normal left inverted right x axis y axis) 304mm x 228mm
   1024x768       60.0*+   75.1     60.0*
   800x600        75.0     60.3
   640x480        75.0     60.0
   720x400        70.1
LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 331mm x 207mm
   1280x800       60.3 +   50.0
   1024x768       60.0*
   800x600        60.3
   640x480        59.9
TMDS-1 disconnected (normal left inverted right x axis y axis)


The xorg.log and xorg.conf can refer to bug #10388. Do not upload again.
Comment 1 WuNian 2007-11-05 23:55:32 UTC
The git tip is used. commits:

Xf86_video_intel:		b434c1a437c407de88396b219560649c2dae82b2 Xserver:		aec0d06469a2fa7440fdd5ee03dc256a68704e77 
Comment 2 WuNian 2007-11-06 23:49:01 UTC
This is a bug of app/xrandr.

In app/xrandr, it will set one monitor's position to 0x0. But this is not necessery. Below patch can fix this bug.


diff --git a/xrandr.c b/xrandr.c
index 2fb1212..abdff32 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -1378,31 +1378,6 @@ set_positions (void)
 	if (!any_set)
 	    fatal ("loop in relative position specifications\n");
     }
-
-    /*
-     * Now normalize positions so the upper left corner of all outputs is at 0,0
-     */
-    min_x = 32768;
-    min_y = 32768;
-    for (output = outputs; output; output = output->next)
-    {
-	if (output->mode_info == NULL) continue;
-	
-	if (output->x < min_x) min_x = output->x;
-	if (output->y < min_y) min_y = output->y;
-    }
-    if (min_x || min_y)
-    {
-	/* move all outputs */
-	for (output = outputs; output; output = output->next)
-	{
-	    if (output->mode_info == NULL) continue;
-
-	    output->x -= min_x;
-	    output->y -= min_y;
-	    output->changes |= changes_position;
-	}
-    }
 }
 
 static void
Comment 3 Keith Packard 2008-01-03 00:39:59 UTC
Keeping the monitors normalized so that the bounding box of their coverage aligns with the origin is the policy of the xrandr tool, and is very useful when people want to specify '-left-of' or '-above'. Changing this policy will break many existing tools. I don't think it's a sensible behaviour.
Comment 4 WuNian 2008-01-03 18:50:27 UTC
The rule is reasonable. But when execute below commands:

root@x-gm965:~/media# xrandr --output VGA --pos 400x800
root@x-gm965:~/media# xrandr --output LVDS --pos 200x700

Xrandr should not change the VGA's pos when execute the second command. We can tell the user that one monitor need to be locate 0x0, so the second command does not work.

Reopen this bug ans change the priority to low.
Comment 5 Hong Liu 2008-01-29 19:54:02 UTC
(In reply to comment #4)
> The rule is reasonable. But when execute below commands:
> 
> root@x-gm965:~/media# xrandr --output VGA --pos 400x800
> root@x-gm965:~/media# xrandr --output LVDS --pos 200x700
> 
> Xrandr should not change the VGA's pos when execute the second command. We can
> tell the user that one monitor need to be locate 0x0, so the second command
> does not work.
> 

Since xrandr normalizes all outputs' position to the minmium one, shall we just document this behavior as xrandr's policy?

Thanks,
Hong
Comment 6 Wang Zhenyu 2008-02-24 23:37:34 UTC
So this is xrandr tool behavior, mark as not-a-bug.
Comment 7 WuNian 2008-02-26 23:19:48 UTC
My option is in comment #4. Of coz, the bug is trivial and we can think this a known issue.

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.