tests/kms_writeback: Check CRC capture survives writeback
PATCH 1/1 tests/kms_writeback: Check CRC capture survives writeback
The existing writeback tests validate captured framebuffer contents, but do not keep pipe CRC capture active across writeback completion. This misses the VKMS bug where writeback cleanup disables the composer while CRC capture still needs it, leaving subsequent CRC reads waiting for samples that never arrive.
Add writeback-preserves-crc. Complete the initial modeset before starting capture and establish reference CRCs for separate red and blue input framebuffers. Keep capture open across four alternating writebacks, wait for each output fence, and compare three fresh CRC samples with the corresponding reference after each writeback. Use atomic updates without ALLOW_MODESET once capture starts, and release capture from the final fixture so a failed subtest also closes it.
Check output fence status in the shared wait helper so a signalled error fence cannot be treated as a successful writeback.
On ARM64 QEMU with one and two CPUs, the new subtest fails on unmodified mainline and passes with the local VKMS composer-user lifetime fix. Four existing applicable writeback subtests pass on both kernels; the two XRGB2101010 subtests skip because the format probe rejects them.
--- tests/kms_writeback.c | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)
tests/kms_writeback.c +62 -0
@@ -64,6 +64,10 @@* * SUBTEST: writeback-pixel-formats * Description: Check the writeback format +* +* SUBTEST: writeback-preserves-crc +* Description: CRC capture remains active across completed writebacks +* Driver requirement: i915, xe, vkms */ IGT_TEST_DESCRIPTION(
@@ -317,6 +321,7 @@ static void get_and_wait_out_fence(igt_output_t *output) ret =sync_fence_wait (output->writeback_out_fence_fd,1000 );igt_assert_f (ret ==0 ,"sync_fence_wait failed: %s\n" ,strerror (-ret)); +igt_assert_eq (sync_fence_status (output->writeback_out_fence_fd),1 );close (output->writeback_out_fence_fd); output->writeback_out_fence_fd =-1 ; }
@@ -537,6 +542,7 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_output_t *output;igt_plane_t *plane;igt_fb_t input_fb, input_fb_10bit; +static igt_pipe_crc_t *pipe_crc;drmModeModeInfo mode;unsigned int fb_id;int ret;
@@ -709,7 +715,63 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_remove_fb (display.drm_fd, &output_fb); } +igt_describe ("CRC capture remains active across completed writebacks" ); + igt_subtest("writeback-preserves-crc") { +igt_fb_t blue_fb, output_fb; +igt_fb_t *colors[] = { &input_fb, &blue_fb }; +igt_crc_t reference[2 ], crc; +int i, j; + +igt_skip_on (data.dump_check || data.list_modes); +igt_require (data.supported_colors &XRGB8888 ); +igt_require_pipe_crc (display.drm_fd); + +igt_create_color_fb (display.drm_fd, mode.hdisplay, mode.vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR , +0.0 ,0.0 ,1.0 , &blue_fb); +igt_create_fb (display.drm_fd, mode.hdisplay, mode.vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR , + &output_fb); +fill_fb (&input_fb,0x00ff0000 ); +igt_plane_set_fb (plane, &input_fb); +igt_output_set_writeback_fb (output,NULL ); +igt_display_commit_atomic (&display,DRM_MODE_ATOMIC_ALLOW_MODESET ,NULL ); + +/* Finish the modeset before starting continuous CRC capture. */ + pipe_crc =igt_pipe_crc_new (display.drm_fd, output->config.crtc_index, +IGT_PIPE_CRC_SOURCE_AUTO ); +igt_pipe_crc_start (pipe_crc); + +/* Establish both references before writeback can affect capture. */ +for (i =0 ; i <ARRAY_SIZE (colors); i++) { +igt_plane_set_fb (plane, colors[i]); +igt_display_commit_atomic (&display,0 ,NULL ); +igt_pipe_crc_get_current (display.drm_fd, pipe_crc, &reference[i]); + } + +for (i =0 ; i <4 ; i++) { +int color = i %ARRAY_SIZE (colors); + +igt_plane_set_fb (plane, colors[color]); +igt_output_set_writeback_fb (output, &output_fb); +igt_display_commit_atomic (&display,0 ,NULL ); +get_and_wait_out_fence (output); + +/* Require fresh frames without stopping or restarting capture. */ +for (j =0 ; j <3 ; j++) { +igt_pipe_crc_get_current (display.drm_fd, pipe_crc, &crc); +igt_assert_crc_equal (&reference[color], &crc); + } + } + +igt_plane_set_fb (plane, &input_fb); +igt_display_commit_atomic (&display,0 ,NULL ); +igt_remove_fb (display.drm_fd, &blue_fb); +igt_remove_fb (display.drm_fd, &output_fb); + } + igt_fixture() { +igt_pipe_crc_free (pipe_crc);cleanup_writeback (&display, output);igt_remove_fb (display.drm_fd, &input_fb);
base-commit: bb76404eac7032ba85c53eac15b76e4fadaff0de
Signature · 1 line
2.50.1 (Apple Git-155)
Hi atipre,
Quoted 17 lines · atipre
The existing writeback tests validate captured framebuffer contents, but do not keep pipe CRC capture active across writeback completion. This misses the VKMS bug where writeback cleanup disables the composer while CRC capture still needs it, leaving subsequent CRC reads waiting for samples that never arrive.
Add writeback-preserves-crc. Complete the initial modeset before starting capture and establish reference CRCs for separate red and blue input framebuffers. Keep capture open across four alternating writebacks, wait for each output fence, and compare three fresh CRC samples with the corresponding reference after each writeback. Use atomic updates without
ALLOW_MODESETonce capture starts, and release capture from the final fixture so a failed subtest also closes it.Check output fence status in the shared wait helper so a signalled error fence cannot be treated as a successful writeback.
Quoted 6 lines
On ARM64 QEMU with one and two CPUs, the new subtest fails on unmodified mainline and passes with the local VKMS composer-user lifetime fix. Four existing applicable writeback subtests pass on both kernels; the two XRGB2101010 subtests skip because the format probe rejects them.
Signed-off-by atipre <[email protected]>
It would be preferable to have Full Name instead of nick, should this be:
?
If yes, add also same From: at beginnig or configure your git.
+cc Swati and Karthik
Cc: Karthik B S <[email protected]>
Cc: Swati Sharma <[email protected]>
Regards,
Kamil
Quoted 104 lines
--- tests/kms_writeback.c | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)tests/kms_writeback.c +62
-0@@ -64,6 +64,10 @@* * SUBTEST: writeback-pixel-formats * Description: Check the writeback format +* +* SUBTEST: writeback-preserves-crc +* Description: CRC capture remains active across completed writebacks +* Driver requirement: i915, xe, vkms */ IGT_TEST_DESCRIPTION(@@ -317,6 +321,7 @@ static void get_and_wait_out_fence(igt_output_t *output) ret =sync_fence_wait (output->writeback_out_fence_fd,1000 );igt_assert_f (ret ==0 ,"sync_fence_wait failed: %s\n" ,strerror (-ret)); +igt_assert_eq (sync_fence_status (output->writeback_out_fence_fd),1 );close (output->writeback_out_fence_fd); output->writeback_out_fence_fd =-1 ; }@@ -537,6 +542,7 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_output_t *output;igt_plane_t *plane;igt_fb_t input_fb, input_fb_10bit; +static igt_pipe_crc_t *pipe_crc;drmModeModeInfo mode;unsigned int fb_id;int ret;@@ -709,7 +715,63 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_remove_fb (display.drm_fd, &output_fb); } +igt_describe ("CRC capture remains active across completed writebacks" ); + igt_subtest("writeback-preserves-crc") { +igt_fb_t blue_fb, output_fb; +igt_fb_t *colors[] = { &input_fb, &blue_fb }; +igt_crc_t reference[2 ], crc; +int i, j; + +igt_skip_on (data.dump_check || data.list_modes); +igt_require (data.supported_colors &XRGB8888 ); +igt_require_pipe_crc (display.drm_fd); + +igt_create_color_fb (display.drm_fd, mode.hdisplay, mode.vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR , +0.0 ,0.0 ,1.0 , &blue_fb); +igt_create_fb (display.drm_fd, mode.hdisplay, mode.vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR , + &output_fb); +fill_fb (&input_fb,0x00ff0000 ); +igt_plane_set_fb (plane, &input_fb); +igt_output_set_writeback_fb (output,NULL ); +igt_display_commit_atomic (&display,DRM_MODE_ATOMIC_ALLOW_MODESET ,NULL ); + +/* Finish the modeset before starting continuous CRC capture. */ + pipe_crc =igt_pipe_crc_new (display.drm_fd, output->config.crtc_index, +IGT_PIPE_CRC_SOURCE_AUTO ); +igt_pipe_crc_start (pipe_crc); + +/* Establish both references before writeback can affect capture. */ +for (i =0 ; i <ARRAY_SIZE (colors); i++) { +igt_plane_set_fb (plane, colors[i]); +igt_display_commit_atomic (&display,0 ,NULL ); +igt_pipe_crc_get_current (display.drm_fd, pipe_crc, &reference[i]); + } + +for (i =0 ; i <4 ; i++) { +int color = i %ARRAY_SIZE (colors); + +igt_plane_set_fb (plane, colors[color]); +igt_output_set_writeback_fb (output, &output_fb); +igt_display_commit_atomic (&display,0 ,NULL ); +get_and_wait_out_fence (output); + +/* Require fresh frames without stopping or restarting capture. */ +for (j =0 ; j <3 ; j++) { +igt_pipe_crc_get_current (display.drm_fd, pipe_crc, &crc); +igt_assert_crc_equal (&reference[color], &crc); + } + } + +igt_plane_set_fb (plane, &input_fb); +igt_display_commit_atomic (&display,0 ,NULL ); +igt_remove_fb (display.drm_fd, &blue_fb); +igt_remove_fb (display.drm_fd, &output_fb); + } + igt_fixture() { +igt_pipe_crc_free (pipe_crc);cleanup_writeback (&display, output);igt_remove_fb (display.drm_fd, &input_fb);base-commit:
bb76404eac7032ba85c53eac15b76e4fadaff0deSignature · 1 line
2.50.1 (Apple Git-155)
Patchwork
CI✗ LGCI.VerificationFailed: failure for tests/kms_writeback: Check CRC capture survives writeback
In reply to atipre== Series Details ==
== Series Details ==
Series: tests/kms_writeback: Check CRC capture survives writeback
URL : https://patchwork.freedesktop.org/series/176841/
State : failure
== Summary ==
Series author address '[email protected]' is not on the allowlist, which prevents CI from being automatically triggered. If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork. Exception occurred during validation, bailing out!
Build URL: http://gfx-ci.igk.intel.com:8080/job/CI_IGTPW_check/243181/ (on cidrm1)
PATCH v2 1/1 tests/kms_writeback: Check CRC capture survives writeback
In reply to atipreThe existing writeback tests validate captured framebuffer contents, but do not keep pipe CRC capture active across writeback completion. This misses the VKMS bug where writeback cleanup disables the composer while CRC capture still needs it, leaving subsequent CRC reads waiting for samples that never arrive.
Add writeback-preserves-crc. Complete the initial modeset before starting capture and establish reference CRCs for separate red and blue input framebuffers. Keep capture open across four alternating writebacks, wait for each output fence, and compare three fresh CRC samples with the corresponding reference after each writeback. Use atomic updates without ALLOW_MODESET once capture starts, and release capture from the final fixture so a failed subtest also closes it.
Check output fence status in the shared wait helper so a signalled error fence cannot be treated as a successful writeback.
On ARM64 QEMU with one and two CPUs, the new subtest fails on unmodified mainline and passes with the local VKMS composer-user lifetime fix. Four existing applicable writeback subtests pass on both kernels; the two XRGB2101010 subtests skip because the format probe rejects them.
---
Changes in v2:
- Use my full name in the author and Signed-off-by fields.
- No code changes.
tests/kms_writeback.c | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)
tests/kms_writeback.c +62 -0
@@ -64,6 +64,10 @@* * SUBTEST: writeback-pixel-formats * Description: Check the writeback format +* +* SUBTEST: writeback-preserves-crc +* Description: CRC capture remains active across completed writebacks +* Driver requirement: i915, xe, vkms */ IGT_TEST_DESCRIPTION(
@@ -317,6 +321,7 @@ static void get_and_wait_out_fence(igt_output_t *output) ret =sync_fence_wait (output->writeback_out_fence_fd,1000 );igt_assert_f (ret ==0 ,"sync_fence_wait failed: %s\n" ,strerror (-ret)); +igt_assert_eq (sync_fence_status (output->writeback_out_fence_fd),1 );close (output->writeback_out_fence_fd); output->writeback_out_fence_fd =-1 ; }
@@ -537,6 +542,7 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_output_t *output;igt_plane_t *plane;igt_fb_t input_fb, input_fb_10bit; +static igt_pipe_crc_t *pipe_crc;drmModeModeInfo mode;unsigned int fb_id;int ret;
@@ -709,7 +715,63 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_remove_fb (display.drm_fd, &output_fb); } +igt_describe ("CRC capture remains active across completed writebacks" ); + igt_subtest("writeback-preserves-crc") { +igt_fb_t blue_fb, output_fb; +igt_fb_t *colors[] = { &input_fb, &blue_fb }; +igt_crc_t reference[2 ], crc; +int i, j; + +igt_skip_on (data.dump_check || data.list_modes); +igt_require (data.supported_colors &XRGB8888 ); +igt_require_pipe_crc (display.drm_fd); + +igt_create_color_fb (display.drm_fd, mode.hdisplay, mode.vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR , +0.0 ,0.0 ,1.0 , &blue_fb); +igt_create_fb (display.drm_fd, mode.hdisplay, mode.vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR , + &output_fb); +fill_fb (&input_fb,0x00ff0000 ); +igt_plane_set_fb (plane, &input_fb); +igt_output_set_writeback_fb (output,NULL ); +igt_display_commit_atomic (&display,DRM_MODE_ATOMIC_ALLOW_MODESET ,NULL ); + +/* Finish the modeset before starting continuous CRC capture. */ + pipe_crc =igt_pipe_crc_new (display.drm_fd, output->config.crtc_index, +IGT_PIPE_CRC_SOURCE_AUTO ); +igt_pipe_crc_start (pipe_crc); + +/* Establish both references before writeback can affect capture. */ +for (i =0 ; i <ARRAY_SIZE (colors); i++) { +igt_plane_set_fb (plane, colors[i]); +igt_display_commit_atomic (&display,0 ,NULL ); +igt_pipe_crc_get_current (display.drm_fd, pipe_crc, &reference[i]); + } + +for (i =0 ; i <4 ; i++) { +int color = i %ARRAY_SIZE (colors); + +igt_plane_set_fb (plane, colors[color]); +igt_output_set_writeback_fb (output, &output_fb); +igt_display_commit_atomic (&display,0 ,NULL ); +get_and_wait_out_fence (output); + +/* Require fresh frames without stopping or restarting capture. */ +for (j =0 ; j <3 ; j++) { +igt_pipe_crc_get_current (display.drm_fd, pipe_crc, &crc); +igt_assert_crc_equal (&reference[color], &crc); + } + } + +igt_plane_set_fb (plane, &input_fb); +igt_display_commit_atomic (&display,0 ,NULL ); +igt_remove_fb (display.drm_fd, &blue_fb); +igt_remove_fb (display.drm_fd, &output_fb); + } + igt_fixture() { +igt_pipe_crc_free (pipe_crc);cleanup_writeback (&display, output);igt_remove_fb (display.drm_fd, &input_fb);
base-commit: bb76404eac7032ba85c53eac15b76e4fadaff0de
Signature · 1 line
2.50.1 (Apple Git-155)
Patchwork
CI✗ LGCI.VerificationFailed: failure for tests/kms_writeback: Check CRC capture survives writeback (rev2)
In reply to atipre== Series Details ==
== Series Details ==
Series: tests/kms_writeback: Check CRC capture survives writeback (rev2)
URL : https://patchwork.freedesktop.org/series/176841/
State : failure
== Summary ==
Series author address '[email protected]' is not on the allowlist, which prevents CI from being automatically triggered. If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork. Exception occurred during validation, bailing out!
Build URL: http://gfx-ci.igk.intel.com:8080/job/CI_IGTPW_check/243327/ (on cidrm1)
Patchwork
CI✓ Xe.CI.BAT: success for tests/kms_writeback: Check CRC capture survives writeback (rev3)
In reply to atipre== Series Details ==
== Series Details ==
Series: tests/kms_writeback: Check CRC capture survives writeback (rev3)
URL : https://patchwork.freedesktop.org/series/176841/
State : success
== Summary ==
CI Bug Log - changes from XEIGT_9175_BAT -> XEIGTPW_16083_BAT
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (15 -> 15)
------------------------------
No changes in participating hosts
Changes
-------
No changes found
Build changes
-------------
* IGT: IGT_9175 -> IGTPW_16083
IGTPW_16083: 16083
IGT_9175: 9175
xe-6046-79cefeb775e63da397152ab01c2f1d4fa1b9b46d: 79cefeb775e63da397152ab01c2f1d4fa1b9b46d
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_16083/index.html
Patchwork
CI✓ i915.CI.BAT: success for tests/kms_writeback: Check CRC capture survives writeback (rev3)
In reply to atipre== Series Details ==
== Series Details ==
Series: tests/kms_writeback: Check CRC capture survives writeback (rev3)
URL : https://patchwork.freedesktop.org/series/176841/
State : success
== Summary ==
CI Bug Log - changes from IGT_9175 -> IGTPW_16083
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/index.html
Participating hosts (38 -> 39)
------------------------------
Additional (2): bat-arls-5 bat-adls-6
Missing (1): bat-dg2-13
Known issues
------------
Here are the changes found in IGTPW_16083 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@runner@aborted:
- bat-adls-6: NOTRUN -> [FAIL][1] ([i915#17747])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/bat-adls-6/igt@[email protected]
- bat-arls-5: NOTRUN -> [FAIL][2] ([i915#17747])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/bat-arls-5/igt@[email protected]
[i915#17747]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/17747
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_9175 -> IGTPW_16083
* Linux: CI_DRM_19430 -> CI_DRM_19431
CI-20190529: 20190529
CI_DRM_19430: 79cefeb775e63da397152ab01c2f1d4fa1b9b46d @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_19431: 2cd78713d917a02987f21b437561a5e1e13ddda2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_16083: 16083
IGT_9175: 9175
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/index.html
Patchwork
CI✓ Xe.CI.FULL: success for tests/kms_writeback: Check CRC capture survives writeback (rev3)
In reply to atipre== Series Details ==
== Series Details ==
Series: tests/kms_writeback: Check CRC capture survives writeback (rev3)
URL : https://patchwork.freedesktop.org/series/176841/
State : success
== Summary ==
CI Bug Log - changes from XEIGT_9175_FULL -> XEIGTPW_16083_FULL
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (3 -> 3)
------------------------------
No changes in participating hosts
Changes
-------
No changes found
Build changes
-------------
* IGT: IGT_9175 -> IGTPW_16083
IGTPW_16083: 16083
IGT_9175: 9175
xe-6046-79cefeb775e63da397152ab01c2f1d4fa1b9b46d: 79cefeb775e63da397152ab01c2f1d4fa1b9b46d
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_16083/index.html
Patchwork
CI✓ i915.CI.Full: success for tests/kms_writeback: Check CRC capture survives writeback (rev3)
In reply to atipre== Series Details ==
== Series Details ==
Series: tests/kms_writeback: Check CRC capture survives writeback (rev3)
URL : https://patchwork.freedesktop.org/series/176841/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_19431_full -> IGTPW_16083_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/index.html
Participating hosts (11 -> 10)
------------------------------
Missing (1): pig-kbl-iris
Known issues
------------
Here are the changes found in IGTPW_16083_full that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@i915_module_load@load:
- shard-tglu: ([PASS][1], [PASS][2], [PASS][3], [PASS][4], [PASS][5], [PASS][6], [PASS][7], [PASS][8], [PASS][9], [PASS][10], [PASS][11], [PASS][12], [PASS][13], [PASS][14], [PASS][15], [PASS][16], [PASS][17], [PASS][18], [SKIP][19], [PASS][20]) ([i915#17257]) -> ([PASS][21], [PASS][22], [PASS][23], [PASS][24], [PASS][25], [PASS][26], [PASS][27], [PASS][28], [PASS][29], [PASS][30], [PASS][31], [PASS][32], [PASS][33], [PASS][34], [PASS][35], [PASS][36], [PASS][37], [PASS][38], [PASS][39], [PASS][40])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-5/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-4/igt@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-7/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-10/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-5/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-4/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-9/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-2/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-4/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-9/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-10/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-8/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-3/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-2/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-9/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-8/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-5/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-7/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19431/shard-tglu-3/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-4/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-8/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-9/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-2/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-8/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-10/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-10/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-5/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-4/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-3/igt@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-4/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-5/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-3/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-7/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-2/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-7/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-9/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-3/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-8/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/shard-tglu-7/igt@[email protected]
[i915#17257]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/17257
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_9175 -> IGTPW_16083
* Piglit: piglit_4509 -> None
CI-20190529: 20190529
CI_DRM_19431: 2cd78713d917a02987f21b437561a5e1e13ddda2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_16083: 16083
IGT_9175: 9175
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_16083/index.html
Hi @atipre,
Quoted 41 lines
-----Original Message-----
From: igt-dev <[email protected]> On Behalf Of atipre
Sent: 25 October 2026 23:54
To: [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH i-g-t] tests/kms_writeback: Check CRC capture survives writebackThe existing writeback tests validate captured framebuffer contents, but do not keep pipe CRC capture active across writeback completion. This misses the VKMS bug where writeback cleanup disables the composer while CRC capture still needs it, leaving subsequent CRC reads waiting for samples that never arrive.
Add writeback-preserves-crc. Complete the initial modeset before starting capture and establish reference CRCs for separate red and blue input framebuffers. Keep capture open across four alternating writebacks, wait for each output fence, and compare three fresh CRC samples with the corresponding reference after each writeback. Use atomic updates without
ALLOW_MODESETonce capture starts, and release capture from the final fixture so a failed subtest also closes it.Check output fence status in the shared wait helper so a signalled error fence cannot be treated as a successful writeback.
On ARM64 QEMU with one and two CPUs, the new subtest fails on unmodified mainline and passes with the local VKMS composer-user lifetime fix. Four existing applicable writeback subtests pass on both kernels; the two XRGB2101010 subtests skip because the format probe rejects them.
Signed-off-by atipre <[email protected]>--- tests/kms_writeback.c | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)tests/kms_writeback.c index renamed from tests/kms_writeback.c +0
-07c30e8e..71317cf 100644
tests/kms_writeback.c line 70
Quoted 7 lines
tests/kms_writeback.c +4
-0@@ -64,6 +64,10 @@* * SUBTEST: writeback-pixel-formats * Description: Check the writeback format +* +* SUBTEST: writeback-preserves-crc +* Description: CRC capture remains active across completed writebacks +* Driver requirement: i915, xe, vkms
Xe doesn't support writeback. We can't test it now. In future, we can. I hope you didn't tested it on xe.
Quoted 68 lines
tests/kms_writeback.c +1
-0*/ IGT_TEST_DESCRIPTION(@@ -317,6 +321,7 @@ static void get_and_wait_out_fence(igt_output_t *output) ret =sync_fence_wait (output->writeback_out_fence_fd,1000 );igt_assert_f (ret ==0 ,"sync_fence_wait failed: %s\n" ,strerror (-ret)); +igt_assert_eq (sync_fence_status (output->writeback_out_fence_fd),1 );close (output->writeback_out_fence_fd); output->writeback_out_fence_fd =-1 ;}
tests/kms_writeback.c +1
-0@@ -537,6 +542,7 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_output_t *output;igt_plane_t *plane;igt_fb_t input_fb, input_fb_10bit; +static igt_pipe_crc_t *pipe_crc;drmModeModeInfo mode;unsigned int fb_id;tests/kms_writeback.c +16
-0int ret;@@ -709,7 +715,63 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_remove_fb (display.drm_fd, &output_fb); } +igt_describe ("CRC capture remains active across completed writebacks"); + igt_subtest("writeback-preserves-crc") { +igt_fb_t blue_fb, output_fb; +igt_fb_t *colors[] = { &input_fb, &blue_fb }; +igt_crc_t reference[2 ], crc; +int i, j; + +igt_skip_on (data.dump_check || data.list_modes); +igt_require (data.supported_colors &XRGB8888 ); +igt_require_pipe_crc (display.drm_fd); + +igt_create_color_fb (display.drm_fd, mode.hdisplay, mode.vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR , +0.0 ,0.0 ,1.0 , &blue_fb); + igt_create_fb(display.drm_fd, mode.hdisplay, mode.vdisplay, + DRM_FORMAT_XRGB8888,
DRM_FORMAT_MOD_LINEAR,tests/kms_writeback.c +5
-0+ &output_fb); +fill_fb (&input_fb,0x00ff0000 ); +igt_plane_set_fb (plane, &input_fb); +igt_output_set_writeback_fb (output,NULL ); + igt_display_commit_atomic(&display,
DRM_MODE_ATOMIC_ALLOW_MODESET,tests/kms_writeback.c +3
-0+NULL); + +/* Finish the modeset before starting continuous CRC capture. */
tests/kms_writeback.c +1
-0+ pipe_crc = igt_pipe_crc_new(display.drm_fd, output-Quoted 1 line
config.crtc_index,
tests/kms_writeback.c +4
-0+ IGT_PIPE_CRC_SOURCE_AUTO); +igt_pipe_crc_start (pipe_crc); + +/* Establish both references before writeback can affect capture. */
tests/kms_writeback.c +4
-0+for (i =0 ; i <ARRAY_SIZE (colors); i++) { +igt_plane_set_fb (plane, colors[i]); +igt_display_commit_atomic (&display,0 ,NULL ); + igt_pipe_crc_get_current(display.drm_fd, pipe_crc,&reference[i]);
tests/kms_writeback.c int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL) · line 759
Quoted 10 lines
tests/kms_writeback.c +10
-0+ } + +for (i =0 ; i <4 ; i++) { +int color = i %ARRAY_SIZE (colors); + +igt_plane_set_fb (plane, colors[color]); +igt_output_set_writeback_fb (output, &output_fb); +igt_display_commit_atomic (&display,0 ,NULL ); +get_and_wait_out_fence (output); +
This drops DRM_MODE_ATOMIC_ALLOW_MODESET for a WRITEBACK_FB_ID commit.
Every other call site of igt_output_set_writeback_fb() in this file (do_writeback_test(), writeback_sequence()) and in kms_colorop.c pairs it with ALLOW_MODESET, with no exceptions. igt_display_commit_atomic() asserts on a non-zero return, so if the kernel still requires ALLOW_MODESET here on i915/xe, this subtest will hard-fail there for reasons unrelated to the composer bug being tested.
Did you confirm this commit actually succeeds without ALLOW_MODESET, or did it only need to work on the vkms config you tested against? If it's vkms-specific behavior, worth a comment explaining why it's safe to drop here when nothing else in the file does.
Quoted 5 lines
tests/kms_writeback.c +1
-0+/* Require fresh frames without stopping or restarting capture. */
tests/kms_writeback.c +2
-0+for (j =0 ; j <3 ; j++) { + igt_pipe_crc_get_current(display.drm_fd,
pipe_crc, &crc);
tests/kms_writeback.c int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL) · line 771
Quoted 9 lines
tests/kms_writeback.c +9
-0+igt_assert_crc_equal (&reference[color], &crc); + } + } + +igt_plane_set_fb (plane, &input_fb); +igt_display_commit_atomic (&display,0 ,NULL ); +igt_remove_fb (display.drm_fd, &blue_fb); +igt_remove_fb (display.drm_fd, &output_fb); + }
Minor: blue_fb/output_fb are only released at the end of the subtest body, so an igt_assert_crc_equal() failure inside the loop above (the actual failure mode this test is meant to catch) will leak both FBs for the rest of the binary's run. You already handled this correctly for pipe_crc (static + unconditional free in the trailing fixture); might be worth the same treatment here, though it's low severity.
Quoted 10 lines
tests/kms_writeback.c +2
-0+ igt_fixture() { +igt_pipe_crc_free (pipe_crc);cleanup_writeback (&display, output);igt_remove_fb (display.drm_fd, &input_fb);base-commit:
bb76404eac7032ba85c53eac15b76e4fadaff0de--
2.50.1 (Apple Git-155)
PATCH v3 1/2 tests/kms_writeback: Wait for the valid FB ID writeback
The positive WRITEBACK_FB_ID test submits a writeback to the common input framebuffer without requesting or waiting for its completion fence. A blocking atomic commit does not imply that writeback has finished.
The following pixel-output test fills the same buffer with its reference color. The earlier writeback can still be modifying it, leaving a mixture of the old and new contents and causing intermittent checksum failures. On ARM64 VKMS, a diagnostic run observed the prior fence still unsignalled and a black row in both the input and the captured output after the input had been filled red.
Request a fence for the successful FB ID writeback and wait for it before returning. Only require the returned fence descriptor to be -1 when the commit fails, so the shared commit helper also accepts this successful fenced operation. Keep all invalid-parameter checks intact.
---
New prerequisite in v3:
- Wait for the existing valid FB ID writeback before its target buffer is reused as input by the next subtest.
A diagnostic run observed the prior fence still unsignalled and a row of old black pixels replacing red input pixels. Waiting for the fence removes this race. The standalone fix passes the four applicable existing subtests on unfixed and fixed VKMS kernels with one and two CPUs; both XRGB2101010 cases skip.
tests/kms_writeback.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
tests/kms_writeback.c +6 -2
@@ -228,7 +228,7 @@ static int do_writeback_test(igt_output_t *output, uint32_t fb_id, ret =igt_display_try_commit_atomic (display,DRM_MODE_ATOMIC_ALLOW_MODESET ,NULL ); -if (ptr_valid) +if (ptr_valid && ret)igt_assert (*out_fence_ptr ==-1 );/* WRITEBACK_FB_ID must always read as zero */
@@ -288,8 +288,12 @@ static void writeback_fb_id(igt_output_t *output, igt_fb_t *valid_fb, igt_fb_t *igt_assert_eq (ret,0 );/* Valid output buffer */ - ret =do_writeback_test (output, valid_fb->fb_id,NULL , false); + ret =do_writeback_test (output, valid_fb->fb_id, + &output->writeback_out_fence_fd, true);igt_assert_eq (ret,0 ); + +/* The next subtest may reuse this buffer as input. */ +igt_get_and_wait_out_fence (output); }static void fill_fb (igt_fb_t *fb,uint32_t pixel)
base-commit: 454657e58fbcfd6fa8a9db0830aa1652fe6364c2
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH v3 2/2 tests/kms_writeback: Check CRC capture survives writeback
The existing writeback tests validate captured framebuffer contents, but do not keep pipe CRC capture active across writeback completion. This misses the VKMS bug where writeback cleanup disables the composer while CRC capture still needs it, leaving subsequent CRC reads waiting for samples that never arrive.
Add a VKMS-only writeback-preserves-crc subtest. Complete the initial modeset before starting capture and establish reference CRCs for separate red and blue input framebuffers. Keep capture open across four alternating writebacks, wait for each output fence, and compare three fresh CRC samples with the corresponding reference after each writeback. Do not allow modesets once capture starts, since they may disrupt CRC generation.
Clear the pending out-fence request left by the configuration probe before the initial modeset so the subtest also works when run independently. Use the final fixture to close capture, disable the output, and remove the two new framebuffers so subtest failure or skip also cleans them up.
Check output fence status in the shared wait helper so a signalled error fence cannot be treated as a successful writeback.
On ARM64 QEMU with one and two CPUs, the new subtest fails with a CRC read timeout on the unmodified kernel and passes with the VKMS composer-user lifetime fix, both independently and in the full writeback suite.
---
Changes in v3:
- Add the preceding writeback-fb-id completion fix so earlier subtests do not race while reusing the shared input framebuffer.
- Restrict the new subtest to VKMS in metadata and at runtime.
- Explain why commits after starting CRC capture do not allow modesets.
- Release the new framebuffers in the final fixture after disabling output.
- Clear the configuration probe's pending writeback out-fence request so the subtest works independently of earlier writeback subtests.
Changes in v2:
- Use my full name in the author and Signed-off-by fields.
- No code changes.
Validation on ARM64 QEMU/HVF with one and two CPUs:
- With both patches applied, all four existing applicable subtests pass on the unfixed and fixed kernels; both XRGB2101010 cases skip.
- The new regression, independently and in the full suite, times out at the post-writeback CRC read on the unfixed kernel and passes with the VKMS composer lifetime fix.
- Disposable probes verify FB and buffer-handle cleanup before DRM FD close after partial setup, CRC comparison failure while blue is scanned out, the natural baseline timeout, success, and skip.
tests/kms_writeback.c | 67 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)
tests/kms_writeback.c +67 -0
@@ -64,6 +64,10 @@* * SUBTEST: writeback-pixel-formats * Description: Check the writeback format +* +* SUBTEST: writeback-preserves-crc +* Description: CRC capture remains active across completed writebacks +* Driver requirement: vkms */ IGT_TEST_DESCRIPTION(
@@ -321,6 +325,7 @@ static void get_and_wait_out_fence(igt_output_t *output) ret =sync_fence_wait (output->writeback_out_fence_fd,1000 );igt_assert_f (ret ==0 ,"sync_fence_wait failed: %s\n" ,strerror (-ret)); +igt_assert_eq (sync_fence_status (output->writeback_out_fence_fd),1 );close (output->writeback_out_fence_fd); output->writeback_out_fence_fd =-1 ; }
@@ -541,6 +546,8 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_output_t *output;igt_plane_t *plane;igt_fb_t input_fb, input_fb_10bit; +static igt_pipe_crc_t *pipe_crc; +static igt_fb_t crc_blue_fb, crc_output_fb;drmModeModeInfo mode;unsigned int fb_id;int ret;
@@ -713,8 +720,68 @@ int igt_main_args("b:c:f:dl", long_options, help_str, opt_handler, NULL)igt_remove_fb (display.drm_fd, &output_fb); } +igt_describe ("CRC capture remains active across completed writebacks" ); + igt_subtest("writeback-preserves-crc") { +igt_fb_t *colors[] = { &input_fb, &crc_blue_fb }; +igt_crc_t reference[2 ], crc; +int i, j; + +igt_skip_on (data.dump_check || data.list_modes); +igt_require (is_vkms_device (display.drm_fd)); +igt_require (data.supported_colors &XRGB8888 ); +igt_require_pipe_crc (display.drm_fd); + +igt_create_color_fb (display.drm_fd, mode.hdisplay, mode.vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR , +0.0 ,0.0 ,1.0 , &crc_blue_fb); +igt_create_fb (display.drm_fd, mode.hdisplay, mode.vdisplay, +DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_LINEAR , + &crc_output_fb); +fill_fb (&input_fb,0x00ff0000 ); +igt_plane_set_fb (plane, &input_fb); +igt_output_set_writeback_fb (output,NULL ); +/* Discard the out-fence request left by the configuration probe. */ +igt_output_set_prop_value (output,IGT_CONNECTOR_WRITEBACK_OUT_FENCE_PTR , +to_user_pointer (NULL )); +igt_display_commit_atomic (&display,DRM_MODE_ATOMIC_ALLOW_MODESET ,NULL ); + +/* Finish the modeset before starting continuous CRC capture. */ + pipe_crc =igt_pipe_crc_new (display.drm_fd, output->config.crtc_index, +IGT_PIPE_CRC_SOURCE_AUTO ); +igt_pipe_crc_start (pipe_crc); + +/* +* Establish both references before writeback can affect capture. +* Do not allow modesets below: they may disrupt continuous CRC +* generation. +*/ +for (i =0 ; i <ARRAY_SIZE (colors); i++) { +igt_plane_set_fb (plane, colors[i]); +igt_display_commit_atomic (&display,0 ,NULL ); +igt_pipe_crc_get_current (display.drm_fd, pipe_crc, &reference[i]); + } + +for (i =0 ; i <4 ; i++) { +int color = i %ARRAY_SIZE (colors); + +igt_plane_set_fb (plane, colors[color]); +igt_output_set_writeback_fb (output, &crc_output_fb); +igt_display_commit_atomic (&display,0 ,NULL ); +get_and_wait_out_fence (output); + +/* Require fresh frames without stopping or restarting capture. */ +for (j =0 ; j <3 ; j++) { +igt_pipe_crc_get_current (display.drm_fd, pipe_crc, &crc); +igt_assert_crc_equal (&reference[color], &crc); + } + } + } + igt_fixture() { +igt_pipe_crc_free (pipe_crc);cleanup_writeback (&display, output); +igt_remove_fb (display.drm_fd, &crc_blue_fb); +igt_remove_fb (display.drm_fd, &crc_output_fb);igt_remove_fb (display.drm_fd, &input_fb);if (data.supported_colors &XRGB2101010 )
Signature · 1 line
2.50.1 (Apple Git-155)