Bug 86548

Summary: Screen tears on xrandr orientation inverted
Product: xorg Reporter: Jeff Cook <jeff>
Component: Driver/intelAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: intel-gfx-bugs, jeff.zheng, li.l.xu, matthew.d.roper
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
screenshot of tearing effect
none
screenshot of tearing effect
none
screenshot of the problem with kernel 3.16
none
Xorg.log with --enable-debug=full none

Description Jeff Cook 2014-11-22 00:06:11 UTC
Created attachment 109827 [details]
screenshot of tearing effect

When xrandr -o inverted is run, the resulting image is split down the middle. This happens 95% of the time; it has worked once or twice without tearing. Rotation can be activated through unity-control-center Display Settings rotation field, and that reliably works fine. When xrandr -o normal is run, the display returns to normal (although bug #1376760 is observed). xrandr -o right and xrandr -o left also reliably work without issue; this only occurs on xrandr -o inverted. The same behaviors are observed with the longer form of the command xrandr --output eDP1 --rotation inverted, etc.

This has also been reported at https://github.com/pfps/yoga-laptop/issues/28, which uses xrandr commands to invert the display.

See also Launchpad: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1395182

lspci:

00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell-ULT Integrated Graphics Controller [8086:0a16] (rev 0b) (prog-if 00 [VGA controller])

Screenshot attached.
Comment 1 Jeff Cook 2014-11-22 00:07:46 UTC
Woops, looks like that screenshot went up with the wrong mimetype. Can someone correct that?
Comment 2 Jeff Cook 2014-11-22 00:08:34 UTC
Created attachment 109828 [details]
screenshot of tearing effect

screenshot of tearing effect (correct mimetype)
Comment 4 Jeff Cook 2014-11-26 20:53:45 UTC
Thanks for that Chris. Is there a recent patch I can try that is perhaps less "sketchy and completely broken"?
Comment 5 Chris Wilson 2014-11-27 16:18:24 UTC
Hmm, the other question here is whether fbc is enabled?

"FBC can show stale data when using 180 degree hardware rotation of the primary display plane.
WA: Do not enable FBC when using hardware 180 degree rotation on the primary display plane."
Comment 6 Jeff Cook 2014-11-28 20:40:24 UTC
I believe FBC is disabled. Here's what I found in /sys:

jeff@jeff-yoga:~$ sudo cat /sys/kernel/debug/dri/0/i915_fbc_status
FBC disabled: disabled per chip default
jeff@jeff-yoga:~$ sudo cat /sys/kernel/debug/dri/64/i915_fbc_status
FBC disabled: disabled per chip default
Comment 7 Chris Wilson 2014-12-24 07:09:50 UTC
*** Bug 87662 has been marked as a duplicate of this bug. ***
Comment 8 Chris Wilson 2014-12-25 11:57:30 UTC
Yikes, this regression made it into a stable release.
Comment 9 Ander Conselvan de Oliveira 2014-12-30 02:09:03 UTC
(In reply to Chris Wilson from comment #8)
> Yikes, this regression made it into a stable release.

I was actually able to reproduce this with 3.14. I tried to reproduce this before with drm-intel-nightly on SNB, IVB and HSW, but failed. Turns out I needed a more recent xorg intel driver to uncover the bug. I bisected the first appearance of the bug to

commit 975b9798be77b30cbed485583d0ccb48318708f7
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed May 21 08:58:24 2014 +0100

    sna: Add support for Present


The problem goes away after commit

commit 105d478cdd70ac3b38be51c9014b22b7233c241e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Aug 6 09:10:30 2014 +0100

    sna: Enable kernel rotation support by default


but oddly, after 

commit b6eeb7a1f7efa591504070b606be655e27e6e9c2
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Nov 5 13:03:41 2014 +0000

    Disable DRI3 by default

turning the rotation on with xrandr causes a black screen that can be fixed by vt switching away and back to X.

Anyway, I haven't looked yet into why the support for the Present extension uncovers the bug, but it seems this bug has been in the kernel for a while.
Comment 10 Chris Wilson 2014-12-30 11:30:25 UTC
(In reply to Ander Conselvan de Oliveira from comment #9)
> (In reply to Chris Wilson from comment #8)
> > Yikes, this regression made it into a stable release.
> 
> I was actually able to reproduce this with 3.14. I tried to reproduce this
> before with drm-intel-nightly on SNB, IVB and HSW, but failed. Turns out I
> needed a more recent xorg intel driver to uncover the bug. I bisected the
> first appearance of the bug to
> 
> commit 975b9798be77b30cbed485583d0ccb48318708f7
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Wed May 21 08:58:24 2014 +0100
> 
>     sna: Add support for Present

I think that is a seperate bug, please could you file a new report with a full description of the behavior you see and a full debug log. (There is certainly a kernel regression due to planes)
Comment 11 Ander Conselvan de Oliveira 2014-12-30 15:17:49 UTC
(In reply to Chris Wilson from comment #10)
> (There is certainly a kernel regression due to planes)

Even so, the original report makes no mention of using nightly or a very recent kernel. Also, the link to github implies the problem started to happen after an upgrade from Ubuntu 14.04 to 14.10. The latter uses kernel 3.16 and xf86-video-intel version 2.99.914. I am able to reproduce the bug with that config, getting the screen divided horizontally like in the attached screenshot.

Adding

   Option "Present" "false"

to the device section of xorg.conf works around the problem.
Comment 12 Ander Conselvan de Oliveira 2014-12-30 15:19:00 UTC
Created attachment 111519 [details]
screenshot of the problem with kernel 3.16
Comment 13 Ander Conselvan de Oliveira 2014-12-30 15:34:33 UTC
Created attachment 111520 [details]
Xorg.log with --enable-debug=full

I tried to reproduce the problem with the driver compiled with --enable-debug=full. However, the session strangely dies after setting the rotation. There is no error reported in the log after setting rotation to inverted.

The log seems to indicate that a shadow buffer is being used since the rotation is not supported by the kernel.
Comment 14 Chris Wilson 2014-12-30 17:06:14 UTC
(In reply to Ander Conselvan de Oliveira from comment #11)
> (In reply to Chris Wilson from comment #10)
> > (There is certainly a kernel regression due to planes)
> 
> Even so, the original report makes no mention of using nightly or a very
> recent kernel.

Duped the wrong bug. But since I was using this to track the kernel regression, hence the P1 blocker status, it would have been better to create a new bug.
Comment 15 Chris Wilson 2014-12-30 19:22:02 UTC
Then update the ddx...

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.