Bug 106701

Summary: [CI] igt@kms_available_modes_crc@available_mode_test_crc - fail - Failed assertion: __gem_create(fd, size, &handle) == 0
Product: DRI Reporter: Martin Peres <martin.peres>
Component: DRM/IntelAssignee: Juha-Pekka Heikkilä <juhapekka.heikkila>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: high CC: intel-gfx-bugs, lakshminarayana.vudum
Version: XOrg git   
Hardware: Other   
OS: All   
Whiteboard: ReadyForDev
i915 platform: BSW/CHT, BXT, BYT, CFL, ICL i915 features: display/Other

Description Martin Peres 2018-05-29 08:17:12 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_51/fi-byt-j1900/igt@kms_available_modes_crc@available_mode_test_crc.html

https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_51/fi-byt-n2820/igt@kms_available_modes_crc@available_mode_test_crc.html

https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_51/fi-bsw-n3050/igt@kms_available_modes_crc@available_mode_test_crc.html

(kms_available_modes_crc:1242) ioctl_wrappers-CRITICAL: Test assertion failure function gem_create, file ../lib/ioctl_wrappers.c:573:
(kms_available_modes_crc:1242) ioctl_wrappers-CRITICAL: Failed assertion: __gem_create(fd, size, &handle) == 0
(kms_available_modes_crc:1242) ioctl_wrappers-CRITICAL: error: -22 != 0
Subtest available_mode_test_crc failed.

This appears to be a regression introduced in drmtip_51.
Comment 1 Martin Peres 2018-05-29 08:19:44 UTC
Bumping the priority because 4.17 is about to be released.
Comment 2 Martin Peres 2018-08-31 13:51:43 UTC
https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_92/fi-bsw-kefka/igt@kms_available_modes_crc@available_mode_test_crc.html

(kms_available_modes_crc:1367) ioctl_wrappers-CRITICAL: Test assertion failure function gem_create, file ../lib/ioctl_wrappers.c:573:
(kms_available_modes_crc:1367) ioctl_wrappers-CRITICAL: Failed assertion: __gem_create(fd, size, &handle) == 0
(kms_available_modes_crc:1367) ioctl_wrappers-CRITICAL: error: -22 != 0
Comment 3 Martin Peres 2018-09-07 15:18:33 UTC
Also seen on APL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10123/shard-apl4/igt@kms_available_modes_crc@available_mode_test_crc.html

(kms_available_modes_crc:2718) ioctl_wrappers-CRITICAL: Test assertion failure function gem_create, file ../lib/ioctl_wrappers.c:573:
(kms_available_modes_crc:2718) ioctl_wrappers-CRITICAL: Failed assertion: __gem_create(fd, size, &handle) == 0
(kms_available_modes_crc:2718) ioctl_wrappers-CRITICAL: error: -22 != 0
Comment 4 mwa 2018-11-02 16:28:54 UTC
The only sane way I can see gem_create returning -EINVAL is if the test is trying to create a zero sized object, so doesn't sound like a gem bug...
Comment 5 Martin Peres 2018-11-02 16:42:51 UTC
(In reply to mwa from comment #4)
> The only sane way I can see gem_create returning -EINVAL is if the test is
> trying to create a zero sized object, so doesn't sound like a gem bug...

Thanks for commenting! Do you think you could you check the IGT code? I know this is a KMS test, but the GEM call comes from the lib/, so this is something your team should co-own and there may be a bug there.
Comment 6 Chris Wilson 2018-11-02 16:53:56 UTC
kms_available_modes_crc.c, setup_fb():

        mode = igt_output_get_mode(output);
        if (plane->type != DRM_PLANE_TYPE_CURSOR) {
                w = mode->hdisplay;
                h = mode->vdisplay;
                tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
        } 

is the source.
Comment 7 Juha-Pekka Heikkilä 2018-11-02 19:27:29 UTC
I think problem part is this piece of code in kms_available_modes_crc.c, setup_fb():

	switch (fillers[i].bpp) {
	case NV12:
	case BYTES_PP_1:
		bpp = 8;
		break;

	case P010:
	case BYTES_PP_2:
		bpp = 16;
		break;

	case SKIP4:
	case BYTES_PP_4:
		bpp = 32;
		break;
	}

it's missing default case and leave 'bpp' to zero. To me it look like correct fix is to change in table 'fillers' last element from 

	{ 0, 0, 0, 0 }

to

	{ 0, 0, SKIP4, 0 }

I think this change will fix bug that would follow from creating default case.
Comment 8 Juha-Pekka Heikkilä 2018-11-03 11:33:54 UTC
Waiting for CI results but I think this patch will fix this issue:
https://patchwork.freedesktop.org/series/52000/
Comment 10 Juha-Pekka Heikkilä 2018-12-18 20:44:17 UTC
(In reply to Lakshmi from comment #9)
> https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_173/fi-icl-u3/
> igt@kms_plane_lowres@pipe-c-tiling-yf.html
> 
> This failure needs a separate bug?

Yes. This bug is about error in kms_available_modes_crc which cannot affect kms_plane_lowres. Though, reading comment #4 there is most likely similar bug in kms_plane_lowres where is asked to create zero size object.
Comment 11 Juha-Pekka Heikkilä 2019-01-25 12:40:15 UTC
Patch which contain fix for this https://patchwork.freedesktop.org/series/55727/
Comment 12 CI Bug Log 2019-01-30 16:55:15 UTC
A CI Bug Log filter associated to this bug has been updated:

{- BYT BSW APL: igt@kms_available_modes_crc@available_mode_test_crc - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 -}
{+ BYT BSW APL CFL: igt@kms_available_modes_crc@available_mode_test_crc|igt@kms_flip_tiling@flip-y* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 +}

New failures caught by the filter:

* https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_190/fi-cfl-8109u/igt@kms_flip_tiling@flip-y-tiled.html
Comment 13 CI Bug Log 2019-01-31 13:14:48 UTC
A CI Bug Log filter associated to this bug has been updated:

{- BYT BSW APL CFL: igt@kms_available_modes_crc@available_mode_test_crc|igt@kms_flip_tiling@flip-y* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 -}
{+ BYT BSW APL CFL: igt@kms_available_modes_crc@available_mode_test_crc|igt@kms_flip_tiling@flip-y* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 +}

New failures caught by the filter:

* https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_199/fi-cfl-8109u/igt@kms_flip_tiling@flip-changes-tiling.html
Comment 14 Juha-Pekka Heikkilä 2019-02-01 21:31:58 UTC
(In reply to CI Bug Log from comment #13)
> A CI Bug Log filter associated to this bug has been updated:
> 
> {- BYT BSW APL CFL:
> igt@kms_available_modes_crc@available_mode_test_crc|igt@kms_flip_tiling@flip-
> y* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 -}
> {+ BYT BSW APL CFL:
> igt@kms_available_modes_crc@available_mode_test_crc|igt@kms_flip_tiling@flip-
> y* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 +}
> 
> New failures caught by the filter:
> 
> *
> https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_199/fi-cfl-8109u/
> igt@kms_flip_tiling@flip-changes-tiling.html

Linked report has absolutely nothing to do with this bug.

This bug is about error in available_modes_crc test while linked report has dmesg talking about powerwells before if fails.
Comment 15 CI Bug Log 2019-02-08 10:45:50 UTC
A CI Bug Log filter associated to this bug has been updated:

{- BYT BSW APL CFL: igt@kms_available_modes_crc@available_mode_test_crc|igt@kms_flip_tiling@flip-y* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 -}
{+ BYT BSW APL CFL: igt@kms_available_modes_crc@available_mode_test_crc|igt@kms_flip_tiling@flip-* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 +}

New failures caught by the filter:

* https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_205/fi-cfl-8109u/igt@kms_flip_tiling@flip-x-tiled.html
Comment 16 CI Bug Log 2019-02-12 09:58:02 UTC
A CI Bug Log filter associated to this bug has been updated:

{- BYT BSW APL CFL: igt@kms_available_modes_crc@available_mode_test_crc|igt@kms_flip_tiling@flip-* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 -}
{+ BYT BSW APL CFL: igt@kms_available_modes_crc@*|igt@kms_flip_tiling@*|igt@kms_plane_scaling@* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 +}

New failures caught by the filter:

* https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_212/fi-cfl-8109u/igt@kms_plane_scaling@pipe-c-plane-scaling.html
Comment 17 CI Bug Log 2019-02-12 09:59:42 UTC
A CI Bug Log filter associated to this bug has been updated:

{- BYT BSW APL CFL: igt@kms_available_modes_crc@*|igt@kms_flip_tiling@*|igt@kms_plane_scaling@* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 -}
{+ BYT BSW APL CFL: igt@kms_available_modes_crc@*|igt@kms_flip_tiling@*|igt@kms_plane_scaling@* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 +}

New failures caught by the filter:

* https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_212/fi-cfl-8109u/igt@kms_plane_scaling@pipe-a-plane-scaling.html
Comment 18 CI Bug Log 2019-03-11 14:53:41 UTC
A CI Bug Log filter associated to this bug has been updated:

{- BYT BSW APL CFL: igt@kms_available_modes_crc@*|igt@kms_flip_tiling@*|igt@kms_plane_scaling@* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 -}
{+ BYT BSW APL CFL ICL: igt@kms_available_modes_crc@*|igt@kms_flip_tiling@*|igt@kms_plane_scaling@* - fail - Failed assertion: __gem_create(fd, size, &amp;handle) == 0 +}

New failures caught by the filter:

* https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4879/shard-iclb8/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_5715/shard-iclb5/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_5721/shard-iclb5/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4877/shard-iclb8/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_5722/shard-iclb5/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_5723/shard-iclb1/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_5725/shard-iclb6/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_5726/shard-iclb3/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_5727/shard-iclb5/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_5728/shard-iclb4/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4878/shard-iclb1/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_240/fi-icl-u3/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_241/fi-icl-u2/igt@kms_available_modes_crc@available_mode_test_crc.html
* https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_242/fi-icl-u2/igt@kms_available_modes_crc@available_mode_test_crc.html
Comment 19 Juha-Pekka Heikkilä 2019-03-21 13:57:35 UTC
patch #1 needs review to get this fixed:
https://patchwork.freedesktop.org/series/58177/
Comment 20 Juha-Pekka Heikkilä 2019-03-22 11:01:48 UTC
commit ba96339c238180b38d05d7fa2dca772d49eee332
Author: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Date:   Mon Feb 11 13:34:57 2019 +0200

was merged to igt which should fix this
Comment 21 swathi.dhanavanthri 2019-11-13 18:15:49 UTC
Last seen drmtip_354 (2 months, 2 weeks old) not seen in the last 43 runs, so closing and archiving this
Comment 22 CI Bug Log 2019-11-13 18:15:56 UTC
The CI Bug Log issue associated to this bug has been archived.

New failures matching the above filters will not be associated to this bug anymore.

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.