Bug 83640

Summary: [BDW] Missing VBlank interuptions on some pipes making some kms tests and subcases fail
Product: DRI Reporter: Guo Jinxian <jinxianx.guo>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: critical    
Priority: high CC: intel-gfx-bugs, przanoni
Version: unspecifiedKeywords: bisect_pending
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg
none
Possible fix none

Description Guo Jinxian 2014-09-09 02:31:42 UTC
Created attachment 105941 [details]
dmesg

==System Environment==
--------------------------
Regression: Yes.
Bisected

Non-working platforms: BDW

==kernel==
--------------------------
origin/drm-intel-nightly: 4a3d32734bdcef6813b31f06a58430436e98711e(fails)
    drm-intel-nightly: 2014y-09m-08d-18h-33m-01s integration manifest
origin/drm-intel-next-queued: 9c787942907face82da505c2c5493998b56cfc5a(fails)
    drm/i915: Decouple the stuck pageflip on modeset
origin/drm-intel-fixes: 25fc92b99f65bec7d7c747c0305f048d7b19cc44(fails)
    drm/i915: Fix EIO/wedged handling in gem fault handler

==Bug detailed description==
-----------------------------
igt/kms_plane some subcases fail

Case list:
igt/kms_plane/plane-panning-bottom-right-pipe-B-plane-1
igt/kms_plane/plane-panning-bottom-right-pipe-B-plane-2
igt/kms_plane/plane-panning-bottom-right-pipe-C-plane-1
igt/kms_plane/plane-panning-bottom-right-pipe-C-plane-2
igt/kms_plane/plane-panning-top-left-pipe-B-plane-1
igt/kms_plane/plane-panning-top-left-pipe-B-plane-2
igt/kms_plane/plane-panning-top-left-pipe-C-plane-1
igt/kms_plane/plane-panning-top-left-pipe-C-plane-2
igt/kms_plane/plane-position-covered-pipe-B-plane-1
igt/kms_plane/plane-position-covered-pipe-B-plane-2
igt/kms_plane/plane-position-covered-pipe-C-plane-1
igt/kms_plane/plane-position-covered-pipe-C-plane-2
igt/kms_plane/plane-position-hole-pipe-B-plane-1
igt/kms_plane/plane-position-hole-pipe-B-plane-2
igt/kms_plane/plane-position-hole-pipe-C-plane-1
igt/kms_plane/plane-position-hole-pipe-C-plane-2

Output:
root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_plane --run-subtest plane-position-covered-pipe-C-plane-1
IGT-Version: 1.7-gac3d060 (x86_64) (Linux: 3.17.0-rc2_drm-intel-nightly_51c49e_20140908+ x86_64)
Testing connector eDP-1 using pipe C plane 1
Test assertion failure function igt_wait_for_vblank, file igt_kms.c:1707:
Failed assertion: drmWaitVBlank(drm_fd, &wait_vbl) == 0
Last errno: 16, Device or resource busy
Subtest plane-position-covered-pipe-C-plane-1: FAIL (4.073s)
root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# echo $?
99

==Reproduce steps==
---------------------------- 
1. ./kms_plane --run-subtest plane-position-covered-pipe-C-plane-1

==Bisect results==
----------------------------
Bisect shows: ab60c84d87edffe6555fc9f1703e8f9074d06416 is the first bad commit
commit ab60c84d87edffe6555fc9f1703e8f9074d06416
Author:     Ville Syrjälä <ville.syrjala@linux.intel.com>
AuthorDate: Mon Sep 1 18:08:25 2014 +0300
Commit:     Daniel Vetter <daniel.vetter@ffwll.ch>
CommitDate: Tue Sep 2 17:25:47 2014 +0200

    drm/i915: Don't call intel_plane_restore() when the prop value didn't change
    
    No point in calling intel_plane_restore() in .set_property() if the
    value didn't change.
    
    More importantly this papers over a bug where the current primary plane
    code forgets to update the user coordinates we store under intel_plane
    unless the primary plane .update_plane() hook is actually called. This
    means we have 0 in the coordinates straight after boot and any call
    to intel_restore_plane() (such as from restore_fbdev_mode()) will
    actually turn off the primary plane. This mess needs to be fixed properly
    but that's a bigger task and the first step there is killing off
    intel_pipe_set_base() and just calling the primary plane
    .update_plane() hook. For the immediate problem of black screen after
    boot this small patch is enough to hide it.
    
    The problem originates from these two commits:
     commit 3a5f87c286515c54ff5c52c3e64d0c522b7570c0
     Author: Thomas Wood <thomas.wood@intel.com>
     Date:   Wed Aug 20 14:45:00 2014 +0100
    
        drm: fix plane rotation when restoring fbdev configuration
    
     commit d91a2cb8e5104233c02bbde539bd4ee455ec12ac
     Author: Sonika Jindal <sonika.jindal@intel.com>
     Date:   Fri Aug 22 14:06:04 2014 +0530
    
        drm/i915: Add 180 degree primary plane rotation support
    
    Cc: Thomas Wood <thomas.wood@intel.com>
    Cc: Sonika Jindal <sonika.jindal@intel.com>
    Tested-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
    Tested-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Comment 1 Jani Nikula 2014-09-09 07:30:39 UTC
See also https://bugs.freedesktop.org/show_bug.cgi?id=81410
Comment 2 Guo Jinxian 2014-09-17 07:27:43 UTC
This failure is able to reproduce while running tests below

igt/kms_cursor_crc/cursor-128-offscreen
igt/kms_cursor_crc/cursor-128-onscreen
igt/kms_cursor_crc/cursor-128-random
igt/kms_cursor_crc/cursor-128-sliding
igt/kms_cursor_crc/cursor-256-offscreen
igt/kms_cursor_crc/cursor-256-onscreen
igt/kms_cursor_crc/cursor-256-random
igt/kms_cursor_crc/cursor-256-sliding
igt/kms_cursor_crc/cursor-64-offscreen
igt/kms_cursor_crc/cursor-64-onscreen
igt/kms_cursor_crc/cursor-64-random
igt/kms_cursor_crc/cursor-64-sliding
igt/kms_cursor_crc/cursor-size-change

root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_cursor_crc --run-subtest cursor-128-offscreenIGT-Version: 1.8-g137877f (x86_64) (Linux: 3.17.0-rc5_drm-intel-nightly_ab7f1a_20140917+ x86_64)
Beginning cursor-128-offscreen on pipe A, connector eDP-1
....................................................
cursor-128-offscreen on pipe A, connector eDP-1: PASSED

Test assertion failure function igt_wait_for_vblank, file igt_kms.c:1707:
Failed assertion: drmWaitVBlank(drm_fd, &wait_vbl) == 0
Last errno: 16, Device or resource busy
Subtest cursor-128-offscreen: FAIL (12.173s)
Comment 3 lu hua 2014-09-24 06:40:56 UTC
It impacts about 40 cases. 

igt/kms_cursor_crc/cursor-128x128-offscreen
igt/kms_cursor_crc/cursor-128x128-onscreen
igt/kms_cursor_crc/cursor-128x128-random
igt/kms_cursor_crc/cursor-128x128-sliding
gt/kms_cursor_crc/cursor-256x256-offscreen
igt/kms_cursor_crc/cursor-256x256-onscreen
igt/kms_cursor_crc/cursor-256x256-random
igt/kms_cursor_crc/cursor-256x256-sliding
igt/kms_cursor_crc/cursor-64x64-offscreen
igt/kms_cursor_crc/cursor-64x64-onscreen
igt/kms_cursor_crc/cursor-64x64-random
igt/kms_cursor_crc/cursor-64x64-sliding
igt/kms_cursor_crc/cursor-size-change
igt/kms_cursor_crc/cursor-128x42-offscreen
igt/kms_cursor_crc/cursor-128x42-onscreen
igt/kms_cursor_crc/cursor-128x42-random
igt/kms_cursor_crc/cursor-128x42-sliding
igt/kms_cursor_crc/cursor-256x85-offscreen
igt/kms_cursor_crc/cursor-256x85-onscreen
igt/kms_cursor_crc/cursor-256x85-random
igt/kms_cursor_crc/cursor-256x85-sliding
igt/kms_cursor_crc/cursor-64x21-offscreen
igt/kms_cursor_crc/cursor-64x21-onscreen
igt/kms_cursor_crc/cursor-64x21-random
igt/kms_cursor_crc/cursor-64x21-sliding

igt/kms_plane/plane-panning-bottom-right-pipe-B-plane-1
igt/kms_plane/plane-panning-bottom-right-pipe-B-plane-2
igt/kms_plane/plane-panning-bottom-right-pipe-C-plane-1
igt/kms_plane/plane-panning-bottom-right-pipe-C-plane-2
igt/kms_plane/plane-panning-top-left-pipe-B-plane-1
igt/kms_plane/plane-panning-top-left-pipe-B-plane-2
igt/kms_plane/plane-panning-top-left-pipe-C-plane-1
igt/kms_plane/plane-panning-top-left-pipe-C-plane-2
igt/kms_plane/plane-position-covered-pipe-B-plane-1
igt/kms_plane/plane-position-covered-pipe-B-plane-2
igt/kms_plane/plane-position-covered-pipe-C-plane-1
igt/kms_plane/plane-position-covered-pipe-C-plane-2
igt/kms_plane/plane-position-hole-pipe-B-plane-1
igt/kms_plane/plane-position-hole-pipe-B-plane-2
igt/kms_plane/plane-position-hole-pipe-C-plane-1
igt/kms_plane/plane-position-hole-pipe-C-plane-2
Comment 4 Rodrigo Vivi 2014-09-26 19:35:50 UTC
Hi Guo,

Could you please revert this patch to validate the bisect?

I don't believe this bisect result is valid and tested here and still face the issue with the revert.

So if you face the same could you please bisect a little further to find the proper ofending commit?
Comment 5 Guo Jinxian 2014-09-28 05:24:23 UTC
(In reply to comment #4)
> Hi Guo,
> 
> Could you please revert this patch to validate the bisect?
> 
> I don't believe this bisect result is valid and tested here and still face
> the issue with the revert.
> 
> So if you face the same could you please bisect a little further to find the
> proper ofending commit?

Yes, The bisect result is invalid. I tried on both kernel and igt, and doesn't find good commit.

I tried rollback igt to commit(c12f292b1d8bbc61b65f1dfc3fd4a9e1e286dbee), and found the failure is same as bug 81377. This bug should be duplicated with bug 81377.

root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_plane --run-subtest plane-position-covered-pipe-C-plane-1
IGT-Version: 1.7-gc12f292 (x86_64) (Linux: 3.17.0-rc6_drm-intel-nightly_7101d8_20140928+ x86_64)
Testing connector eDP-1 using pipe C plane 1
Test assertion failure function igt_wait_for_vblank, file igt_kms.c:1589:
Failed assertion: drmWaitVBlank(drm_fd, &wait_vbl) == 0
Last errno: 16, Device or resource busy
Subtest plane-position-covered-pipe-C-plane-1: FAIL
Comment 6 Rodrigo Vivi 2014-10-02 22:17:45 UTC
VBlank interruption aren't coming on Pipe C on BDW. This is making many different kms test cases to fail.
Comment 7 Paulo Zanoni 2014-10-07 12:34:09 UTC
Created attachment 107489 [details] [review]
Possible fix

Hi

Can you please test this patch? It fixes some problems I can reproduce.

Thanks,
Paulo
Comment 8 Rodrigo Vivi 2014-10-07 17:31:39 UTC
This patch fix the issues I was facing.
Comment 9 Guo Jinxian 2014-10-08 03:10:58 UTC
(In reply to Paulo Zanoni from comment #7)
> Created attachment 107489 [details] [review] [review]
> Possible fix
> 
> Hi
> 
> Can you please test this patch? It fixes some problems I can reproduce.
> 
> Thanks,
> Paulo

The failure unable to reproduce with this patch.

root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_plane --run-subtest plane-position-covered-pipe-C-plane-1
IGT-Version: 1.8-g6a8d33c (x86_64) (Linux: 3.17.0-rc5_kcloud_89363e_20141008+ x86_64)
Test requirement not met in function drm_open_any_master, file drmtest.c:341:
Test requirement: drmSetMaster(fd) == 0
Can't become DRM master, please check if no other DRM client is running.
Last errno: 22, Invalid argument
Subtest plane-position-covered-pipe-C-plane-1: SKIP
root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_plane --run-subtest plane-panning-bottom-right-pipe-B-plane-1
IGT-Version: 1.8-g6a8d33c (x86_64) (Linux: 3.17.0-rc5_kcloud_89363e_20141008+ x86_64)
Test requirement not met in function drm_open_any_master, file drmtest.c:341:
Test requirement: drmSetMaster(fd) == 0
Can't become DRM master, please check if no other DRM client is running.
Last errno: 22, Invalid argument
Subtest plane-panning-bottom-right-pipe-B-plane-1: SKIP
root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_plane --run-subtest plane-position-hole-pipe-B-plane-1
IGT-Version: 1.8-g6a8d33c (x86_64) (Linux: 3.17.0-rc5_kcloud_89363e_20141008+ x86_64)
Testing connector eDP-1 using pipe B plane 1
Subtest plane-position-hole-pipe-B-plane-1: SUCCESS (2.296s)
Comment 10 Paulo Zanoni 2014-10-08 13:48:07 UTC
(In reply to Guo Jinxian from comment #9)
> (In reply to Paulo Zanoni from comment #7)
> > Created attachment 107489 [details] [review] [review] [review]
> > Possible fix
> > 
> > Hi
> > 
> > Can you please test this patch? It fixes some problems I can reproduce.
> > 
> > Thanks,
> > Paulo
> 
> The failure unable to reproduce with this patch.
> 
> root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_plane
> --run-subtest plane-position-covered-pipe-C-plane-1
> IGT-Version: 1.8-g6a8d33c (x86_64) (Linux:
> 3.17.0-rc5_kcloud_89363e_20141008+ x86_64)
> Test requirement not met in function drm_open_any_master, file drmtest.c:341:
> Test requirement: drmSetMaster(fd) == 0
> Can't become DRM master, please check if no other DRM client is running.

Please retest. This error message suggests you had another DRM master application running.


> Last errno: 22, Invalid argument
> Subtest plane-position-covered-pipe-C-plane-1: SKIP
> root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_plane
> --run-subtest plane-panning-bottom-right-pipe-B-plane-1
> IGT-Version: 1.8-g6a8d33c (x86_64) (Linux:
> 3.17.0-rc5_kcloud_89363e_20141008+ x86_64)
> Test requirement not met in function drm_open_any_master, file drmtest.c:341:
> Test requirement: drmSetMaster(fd) == 0
> Can't become DRM master, please check if no other DRM client is running.

Same here.


> Last errno: 22, Invalid argument
> Subtest plane-panning-bottom-right-pipe-B-plane-1: SKIP
> root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_plane
> --run-subtest plane-position-hole-pipe-B-plane-1
> IGT-Version: 1.8-g6a8d33c (x86_64) (Linux:
> 3.17.0-rc5_kcloud_89363e_20141008+ x86_64)
> Testing connector eDP-1 using pipe B plane 1
> Subtest plane-position-hole-pipe-B-plane-1: SUCCESS (2.296s)
Comment 11 Jani Nikula 2014-10-08 13:51:10 UTC
Fixed pushed to drm-intel-next-fixes as

commit 1180e20606fd7c5d76dc5b2a1594fa51ba5a0f31
Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
Date:   Tue Oct 7 18:02:52 2014 -0300

    drm/i915: properly reenable gen8 pipe IRQs

Please retest with nightly.
Comment 12 Guo Jinxian 2014-10-11 02:18:45 UTC
Verified on latest -nightly(ea4bec8e96ea8b33b49a7892c1c7f20041a56da6)

root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_plane --run-subtest plane-position-covered-pipe-C-plane-1
IGT-Version: 1.8-gb7d80d1 (x86_64) (Linux: 3.17.0_drm-intel-nightly_ea4bec_20141010+ x86_64)
Testing connector eDP-1 using pipe C plane 1
Subtest plane-position-covered-pipe-C-plane-1: SUCCESS (2.235s)
Comment 13 Jari Tahvanainen 2017-09-04 10:27:48 UTC
Closing old verified+fixed.

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.