Bug 25113

Summary: XCopyArea() does not work in Xinerama
Product: xorg Reporter: Arvind Umrao <arvind.umrao>
Component: Server/GeneralAssignee: Arvind Umrao <arvind.umrao>
Status: RESOLVED MOVED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high CC: alan.coopersmith, jeremyhu
Version: gitKeywords: patch
Hardware: All   
OS: All   
Whiteboard: 2011BRB_Reviewed
i915 platform: i915 features:
Attachments:
Description Flags
To compile the test sample cc -lX11 test.c
none
patch for bug 25113
none
xorg.conf file for setting up Xinerama
none
Patch fix none

Description Arvind Umrao 2009-11-16 02:31:53 UTC
Created attachment 31225 [details]
 To compile the test sample cc -lX11 test.c 

XCopyArea() does not copy areas of the screen between physical displays.

See attached test program, it creates a rectangle on screen 1 and copies that area to anywhere where the mouse is pressed. It only works on screen 1. Also if I move the drawing to screen 2 and do it from there it only works on screen 2.

To compile the test sample cc -lX11 test.c
Comment 1 Arvind Umrao 2009-11-16 03:42:02 UTC
Created attachment 31226 [details]
patch for bug 25113

Description of the change:
This bug was first reported for Xsun. Two months back I have fixed Xsun,in Nevada. Xserver team in SUN reviewed my code changes.

Xcopy does not work, when we xcopy image from one screen to other in Xinerama mode. The solution to the problem is use internal xcopy  instead of regular xcopy. Lines of code I have added is to detect if copied image( destination coordinate) not lies in same  screen of source image, then call internal xcopy instead of regular xcopy.
*1) Internal Xcopy*
In Internal Xcopy  temporary buffer is allocated and Xineramadata is copied .  Size of temporary buffer is same as drawing object(stuff). GetImage reads the image(Xineramadata) from all intersection boxes. When image overlaps between two or more screens, we can visualize portion of image in intersection boxes.

*2) Regular xcopy*
*Regular xcopy calls the regular copyimage. Regular copyimage will be much faster, because it does not call  getimage or putimage.* 


My code changes are well commented


Testing 
a)I have tested my fixes using two XVR2500 frame buffer on SPARC Ultra 45 with Xinerama on.
b)Also I have tested my fixes on Sunray with Xinerama on.
Comment 2 Arvind Umrao 2009-11-16 03:44:14 UTC
XCopyArea() does not work in Xinerama mode. XCopyArea() does not copy areas of the screen between physical displays.

Description of the change:
This bug was first reported for Xsun. Two months back I have fixed Xsun,in Nevada. Xserver team in SUN reviewed my code changes.

Xcopy does not work, when we xcopy image from one screen to other in Xinerama mode. The solution to the problem is use internal xcopy  instead of regular xcopy. Lines of code I have added is to detect if copied image( destination coordinate) not lies in same  screen of source image, then call internal xcopy instead of regular xcopy.
*1) Internal Xcopy*
In Internal Xcopy  temporary buffer is allocated and Xineramadata is copied .  Size of temporary buffer is same as drawing object(stuff). GetImage reads the image(Xineramadata) from all intersection boxes. When image overlaps between two or more screens, we can visualize portion of image in intersection boxes.

*2) Regular xcopy*
*Regular xcopy calls the regular copyimage. Regular copyimage will be much faster, because it does not call  getimage or putimage.* 


My code changes are well commented


Testing 
a)I have tested my fixes using two XVR2500 frame buffer on SPARC Ultra 45 with Xinerama on.
b)Also I have tested my fixes on Sunray with Xinerama on.
Comment 3 Jeremy Huddleston Sequoia 2011-10-05 21:20:13 UTC
Please send your patch to xorg-devel for review.
Comment 4 Arvind Umrao 2011-10-14 09:14:51 UTC
Created attachment 52343 [details]
xorg.conf file for setting up Xinerama
Comment 5 Arvind Umrao 2011-10-14 09:16:58 UTC
Created attachment 52344 [details] [review]
Patch fix
Comment 6 Adam Jackson 2018-07-30 15:46:40 UTC
Whatever these bugs are, they are probably not libXext's fault.
Comment 7 GitLab Migration User 2018-12-13 22:21:47 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/385.

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.