Bug 35903

Summary: [915GM bisected] Two black flickers when probing inputs with drm-intel-fixes
Product: DRI Reporter: Sitsofe Wheeler <sitsofe>
Component: DRM/IntelAssignee: Chris Wilson <chris>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: medium CC: jbarnes
Version: XOrg git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
git bisection log
none
intel_reg_dumper output for 9db reverted
none
intel_reg_dumper output for 9db
none
intel_reg_dumper output for intel-fixes + spurious inputs fix
none
drm/i915/tv: Fix modeset flickering introduced in 7f58aabc369014fda3a4a33604ba0a1b63b941ac none

Description Sitsofe Wheeler 2011-04-02 03:22:03 UTC
Description of the problem:
When Plymouth/Xorg is starting or when xrandr is run the screen goes black then comes back then goes black then comes back in the space of about a second.


Steps to reproduce:
1. Start EeePC .
2. Let the boot finish and log in.
3. Start a terminal and run
xrandr

Expected result:
Extra text to appear in the terminal.

Actual result:
Before xrandr prints the text, the whole screen will go black then return then go black and then return again within the space of about a second creating a flickering effect.

How reproducible is the problem:
The problem is reproducible every time.

Version information:
EeePC 900
Ubuntu 10.04 (so an old xorg)
Kernel: 7f58aabc369014fda3a4a33604ba0a1b63b941ac (drm-intel-fixes)

Additional information:
This problem does not occur on 2.6.38 or below. A bisection narrowed it down to the following commit:

commit 9db4a9c7b2a3bd5b4952846bc0c2f58daa80ddd7
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Mon Feb 7 12:26:52 2011 -0800

    drm/i915: cleanup per-pipe reg usage
    
    We had some conversions over to the _PIPE macros, but didn't get
    everything.  So hide the per-pipe regs with an _ (still used in a few
    places for legacy) and add a few _PIPE based macros, then make sure
    everyone uses them.
    
    [update: remove usage of non-existent no-op macro]
    [update 2: keep modesetting suspend/resume code, update to new reg names]
    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
    [ickle: stylistic cleanups for checkpatch and taste]
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reverting this makes the problem go away.

While a later patch ( 548f245ba6a318ef93f4d79bcc15cfe59a86f0d5 ) fixes the double height cursor that 9db4a9c7b2a3bd5b4952846bc0c2f58daa80ddd7 introduces, it does not fix the flickering.
Comment 1 Sitsofe Wheeler 2011-04-02 03:24:46 UTC
Created attachment 45155 [details]
git bisection log
Comment 2 Chris Wilson 2011-04-02 03:25:29 UTC
Let's compare the output of intel_reg_dumper with 9db4a9c7b2a3bd5b4952846bc0c2f58daa80ddd7^ and drm-intel-fixes.
Comment 3 Sitsofe Wheeler 2011-04-02 04:32:16 UTC
--- intel_reg_dumper.9db-reverted       2011-04-02 12:12:02.359380868 +0100
+++ intel_reg_dumper.7f5-dirty  2011-04-02 12:29:00.771442065 +0100
@@ -42,7 +42,7 @@
         PP_ON_DELAYS: 0x025807d0
        PP_OFF_DELAYS: 0x01f407d0
           PP_DIVISOR: 0x00251b05
-        PFIT_CONTROL: 0x00000000
+        PFIT_CONTROL: 0x00000008
      PFIT_PGM_RATIOS: 0x00000000
      PORT_HOTPLUG_EN: 0x00000000
    PORT_HOTPLUG_STAT: 0x00000000
@@ -55,7 +55,7 @@
          DSPATILEOFF: 0x00000000
            PIPEACONF: 0x80000000 (enabled, single-wide)
             PIPEASRC: 0x04ff03ff (1280, 1024)
-           PIPEASTAT: 0x84040203 (status: FIFO_UNDERRUN SVBLANK_INT_ENABLE VSYNC_INT_STATUS VBLANK_INT_STATUS OREG_UPDATE_STATUS)
+           PIPEASTAT: 0x80000203 (status: FIFO_UNDERRUN VSYNC_INT_STATUS VBLANK_INT_STATUS OREG_UPDATE_STATUS)
    PIPEA_GMCH_DATA_M: 0x00000000
    PIPEA_GMCH_DATA_N: 0x00000000
      PIPEA_DP_LINK_M: 0x00000000
@@ -79,7 +79,7 @@
           DSPBSTRIDE: 0x00000a00 (2560 bytes)
              DSPBPOS: 0x00000000 (0, 0)
             DSPBSIZE: 0x03ff04ff (1280, 1024)
-            DSPBBASE: 0x00000000
+            DSPBBASE: 0x0012c000
             DSPBSURF: 0x00000000
          DSPBTILEOFF: 0x00000000
            PIPEBCONF: 0x80000000 (enabled, single-wide)
@@ -195,6 +195,6 @@
             FENCE  5: 0x00000000 (disabled)
             FENCE  6: 0x00000000 (disabled)
             FENCE  7: 0x00000000 (disabled)
-             INST_PM: 0x00000000
+             INST_PM: 0x00000800
 pipe A dot 108000 n 2 m1 14 m2 8 p1 2 p2 10
 pipe B dot 50057 n 3 m1 11 m2 6 p1 2 p2 14
Comment 4 Sitsofe Wheeler 2011-04-02 04:53:52 UTC
Created attachment 45158 [details]
intel_reg_dumper output for 9db reverted

intel_reg_dumper output for a reverted 9db4a9c7b2a3bd5b4952846bc0c2f58daa80ddd7 (so effectively 8d7e3de1e019238211fa06e109437a13cae62004)
Comment 5 Sitsofe Wheeler 2011-04-02 04:55:05 UTC
Created attachment 45159 [details]
intel_reg_dumper output for 9db

intel_reg_dumper output for 9db4a9c7b2a3bd5b4952846bc0c2f58daa80ddd7 .
Comment 6 Sitsofe Wheeler 2011-04-02 04:58:41 UTC
Created attachment 45160 [details]
intel_reg_dumper output for intel-fixes + spurious inputs fix

intel_reg_dumper output for 7f58aabc369014fda3a4a33604ba0a1b63b941ac + a fix to detect attached outputs correctly (so that at least the screen resolution used between all the dumps is the same).
Comment 7 Sitsofe Wheeler 2011-04-09 10:32:22 UTC
Created attachment 45445 [details] [review]
drm/i915/tv: Fix modeset flickering introduced in 7f58aabc369014fda3a4a33604ba0a1b63b941ac

The tidy ups in 7f58aabc369014fda3a4a33604ba0a1b63b941ac ("drm/i915: cleanup per-pipe reg usage") changed intel_crtc->plane to intel_crtc->pipe in intel_tv_mode_set(). This caused the screen to quickly turn off before returning whenever modesetting/mode probing took place on my 915GM EeePC 900 creating a flickering effect. This patch changes intel_crtc->pipe back to intel_crtc->plane which solves the problem for me.

References: https://bugs.freedesktop.org/show_bug.cgi?id=35903
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Comment 8 Chris Wilson 2011-04-09 12:01:06 UTC
Thanks Sitosfe!
Comment 9 Chris Wilson 2011-04-13 04:05:03 UTC
Sitsofe, thanks for the patch:

commit ccacfec6cc22157971bd970486fd3fd4972b8e2e
Author: Sitsofe Wheeler <sitsofe@yahoo.com>
Date:   Tue Apr 12 06:51:39 2011 +0100

    drm/i915/tv: Fix modeset flickering introduced in 7f58aabc3
    
    The tidy ups in 7f58aabc369014fda3a4a33604ba0a1b63b941ac ("drm/i915:
    cleanup per-pipe reg usage") changed intel_crtc->plane to intel_crtc->pipe i
    intel_tv_mode_set(). This caused the screen to quickly turn off before
    returning whenever modesetting/mode probing took place on my 915GM EeePC
    900 creating a flickering effect. This patch changes intel_crtc->pipe back
    to intel_crtc->plane which solves the problem for me.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=35903
    Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
    Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Humbly-acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
    Signed-off-by: Keith Packard <keithp@keithp.com>
Comment 10 Sitsofe Wheeler 2011-04-13 08:49:16 UTC
A quick note in case anyone arrives at this bug report via the reference link in the commit - the commit id 7f58aabc369014fda3a4a33604ba0a1b63b941ac is incorrect and is not the clean up commit that introduced the problem! It should have been 9db4a9c7b2a3bd5b4952846bc0c2f58daa80ddd7 ...

Sorry!
Comment 11 Chris Wilson 2011-04-13 08:51:31 UTC
/me mutters the one I had in my tree had the corrected changelogs...

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.