Bug 1318352

Summary: Test case failure: Panning with xrandr
Product: Red Hat Enterprise Linux 6 Reporter: Tomas Hudziec <thudziec>
Component: xorg-x11-drv-intelAssignee: Lyude <lyude>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.8CC: jkoten, lyude, thudziec, tlavigne, tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: xorg-x11-drv-intel-2.99.917-0.4.20151111.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-10 19:55:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
xorg log none

Description Tomas Hudziec 2016-03-16 15:42:36 UTC
Created attachment 1137095 [details]
xorg log

Filed from caserun https://tcms.engineering.redhat.com/run/273669

Version-Release number of selected component (if applicable):
RHEL-6.8-20160215.n.0
xorg-x11-drv-intel-2.99.917-0.2.20151111.el6.x86_64

Steps to Reproduce: 
Get your display highest supported resolution, use xrandr for example (is is
the first resolution in the list, 1920x1080 in my case).

1. Run xrandr and set higher resolution that you have supported

    xrandr  --output DP2-2 --panning 5200x3200

Note: replace "DP2-2" with real name of your output interface.

it starts to crash approx. at 5200x3200 resolution, for lower than 5200x3200 works fine

Actual results: 
X crashes and restarts, backtrace from Xorg.0.log.old:
0: /usr/bin/Xorg (xorg_backtrace+0x51) [0x7ff56d7487f1]
1: /usr/bin/Xorg (0x7ff56d57b000+0x1d1e69) [0x7ff56d74ce69]
2: /lib64/libpthread.so.0 (0x7ff56ccea000+0xf7e0) [0x7ff56ccf97e0]
3: /usr/lib64/libpixman-1.so.0 (0x7ff56be1d000+0x75920) [0x7ff56be92920]
4: /usr/lib64/libpixman-1.so.0 (0x7ff56be1d000+0x5c63f) [0x7ff56be7963f]
5: /usr/lib64/libpixman-1.so.0 (pixman_fill+0x31) [0x7ff56be275e1]
6: /usr/lib64/xorg/modules/libfb.so (fbFill+0x620) [0x7ff566bec950]
7: /usr/lib64/xorg/modules/libfb.so (fbPolyFillRect+0x1ca) [0x7ff566becd6a]
8: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7ff567a4a000+0x142821) [0x7ff567b8c821]
9: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7ff567a4a000+0x13a958) [0x7ff567b84958]
10: /usr/bin/Xorg (0x7ff56d57b000+0x14f469) [0x7ff56d6ca469]
11: /usr/bin/Xorg (miPaintWindow+0x1b9) [0x7ff56d729b09]
12: /usr/bin/Xorg (miWindowExposures+0xe6) [0x7ff56d729f16]
13: /usr/bin/Xorg (0x7ff56d57b000+0xb83e7) [0x7ff56d6333e7]
14: /usr/bin/Xorg (0x7ff56d57b000+0xee913) [0x7ff56d669913]
15: /usr/bin/Xorg (miHandleValidateExposures+0x66) [0x7ff56d741536]
16: /usr/bin/Xorg (SetRootClip+0x26f) [0x7ff56d60907f]
17: /usr/bin/Xorg (0x7ff56d57b000+0xe302b) [0x7ff56d65e02b]
18: /usr/bin/Xorg (0x7ff56d57b000+0xdfa9e) [0x7ff56d65aa9e]
19: /usr/bin/Xorg (ProcRRSetScreenSize+0xfc) [0x7ff56d6ac1bc]
20: /usr/bin/Xorg (0x7ff56d57b000+0x59dee) [0x7ff56d5d4dee]
21: /usr/bin/Xorg (0x7ff56d57b000+0x5d7ba) [0x7ff56d5d87ba]
22: /lib64/libc.so.6 (__libc_start_main+0xfd) [0x7ff56a7a8d1d]
23: /usr/bin/Xorg (0x7ff56d57b000+0x47741) [0x7ff56d5c2741]

Expected results:
Make sure the screen is panned. No crashes/errors at display should appear.

Comment 2 Tomas Pelka 2016-03-16 16:19:45 UTC
00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell-ULT Integrated Graphics Controller [8086:0a16] (rev 0b)

Comment 3 Lyude 2016-03-16 19:14:55 UTC
I'm able to reproduce this on the T440s (Haswell), T450s (Broadwell), and T460s (Skylake). Characteristics are basically exactly the same on all of them, although mine seems to go up to resolutions like 7200x3200 before crashing (this is using eDP1)

Comment 5 Lyude 2016-03-17 19:51:13 UTC
I take back my previous comment, kept misreading this bug as being present on RHEL7, not 6… it does seem to crash after 5200x3200, but it's still present on all of the machines I've tested

Comment 6 Lyude 2016-03-21 16:21:42 UTC
So the bad news is that it looks like pannning at 5200x3200 was never actually supposed to work in uxa, a 5200x3200 buffer is too large for the amount of memory we have to work with when we're using uxa (which is significantly less then what we have to work with on sna). While it may have worked before, there's a big chance we can run into issues when doing various acceleration operations with such a large framebuffer that may not immediately be apparent. If you change your acceleration method to sna by putting something like this in your /etc/X11/xorg.conf.d/:

Section "Device"
	Identifier "Device0"
	Driver "intel"
	Option "AccelMethod" "sna"
EndSection

You can switch the acceleration method to sna and have panning work at high resolutions like this. This being said, sna is definitely not as well tested as uxa on RHEL6 so this might not be a very advisable workaround unless you're willing to take a few risks.

Since we can't properly support this (changing UXA to use the full memory available to SNA would be way too big of a change for RHEL6), I've written a patch that at the very least will stop the X server from crashing with panning settings like this, and instead have it gracefully fallback to the previous settings and simply return an error through xrandr.

Comment 7 Tomas Pelka 2016-03-21 17:58:52 UTC
I guess this is exactly what we want and expect.

Thanks Lyude!

Comment 8 Adam Jackson 2016-03-22 12:47:09 UTC
Patch looks good.

Comment 13 errata-xmlrpc 2016-05-10 19:55:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0761.html