Bug 78873

Summary: [PNV/BDW Regression]igt/kms_render subcases direct-render and gpu-blit 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: normal    
Priority: highest CC: intel-gfx-bugs, yi.sun
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg
none
dmesg none

Description Guo Jinxian 2014-05-19 03:12:03 UTC
==System Environment==
--------------------------
Regression: Yes. 
It was igt issue

Bad commit:252d1151a809683b0f6ed2c546358b7375a27f18
Good commit: d2d0a96eca2e63a7ec75fd15b81808c42ae796b7

Non-working platforms: PNV BDW

==kernel==
--------------------------
-nightly: f79ba79cf037eea9ee757ad37730b00f43d5ef80 (fails)
-queued: d3b448d9917a3d6531e499d88bfb13ea5e31e4ad (fails)
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Fri May 16 18:59:00 2014 +0100

    drm/i915: Only unpin the default ctx object if it exists

    Since commit 691e6415c891b8b2b082a120b896b443531c4d45
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Wed Apr 9 09:07:36 2014 +0100

        drm/i915: Always use kref tracking for all contexts.

    we have contexts everywhere, and so we must be careful to distinguish
    fake contexts, which do not have an associated bo, and real ones, which
    do. In particular, we now need to be careful not to dereference NULL
    pointers.

    This is one such example, as the commit highlighted above failed to move
    the unpinning of the default ctx object into the real-context-only
    branch.

    Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78792
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: Ben Widawsky <benjamin.widawsky@intel.com>
    Cc: Mika Kuoppala <mika.kuoppala@intel.com>
    Cc: Jani Nikula <jani.nikula@intel.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

-fixes: e95a2f7509f5219177d6821a0a8754f93892ca56 (fails)
    Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Date:   Thu May 8 15:09:19 2014 +0300

    drm/i915: Increase WM memory latency values on SNB

    On SNB the BIOS provided WM memory latency values seem insufficient to
    handle high resolution displays.

    In this particular case the display mode was a 2560x1440@60Hz, which
    makes the pixel clock 241.5 MHz. It was empirically found that a memory
    latency value if 1.2 usec is enough to avoid underruns, whereas the BIOS
    provided value of 0.7 usec was clearly too low. Incidentally 1.2 usec
    is what the typical BIOS provided values are on IVB systems.

    Increase the WM memory latency values to at least 1.2 usec on SNB.
    Hopefully this won't have a significant effect on power consumption.

    v2: Increase the latency values regardless of the pixel clock

    Cc: Robert N <crshman@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70254
    Tested-by: Robert Navarro <crshman@gmail.com>
    Tested-by: Vitaly Minko <vitaly.minko@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>

==Bug detailed description==
-----------------------------
Subcases direct-render and gpu-blit of igt/kms_render fail

Output:
./kms_render --run-subtest gpu-blit
IGT-Version: 1.6-g252d115 (i686) (Linux: 3.15.0-rc3_drm-intel-next-queued_d3b448_20140518+ i686)
Beginning test gpu-blit with 1024x600 @ 60Hz / RGB565 on pipe B, encoder LVDS, connector LVDS
Test gpu-blit with 1024x600 @ 60Hz / RGB565 on pipe B, encoder LVDS, connector LVDS: PASSED
Beginning test gpu-blit with LVDS @ 1868767276Hz / RGB888 on pipe B, encoder LVDS, connector LVDS
Test gpu-blit with LVDS @ 1868767276Hz / RGB888 on pipe B, encoder LVDS, connector LVDS: SKIPPED
Beginning test gpu-blit with P▒ @ 1Hz / XRGB8888 on pipe B, encoder LVDS, connector LVDS
Test assertion failure function gem_create, file ioctl_wrappers.c:382:
Last errno: 22, Invalid argument
Failed assertion: drmIoctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0
Subtest gpu-blit: FAIL

==Reproduce steps==
---------------------------- 
1. ./kms_render --run-subtest gpu-blit
Comment 1 Guo Jinxian 2014-05-19 03:12:40 UTC
Created attachment 99291 [details]
dmesg
Comment 2 Chris Wilson 2014-05-19 06:25:40 UTC
There is significant garbage in the kms_connector_config (looks like a use-after-free of the modes list or general corruption). Code looks fine, valgrind also has no issues.
Comment 3 Daniel Vetter 2014-05-19 08:45:23 UTC
igt_kms completely lacks a way to reset the config. Not Sure if this is relevant here ...
Comment 4 Daniel Vetter 2014-05-19 08:46:15 UTC
Also please supply the bisect result.
Comment 5 Guo Jinxian 2014-05-21 04:00:01 UTC
(In reply to comment #4)
> Also please supply the bisect result.

The first bad commit could be any of:
bd521b493e73d987669afbce8da6418e1aed7db6
1bee7e8b82e4a264d20df1f5825b8424c9241e39
6727de0c1abe0b2d6d44255dd30a29dc3ee84993
943511a3ab53df1db5e631bface63bdae663c4c8
af1fbc427f50ac38ed93f3e682cf92b9ae1b2f41
6797ca8c75dc57f4a5eaa9ca8d6f180fd24491dc
ef51988ab287c86c2a324271eebf85a68979ac46
5e83f0444d0fcef2d5996ef12f9cf1593ccd8f78
We cannot bisect more!
Comment 6 Daniel Vetter 2014-05-22 06:49:06 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Also please supply the bisect result.
> 
> The first bad commit could be any of:
> bd521b493e73d987669afbce8da6418e1aed7db6
> 1bee7e8b82e4a264d20df1f5825b8424c9241e39
> 6727de0c1abe0b2d6d44255dd30a29dc3ee84993
> 943511a3ab53df1db5e631bface63bdae663c4c8
> af1fbc427f50ac38ed93f3e682cf92b9ae1b2f41
> 6797ca8c75dc57f4a5eaa9ca8d6f180fd24491dc
> ef51988ab287c86c2a324271eebf85a68979ac46
> 5e83f0444d0fcef2d5996ef12f9cf1593ccd8f78
> We cannot bisect more!

If you can't bisect more please also explain the reason for that. Doesn't compile? Doesn't boot?
Comment 7 Daniel Vetter 2014-05-22 06:53:21 UTC
Also please attach the output of the failing kms_render subtest again.
Comment 8 Guo Jinxian 2014-05-22 06:59:58 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > Also please supply the bisect result.
> > 
> > The first bad commit could be any of:
> > bd521b493e73d987669afbce8da6418e1aed7db6
> > 1bee7e8b82e4a264d20df1f5825b8424c9241e39
> > 6727de0c1abe0b2d6d44255dd30a29dc3ee84993
> > 943511a3ab53df1db5e631bface63bdae663c4c8
> > af1fbc427f50ac38ed93f3e682cf92b9ae1b2f41
> > 6797ca8c75dc57f4a5eaa9ca8d6f180fd24491dc
> > ef51988ab287c86c2a324271eebf85a68979ac46
> > 5e83f0444d0fcef2d5996ef12f9cf1593ccd8f78
> > We cannot bisect more!
> 
> If you can't bisect more please also explain the reason for that. Doesn't
> compile? Doesn't boot?

Unale to make.
Comment 9 Guo Jinxian 2014-05-22 07:00:12 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > (In reply to comment #4)
> > > > Also please supply the bisect result.
> > > 
> > > The first bad commit could be any of:
> > > bd521b493e73d987669afbce8da6418e1aed7db6
> > > 1bee7e8b82e4a264d20df1f5825b8424c9241e39
> > > 6727de0c1abe0b2d6d44255dd30a29dc3ee84993
> > > 943511a3ab53df1db5e631bface63bdae663c4c8
> > > af1fbc427f50ac38ed93f3e682cf92b9ae1b2f41
> > > 6797ca8c75dc57f4a5eaa9ca8d6f180fd24491dc
> > > ef51988ab287c86c2a324271eebf85a68979ac46
> > > 5e83f0444d0fcef2d5996ef12f9cf1593ccd8f78
> > > We cannot bisect more!
> > 
> > If you can't bisect more please also explain the reason for that. Doesn't
> > compile? Doesn't boot?
> 
> Unale to make.

Unable to make
Comment 10 Guo Jinxian 2014-05-23 05:20:17 UTC
(In reply to comment #7)
> Also please attach the output of the failing kms_render subtest again.

The output on -nightly(f5b0cca269ca3f7062f8d3441cebe6a16ce12be4) on BDW

./kms_render --run-subtest gpu-blit
IGT-Version: 1.6-gff3c122 (x86_64) (Linux: 3.15.0-rc5_drm-intel-nightly_f5b0cc_20140522+ x86_64)
Beginning test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe A, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe A, encoder TMDS, connector eDP: SKIPPED
Beginning test gpu-blit with ! @ 0Hz / RGB888 on pipe A, encoder TMDS, connector eDP
Test assertion failure function gem_create, file ioctl_wrappers.c:382:
Last errno: 22, Invalid argument
Failed assertion: drmIoctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0
Subtest gpu-blit: FAIL
Comment 11 Chris Wilson 2014-09-06 11:11:58 UTC
commit 9df77d566409fcef90c7ea63bb6d3df8d8c76dde
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Sep 6 12:08:13 2014 +0100

    lib/igt_fb: Ignore RGB888
    
    None of our display hardware supports the packed 24-bit format, so stop
    trying to use it and causing test failures.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78873&list_id=465068
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Skip the bad format, is the test happy yet?
Comment 12 Guo Jinxian 2014-09-10 03:51:13 UTC
(In reply to comment #11)
> commit 9df77d566409fcef90c7ea63bb6d3df8d8c76dde
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Sat Sep 6 12:08:13 2014 +0100
> 
>     lib/igt_fb: Ignore RGB888
>     
>     None of our display hardware supports the packed 24-bit format, so stop
>     trying to use it and causing test failures.
>     
>     Bugzilla:
> https://bugs.freedesktop.org/show_bug.cgi?id=78873&list_id=465068
>     Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Skip the bad format, is the test happy yet?

This failure unable to repdocue on latest -nightly(99f444f7f8308ca93d56a3802a3e1a8abcad7f57) with latest igt(d9d3f4b0d23a7ea2147f33ab40558edd6128f3ac). But here has another bug 82649

root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_render --run-subtest gpu-blit
IGT-Version: 1.8-gd9d3f4b (x86_64) (Linux: 3.17.0-rc4_drm-intel-nightly_99f444_20140910+ x86_64)
Beginning test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe A, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe A, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 40Hz / XRGB8888 on pipe A, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 40Hz / XRGB8888 on pipe A, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with  @ 0Hz / XRGB2101010 on pipe A, encoder TMDS, connector eDP
Test assertion failure function gem_create, file ioctl_wrappers.c:416:
Failed assertion: drmIoctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0
Last errno: 22, Invalid argument
Subtest gpu-blit: FAIL (16.850s)
Comment 13 Chris Wilson 2014-09-10 06:25:10 UTC
Beginning test gpu-blit with  @ 0Hz / XRGB2101010

Suggests the mode is all zero and so tried to create a zero sized bo. Is there any extra output if you run with:

IGT_LOG_LEVEL=debug ./kms_render --run-subtest gpu-blit
Comment 14 Guo Jinxian 2014-09-11 01:32:58 UTC
Created attachment 106098 [details]
dmesg

(In reply to comment #13)
> Beginning test gpu-blit with  @ 0Hz / XRGB2101010
> 
> Suggests the mode is all zero and so tried to create a zero sized bo. Is
> there any extra output if you run with:
> 
> IGT_LOG_LEVEL=debug ./kms_render --run-subtest gpu-blit

Update dmesg with "IGT_LOG_LEVEL=debug"

root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# IGT_LOG_LEVEL=debug ./kms_render --run-subtest gpu-blit
IGT-Version: 1.8-gd9d3f4b (x86_64) (Linux: 3.17.0-rc4_drm-intel-nightly_99f444_20140910+ x86_64)
VT: graphics mode set
Beginning test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe A, encoder TMDS, connector eDP
igt_create_fb_with_bo_size(width=1920, height=1080, format=0x36314752 [bpp=16], tiling=0, size=0
igt_create_fb_with_bo_size(handle=2, pitch=3840)
igt_create_fb_with_bo_size(width=1920, height=1080, format=0x36314752 [bpp=16], tiling=0, size=0
igt_create_fb_with_bo_size(handle=3, pitch=3840)
Test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe A, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 40Hz / XRGB8888 on pipe A, encoder TMDS, connector eDP
igt_create_fb_with_bo_size(width=1920, height=1080, format=0x34325258 [bpp=32], tiling=0, size=0
igt_create_fb_with_bo_size(handle=2, pitch=7680)
igt_create_fb_with_bo_size(width=1920, height=1080, format=0x34325258 [bpp=32], tiling=0, size=0
igt_create_fb_with_bo_size(handle=3, pitch=7680)
Test gpu-blit with 1920x1080 @ 40Hz / XRGB8888 on pipe A, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with  @ 0Hz / XRGB2101010 on pipe A, encoder TMDS, connector eDP
igt_create_fb_with_bo_size(width=0, height=0, format=0x30335258 [bpp=32], tiling=0, size=0
Test assertion failure function gem_create, file ioctl_wrappers.c:416:
Failed assertion: drmIoctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0
Last errno: 22, Invalid argument
Subtest gpu-blit: FAIL (16.913s)
VT: original mode restored
Comment 15 Chris Wilson 2014-09-12 08:14:27 UTC
commit f81d8eba4fb4448e6ea777aa2072c3b9f277e7cb
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Sep 12 09:11:55 2014 +0100

    igt/kms_render: Iterate only through the formats
    
    When testing each format, iterate through the formats and not randomly
    through the modes.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83788
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 16 Guo Jinxian 2014-09-15 02:26:58 UTC
Verified on latest -nightly(43df30da20447e2856b2761215ff274886a9f931) with latest igt(137877f16b7d026fa1bc17797604e17de2af7e92)

root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# ./kms_render --run-subtest gpu-blit                IGT-Version: 1.8-g137877f (x86_64) (Linux: 3.17.0-rc4_drm-intel-nightly_43df30_20140914+ x86_64)
Beginning test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe A, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe A, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / XRGB8888 on pipe A, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / XRGB8888 on pipe A, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / XRGB2101010 on pipe A, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / XRGB2101010 on pipe A, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / ARGB8888 on pipe A, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / ARGB8888 on pipe A, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe B, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe B, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / XRGB8888 on pipe B, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / XRGB8888 on pipe B, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / XRGB2101010 on pipe B, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / XRGB2101010 on pipe B, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / ARGB8888 on pipe B, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / ARGB8888 on pipe B, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe C, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / RGB565 on pipe C, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / XRGB8888 on pipe C, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / XRGB8888 on pipe C, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / XRGB2101010 on pipe C, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / XRGB2101010 on pipe C, encoder TMDS, connector eDP: PASSED
Beginning test gpu-blit with 1920x1080 @ 60Hz / ARGB8888 on pipe C, encoder TMDS, connector eDP
Test gpu-blit with 1920x1080 @ 60Hz / ARGB8888 on pipe C, encoder TMDS, connector eDP: PASSED
Subtest gpu-blit: SUCCESS (99.869s)
root@x-bdw05:/GFX/Test/Intel_gpu_tools/intel-gpu-tools/tests# echo $?
0
Comment 17 Jari Tahvanainen 2016-11-22 08:57:19 UTC
Closing 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.