Bug 72864 - [BYT]igt/kms_cursor_crc fails with eDP
Summary: [BYT]igt/kms_cursor_crc fails with eDP
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Paulo Zanoni
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-19 06:17 UTC by lu hua
Modified: 2017-10-06 14:41 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg (56.60 KB, text/plain)
2013-12-19 06:17 UTC, lu hua
no flags Details
dmesg (124.86 KB, text/plain)
2014-05-04 07:26 UTC, Guo Jinxian
no flags Details
output (7.01 KB, text/plain)
2014-10-13 05:59 UTC, lu hua
no flags Details

Description lu hua 2013-12-19 06:17:52 UTC
Created attachment 90970 [details]
dmesg

System Environment:
--------------------------
Platform: BYT/BDW
kernel:   (drm-intel-nightly)02905525c3310ba673676f8041d0ff6be4da0e24

Bug detailed description:
---------------------------
It fails on BYT and BDW with eDP, If connect VGA, It works well.
I can't find out a good commit.

run ./kms_cursor_crc --run-subtest cursor-black-invisible-offscreen
output:
IGT-Version: 1.5-g2a71bff (x86_64) (Linux: 3.13.0-rc4_drm-intel-nightly_074fdf_20131219+ x86_64)
Beginning cursor-black-invisible-offscreen on crtc 3, connector 20
.Test assertion failure function do_single_test, file kms_cursor_crc.c:147:
Last errno: 0, Success
Failed assertion: igt_crc_equal(&crcs[0], &test_data->ref_crc)
Subtest cursor-black-invisible-offscreen: FAIL

Reproduce steps:
-------------------------
1. ./kms_cursor_crc --run-subtest cursor-black-invisible-offscreen
Comment 1 lu hua 2013-12-19 06:44:44 UTC
It's only happens on BYT

Following cases also have this issue on BYT:
igt/kms_pipe_crc_basic/read-crc-pipe-A
igt/kms_pipe_crc_basic/read-crc-pipe-A-frame-sequence
igt/kms_pipe_crc_basic/read-crc-pipe-B
igt/kms_pipe_crc_basic/read-crc-pipe-B-frame-sequence
igt/kms_flip/wf_vblank-vs-modeset
igt/kms_flip/wf_vblank-vs-modeset-interruptible
igt/kms_flip/rcs-wf_vblank-vs-modeset
igt/kms_flip/rcs-wf_vblank-vs-modeset-interruptible
igt/kms_flip/rcs-flip-vs-modeset
igt/kms_flip/rcs-flip-vs-modeset-interruptible
igt/kms_flip/flip-vs-rmfb
igt/kms_flip/flip-vs-rmfb-interruptible
igt/kms_flip/flip-vs-modeset
igt/kms_flip/flip-vs-modeset-vs-hang
igt/kms_flip/flip-vs-modeset-vs-hang-interruptible
igt/kms_flip/bcs-flip-vs-dpms
igt/kms_flip/bcs-flip-vs-modeset
igt/kms_flip/bcs-flip-vs-modeset-interruptible
Comment 2 Daniel Vetter 2013-12-19 08:14:20 UTC
Does it work with an external DP monitor?
Comment 3 lu hua 2013-12-20 05:30:51 UTC
(In reply to comment #2)
> Does it work with an external DP monitor?

DP doesn't work after loading i915 driver.Already reported 2 bugs on jira.
https://jira01.devtools.intel.com/browse/VIZ-3323
https://jira01.devtools.intel.com/browse/VIZ-3326
Comment 4 Gordon Jin 2013-12-20 07:11:44 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Does it work with an external DP monitor?
> 
> DP doesn't work after loading i915 driver.Already reported 2 bugs on jira.
> https://jira01.devtools.intel.com/browse/VIZ-3323
> https://jira01.devtools.intel.com/browse/VIZ-3326

also available on this bugzilla: bug#72896 and bug#72897
Comment 5 Ben Widawsky 2014-01-13 23:54:27 UTC
BDW doesn't currently have any platforms with VGA. The original description says: "If connect VGA, It works well"

Does this bug actually apply to BDW?
Comment 6 lu hua 2014-01-17 01:31:43 UTC
(In reply to comment #5)
> BDW doesn't currently have any platforms with VGA. The original description
> says: "If connect VGA, It works well"
> 
> Does this bug actually apply to BDW?

This issue only happens on BYT. Sorry for the confusion.
Comment 7 Daniel Vetter 2014-03-13 16:47:36 UTC
Ok, I've just pushed a patch onto dinq to at least remove the errornous WARN.

Please retest with latest -nightly.
Comment 8 lu hua 2014-03-14 06:49:19 UTC
It still fail on latest -nightly kernel.
output:
IGT-Version: 1.5-g9812768 (x86_64) (Linux: 3.14.0-rc6_drm-intel-nightly_b18596_20140314+ x86_64)
Beginning cursor-black-invisible-offscreen on pipe A, connector eDP-1
.Test assertion failure function do_single_test, file kms_cursor_crc.c:88:
Last errno: 0, Success
Failed assertion: igt_crc_equal(&crc, &test_data->ref_crc)
Subtest cursor-black-invisible-offscreen: FAIL
Comment 9 Daniel Vetter 2014-03-27 10:17:33 UTC
A few questions:

- Does this happen only on edp or also on other platforms?

- What is the health of the basic crc tests (kms_pipe_crc_basic) on byt with edp?
Comment 10 lu hua 2014-03-28 06:24:40 UTC
(In reply to comment #9)
> A few questions:
> 
> - Does this happen only on edp or also on other platforms?

It only happens on edp. It doesn't happen on other platforms.


> - What is the health of the basic crc tests (kms_pipe_crc_basic) on byt with
> edp?

kms_pipe_crc_basic was mentioned in Comment 1.
Comment 11 Jani Nikula 2014-04-10 12:51:15 UTC
Antti has been looking at kms_cursor_crc lately, reassigning to him.
Comment 12 Daniel Vetter 2014-04-11 13:10:51 UTC
So pipe CRC on byt eDP seems completely busted. Anyone got such a machine?
Comment 13 Guo Jinxian 2014-05-04 07:26:08 UTC
Created attachment 98403 [details]
dmesg

Subcases of kms_cursor_crc below also fail on BYT.
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


output:
IGT-Version: 1.6-gc1404e0 (x86_64) (Linux: 3.15.0-rc2_drm-intel-nightly_08ce66_20140503+ x86_64)
Beginning cursor-64-offscreen on pipe A, connector eDP-1
.Test assertion failure function do_single_test, file kms_cursor_crc.c:129:
Last errno: 0, Success
Failed assertion: igt_crc_equal(&crc, &ref_crc)
Subtest cursor-64-offscreen: FAIL
Comment 14 Guo Jinxian 2014-05-07 06:28:59 UTC
This bug is able to reproduce on HSW ULT too.
kernel: -nightly(30c8c9cd8bc88d6ae70f09d403e725b51e0bd7dd)
case list:
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


output:

./kms_cursor_crc --run-subtest cursor-64-sliding
IGT-Version: 1.6-g4bd9fe6 (x86_64) (Linux: 3.15.0-rc3_drm-intel-nightly_30c8c9_20140507+ x86_64)
Beginning cursor-64-sliding on pipe A, connector eDP-1
...Test assertion failure function do_single_test, file kms_cursor_crc.c:129:
Last errno: 0, Success
Failed assertion: igt_crc_equal(&crc, &ref_crc)
Subtest cursor-64-sliding: FAIL
Comment 15 Daniel Vetter 2014-05-15 21:45:05 UTC
(In reply to comment #13)
> Created attachment 98403 [details]
> dmesg
> 
> Subcases of kms_cursor_crc below also fail on BYT.
> 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
> 
> 
> output:
> IGT-Version: 1.6-gc1404e0 (x86_64) (Linux:
> 3.15.0-rc2_drm-intel-nightly_08ce66_20140503+ x86_64)
> Beginning cursor-64-offscreen on pipe A, connector eDP-1
> .Test assertion failure function do_single_test, file kms_cursor_crc.c:129:
> Last errno: 0, Success
> Failed assertion: igt_crc_equal(&crc, &ref_crc)
> Subtest cursor-64-offscreen: FAIL

Please open a new bug report for the BYT failure.

The hsw edp issue is something we know about, but byt should work. So different bug.
Comment 16 Guo Jinxian 2014-05-23 06:09:12 UTC
This issue still able to reproduce on BDW
Case list:
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-onscreen
igt/kms_cursor_crc/cursor-256-random
igt/kms_cursor_crc/cursor-256-sliding
igt/kms_cursor_crc/cursor-64-onscreen
igt/kms_cursor_crc/cursor-64-random
igt/kms_cursor_crc/cursor-64-sliding

Output:
./kms_cursor_crc --run-subtest cursor-64-onscreen
IGT-Version: 1.6-gc75dcbd (x86_64) (Linux: 3.15.0-rc6_drm-intel-nightly_de544d_20140523+ x86_64)
Beginning cursor-64-onscreen on pipe A, connector eDP-1
............................
cursor-64-onscreen on pipe A, connector eDP-1: PASSED

Beginning cursor-64-onscreen on pipe B, connector eDP-1
.Test assertion failure function do_single_test, file kms_cursor_crc.c:129:
Last errno: 0, Success
Failed assertion: igt_crc_equal(&crc, &ref_crc)
Subtest cursor-64-onscreen: FAIL
Comment 17 Paulo Zanoni 2014-10-09 18:56:49 UTC
The problem is that it takes some time for the CRC value to stabilize. If we wait for 100 vblanks (instead of just one) before getting the pipe CRC, it's very likely that the test won't fail!
Comment 18 Paulo Zanoni 2014-10-10 21:46:16 UTC
Ok, so I did some more investigation... The problem only appears to happen on pipe A. Arthur suggested that some package C state may be interfering with memory/caches, and the HW is calculating CRC the result based on a wrong input.

So I did some test, and if we keep the i915_forcewake_user file open, the problem _does not_ happen.

The easiest way I found to test this is:

- open a terminal
- become root
- run "irb"
- on its prompt, type: "a = File.open("/sys/kernel/debug/dri/0/i915_forcewake_user")"
- leave this terminal as it is
- open a new terminal
- run sudo ./kms_cursor_crc

The test will succeed!

For the real fix, I guess we have to find a way to prevent deep PC states whenever we're calculating CRCs for pipe A...
Comment 19 lu hua 2014-10-13 05:59:06 UTC
Created attachment 107757 [details]
output

(In reply to Paulo Zanoni from comment #18)
> Ok, so I did some more investigation... The problem only appears to happen
> on pipe A. Arthur suggested that some package C state may be interfering
> with memory/caches, and the HW is calculating CRC the result based on a
> wrong input.
> 
> So I did some test, and if we keep the i915_forcewake_user file open, the
> problem _does not_ happen.
> 
> The easiest way I found to test this is:
> 
> - open a terminal
> - become root
> - run "irb"
> - on its prompt, type: "a =
> File.open("/sys/kernel/debug/dri/0/i915_forcewake_user")"
> - leave this terminal as it is
> - open a new terminal
> - run sudo ./kms_cursor_crc
> 
> The test will succeed!
> 
> For the real fix, I guess we have to find a way to prevent deep PC states
> whenever we're calculating CRCs for pipe A...


Attached output.
Comment 20 Paulo Zanoni 2014-10-17 21:43:33 UTC
Please test this patch: http://patchwork.freedesktop.org/patch/35237/

It solves the problem for me, on BDW.
Comment 21 lu hua 2014-10-20 06:07:42 UTC
(In reply to Paulo Zanoni from comment #20)
> Please test this patch: http://patchwork.freedesktop.org/patch/35237/
> 
> It solves the problem for me, on BDW.

Test on latest -nightly kernel, It works well on BDW. It still fails on BYT.

Apply this patch and test on BYT, it still fails.
output:
IGT-Version: 1.8-gbba1cd0 (x86_64) (Linux: 3.17.0_kcloud_1fae80_20141020+ x86_64)
Beginning cursor-128x128-offscreen on pipe A, connector eDP-1
.Test assertion failure function do_single_test, file kms_cursor_crc.c:131:
Failed assertion: igt_crc_equal(&crc, &ref_crc)
Subtest cursor-128x128-offscreen: FAIL (3.246s)
Comment 22 Paulo Zanoni 2014-10-22 13:10:09 UTC
The patch I wrote for HSW/BDW was merged, so now only the BYT problem remains. The BYT fix is certainly going to be different from the HSW/BDW fix.

To make things more organized, and reduce the confusion probability it would be nice if we could close this bug, then report a new one just for BYT, redo the tests and list the set of subtests that still fail on BYT, along with their dmesg output. Or we could do this on this bug anyway.
Comment 23 lu hua 2014-10-23 03:29:03 UTC
It works well on HSW ULT and BDW, but still fails on BYT.
Report bug 85351 to track BYT's fail, and close it.
Comment 24 lu hua 2014-10-23 03:29:23 UTC
Verified.Fixed.
Comment 25 Elizabeth 2017-10-06 14:41:10 UTC
Closing old verified.


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.