Skip VBlank tests in modules without VBlank
PATCH v2 1/1 Skip VBlank tests in modules without VBlank
The kms_flip test does not support drivers without VBlank which exclude some virtual drivers. This patch adds a function that checks if a module has a VBlank or not; if a module has VBlank than kms_flip will execute all the VBlank tests, otherwise, VBlank tests will be skipped.
Changes since V1:
Chris Wilson:
- Change function name from igt_there_is_vblank to kms_has_vblank
- Move vblank function check from igt_aux to igt_kms
- Utilizes memset in dummy_vbl variable
- Directly return the result of drmWaitVblank()
--- lib/igt_kms.c | 10 ++++++++++ lib/igt_kms.h | 2 ++ tests/kms_flip.c | 26 ++++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 2 deletions(-)
lib/igt_kms.c +10 -0
@@ -1684,6 +1684,16 @@ void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility)igt_assert_eq (visible, visibility); } +bool kms_has_vblank (int fd) +{ +drmVBlank dummy_vbl; + +memset (&dummy_vbl,0 ,sizeof (drmVBlank)); + dummy_vbl.request.type =DRM_VBLANK_ABSOLUTE ; + +return drmWaitVBlank (fd, &dummy_vbl) ==0 ; +} +/* * A small modeset API */
lib/igt_kms.h +2 -0
@@ -226,6 +226,8 @@ void kmstest_wait_for_pageflip(int fd);unsigned int kmstest_get_vblank (int fd,int pipe,unsigned int flags);void igt_assert_plane_visible (int fd,enum pipe pipe,bool visibility); +bool kms_has_vblank (int fd); +/* * A small modeset API */
tests/kms_flip.c +24 -2
@@ -73,6 +73,7 @@#define TEST_TS_CONT (1 << 27)#define TEST_BO_TOOBIG (1 << 28) +#define TEST_NO_VBLANK (1 << 29)#define TEST_BASIC (1 << 30)#define EVENT_FLIP (1 << 0)
@@ -125,6 +126,18 @@ struct event_state {int seq_step; }; +static bool vblank_dependence (int flags) +{ +int vblank_flags =TEST_VBLANK |TEST_VBLANK_BLOCK | +TEST_VBLANK_ABSOLUTE |TEST_VBLANK_EXPIRED_SEQ | +TEST_TS_CONT |TEST_CHECK_TS |TEST_VBLANK_RACE ; + +if (flags & vblank_flags) +return true; + +return false; +} +static float timeval_float (const struct timeval *tv) {return tv->tv_sec + tv->tv_usec /1000000.0f ;
@@ -493,11 +506,11 @@ static void check_state(const struct test_output *o, const struct event_state *e/* check only valid if no modeset happens in between, that increments by * (1 << 23) on each step. This bounding matches the one in * DRM_IOCTL_WAIT_VBLANK. */ -if (!(o->flags & (TEST_DPMS |TEST_MODESET ))) +if (!(o->flags & (TEST_DPMS |TEST_MODESET |TEST_NO_VBLANK ))) {igt_assert_f (es->current_seq - (es->last_seq + o->seq_step) <=1UL <<23 ,"unexpected %s seq %u, should be >= %u\n" , es->name, es->current_seq, es->last_seq + o->seq_step); - + }/* Check that the vblank frame didn't wrap unexpectedly. */ if (o->flags &TEST_TS_CONT ) {/* Ignore seq_step here since vblank waits time out immediately
@@ -1204,6 +1217,7 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,unsigned bo_size =0 ;uint64_t tiling;int i; +bool vblank = true;switch (crtc_count) {case 1 :
@@ -1297,6 +1311,14 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs, }igt_assert (fb_is_bound (o, o->fb_ids[0 ])); + vblank =kms_has_vblank (drm_fd); +if (!vblank) { +if (vblank_dependence (o->flags)) +igt_require_f (vblank,"There is no Vblank\n" ); +else + o->flags |=TEST_NO_VBLANK ; + } +/* quiescent the hw a bit so ensure we don't miss a single frame */ if (o->flags &TEST_CHECK_TS )calibrate_ts (o, crtc_idxs[0 ]);
Signature · 13 lines
2.18.0 -- Rodrigo Siqueira http://siqueira.tech Graduate Student Department of Computer Science University of São Paulo _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for Skip VBlank tests in modules without VBlank (rev2)
== Series Details ==
== Series Details ==
Series: Skip VBlank tests in modules without VBlank (rev2)
URL : https://patchwork.freedesktop.org/series/48468/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4702 -> IGTPW_1741 =
== Summary - WARNING ==
Minor unknown changes coming with IGTPW_1741 need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_1741, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/48468/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in IGTPW_1741:
=== IGT changes ===
==== Warnings ====
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-hsw-peppy: PASS -> SKIP
fi-snb-2600: PASS -> SKIP
fi-skl-6260u: PASS -> SKIP
fi-hsw-4770r: PASS -> SKIP
{fi-bdw-samus}: PASS -> SKIP
{fi-cfl-8109u}: PASS -> SKIP
fi-blb-e6850: PASS -> SKIP
fi-kbl-r: PASS -> SKIP
fi-bwr-2160: PASS -> SKIP
fi-bdw-5557u: PASS -> SKIP
fi-skl-6600u: PASS -> SKIP
fi-kbl-7560u: PASS -> SKIP
fi-hsw-4770: PASS -> SKIP
fi-byt-j1900: PASS -> SKIP
fi-skl-6700k2: PASS -> SKIP
fi-ivb-3770: PASS -> SKIP
fi-cnl-psr: PASS -> SKIP
{fi-bsw-kefka}: PASS -> SKIP
fi-skl-6700hq: PASS -> SKIP
fi-bxt-j4205: PASS -> SKIP
fi-bsw-n3050: PASS -> SKIP
fi-skl-gvtdvm: PASS -> SKIP
{fi-byt-clapper}: PASS -> SKIP
fi-gdg-551: PASS -> SKIP
fi-glk-dsi: PASS -> SKIP
fi-glk-j4005: PASS -> SKIP
fi-skl-guc: PASS -> SKIP
fi-kbl-7567u: PASS -> SKIP
fi-bdw-gvtdvm: PASS -> SKIP
fi-ivb-3520m: PASS -> SKIP
fi-kbl-7500u: PASS -> SKIP
fi-cfl-8700k: PASS -> SKIP
fi-whl-u: PASS -> SKIP
fi-pnv-d510: PASS -> SKIP
fi-snb-2520m: PASS -> SKIP
fi-cfl-s3: PASS -> SKIP
{fi-skl-iommu}: PASS -> SKIP
fi-cfl-guc: PASS -> SKIP
fi-byt-n2820: PASS -> SKIP
fi-skl-6770hq: PASS -> SKIP
fi-elk-e7500: PASS -> SKIP
fi-ilk-650: PASS -> SKIP
{igt@kms_psr@primary_page_flip}:
fi-cnl-psr: DMESG-FAIL -> DMESG-WARN
{igt@pm_rpm@module-reload}:
fi-byt-n2820: DMESG-FAIL -> DMESG-WARN== Known issues ==
Here are the changes found in IGTPW_1741 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_selftest@live_coherency:
fi-gdg-551: PASS -> DMESG-FAIL (fdo#107164)
igt@kms_frontbuffer_tracking@basic:
fi-hsw-peppy: PASS -> DMESG-FAIL (fdo#102614)
{fi-byt-clapper}: PASS -> FAIL (fdo#103167)
==== Possible fixes ====
{igt@kms_psr@primary_mmap_gtt}:
fi-cnl-psr: DMESG-WARN -> PASS
{igt@pm_rpm@module-reload}:
fi-cnl-psr: WARN (fdo#107602) -> PASS {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#107164 https://bugs.freedesktop.org/show_bug.cgi?id=107164
fdo#107602 https://bugs.freedesktop.org/show_bug.cgi?id=107602
== Participating hosts (53 -> 47) ==
Missing (6): fi-ilk-m540 fi-bxt-dsi fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600
== Build changes ==
* IGT: IGT_4608 -> IGTPW_1741
CI_DRM_4702: 0349bfb08204a6b44f16551c2be3b58563ff73d2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1741: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1741/
IGT_4608: 94ebd21177feedf03e8f6dd1e73dca1a6ec7a0ac @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1741/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] ✓ Fi.CI.BAT: success for Skip VBlank tests in modules without VBlank (rev2)
Quoted 64 lines · Patchwork
== Series Details ==
Series: Skip VBlank tests in modules without VBlank (rev2)
URL : https://patchwork.freedesktop.org/series/48468/
State : success== Summary ==
= CI Bug Log - changes from
CI_DRM_4702->IGTPW_1741=== Summary - WARNING ==
Minor unknown changes coming with
IGTPW_1741need to be verified manually.If you think the reported changes have nothing to do with the changes introduced in
IGTPW_1741, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.External URL: https://patchwork.freedesktop.org/api/1.0/series/48468/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in
IGTPW_1741:=== IGT changes ===
==== Warnings ==== igt@kms_flip@basic-flip-vs-wf_vblank: fi-hsw-peppy: PASS -> SKIP fi-snb-2600: PASS -> SKIP fi-skl-6260u: PASS -> SKIP fi-hsw-4770r: PASS -> SKIP {fi-bdw-samus}: PASS -> SKIP {fi-cfl-8109u}: PASS -> SKIP fi-blb-e6850: PASS -> SKIP fi-kbl-r: PASS -> SKIP fi-bwr-2160: PASS -> SKIP fi-bdw-5557u: PASS -> SKIP fi-skl-6600u: PASS -> SKIP fi-kbl-7560u: PASS -> SKIP fi-hsw-4770: PASS -> SKIP fi-byt-j1900: PASS -> SKIP fi-skl-6700k2: PASS -> SKIP fi-ivb-3770: PASS -> SKIP fi-cnl-psr: PASS -> SKIP {fi-bsw-kefka}: PASS -> SKIP fi-skl-6700hq: PASS -> SKIP fi-bxt-j4205: PASS -> SKIP fi-bsw-n3050: PASS -> SKIP fi-skl-gvtdvm: PASS -> SKIP {fi-byt-clapper}: PASS -> SKIP fi-gdg-551: PASS -> SKIP fi-glk-dsi: PASS -> SKIP fi-glk-j4005: PASS -> SKIP fi-skl-guc: PASS -> SKIP fi-kbl-7567u: PASS -> SKIP fi-bdw-gvtdvm: PASS -> SKIP fi-ivb-3520m: PASS -> SKIP fi-kbl-7500u: PASS -> SKIP fi-cfl-8700k: PASS -> SKIP fi-whl-u: PASS -> SKIP fi-pnv-d510: PASS -> SKIP
Quoted 8 lines
fi-snb-2520m: PASS -> SKIP
fi-cfl-s3: PASS -> SKIP
{fi-skl-iommu}: PASS -> SKIP
fi-cfl-guc: PASS -> SKIP
fi-byt-n2820: PASS -> SKIP
fi-skl-6770hq: PASS -> SKIP
fi-elk-e7500: PASS -> SKIP
fi-ilk-650: PASS -> SKIPHey,
The patch makes overall sense and thanks for sending it.
The test result changes seen above suggest that something is off with the logic in the patch or flags for the tests.
There are more of those in the IGT run (NOTE: if you see +43, that means that 43 changes like that were observerd).
They were passing before now they are skipping. Please investigate that.
Signature · 7 lines
Cheers, Arek _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] ✓ Fi.CI.BAT: success for Skip VBlank tests in modules without VBlank (rev2)
Hi Arkadiusz,
Quoted 79 lines · Arkadiusz Hiler
Quoted 64 lines · Patchwork
== Series Details ==
Series: Skip VBlank tests in modules without VBlank (rev2)
URL : https://patchwork.freedesktop.org/series/48468/
State : success== Summary ==
= CI Bug Log - changes from
CI_DRM_4702->IGTPW_1741=== Summary - WARNING ==
Minor unknown changes coming with
IGTPW_1741need to be verified manually.If you think the reported changes have nothing to do with the changes introduced in
IGTPW_1741, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.External URL: https://patchwork.freedesktop.org/api/1.0/series/48468/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in
IGTPW_1741:=== IGT changes ===
==== Warnings ==== igt@kms_flip@basic-flip-vs-wf_vblank: fi-hsw-peppy: PASS -> SKIP fi-snb-2600: PASS -> SKIP fi-skl-6260u: PASS -> SKIP fi-hsw-4770r: PASS -> SKIP {fi-bdw-samus}: PASS -> SKIP {fi-cfl-8109u}: PASS -> SKIP fi-blb-e6850: PASS -> SKIP fi-kbl-r: PASS -> SKIP fi-bwr-2160: PASS -> SKIP fi-bdw-5557u: PASS -> SKIP fi-skl-6600u: PASS -> SKIP fi-kbl-7560u: PASS -> SKIP fi-hsw-4770: PASS -> SKIP fi-byt-j1900: PASS -> SKIP fi-skl-6700k2: PASS -> SKIP fi-ivb-3770: PASS -> SKIP fi-cnl-psr: PASS -> SKIP {fi-bsw-kefka}: PASS -> SKIP fi-skl-6700hq: PASS -> SKIP fi-bxt-j4205: PASS -> SKIP fi-bsw-n3050: PASS -> SKIP fi-skl-gvtdvm: PASS -> SKIP {fi-byt-clapper}: PASS -> SKIP fi-gdg-551: PASS -> SKIP fi-glk-dsi: PASS -> SKIP fi-glk-j4005: PASS -> SKIP fi-skl-guc: PASS -> SKIP fi-kbl-7567u: PASS -> SKIP fi-bdw-gvtdvm: PASS -> SKIP fi-ivb-3520m: PASS -> SKIP fi-kbl-7500u: PASS -> SKIP fi-cfl-8700k: PASS -> SKIP fi-whl-u: PASS -> SKIP fi-pnv-d510: PASS -> SKIPQuoted 8 lines
fi-snb-2520m: PASS -> SKIP fi-cfl-s3: PASS -> SKIP {fi-skl-iommu}: PASS -> SKIP fi-cfl-guc: PASS -> SKIP fi-byt-n2820: PASS -> SKIP fi-skl-6770hq: PASS -> SKIP fi-elk-e7500: PASS -> SKIP fi-ilk-650: PASS -> SKIPHey,
The patch makes overall sense and thanks for sending it.
Quoted 7 lines
The test result changes seen above suggest that something is off with the logic in the patch or flags for the tests.
There are more of those in the IGT run (NOTE: if you see +43, that means that 43 changes like that were observerd).
They were passing before now they are skipping. Please investigate that.
First of all, sorry for the long time to take a look at this.
I tried to understand the skipping problem by investigating the test “basic-flip-vs-wf_vblank()” in “kms_flip.c”, and I replicated the issue in my local machine running i915 driver. Without my patch, the "flip-vs-wf_vblank" worked like a charm; however, after applied my patch I got the following log:
IGT-Version: 1.23-g8d81c2c2 (x86_64) (Linux: 4.20.0-arch1-1-ARCH x86_64) Using monotonic timestamps
Starting subtest: basic-flip-vs-wf_vblank
Beginning basic-flip-vs-wf_vblank on pipe A, connector eDP-1
1920x1080 60 1920 2028 2076 2100 1080 1090 1100 1126 0xa 0x48 142000
Expected frametime: 16652us; measured 16652.4us +- 5.726us accuracy 0.10%
basic-flip-vs-wf_vblank on pipe A, connector eDP-1: PASSED
Beginning basic-flip-vs-wf_vblank on pipe B, connector eDP-1
1920x1080 60 1920 2028 2076 2100 1080 1090 1100 1126 0xa 0x48 142000
Test requirement not met in function run_test_on_crtc_set, file ../tests/kms_flip.c:1317:
Test requirement: vblank
There is no Vblank
Last errno: 22, Invalid argument
Subtest basic-flip-vs-wf_vblank: SKIP (4.441s)
The test was skipped because we get EINVAL (-22) which means many things in this case (I'll detail this ahead). To better understand the problem, I highlighted the function that I used in the patch for checking if a driver has or not vblank support:
+bool kms_has_vblank(int fd)
+{
+ drmVBlank dummy_vbl;
+
+ memset(&dummy_vbl, 0, sizeof(drmVBlank));
+ dummy_vbl.request.type = DRM_VBLANK_ABSOLUTE;
+
+ return drmWaitVBlank(fd, &dummy_vbl) == 0;
+}
As you can see in the return line, we just check if “drmWaitVBlank()” returns 0 and this is the problem. If you take a look at “drivers/gpu/drm/drm_vblank.c” (kernel), the function “drm_wait_vblank_ioctl()”, you'll notice that the only error returned to the user space is “EINVAL”; which includes the check if a driver support vblank or not (“dev->irq_enabled”).
IMHO the correct solution is changing the “drm_wait_vblank_ioctl()” to return “EOPNOTSUPP” in the case that a driver does not support vblank. I I already sent a patch to change it, and you can see the discussion here:
https://lkml.org/lkml/2018/10/15/609
So... for checking my point, I applied the above patch and made a change in “kms_has_vblank” as follows:
+bool kms_has_vblank(int fd)
+{
+ drmVBlank dummy_vbl;
+
+ memset(&dummy_vbl, 0, sizeof(drmVBlank));
+ dummy_vbl.request.type = DRM_VBLANK_ABSOLUTE;
+
+ drmWaitVBlank(fd, &dummy_vbl);
+ return (errno != EOPNOTSUPP);
+}
After that, the “basic-flip-vs-wf_vblank()” worked as expected. I tested in i915, Bosch (no vblank), and VKMS. Everything looks right now.
So... make sense? Do you see another alternative to solve this problem?
Additionally, it is weird for me that “drm_wait_vblank_ioctl()” returns EINVAL in some case related to “basic-flip-vs-wf_vblank()”.
Best Regards
Quoted 4 lines
Signature · 2 lines
Cheers, Arek
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] ✓ Fi.CI.BAT: success for Skip VBlank tests in modules without VBlank (rev2)
Quoted 157 lines · Rodrigo Siqueira
Hi Arkadiusz,
Quoted 79 lines · Arkadiusz Hiler
Quoted 64 lines · Patchwork
== Series Details ==
Series: Skip VBlank tests in modules without VBlank (rev2)
URL : https://patchwork.freedesktop.org/series/48468/
State : success== Summary ==
= CI Bug Log - changes from
CI_DRM_4702->IGTPW_1741=== Summary - WARNING ==
Minor unknown changes coming with
IGTPW_1741need to be verified manually.If you think the reported changes have nothing to do with the changes introduced in
IGTPW_1741, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.External URL: https://patchwork.freedesktop.org/api/1.0/series/48468/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in
IGTPW_1741:=== IGT changes ===
==== Warnings ==== igt@kms_flip@basic-flip-vs-wf_vblank: fi-hsw-peppy: PASS -> SKIP fi-snb-2600: PASS -> SKIP fi-skl-6260u: PASS -> SKIP fi-hsw-4770r: PASS -> SKIP {fi-bdw-samus}: PASS -> SKIP {fi-cfl-8109u}: PASS -> SKIP fi-blb-e6850: PASS -> SKIP fi-kbl-r: PASS -> SKIP fi-bwr-2160: PASS -> SKIP fi-bdw-5557u: PASS -> SKIP fi-skl-6600u: PASS -> SKIP fi-kbl-7560u: PASS -> SKIP fi-hsw-4770: PASS -> SKIP fi-byt-j1900: PASS -> SKIP fi-skl-6700k2: PASS -> SKIP fi-ivb-3770: PASS -> SKIP fi-cnl-psr: PASS -> SKIP {fi-bsw-kefka}: PASS -> SKIP fi-skl-6700hq: PASS -> SKIP fi-bxt-j4205: PASS -> SKIP fi-bsw-n3050: PASS -> SKIP fi-skl-gvtdvm: PASS -> SKIP {fi-byt-clapper}: PASS -> SKIP fi-gdg-551: PASS -> SKIP fi-glk-dsi: PASS -> SKIP fi-glk-j4005: PASS -> SKIP fi-skl-guc: PASS -> SKIP fi-kbl-7567u: PASS -> SKIP fi-bdw-gvtdvm: PASS -> SKIP fi-ivb-3520m: PASS -> SKIP fi-kbl-7500u: PASS -> SKIP fi-cfl-8700k: PASS -> SKIP fi-whl-u: PASS -> SKIP fi-pnv-d510: PASS -> SKIPQuoted 8 lines
fi-snb-2520m: PASS -> SKIP fi-cfl-s3: PASS -> SKIP {fi-skl-iommu}: PASS -> SKIP fi-cfl-guc: PASS -> SKIP fi-byt-n2820: PASS -> SKIP fi-skl-6770hq: PASS -> SKIP fi-elk-e7500: PASS -> SKIP fi-ilk-650: PASS -> SKIPHey,
The patch makes overall sense and thanks for sending it.
Quoted 7 lines
The test result changes seen above suggest that something is off with the logic in the patch or flags for the tests.
There are more of those in the IGT run (NOTE: if you see +43, that means that 43 changes like that were observerd).
They were passing before now they are skipping. Please investigate that.
First of all, sorry for the long time to take a look at this.
I tried to understand the skipping problem by investigating the test “basic-flip-vs-wf_vblank()” in “kms_flip.c”, and I replicated the issue in my local machine running i915 driver. Without my patch, the "flip-vs-wf_vblank" worked like a charm; however, after applied my patch I got the following log:
IGT-Version: 1.23-g8d81c2c2 (
x86_64) (Linux: 4.20.0-arch1-1-ARCHx86_64) Using monotonic timestamps
Starting subtest: basic-flip-vs-wf_vblank
Beginning basic-flip-vs-wf_vblank on pipe A, connector eDP-1
1920x1080 60 1920 2028 2076 2100 1080 1090 1100 11260xa0x48142000
Expected frametime: 16652us; measured 16652.4us +- 5.726us accuracy 0.10%basic-flip-vs-wf_vblank on pipe A, connector eDP-1: PASSED
Beginning basic-flip-vs-wf_vblank on pipe B, connector eDP-1
1920x1080 60 1920 2028 2076 2100 1080 1090 1100 11260xa0x48142000
Test requirement not met in functionrun_test_on_crtc_set, file../tests/kms_flip.c:1317:
Test requirement: vblank
There is no Vblank
Last errno: 22, Invalid argument
Subtest basic-flip-vs-wf_vblank: SKIP (4.441s)The test was skipped because we get EINVAL (-22) which means many things in this case (I'll detail this ahead). To better understand the problem, I highlighted the function that I used in the patch for checking if a driver has or not vblank support:
lib/igt_kms.c +9
-0+bool kms_has_vblank (int fd) +{ +drmVBlank dummy_vbl; + +memset (&dummy_vbl,0 ,sizeof (drmVBlank)); + dummy_vbl.request.type =DRM_VBLANK_ABSOLUTE ; + +return drmWaitVBlank (fd, &dummy_vbl) ==0 ; +}As you can see in the return line, we just check if “drmWaitVBlank()” returns 0 and this is the problem. If you take a look at “drivers/gpu/drm/drm_vblank.c” (kernel), the function “drm_wait_vblank_ioctl()”, you'll notice that the only error returned to the user space is “EINVAL”; which includes the check if a driver support vblank or not (“dev->irq_enabled”).
IMHO the correct solution is changing the “drm_wait_vblank_ioctl()” to return “EOPNOTSUPP” in the case that a driver does not support vblank. I I already sent a patch to change it, and you can see the discussion here:
https://lkml.org/lkml/2018/10/15/609So... for checking my point, I applied the above patch and made a change in “kms_has_vblank” as follows:
lib/igt_kms.c +10
-0+bool kms_has_vblank (int fd) +{ +drmVBlank dummy_vbl; + +memset (&dummy_vbl,0 ,sizeof (drmVBlank)); + dummy_vbl.request.type =DRM_VBLANK_ABSOLUTE ; + +drmWaitVBlank (fd, &dummy_vbl); +return (errno !=EOPNOTSUPP ); +}
Quoted 4 lines
After that, the “basic-flip-vs-wf_vblank()” worked as expected. I tested in i915, Bosch (no vblank), and VKMS. Everything looks right now.
So... make sense? Do you see another alternative to solve this problem?
Yup. Even with your patch we can still get -EINVAL (when the crtc is off), so merging the EOPNOTSUPP patches first, then this here, and only skipping if EOPNOTSUPP is the only way to go I think.
The above is probably good in a comment in kms_has_vblank().
Btw I thought the EOPNOTSUPP was merged already, why is it stuck? Or should retesting this fix things?
-Daniel
Quoted 14 lines
Additionally, it is weird for me that “drm_wait_vblank_ioctl()” returns EINVAL in some case related to “basic-flip-vs-wf_vblank()”.
Best Regards
Quoted 4 lines
Signature · 2 lines
Cheers, Arek_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] ✓ Fi.CI.BAT: success for Skip VBlank tests in modules without VBlank (rev2)
Quoted 161 lines · Daniel Vetter
Quoted 160 lines · Rodrigo Siqueira
Hi Arkadiusz,
Quoted 79 lines · Arkadiusz Hiler
Quoted 64 lines · Patchwork
== Series Details ==
Series: Skip VBlank tests in modules without VBlank (rev2)
URL : https://patchwork.freedesktop.org/series/48468/
State : success== Summary ==
= CI Bug Log - changes from
CI_DRM_4702->IGTPW_1741=== Summary - WARNING ==
Minor unknown changes coming with
IGTPW_1741need to be verified manually.If you think the reported changes have nothing to do with the changes introduced in
IGTPW_1741, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.External URL: https://patchwork.freedesktop.org/api/1.0/series/48468/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in
IGTPW_1741:=== IGT changes ===
==== Warnings ==== igt@kms_flip@basic-flip-vs-wf_vblank: fi-hsw-peppy: PASS -> SKIP fi-snb-2600: PASS -> SKIP fi-skl-6260u: PASS -> SKIP fi-hsw-4770r: PASS -> SKIP {fi-bdw-samus}: PASS -> SKIP {fi-cfl-8109u}: PASS -> SKIP fi-blb-e6850: PASS -> SKIP fi-kbl-r: PASS -> SKIP fi-bwr-2160: PASS -> SKIP fi-bdw-5557u: PASS -> SKIP fi-skl-6600u: PASS -> SKIP fi-kbl-7560u: PASS -> SKIP fi-hsw-4770: PASS -> SKIP fi-byt-j1900: PASS -> SKIP fi-skl-6700k2: PASS -> SKIP fi-ivb-3770: PASS -> SKIP fi-cnl-psr: PASS -> SKIP {fi-bsw-kefka}: PASS -> SKIP fi-skl-6700hq: PASS -> SKIP fi-bxt-j4205: PASS -> SKIP fi-bsw-n3050: PASS -> SKIP fi-skl-gvtdvm: PASS -> SKIP {fi-byt-clapper}: PASS -> SKIP fi-gdg-551: PASS -> SKIP fi-glk-dsi: PASS -> SKIP fi-glk-j4005: PASS -> SKIP fi-skl-guc: PASS -> SKIP fi-kbl-7567u: PASS -> SKIP fi-bdw-gvtdvm: PASS -> SKIP fi-ivb-3520m: PASS -> SKIP fi-kbl-7500u: PASS -> SKIP fi-cfl-8700k: PASS -> SKIP fi-whl-u: PASS -> SKIP fi-pnv-d510: PASS -> SKIPQuoted 8 lines
fi-snb-2520m: PASS -> SKIP fi-cfl-s3: PASS -> SKIP {fi-skl-iommu}: PASS -> SKIP fi-cfl-guc: PASS -> SKIP fi-byt-n2820: PASS -> SKIP fi-skl-6770hq: PASS -> SKIP fi-elk-e7500: PASS -> SKIP fi-ilk-650: PASS -> SKIPHey,
The patch makes overall sense and thanks for sending it.
Quoted 7 lines
The test result changes seen above suggest that something is off with the logic in the patch or flags for the tests.
There are more of those in the IGT run (NOTE: if you see +43, that means that 43 changes like that were observerd).
They were passing before now they are skipping. Please investigate that.
First of all, sorry for the long time to take a look at this.
I tried to understand the skipping problem by investigating the test “basic-flip-vs-wf_vblank()” in “kms_flip.c”, and I replicated the issue in my local machine running i915 driver. Without my patch, the "flip-vs-wf_vblank" worked like a charm; however, after applied my patch I got the following log:
IGT-Version: 1.23-g8d81c2c2 (
x86_64) (Linux: 4.20.0-arch1-1-ARCHx86_64) Using monotonic timestamps
Starting subtest: basic-flip-vs-wf_vblank
Beginning basic-flip-vs-wf_vblank on pipe A, connector eDP-1
1920x1080 60 1920 2028 2076 2100 1080 1090 1100 11260xa0x48142000
Expected frametime: 16652us; measured 16652.4us +- 5.726us accuracy 0.10%basic-flip-vs-wf_vblank on pipe A, connector eDP-1: PASSED
Beginning basic-flip-vs-wf_vblank on pipe B, connector eDP-1
1920x1080 60 1920 2028 2076 2100 1080 1090 1100 11260xa0x48142000
Test requirement not met in functionrun_test_on_crtc_set, file../tests/kms_flip.c:1317:
Test requirement: vblank
There is no Vblank
Last errno: 22, Invalid argument
Subtest basic-flip-vs-wf_vblank: SKIP (4.441s)The test was skipped because we get EINVAL (-22) which means many things in this case (I'll detail this ahead). To better understand the problem, I highlighted the function that I used in the patch for checking if a driver has or not vblank support:
lib/igt_kms.c +9
-0+bool kms_has_vblank (int fd) +{ +drmVBlank dummy_vbl; + +memset (&dummy_vbl,0 ,sizeof (drmVBlank)); + dummy_vbl.request.type =DRM_VBLANK_ABSOLUTE ; + +return drmWaitVBlank (fd, &dummy_vbl) ==0 ; +}As you can see in the return line, we just check if “drmWaitVBlank()” returns 0 and this is the problem. If you take a look at “drivers/gpu/drm/drm_vblank.c” (kernel), the function “drm_wait_vblank_ioctl()”, you'll notice that the only error returned to the user space is “EINVAL”; which includes the check if a driver support vblank or not (“dev->irq_enabled”).
IMHO the correct solution is changing the “drm_wait_vblank_ioctl()” to return “EOPNOTSUPP” in the case that a driver does not support vblank. I I already sent a patch to change it, and you can see the discussion here:
https://lkml.org/lkml/2018/10/15/609So... for checking my point, I applied the above patch and made a change in “kms_has_vblank” as follows:
lib/igt_kms.c +10
-0+bool kms_has_vblank (int fd) +{ +drmVBlank dummy_vbl; + +memset (&dummy_vbl,0 ,sizeof (drmVBlank)); + dummy_vbl.request.type =DRM_VBLANK_ABSOLUTE ; + +drmWaitVBlank (fd, &dummy_vbl); +return (errno !=EOPNOTSUPP ); +}After that, the “basic-flip-vs-wf_vblank()” worked as expected. I tested in i915, Bosch (no vblank), and VKMS. Everything looks right now.
Quoted 7 lines
Quoted 1 line
So... make sense? Do you see another alternative to solve this problem?
Yup. Even with your patch we can still get
-EINVAL(when the crtc is off), so merging the EOPNOTSUPP patches first, then this here, and only skipping if EOPNOTSUPP is the only way to go I think.The above is probably good in a comment in
kms_has_vblank().
Hi, thanks for the review.
I will prepare a V3 with this fix.
Quoted 2 lines
Btw I thought the EOPNOTSUPP was merged already, why is it stuck? Or should retesting this fix things?
About the patch, we have some discussion about it because two tests failed in the CI. Probably I have to send another patch for making the tests correctly handling EOPNOTSUPP.
Thanks.
Quoted 7 lines
-Daniel
Quoted 6 lines
Additionally, it is weird for me that “drm_wait_vblank_ioctl()” returns EINVAL in some case related to “basic-flip-vs-wf_vblank()”.
Best Regards
Quoted 13 lines
Quoted 8 lines
Quoted 4 lines
Signature · 2 lines
Cheers, Arek_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-devSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for Skip VBlank tests in modules without VBlank (rev2)
In reply to Rodrigo Siqueira== Series Details ==
== Series Details ==
Series: Skip VBlank tests in modules without VBlank (rev2)
URL : https://patchwork.freedesktop.org/series/48468/
State : success
== Summary ==
= CI Bug Log - changes from IGT_4608_full -> IGTPW_1741_full =
== Summary - WARNING ==
Minor unknown changes coming with IGTPW_1741_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_1741_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/48468/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in IGTPW_1741_full:
=== IGT changes ===
==== Warnings ====
igt@kms_draw_crc@draw-method-xrgb8888-mmap-cpu-xtiled:
shard-snb: SKIP -> PASS
igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
shard-hsw: PASS -> SKIP +43
igt@kms_flip@flip-vs-absolute-wf_vblank-interruptible:
shard-snb: PASS -> SKIP +21
igt@kms_flip@plain-flip-fb-recreate-interruptible:
shard-glk: PASS -> SKIP +39
igt@kms_flip@wf_vblank-ts-check:
shard-apl: PASS -> SKIP +21
igt@kms_flip@wf_vblank-ts-check-interruptible:
shard-kbl: PASS -> SKIP +16== Known issues ==
Here are the changes found in IGTPW_1741_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_exec_schedule@pi-ringfull-render:
shard-kbl: NOTRUN -> FAIL (fdo#103158)
igt@kms_available_modes_crc@available_mode_test_crc:
shard-kbl: NOTRUN -> FAIL (fdo#106641)
igt@kms_cursor_legacy@cursor-vs-flip-toggle:
shard-hsw: PASS -> FAIL (fdo#103355)
igt@perf_pmu@rc6-runtime-pm-long:
shard-apl: PASS -> FAIL (fdo#105010)
igt@testdisplay:
shard-glk: PASS -> INCOMPLETE (fdo#107093, k.org#198133, fdo#103359)
==== Possible fixes ====
igt@gem_ctx_isolation@vcs1-s3:
shard-kbl: INCOMPLETE (fdo#103665) -> PASS
igt@gem_ppgtt@blt-vs-render-ctx0:
shard-kbl: INCOMPLETE (fdo#106023, fdo#103665) -> PASS
igt@kms_available_modes_crc@available_mode_test_crc:
shard-snb: FAIL (fdo#106641) -> PASS
igt@kms_flip@dpms-vs-vblank-race:
shard-kbl: FAIL (fdo#103060) -> SKIP
igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-cpu:
shard-snb: INCOMPLETE (fdo#105411) -> PASS
igt@kms_rotation_crc@sprite-rotation-180:
shard-snb: FAIL (fdo#103925) -> PASS
igt@pm_rpm@system-suspend:
shard-kbl: INCOMPLETE (fdo#103665, fdo#107556) -> PASS fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#105010 https://bugs.freedesktop.org/show_bug.cgi?id=105010
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
fdo#107093 https://bugs.freedesktop.org/show_bug.cgi?id=107093
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* IGT: IGT_4608 -> IGTPW_1741
* Linux: CI_DRM_4693 -> CI_DRM_4702
CI_DRM_4693: f22275363ffa04dbd719032810154e857110cd75 @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_4702: 0349bfb08204a6b44f16551c2be3b58563ff73d2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1741: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1741/
IGT_4608: 94ebd21177feedf03e8f6dd1e73dca1a6ec7a0ac @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1741/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev