Bug 81456 - [sna suse] present makes dpms defunct
Summary: [sna suse] present makes dpms defunct
Status: VERIFIED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-17 08:16 UTC by Jiri Slaby
Modified: 2014-07-17 09:53 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
defunct run (27.29 KB, text/plain)
2014-07-17 08:16 UTC, Jiri Slaby
no flags Details
good run (26.28 KB, text/plain)
2014-07-17 08:17 UTC, Jiri Slaby
no flags Details

Description Jiri Slaby 2014-07-17 08:16:59 UTC
Created attachment 102967 [details]
defunct run

If I left Present enabled, "xset dpms force suspend" suspends the monitors, but they turn on after 2 secs. If I use
Option "Present" "0"
they stay off.
Comment 1 Jiri Slaby 2014-07-17 08:17:15 UTC
Created attachment 102968 [details]
good run
Comment 2 Chris Wilson 2014-07-17 08:38:01 UTC
Could you capture the error with --enable-debug=full? I want to look at the sequence of calls and see how they interact with hardware state.
Comment 3 Jiri Slaby 2014-07-17 08:46:28 UTC
(In reply to comment #2)
> Could you capture the error with --enable-debug=full? I want to look at the
> sequence of calls and see how they interact with hardware state.

Here you go:
http://www.fi.muni.cz/~xslaby/sklad/Xorg.0.log.xz
Comment 4 Chris Wilson 2014-07-17 08:57:28 UTC
Ah, I've spotted it.

The next update after the DPMSSuspend does:

[ 46066.999] sna_present_unflip(event=440)
[ 46066.999] get_flip_bo(pixmap=348)
[ 46066.999] sna_pixmap_move_to_gpu(pixmap=348, usage=16), flags=42
[ 46066.999] sna_pixmap_move_to_gpu: already all-damaged
[ 46066.999] sna_pixmap_mark_active: pixmap=348, handle=118
[ 46066.999] page_flip(pipe=-1, event=440, handle=118)
[ 46066.999] sna_page_flip: handle 118 attached
[ 46066.999] do_page_flip: crtc 0 id=5, pipe=0 active? 0
[ 46066.999] do_page_flip: crtc 1 id=8, pipe=1 active? 0
[ 46066.999] do_page_flip: crtc 2 id=11, pipe=2 active? 0
[ 46067.000] sna_page_flip: page flipped 0 crtcs
[ 46067.000] page_flip: pageflip failed
[ 46067.000] sna_present_unflip: failed, trying to restore original mode
[ 46067.000] (II) intel(0): switch to mode 1366x768@60.1 on LVDS1 using pipe 0, position (277, 1080), rotation normal, reflection none

So I confuse the no-op with a failure to flip and proceed to hammer the CRTC back into shape - that also forces them awake again.
Comment 5 Chris Wilson 2014-07-17 09:09:05 UTC
commit 62f62f70eda97a3ef18c5144031fdf1cb2b7dad0
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jul 17 10:06:06 2014 +0100

    sna: Avoid confusing failure to flip and flipping zero CRTC
    
    During the present unflip path we blindly try to restore the original
    mode after a flip failure. However, it confuses flipping zero CRTC with
    a genuine failure. This has the result of undoing a DPMS change (e.g.
    xset dpms force dpms) under a DRI3 compositor.
    
    Reported-by: Jiri Slaby <jirislaby@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81456
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


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.