Bug 13932 - pointer cannot move across screens in zaphod mode
Summary: pointer cannot move across screens in zaphod mode
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: 7.3 (2007.09)
Hardware: All Linux (All)
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
: 19451 (view as bug list)
Depends on: 19472
Blocks: xserver-1.7
  Show dependency treegraph
Reported: 2008-01-04 12:04 UTC by Thomas Mechtler
Modified: 2009-09-23 05:18 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:

Xorg.log (83.41 KB, text/plain)
2008-01-04 12:05 UTC, Thomas Mechtler
no flags Details
xorg.conf (2.13 KB, text/plain)
2008-01-04 12:05 UTC, Thomas Mechtler
no flags Details
lspci -v (8.05 KB, text/plain)
2008-01-04 12:06 UTC, Thomas Mechtler
no flags Details

Description Thomas Mechtler 2008-01-04 12:04:27 UTC
All 3 heads come up fine, but i can't move the mousecursor to the second head.
It is possible to start a xterm on all heads:

xterm -display :0.0
xterm -display :0.1
xterm -display :0.2

But I cant't move the cursor to head :0.1.
The grafik cards are a PEG X550 and a PCI 9200PRO.

I use the newest driver from debian experimental, which follows git head.
Attached are my xorg.conf, Xorg.log and lspci.
Comment 1 Thomas Mechtler 2008-01-04 12:05:20 UTC
Created attachment 13531 [details]
Comment 2 Thomas Mechtler 2008-01-04 12:05:55 UTC
Created attachment 13532 [details]
Comment 3 Thomas Mechtler 2008-01-04 12:06:43 UTC
Created attachment 13533 [details]
lspci -v
Comment 4 Ramon van der Stelt 2008-11-19 09:12:48 UTC
I have the same problem with a dual head setup (R350) in zaphod mode.

The problem results from wrong offset values in the xf86ScreenLayout table. These offsets are used by the miPointerSetPosition function to compute the new pointer coordinates when crossing the screen border. When the offset values are lager then the screen size the coordinates will lay outside the new screen and the pointer is consequently mapped back to the previous screen.
This happens only when moving to the upper screen or to the screen on the left due to the order of the tests in miPointerSetPosition.

The offset values are to large because the xf86ScreenLayout table is created before the screens get their 'correct' sizes.
When the virtual screen size is not specified in the config file then the function xf86InitialConfiguration calls xf86DefaultScreenLimits to determine the necessary virtual screen size to cope with the all the possible modes. This virtual size is used as initial screen size.
So when the resolution of the selected mode is smaller then the computed virtual size then the offsets in the layout table will be to large.

The table should therefor be recreated when the correct screen size (and virtual size) are set. This happens when xf86CrtcCreateScreenResources is called from main (through pScreen->CrtcCreateScreenResources) which calls xf86RandR12CreateScreenResources which in turn calls xf86RandR12ScreenSetSize.

The function xf86ReconfigureLayout should be called from xf86CrtcCreateScreenResources or from main after calling pScreen->CreateScreenResources for each screen. The latter would be more efficient when dealing with a setup with many screens.

Of course, specifying the virtual screen sizes in the config file also 'fixes' the problem. ;-)
Comment 5 Michel Dänzer 2008-11-24 03:29:06 UTC
So this is a problem in the X server, rather than the driver?
Comment 6 Ramon van der Stelt 2008-11-24 12:40:11 UTC
Yes, I don't think the driver should concern itself with the layout of the screens.
Comment 7 Michel Dänzer 2008-11-24 23:30:33 UTC
Okay, reassigning to the server.
Comment 8 Matthieu Herrb 2009-01-07 22:50:47 UTC
*** Bug 19451 has been marked as a duplicate of this bug. ***
Comment 9 Eric Anholt 2009-01-30 18:40:32 UTC
no patch, not a 1.6 blocker
Comment 10 Peter Hutterer 2009-01-31 16:21:28 UTC
confirmed, renaming so the title actually describes the problem.
Comment 11 Peter Hutterer 2009-09-07 18:51:19 UTC
Marking as blocker for 1.7. Please confirm if this issue is still present.
Comment 12 Ramon van der Stelt 2009-09-11 08:19:17 UTC
Difficult to test because zaphod mode is quite broken in the radeon driver.
But when running some tests with the debugger it still looks like xf86InitOrigins uses the wrong screen sizes when building the edge tables.

Need to debug the driver first before I can be certain ;-)
Comment 13 Matthieu Herrb 2009-09-11 08:38:27 UTC
The patch from https://bugs.freedesktop.org/show_bug.cgi?id=19472 should be enough to fix the radeon driver.

Too bad it hasn't been committed yet.
Comment 14 Tiago Vignatti 2009-09-14 05:05:28 UTC
Probably f9a2fff2 ("mi: fix cursor warping screens") fix this bug, though I haven't tested for zaphod specifically. 

Thomas, can you please verify with server 1.7 RC1 if this is already fixed? 
Comment 15 Tiago Vignatti 2009-09-23 05:18:27 UTC
I'm taking the responsibility here and closing.

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.