Bug 93816 - 915GM/945GM XRender does not display stretched image when multiple windows overlap on second display.
Summary: 915GM/945GM XRender does not display stretched image when multiple windows ov...
Status: VERIFIED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-21 19:53 UTC by marc-andre.parent
Modified: 2016-02-03 15:13 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
nodejs script to replicate the issue. (2.27 KB, text/plain)
2016-01-21 19:53 UTC, marc-andre.parent
no flags Details
Zipped Xorg configuration, log and xrandr output (9.26 KB, text/plain)
2016-01-21 19:53 UTC, marc-andre.parent
no flags Details
C code to replicate the issue along with driver debug logs (10.25 KB, application/octet-stream)
2016-02-02 20:05 UTC, marc-andre.parent
no flags Details

Description marc-andre.parent 2016-01-21 19:53:04 UTC
Created attachment 121193 [details]
nodejs script to replicate the issue.

Intel chipsets exposing the issue : 945GME, 915GM
Intel chipset NOT exposing the issue: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
System architecture: i686
Driver version: 2:2.99.917-2~bpo8+1
Kernel: 3.18.22
Distribution: Debian Jessie
Connection type: HDMI or DVI

Description:
I have a Java 1.7_76 application painting over 2 displays and after enabling the XRender pipeline a drawing issue on the second head appeared: A scaled image doesn't get painted if multiple windows overlap.  The problem can be reproduced without Java.
I created 'simple.js', a nodejs script making X11 calls.  It first draws a rectangle at a provided position and once enter is hit on the keyboard, a scaled (or not base on the argument) image is painted.  If between the drawing the rectangle and the image another window, such as xterm, is drawn over the rectangle, the image isn't painted.  Performing these steps over the first display works properly, over the second display, the image isn't drawn when enter is pressed.
The issue occurs only with 915/945 chipsets, over the second display and if the image is scaled.

Setup to replicate the issue:
-Install nodejs 5.4.1.
	curl -sL https://deb.nodesource.com/setup_5.x | bash -
	apt-get install nodejs
-Install node-x11 module.  Use version 2.0.4 because 2.0.5 doesn't work properly.
	cd /usr/lib
	npm install x11@2.0.4
-Install simple.js script in /usr/lib/node_modules/x11/examples/png
-Execute cd /usr/lib/node_modules/x11/examples/png

Script functionality test:
-Open ssh session.
-Execute: cd /usr/lib/node_modules/x11/examples/png
-Execute: nodejs simple.js 0 0 true
--A rectangle is displayed over the left-hand display.
-Open another ssh session and execute: export DISPLAY=:0; xterm -geom 30x10+0+0
--The xterm window is displayed above the rectangle.
-In the ssh session running simple.js, hit the enter key.
--The image is displayed.

Steps to replicate problem:
-Open ssh session.
-Execute: cd /usr/lib/node_modules/x11/examples/png
-Execute: nodejs simple.js 1920 0 true
--A rectangle is displayed over the right-hand display.
-Open another ssh session and execute: export DISPLAY=:0; xterm -geom 30x10+1920+0
--The xterm window is displayed above the rectangle.
-In the ssh session running simple.js, hit the enter key.
--The image is not displayed.
Comment 1 marc-andre.parent 2016-01-21 19:53:40 UTC
Created attachment 121194 [details]
Zipped Xorg configuration, log and xrandr output
Comment 2 marc-andre.parent 2016-02-02 20:05:24 UTC
Created attachment 121466 [details]
C code to replicate the issue along with driver debug logs

In c_test_app.zip, there is a c application which replicates the issue using only Xlib and Xrender calls.
To compile: gcc xrenderscaledimage.c -o xrenderscaledimage -lX11 -lm -lXrender

Here's what the application does:
1. Creates two 1920x1080 side-by-side colored windows(1 & 2) and maps them.
2. Creates two smaller white windows(3 & 4) of 150x150 and maps them over the first two.
3. Creates Pictures for windows 1 and 2.
4. Creates two Pictures for an image and scales them from 300x300 to 600x600.
5. On the 'Expose' event, the image Pictures are XRenderComposite'd over the window Pictures.
***The problem is that on the second head, the scaled image is not displayed.

If SCALE_FACTOR in xrenderscaledimage.c is set to 1.0 the problem doesn't occur.

In c_test_app.zip, there is also intel driver debug logs for executing the code separately on each head.  Strangely, at some point, there seems to be negative coordinates used for the second head:
sna_blt_copy_boxes src=(0, 0) -> (-1920, 0) x 1, tiling=(0, 1), pitch=(15360, 4096)
Comment 3 Chris Wilson 2016-02-03 12:48:35 UTC
Sorry, just took me a bit of time to remember how to trick a single panel into demonstrating the bug...

commit 8b8c9a36828e90e46ad0755c6861df85f5307fb5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Feb 3 12:37:30 2016 +0000

    sna/gen3: Add missing destination offsets to a few vertex emitters
    
    Sometimes we apply a destination offset (for when the coordinates are
    too large to be automatically offset by the 3D pipeline). Only a few
    paths had forgotten to apply the aforementioned offset.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93816
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 4 marc-andre.parent 2016-02-03 15:13:00 UTC
I confirm that the issue is fixed by commit: 8b8c9a36828e90e46ad0755c6861df85f5307fb5.

Thanks.


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.