Bug 89833

Summary: [ All bisected] igt/kms_fbc_crc cases fail
Product: DRI Reporter: ye.tian <yex.tian>
Component: DRM/IntelAssignee: Thomas Wood <thomas.wood>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: intel-gfx-bugs
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg info
none
tests/kms_fbc_crc: fix fread() return value assertion none

Description ye.tian 2015-03-31 08:06:19 UTC
Created attachment 114750 [details]
dmesg info

System Environment:       
-----------------------------------------------------
Regression: Yes, igt
Non-working platforms: all

==Kernel==
--------------------------------------------------
commit ff2304504e2b6f0b5877021d4057271e7cf237ee
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Mar 30 17:41:51 2015 +0200

    drm-intel-nightly: 2015y-03m-30d-15h-41m-14s UTC integration manifest

==Bug detailed description==

igt/kms_fbc_crc cases fail. 
It’s igt regression, By bisected, show the first bad commit is 47f6b1.
commit 47f6b1305cc3752f318a555b932e194e1500c1d8
Author:     Thomas Wood <thomas.wood@intel.com>
AuthorDate: Wed Mar 25 16:42:57 2015 +0000
Commit:     Thomas Wood <thomas.wood@intel.com>
CommitDate: Thu Mar 26 15:50:59 2015 +0000

    igt.cocci: check the return values of various functions
    
    Add rules to fix unused-result warnings when compiling with
    _FORTIFY_SOURCE defined and apply them to the library and tests.

Output:
[root@x-ivb6 tests]# ./kms_fbc_crc
IGT-Version: 1.10-g068f9ce (x86_64) (Linux: 4.0.0-rc6_drm-intel-nightly_ff2304_20150331+ x86_64)
Test assertion failure function __real_main493, file kms_fbc_crc.c:513:
Failed assertion: fread(buf, sizeof(buf), 1, status) == sizeof(buf)
error: 0 != 64
Stack trace:
  #0 [__igt_fail_assert+0xfc]
  #1 [__real_main493+0x1194]
  #2 [main+0x21]
  #3 [__libc_start_main+0xf5]
  #4 [_start+0x29]
  #5 [<unknown>+0x29]
Test kms_fbc_crc failed.
**** DEBUG ****
(kms_fbc_crc:5079) igt-core-DEBUG: Test requirement passed: !igt_run_in_simulation()
Test requirement passed: fd >= 0
Test requirement passed: fd >= 0
Test requirement passed: drmSetMaster(fd) == 0
VT: graphics mode set (mode was 0x0)
Test requirement passed: ctl
Test requirement passed: (written == strlen(cmd) && ret == 0) || errno != ENODEV
Test requirement passed: status
Test assertion failure function __real_main493, file kms_fbc_crc.c:513:
Failed assertion: fread(buf, sizeof(buf), 1, status) == sizeof(buf)
error: 0 != 64
****  END  ****
Subtest page_flip: FAIL
Subtest mmap_cpu: FAIL
Subtest mmap_gtt: FAIL
Subtest blt: FAIL
Subtest render: FAIL
Subtest context: FAIL
Subtest page_flip_and_mmap_cpu: FAIL
Subtest page_flip_and_mmap_gtt: FAIL
Subtest page_flip_and_blt: FAIL
Subtest page_flip_and_render: FAIL
Subtest page_flip_and_context: FAILReproduce steps:
----------------------------
1, ./ kms_fbc_crc
Comment 1 ye.tian 2015-04-01 09:00:00 UTC
./kms_vblank --run-subtest query-busy also fail.  
 The same one igt commit(47f6b130).
Comment 2 Thomas Wood 2015-04-02 10:58:03 UTC
Created attachment 114826 [details] [review]
tests/kms_fbc_crc: fix fread() return value assertion

Please test that the attached patch fixes the issue with kms_fbc_crc.


The issue with kms_vblank should be fixed by the following commit:

commit 590e47c94fd81a182e24b41a715d84491df8cea8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Apr 2 11:37:23 2015 +0100

    igt/kms_vblank: Include a test for comparing blocking drmWaitVblank
Comment 3 Yi Sun 2015-04-03 01:18:06 UTC
(In reply to Thomas Wood from comment #2)
> Created attachment 114826 [details] [review] [review]
> tests/kms_fbc_crc: fix fread() return value assertion
> 
> Please test that the attached patch fixes the issue with kms_fbc_crc.
> 
> 
> The issue with kms_vblank should be fixed by the following commit:
> 
> commit 590e47c94fd81a182e24b41a715d84491df8cea8
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Thu Apr 2 11:37:23 2015 +0100
> 
>     igt/kms_vblank: Include a test for comparing blocking drmWaitVblank

Hi Thomas, don't forget changing the bug status to NEEDINFO/RESOLVED any time you need further information from QA or the bug can be fixed probably.
That can protect QA from escaping the bug updating. Thanks. :p
Comment 4 ye.tian 2015-04-03 05:53:03 UTC
(In reply to Thomas Wood from comment #2)
> Created attachment 114826 [details] [review] [review]
> tests/kms_fbc_crc: fix fread() return value assertion
> 
> Please test that the attached patch fixes the issue with kms_fbc_crc.

Tested it on igt(e8457ed) with this patch on BDW and IVB,this issue still exists.

output:
--------------
root@x-bdw01:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_fbc_crc
IGT-Version: 1.10-g4f2d6f7 (x86_64) (Linux: 4.0.0-rc6_drm-intel-nightly_333cf6_20150403+ x86_64)
Test requirement not met in function __real_main493, file kms_fbc_crc.c:519:
Test requirement: !strstr(buf, "unsupported by this chipset") && !strstr(buf, "disabled per module param") && !strstr(buf, "disabled per chip default")
FBC not supported/enabled
Subtest page_flip: SKIP
Subtest mmap_cpu: SKIP
Subtest mmap_gtt: SKIP
Subtest blt: SKIP
Subtest render: SKIP
Subtest context: SKIP
Subtest page_flip_and_mmap_cpu: SKIP
Subtest page_flip_and_mmap_gtt: SKIP
Subtest page_flip_and_blt: SKIP
Subtest page_flip_and_render: SKIP
Subtest page_flip_and_context: SKIP


 
> The issue with kms_vblank should be fixed by the following commit:
> 
> commit 590e47c94fd81a182e24b41a715d84491df8cea8
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Thu Apr 2 11:37:23 2015 +0100
> 
>     igt/kms_vblank: Include a test for comparing blocking drmWaitVblank

Tested it on igt (e8457edb) and the latest nightly kernel, kms_vblank case is good.
Comment 5 Thomas Wood 2015-04-07 08:59:33 UTC
(In reply to ye.tian from comment #4)
> (In reply to Thomas Wood from comment #2)
> > Created attachment 114826 [details] [review] [review] [review]
> > tests/kms_fbc_crc: fix fread() return value assertion
> > 
> > Please test that the attached patch fixes the issue with kms_fbc_crc.
> 
> Tested it on igt(e8457ed) with this patch on BDW and IVB,this issue still
> exists.
> 

The results show the tests now skip rather than fail. Please compare with the original status of the tests before the regression.
Comment 6 ye.tian 2015-04-07 09:40:37 UTC
(In reply to Thomas Wood from comment #5)
> (In reply to ye.tian from comment #4)
> > (In reply to Thomas Wood from comment #2)
> > > Created attachment 114826 [details] [review] [review] [review] [review]
> > > tests/kms_fbc_crc: fix fread() return value assertion
> > > 
> > > Please test that the attached patch fixes the issue with kms_fbc_crc.
> > 
> > Tested it on igt(e8457ed) with this patch on BDW and IVB,this issue still
> > exists.
> > 
> 
> The results show the tests now skip rather than fail. Please compare with
> the original status of the tests before the regression.

The output status is the same.

output:
[root@x-ivb6 tests]# ./kms_fbc_crc
IGT-Version: 1.10-g0c4dd28 (x86_64) (Linux: 4.0.0-rc6_drm-intel-fixes_840a1c_20150403_debug+x86_64)
Test requirement not met in function __real_main493, file kms_fbc_crc.c:519:
Test requirement: !strstr(buf, "unsupported by this chipset") && !strstr(buf, "disabled per module param") && !strstr(buf, "disabled per chip default")
FBC not supported/enabled
Subtest page_flip: SKIP
Subtest mmap_cpu: SKIP
Subtest mmap_gtt: SKIP
Subtest blt: SKIP
Subtest render: SKIP
Subtest context: SKIP
Subtest page_flip_and_mmap_cpu: SKIP
Subtest page_flip_and_mmap_gtt: SKIP
Subtest page_flip_and_blt: SKIP
Subtest page_flip_and_render: SKIP
Subtest page_flip_and_context: SKIP
Comment 7 Thomas Wood 2015-04-08 17:05:54 UTC
Patch pushed as commit 564dfd4.
Comment 8 ye.tian 2015-04-09 06:12:58 UTC
Tested it on the below the igt patch, this issue does not exists on all platform.


root@x-bsw03:~# cat /sys/kernel/debug/dri/0/i915_fbc_status
FBC unsupported on this chipset

diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c index ccdec33..1320bad 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -513,7 +513,7 @@ igt_main
 		igt_assert_lt(0, fread(buf, 1, sizeof(buf), status));
 		fclose(status);
 		buf[sizeof(buf) - 1] = '\0';
-		igt_require_f(!strstr(buf, "unsupported by this chipset") &&
+		igt_require_f(!strstr(buf, "unsupported on this chipset") &&
 			      !strstr(buf, "disabled per module param") &&
 			      !strstr(buf, "disabled per chip default"),
 			      "FBC not supported/enabled\n");
Comment 9 Elizabeth 2017-10-06 14:30:44 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.