Bug 80325

Summary: [SNA] segfault in git master (b3d3c0e8e75)
Product: xorg Reporter: Sree Harsha Totakura <freedesktop>
Component: Driver/intelAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: blocker    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Backtrace from the core file none

Description Sree Harsha Totakura 2014-06-21 11:27:23 UTC
Created attachment 101479 [details]
Backtrace from the core file

I was trying Dave Airlie's new DP MST patches (http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-i915-mst-support) on my T440s with two monitors with different resolutions connected via an ultradock.  This segfault occurs always when I un-dock the laptop from the dock.  I guess this is relavant: while undocking, the gnome-settings daemon tries to configure X to use just the laptop's display through xrandr and that is where the crash occurs.

Previously, I tried 2.99.912 version which crashed upon changing the orientation of a connected monitor through xrandr.  This current git master (b3d3c0e8e75) does not have this problem.


-- Window manager: i3 + gnome-settings-daemon
-- chipset: 00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
-- system architecture: x86-64
-- xf86-video-intel: GIT head/master b3d3c0e8e75a963262e4dc463fef60d7e9f1f01a
-- xserver: X.Org X Server 1.15.1-1 from latest Debian testing
-- kernel version: 3.14.0 (drm-i915-mst-v3.14 branch from http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-i915-mst-support)
-- Linux distribution: current Debian Testing
-- Machine or mobo model: Lenovo T440s
-- Display connector: DP MST (eDP + HDMI + DVI)
Comment 1 Chris Wilson 2014-06-21 13:54:22 UTC
What's the display configuration at that moment? Can you also please attach your Xorg.0.log?

The bug is that is dies trying to perform TearFree rotation on a disabled crtc. The crash fix looks easy, but I actually need to find out why the transform flag is still set I think. Argh, I wonder...
Comment 2 Chris Wilson 2014-06-21 13:58:14 UTC
I think the right fix is:

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index c540799..d05305e 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1410,7 +1410,10 @@ sna_crtc_disable(xf86CrtcPtr crtc)
                sna->mode.dirty = true;
        }
 
+       sna_crtc->transform = false;
+
        assert(sna_crtc->dpms_mode == DPMSModeOff);
+       assert(!sna_crtc->shadow);
 }
Comment 3 Chris Wilson 2014-06-21 14:46:52 UTC
commit 2046a49be59866a16db776ba53a588dbf6c02b12
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Jun 21 15:43:32 2014 +0100

    sna: Clear the transform flag on disabling the CRTC
    
    In places, we assume that if the flag is set, we must have an active
    CRTC. However, we were not clearing when disabling the CRTC.
    
    Reported-by: Sree Harsha Totakura <freedesktop@h.totakura.in>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80325
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

I am pretty sure that is the fix for that crash. Please do let me know if there is anything else.
Comment 4 Sree Harsha Totakura 2014-06-21 16:43:35 UTC
> I am pretty sure that is the fix for that crash. Please do let me know if
> there is anything else.

Fix confirmed.  Thank you.

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.