tests/kms_cursor_crc: refactoring cursor-alpha subtests
PATCH v2 1/1 tests/kms_cursor_crc: refactoring cursor-alpha subtests
Considering just a fully opaque or fully transparent cursor is not enough to check the composition of an ARGB cursor plane. For example, the cairo ARGB32 format uses pre-multiplied alpha, and this representation may only be evident when testing a translucent cursor.
Therefore, this patch refactors the cursor-alpha-opaque and cursor-alpha-transparent subtests into just one subtest (cursor-alpha) that checks the alpha blending of a white cursor, with different alpha values, in the primary plane. This refactoring also generates some setup stuffs savings.
v2:
- debug log states the alpha whenever CRC mismatch (Arek)
- checking all alpha values before asserting the result (Arek)
--- tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 42 deletions(-)
tests/kms_cursor_crc.c +45 -42
@@ -428,65 +428,73 @@ static void prepare_crtc(data_t *data, igt_output_t *output,igt_pipe_crc_start (data->pipe_crc); } -static void test_cursor_alpha (data_t *data,double a) +static void test_cursor_alpha (data_t *data) {igt_display_t *display = &data->display;igt_pipe_crc_t *pipe_crc = data->pipe_crc; -igt_crc_t crc, ref_crc; +igt_crc_t crc[5 ], ref_crc;cairo_t *cr;uint32_t fb_id;int curw = data->curw;int curh = data->curh; +int i, index; +double alpha; +bool mismatch = false; -/* Alpha cursor fb with white color */ +/* Alpha cursor fb */ fb_id =igt_create_fb (data->drm_fd, curw, curh,DRM_FORMAT_ARGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , &data->fb);igt_assert (fb_id); + +/* +* Hardware Test +* With the cursor enabled, get the PF CRCs from the composition with a +* white cursor with different alpha values. +*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->fb); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); +cairo_set_operator (cr,CAIRO_OPERATOR_SOURCE ); -/* Hardware Test - enable cursor and get PF CRC */ cursor_enable (data); -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); + +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc[i]); + } +igt_put_cairo_ctx (cr);cursor_disable (data);igt_remove_fb (data->drm_fd, &data->fb); -/* Software Test - render cursor in software, drawn it directly on PF */ +/* Software Test - render cursor in software, drawn it directly on PF*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); - -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -/* Compare CRC from Hardware/Software tests */ -igt_assert_crc_equal (&crc, &ref_crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); -/*Clear Screen*/ - cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, -0.0 ,0.0 ,0.0 ); -igt_put_cairo_ctx (cr); -} +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -static void test_cursor_transparent (data_t *data) -{ -test_cursor_alpha (data,0.0 ); +/* Compare CRC from Hardware/Software tests */ +if (igt_find_crc_mismatch (&crc[i], &ref_crc, &index)) { + mismatch = true; +igt_debug ("CRC mismatch for alpha %.2f: 0x%x != 0x%x\n" , + alpha, crc[i].crc[index], ref_crc.crc[index]); + } -} +/*Clear Screen*/ +igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, +0.0 ,0.0 ,0.0 ); + } +igt_put_cairo_ctx (cr); -static void test_cursor_opaque (data_t *data) -{ -test_cursor_alpha (data,1.0 ); +igt_assert_f (!mismatch,"At least one CRC mismatch detected\n" ); }static void run_test (data_t *data,void (*testfunc)(data_t *),int cursor_w,int cursor_h)
@@ -655,15 +663,10 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)run_test (data, test_cursor_size, data->cursor_max_w, data->cursor_max_h); -igt_describe ("Validates the composition of a fully opaque cursor " -"plane, i.e., alpha channel equal to 1.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-opaque", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_opaque, data->cursor_max_w, data->cursor_max_h); - -igt_describe ("Validates the composition of a fully transparent cursor " -"plane, i.e., alpha channel equal to 0.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-transparent", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_transparent, data->cursor_max_w, data->cursor_max_h); +igt_describe ("Validates the composition of alpha cursor plane " +"from fully opaque to fully transparent alpha range" ); + igt_subtest_f("pipe-%s-cursor-alpha", kmstest_pipe_name(pipe)) +run_test (data, test_cursor_alpha, data->cursor_max_w, data->cursor_max_h); igt_fixture create_cursor_fb(data, data->cursor_max_w, data->cursor_max_h);
Signature · 6 lines
2.28.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2)
== Series Details ==
== Series Details ==
Series: tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2)
URL : https://patchwork.freedesktop.org/series/81060/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_9174 -> IGTPW_5080
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/index.html
Known issues
------------
Here are the changes found in IGTPW_5080 that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-byt-j1900: [DMESG-WARN][1] ([i915#1982]) -> [PASS][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/fi-byt-j1900/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/fi-byt-j1900/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-bsw-kefka: [DMESG-WARN][3] ([i915#1982]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/fi-bsw-kefka/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/fi-bsw-kefka/igt@[email protected]
* igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1:
- fi-icl-u2: [DMESG-WARN][5] ([i915#1982]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/fi-icl-u2/igt@kms_flip@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/fi-icl-u2/igt@kms_flip@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2417]: https://gitlab.freedesktop.org/drm/intel/issues/2417
Participating hosts (44 -> 39)
------------------------------
Additional (1): fi-skl-guc
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_5822 -> IGTPW_5080
CI-20190529: 20190529
CI_DRM_9174: 66ac51120c329a9f93352cf480f5098adab24af8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5080: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/index.html
IGT_5822: b4bcf05cb9839037128905deda7146434155cc41 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Testlist changes ==
+igt@kms_cursor_crc@pipe-a-cursor-alpha +igt@kms_cursor_crc@pipe-b-cursor-alpha +igt@kms_cursor_crc@pipe-c-cursor-alpha +igt@kms_cursor_crc@pipe-d-cursor-alpha +igt@kms_cursor_crc@pipe-e-cursor-alpha +igt@kms_cursor_crc@pipe-f-cursor-alpha -igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque -igt@kms_cursor_crc@pipe-a-cursor-alpha-transparent -igt@kms_cursor_crc@pipe-b-cursor-alpha-opaque -igt@kms_cursor_crc@pipe-b-cursor-alpha-transparent -igt@kms_cursor_crc@pipe-c-cursor-alpha-opaque -igt@kms_cursor_crc@pipe-c-cursor-alpha-transparent -igt@kms_cursor_crc@pipe-d-cursor-alpha-opaque -igt@kms_cursor_crc@pipe-d-cursor-alpha-transparent -igt@kms_cursor_crc@pipe-e-cursor-alpha-opaque -igt@kms_cursor_crc@pipe-e-cursor-alpha-transparent -igt@kms_cursor_crc@pipe-f-cursor-alpha-opaque -igt@kms_cursor_crc@pipe-f-cursor-alpha-transparent
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/index.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2)
In reply to Melissa Wen== Series Details ==
== Series Details ==
Series: tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2)
URL : https://patchwork.freedesktop.org/series/81060/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_9174_full -> IGTPW_5080_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_5080_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_5080_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://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_5080_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_exec_flush@basic-wb-ro-before-default:
- shard-snb: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-snb5/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb4/igt@[email protected]
* igt@kms_big_fb@linear-16bpp-rotate-0:
- shard-glk: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk8/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk4/igt@[email protected]
* {igt@kms_cursor_crc@pipe-c-cursor-alpha} (NEW):
- shard-glk: NOTRUN -> [FAIL][5] +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk6/igt@[email protected]
New tests
---------
New tests have been introduced between CI_DRM_9174_full and IGTPW_5080_full:
### New IGT tests (4) ###
* igt@kms_cursor_crc@pipe-a-cursor-alpha:
- Statuses : 1 fail(s) 6 pass(s)
- Exec time: [0.55, 0.86] s
* igt@kms_cursor_crc@pipe-b-cursor-alpha:
- Statuses : 1 fail(s) 6 pass(s)
- Exec time: [0.61, 1.98] s
* igt@kms_cursor_crc@pipe-c-cursor-alpha:
- Statuses : 1 fail(s) 5 pass(s) 1 skip(s)
- Exec time: [0.0, 1.99] s
* igt@kms_cursor_crc@pipe-d-cursor-alpha:
- Statuses : 1 pass(s) 6 skip(s)
- Exec time: [0.0, 1.82] s
Known issues
------------
Here are the changes found in IGTPW_5080_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@core_setmaster@master-drop-set-user:
- shard-iclb: [PASS][6] -> [FAIL][7] ([i915#2247])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-iclb6/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb8/igt@[email protected]
- shard-kbl: [PASS][8] -> [FAIL][9] ([i915#2247])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl1/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl4/igt@[email protected]
- shard-snb: [PASS][10] -> [FAIL][11] ([i915#2247])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-snb2/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb2/igt@[email protected]
- shard-tglb: [PASS][12] -> [FAIL][13] ([i915#2247])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-tglb8/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb5/igt@[email protected]
- shard-apl: [PASS][14] -> [FAIL][15] ([i915#1635] / [i915#2247])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-apl7/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl7/igt@[email protected]
- shard-glk: [PASS][16] -> [FAIL][17] ([i915#2247])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk7/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk3/igt@[email protected]
- shard-hsw: [PASS][18] -> [FAIL][19] ([i915#2247])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw8/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw5/igt@[email protected]
* igt@feature_discovery@psr2:
- shard-iclb: [PASS][20] -> [SKIP][21] ([i915#658])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-iclb2/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb5/igt@[email protected]
* igt@gem_exec_reloc@basic-many-active@rcs0:
- shard-hsw: [PASS][22] -> [FAIL][23] ([i915#2389])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw8/igt@gem_exec_reloc@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw7/igt@gem_exec_reloc@[email protected]
* igt@gem_exec_reloc@basic-range:
- shard-glk: [PASS][24] -> [INCOMPLETE][25] ([i915#1888])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk9/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk4/igt@[email protected]
* igt@gem_exec_whisper@basic-queues-forked-all:
- shard-glk: [PASS][26] -> [FAIL][27] ([i915#2547])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk5/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk4/igt@[email protected]
* igt@gem_partial_pwrite_pread@writes-after-reads-display:
- shard-hsw: [PASS][28] -> [FAIL][29] ([i915#1888])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw8/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw5/igt@[email protected]
- shard-snb: [PASS][30] -> [INCOMPLETE][31] ([i915#82])
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-snb2/igt@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb5/igt@[email protected]
* igt@i915_pm_rpm@modeset-non-lpsp-stress-no-wait:
- shard-kbl: [PASS][32] -> [TIMEOUT][33] ([i915#1288])
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl1/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl6/igt@[email protected]
- shard-apl: [PASS][34] -> [TIMEOUT][35] ([i915#1288] / [i915#1635])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-apl2/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl6/igt@[email protected]
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2:
- shard-glk: [PASS][36] -> [FAIL][37] ([i915#79])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk5/igt@kms_flip@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk3/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbc-rgb565-draw-mmap-wc:
- shard-snb: [PASS][38] -> [FAIL][39] ([i915#2546])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-snb5/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb5/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-plflip-blt:
- shard-tglb: [PASS][40] -> [DMESG-WARN][41] ([i915#1982]) +5 similar issues
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-tglb6/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb2/igt@[email protected]
* igt@kms_psr@psr2_cursor_mmap_cpu:
- shard-iclb: [PASS][42] -> [SKIP][43] ([fdo#109441]) +2 similar issues
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb1/igt@kms_psr@psr2_cursor_mmap_cpu.html
* igt@kms_vblank@pipe-b-wait-idle:
- shard-kbl: [PASS][44] -> [DMESG-WARN][45] ([i915#1982]) +3 similar issues
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl1/igt@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl4/igt@[email protected]
* igt@perf@invalid-oa-format-id:
- shard-kbl: [PASS][46] -> [SKIP][47] ([fdo#109271] / [i915#1354])
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl2/igt@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl1/igt@[email protected]
- shard-hsw: [PASS][48] -> [SKIP][49] ([fdo#109271])
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw2/igt@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw6/igt@[email protected]
- shard-tglb: [PASS][50] -> [SKIP][51] ([i915#1354])
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-tglb3/igt@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb2/igt@[email protected]
- shard-iclb: [PASS][52] -> [SKIP][53] ([i915#1354])
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-iclb1/igt@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb4/igt@[email protected]
- shard-apl: [PASS][54] -> [SKIP][55] ([fdo#109271] / [i915#1354] / [i915#1635])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-apl1/igt@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl4/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_reloc@basic-many-active@vecs0:
- shard-glk: [FAIL][56] ([i915#2389]) -> [PASS][57] +2 similar issues
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk7/igt@gem_exec_reloc@[email protected]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk5/igt@gem_exec_reloc@[email protected]
* igt@gem_exec_whisper@basic-forked-all:
- shard-glk: [DMESG-WARN][58] ([i915#118] / [i915#95]) -> [PASS][59] +1 similar issue
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk9/igt@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk2/igt@[email protected]
* igt@gem_exec_whisper@basic-queues-priority-all:
- shard-glk: [FAIL][60] -> [PASS][61]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk6/igt@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk2/igt@[email protected]
* igt@i915_suspend@debugfs-reader:
- shard-kbl: [INCOMPLETE][62] ([i915#155]) -> [PASS][63]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl4/igt@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl4/igt@[email protected]
* igt@kms_atomic_transition@plane-use-after-nonblocking-unbind@vga-1-pipe-a:
- shard-hsw: [DMESG-WARN][64] ([i915#1982]) -> [PASS][65]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw6/igt@kms_atomic_transition@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw7/igt@kms_atomic_transition@[email protected]
* igt@kms_big_fb@linear-32bpp-rotate-180:
- shard-glk: [DMESG-FAIL][66] ([i915#118] / [i915#95]) -> [PASS][67]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk4/igt@[email protected]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk8/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding:
- shard-apl: [FAIL][68] ([i915#1635] / [i915#54]) -> [PASS][69]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-apl4/igt@[email protected]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl4/igt@[email protected]
- shard-kbl: [FAIL][70] ([i915#54]) -> [PASS][71]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl4/igt@[email protected]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl4/igt@[email protected]
* igt@kms_draw_crc@draw-method-xrgb2101010-blt-untiled:
- shard-snb: [FAIL][72] ([i915#54]) -> [PASS][73]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-snb2/igt@[email protected]
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb7/igt@[email protected]
* igt@kms_flip@blocking-wf_vblank@a-edp1:
- shard-tglb: [DMESG-WARN][74] ([i915#1982]) -> [PASS][75] +5 similar issues
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-tglb3/igt@kms_flip@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb2/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-expired-vblank@b-hdmi-a2:
- shard-glk: [FAIL][76] ([i915#79]) -> [PASS][77]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk2/igt@kms_flip@[email protected]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk2/igt@kms_flip@[email protected]
* igt@kms_psr@psr2_no_drrs:
- shard-iclb: [SKIP][78] ([fdo#109441]) -> [PASS][79] +2 similar issues
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-iclb4/igt@kms_psr@psr2_no_drrs.html
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb2/igt@kms_psr@psr2_no_drrs.html
* igt@kms_setmode@basic:
- shard-glk: [FAIL][80] ([i915#31]) -> [PASS][81]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk1/igt@[email protected]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk9/igt@[email protected]
* igt@kms_universal_plane@universal-plane-gen9-features-pipe-a:
- shard-kbl: [DMESG-WARN][82] ([i915#1982]) -> [PASS][83]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl2/igt@[email protected]
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl7/igt@[email protected]
* igt@perf@polling:
- shard-glk: [SKIP][84] ([fdo#109271] / [i915#1354]) -> [PASS][85]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk6/igt@[email protected]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk9/igt@[email protected]
- shard-tglb: [SKIP][86] ([i915#1354]) -> [PASS][87]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-tglb2/igt@[email protected]
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb5/igt@[email protected]
- shard-apl: [SKIP][88] ([fdo#109271] / [i915#1354] / [i915#1635]) -> [PASS][89]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-apl8/igt@[email protected]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl2/igt@[email protected]
- shard-kbl: [SKIP][90] ([fdo#109271] / [i915#1354]) -> [PASS][91]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl1/igt@[email protected]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl7/igt@[email protected]
- shard-hsw: [SKIP][92] ([fdo#109271]) -> [PASS][93]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw8/igt@[email protected]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw8/igt@[email protected]
- shard-iclb: [SKIP][94] ([i915#1354]) -> [PASS][95]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-iclb5/igt@[email protected]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb1/igt@[email protected]
* igt@perf_pmu@module-unload:
- shard-apl: [DMESG-WARN][96] ([i915#1635] / [i915#1982]) -> [PASS][97]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-apl1/igt@[email protected]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl3/igt@[email protected]
* igt@prime_vgem@coherency-blt:
- shard-snb: [FAIL][98] -> [PASS][99]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-snb2/igt@[email protected]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb7/igt@[email protected]
- shard-hsw: [FAIL][100] -> [PASS][101]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw8/igt@[email protected]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw7/igt@[email protected]
#### Warnings ####
* igt@kms_content_protection@atomic-dpms:
- shard-apl: [TIMEOUT][102] ([i915#1319] / [i915#1635]) -> [FAIL][103] ([fdo#110321] / [fdo#110336] / [i915#1635])
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-apl6/igt@[email protected]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl2/igt@[email protected]
* igt@kms_content_protection@lic:
- shard-apl: [TIMEOUT][104] ([i915#1319] / [i915#1635]) -> [FAIL][105] ([fdo#110321] / [i915#1635])
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-apl1/igt@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl8/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-suspend:
- shard-tglb: [DMESG-WARN][106] ([i915#1982] / [i915#2411]) -> [DMESG-WARN][107] ([i915#2411])
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-tglb8/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb1/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
[fdo#110336]: https://bugs.freedesktop.org/show_bug.cgi?id=110336
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1288]: https://gitlab.freedesktop.org/drm/intel/issues/1288
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#1354]: https://gitlab.freedesktop.org/drm/intel/issues/1354
[i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2247]: https://gitlab.freedesktop.org/drm/intel/issues/2247
[i915#2389]: https://gitlab.freedesktop.org/drm/intel/issues/2389
[i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
[i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
[i915#2546]: https://gitlab.freedesktop.org/drm/intel/issues/2546
[i915#2547]: https://gitlab.freedesktop.org/drm/intel/issues/2547
[i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (11 -> 8)
------------------------------
Missing (3): pig-skl-6260u pig-glk-j5005 pig-icl-1065g7
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_5822 -> IGTPW_5080
* Piglit: piglit_4509 -> None
CI-20190529: 20190529
CI_DRM_9174: 66ac51120c329a9f93352cf480f5098adab24af8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5080: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/index.html
IGT_5822: b4bcf05cb9839037128905deda7146434155cc41 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/index.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Hey,
I saw that the CI reported a failure again for alpha = 0.5. Could it be a rounding issue?
Melissa Wen
Quoted 153 lines · Melissa Wen
Considering just a fully opaque or fully transparent cursor is not enough to check the composition of an ARGB cursor plane. For example, the cairo ARGB32 format uses pre-multiplied alpha, and this representation may only be evident when testing a translucent cursor.
Therefore, this patch refactors the cursor-alpha-opaque and cursor-alpha-transparent subtests into just one subtest (cursor-alpha) that checks the alpha blending of a white cursor, with different alpha values, in the primary plane. This refactoring also generates some setup stuffs savings.
v2:
- debug log states the alpha whenever CRC mismatch (Arek)
- checking all alpha values before asserting the result (Arek)Signed-off-by Melissa Wen <[email protected]>--- tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 42 deletions(-)tests/kms_cursor_crc.c +45
-43@@ -428,65 +428,73 @@ static void prepare_crtc(data_t *data, igt_output_t *output,igt_pipe_crc_start (data->pipe_crc); } -static void test_cursor_alpha (data_t *data,double a) +static void test_cursor_alpha (data_t *data) {igt_display_t *display = &data->display;igt_pipe_crc_t *pipe_crc = data->pipe_crc; -igt_crc_t crc, ref_crc; +igt_crc_t crc[5 ], ref_crc;cairo_t *cr;uint32_t fb_id;int curw = data->curw;int curh = data->curh; +int i, index; +double alpha; +bool mismatch = false; -/* Alpha cursor fb with white color */ +/* Alpha cursor fb */ fb_id =igt_create_fb (data->drm_fd, curw, curh,DRM_FORMAT_ARGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , &data->fb);igt_assert (fb_id); + +/* +* Hardware Test +* With the cursor enabled, get the PF CRCs from the composition with a +* white cursor with different alpha values. +*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->fb); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); +cairo_set_operator (cr,CAIRO_OPERATOR_SOURCE ); -/* Hardware Test - enable cursor and get PF CRC */ cursor_enable (data); -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); + +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc[i]); + } +igt_put_cairo_ctx (cr);cursor_disable (data);igt_remove_fb (data->drm_fd, &data->fb); -/* Software Test - render cursor in software, drawn it directly on PF */ +/* Software Test - render cursor in software, drawn it directly on PF*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); - -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -/* Compare CRC from Hardware/Software tests */ -igt_assert_crc_equal (&crc, &ref_crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); -/*Clear Screen*/ - cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, -0.0 ,0.0 ,0.0 ); -igt_put_cairo_ctx (cr); -} +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -static void test_cursor_transparent (data_t *data) -{ -test_cursor_alpha (data,0.0 ); +/* Compare CRC from Hardware/Software tests */ +if (igt_find_crc_mismatch (&crc[i], &ref_crc, &index)) { + mismatch = true; +igt_debug ("CRC mismatch for alpha %.2f: 0x%x != 0x%x\n" , + alpha, crc[i].crc[index], ref_crc.crc[index]); + } -} +/*Clear Screen*/ +igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, +0.0 ,0.0 ,0.0 ); + } +igt_put_cairo_ctx (cr); -static void test_cursor_opaque (data_t *data) -{ -test_cursor_alpha (data,1.0 ); +igt_assert_f (!mismatch,"At least one CRC mismatch detected\n" ); }static void run_test (data_t *data,void (*testfunc)(data_t *),int cursor_w,int cursor_h)@@ -655,15 +663,10 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)run_test (data, test_cursor_size, data->cursor_max_w, data->cursor_max_h); -igt_describe ("Validates the composition of a fully opaque cursor " -"plane, i.e., alpha channel equal to 1.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-opaque", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_opaque, data->cursor_max_w, data->cursor_max_h); - -igt_describe ("Validates the composition of a fully transparent cursor " -"plane, i.e., alpha channel equal to 0.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-transparent", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_transparent, data->cursor_max_w, data->cursor_max_h); +igt_describe ("Validates the composition of alpha cursor plane " +"from fully opaque to fully transparent alpha range" ); + igt_subtest_f("pipe-%s-cursor-alpha", kmstest_pipe_name(pipe)) +run_test (data, test_cursor_alpha, data->cursor_max_w, data->cursor_max_h); igt_fixture create_cursor_fb(data, data->cursor_max_w, data->cursor_max_h); --
Quoted 2 lines
2.28.0
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 4 lines · Melissa Wen
Hey,
I saw that the CI reported a failure again for alpha = 0.5. Could it be a rounding issue?
Swati and/or J-P, please check this failure.
Signature · 1 line
Petri Latvala
Quoted 154 lines
Melissa Wen
Quoted 150 lines · Melissa Wen
Considering just a fully opaque or fully transparent cursor is not enough to check the composition of an ARGB cursor plane. For example, the cairo ARGB32 format uses pre-multiplied alpha, and this representation may only be evident when testing a translucent cursor.
Therefore, this patch refactors the cursor-alpha-opaque and cursor-alpha-transparent subtests into just one subtest (cursor-alpha) that checks the alpha blending of a white cursor, with different alpha values, in the primary plane. This refactoring also generates some setup stuffs savings.
v2:
- debug log states the alpha whenever CRC mismatch (Arek)
- checking all alpha values before asserting the result (Arek)Signed-off-by Melissa Wen <[email protected]>--- tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 42 deletions(-)tests/kms_cursor_crc.c +45
-42@@ -428,65 +428,73 @@ static void prepare_crtc(data_t *data, igt_output_t *output,igt_pipe_crc_start (data->pipe_crc); } -static void test_cursor_alpha (data_t *data,double a) +static void test_cursor_alpha (data_t *data) {igt_display_t *display = &data->display;igt_pipe_crc_t *pipe_crc = data->pipe_crc; -igt_crc_t crc, ref_crc; +igt_crc_t crc[5 ], ref_crc;cairo_t *cr;uint32_t fb_id;int curw = data->curw;int curh = data->curh; +int i, index; +double alpha; +bool mismatch = false; -/* Alpha cursor fb with white color */ +/* Alpha cursor fb */ fb_id =igt_create_fb (data->drm_fd, curw, curh,DRM_FORMAT_ARGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , &data->fb);igt_assert (fb_id); + +/* +* Hardware Test +* With the cursor enabled, get the PF CRCs from the composition with a +* white cursor with different alpha values. +*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->fb); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); +cairo_set_operator (cr,CAIRO_OPERATOR_SOURCE ); -/* Hardware Test - enable cursor and get PF CRC */ cursor_enable (data); -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); + +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc[i]); + } +igt_put_cairo_ctx (cr);cursor_disable (data);igt_remove_fb (data->drm_fd, &data->fb); -/* Software Test - render cursor in software, drawn it directly on PF */ +/* Software Test - render cursor in software, drawn it directly on PF*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); - -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -/* Compare CRC from Hardware/Software tests */ -igt_assert_crc_equal (&crc, &ref_crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); -/*Clear Screen*/ - cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, -0.0 ,0.0 ,0.0 ); -igt_put_cairo_ctx (cr); -} +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -static void test_cursor_transparent (data_t *data) -{ -test_cursor_alpha (data,0.0 ); +/* Compare CRC from Hardware/Software tests */ +if (igt_find_crc_mismatch (&crc[i], &ref_crc, &index)) { + mismatch = true; +igt_debug ("CRC mismatch for alpha %.2f: 0x%x != 0x%x\n" , + alpha, crc[i].crc[index], ref_crc.crc[index]); + } -} +/*Clear Screen*/ +igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, +0.0 ,0.0 ,0.0 ); + } +igt_put_cairo_ctx (cr); -static void test_cursor_opaque (data_t *data) -{ -test_cursor_alpha (data,1.0 ); +igt_assert_f (!mismatch,"At least one CRC mismatch detected\n" ); }static void run_test (data_t *data,void (*testfunc)(data_t *),int cursor_w,int cursor_h)@@ -655,15 +663,10 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)run_test (data, test_cursor_size, data->cursor_max_w, data->cursor_max_h); -igt_describe ("Validates the composition of a fully opaque cursor " -"plane, i.e., alpha channel equal to 1.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-opaque", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_opaque, data->cursor_max_w, data->cursor_max_h); - -igt_describe ("Validates the composition of a fully transparent cursor " -"plane, i.e., alpha channel equal to 0.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-transparent", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_transparent, data->cursor_max_w, data->cursor_max_h); +igt_describe ("Validates the composition of alpha cursor plane " +"from fully opaque to fully transparent alpha range" ); + igt_subtest_f("pipe-%s-cursor-alpha", kmstest_pipe_name(pipe)) +run_test (data, test_cursor_alpha, data->cursor_max_w, data->cursor_max_h);
Quoted 5 lines
Quoted 5 lines
tests/kms_cursor_crc.c +0
-1igt_fixture create_cursor_fb(data, data->cursor_max_w, data->cursor_max_h); --2.28.0
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 10 lines · Melissa Wen
Considering just a fully opaque or fully transparent cursor is not enough to check the composition of an ARGB cursor plane. For example, the cairo ARGB32 format uses pre-multiplied alpha, and this representation may only be evident when testing a translucent cursor.
Therefore, this patch refactors the cursor-alpha-opaque and cursor-alpha-transparent subtests into just one subtest (cursor-alpha) that checks the alpha blending of a white cursor, with different alpha values, in the primary plane. This refactoring also generates some setup stuffs savings.
Black background means you can't actually tell the difference between premultiplied blending and no blending.
Oh, I guess restore_image() does end up painting the test pattern into the primary plane's fb? Are we guaranteed to position the cursor over some non-black parts?
The other obvious concern is whether hardware and software blending will produce the exact same results or not. I do see you use 1/4 steps for the alpha, which I guess can make that more likely.
Side note: data->primary_fb[RESTOREBUFFER] looks to be dead weight
Quoted 148 lines
v2:
- debug log states the alpha whenever CRC mismatch (Arek)
- checking all alpha values before asserting the result (Arek)Signed-off-by Melissa Wen <[email protected]>--- tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 42 deletions(-)tests/kms_cursor_crc.c +45
-42@@ -428,65 +428,73 @@ static void prepare_crtc(data_t *data, igt_output_t *output,igt_pipe_crc_start (data->pipe_crc); } -static void test_cursor_alpha (data_t *data,double a) +static void test_cursor_alpha (data_t *data) {igt_display_t *display = &data->display;igt_pipe_crc_t *pipe_crc = data->pipe_crc; -igt_crc_t crc, ref_crc; +igt_crc_t crc[5 ], ref_crc;cairo_t *cr;uint32_t fb_id;int curw = data->curw;int curh = data->curh; +int i, index; +double alpha; +bool mismatch = false; -/* Alpha cursor fb with white color */ +/* Alpha cursor fb */ fb_id =igt_create_fb (data->drm_fd, curw, curh,DRM_FORMAT_ARGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , &data->fb);igt_assert (fb_id); + +/* +* Hardware Test +* With the cursor enabled, get the PF CRCs from the composition with a +* white cursor with different alpha values. +*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->fb); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); +cairo_set_operator (cr,CAIRO_OPERATOR_SOURCE ); -/* Hardware Test - enable cursor and get PF CRC */ cursor_enable (data); -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); + +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc[i]); + } +igt_put_cairo_ctx (cr);cursor_disable (data);igt_remove_fb (data->drm_fd, &data->fb); -/* Software Test - render cursor in software, drawn it directly on PF */ +/* Software Test - render cursor in software, drawn it directly on PF*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); - -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -/* Compare CRC from Hardware/Software tests */ -igt_assert_crc_equal (&crc, &ref_crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); -/*Clear Screen*/ - cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, -0.0 ,0.0 ,0.0 ); -igt_put_cairo_ctx (cr); -} +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -static void test_cursor_transparent (data_t *data) -{ -test_cursor_alpha (data,0.0 ); +/* Compare CRC from Hardware/Software tests */ +if (igt_find_crc_mismatch (&crc[i], &ref_crc, &index)) { + mismatch = true; +igt_debug ("CRC mismatch for alpha %.2f: 0x%x != 0x%x\n" , + alpha, crc[i].crc[index], ref_crc.crc[index]); + } -} +/*Clear Screen*/ +igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, +0.0 ,0.0 ,0.0 ); + } +igt_put_cairo_ctx (cr); -static void test_cursor_opaque (data_t *data) -{ -test_cursor_alpha (data,1.0 ); +igt_assert_f (!mismatch,"At least one CRC mismatch detected\n" ); }static void run_test (data_t *data,void (*testfunc)(data_t *),int cursor_w,int cursor_h)@@ -655,15 +663,10 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)run_test (data, test_cursor_size, data->cursor_max_w, data->cursor_max_h); -igt_describe ("Validates the composition of a fully opaque cursor " -"plane, i.e., alpha channel equal to 1.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-opaque", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_opaque, data->cursor_max_w, data->cursor_max_h); - -igt_describe ("Validates the composition of a fully transparent cursor " -"plane, i.e., alpha channel equal to 0.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-transparent", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_transparent, data->cursor_max_w, data->cursor_max_h); +igt_describe ("Validates the composition of alpha cursor plane " +"from fully opaque to fully transparent alpha range" ); + igt_subtest_f("pipe-%s-cursor-alpha", kmstest_pipe_name(pipe)) +run_test (data, test_cursor_alpha, data->cursor_max_w, data->cursor_max_h); igt_fixture create_cursor_fb(data, data->cursor_max_w, data->cursor_max_h);Signature · 6 lines
2.28.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 21 lines · Ville Syrjälä
Quoted 10 lines · Melissa Wen
Considering just a fully opaque or fully transparent cursor is not enough to check the composition of an ARGB cursor plane. For example, the cairo ARGB32 format uses pre-multiplied alpha, and this representation may only be evident when testing a translucent cursor.
Therefore, this patch refactors the cursor-alpha-opaque and cursor-alpha-transparent subtests into just one subtest (cursor-alpha) that checks the alpha blending of a white cursor, with different alpha values, in the primary plane. This refactoring also generates some setup stuffs savings.
Black background means you can't actually tell the difference between premultiplied blending and no blending.
Oh, I guess
restore_image()does end up painting the test pattern into the primary plane's fb? Are we guaranteed to position the cursor over some non-black parts?
Quoted 4 lines
The other obvious concern is whether hardware and software blending will produce the exact same results or not. I do see you use 1/4 steps for the alpha, which I guess can make that more likely.
I don't think verifying those blending levels will be possible when comparing hw vs sw image, to me it seemed different gens behave different with cursor alpha. On this test to make it fail reliably even with alpha value 1.0 one just need to change from cursor image white sub block into grey level 0.5.
Quoted 2 lines
Side note: data->primary_fb[RESTOREBUFFER] looks to be dead weight
Seems it was left when rendercopy was taken out from this test.
Quoted 145 lines
Quoted 145 lines
v2:
- debug log states the alpha whenever CRC mismatch (Arek)
- checking all alpha values before asserting the result (Arek)Signed-off-by Melissa Wen <[email protected]>--- tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 42 deletions(-)tests/kms_cursor_crc.c +45
-42@@ -428,65 +428,73 @@ static void prepare_crtc(data_t *data, igt_output_t *output,igt_pipe_crc_start (data->pipe_crc); } -static void test_cursor_alpha (data_t *data,double a) +static void test_cursor_alpha (data_t *data) {igt_display_t *display = &data->display;igt_pipe_crc_t *pipe_crc = data->pipe_crc; -igt_crc_t crc, ref_crc; +igt_crc_t crc[5 ], ref_crc;cairo_t *cr;uint32_t fb_id;int curw = data->curw;int curh = data->curh; +int i, index; +double alpha; +bool mismatch = false; -/* Alpha cursor fb with white color */ +/* Alpha cursor fb */ fb_id =igt_create_fb (data->drm_fd, curw, curh,DRM_FORMAT_ARGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , &data->fb);igt_assert (fb_id); + +/* +* Hardware Test +* With the cursor enabled, get the PF CRCs from the composition with a +* white cursor with different alpha values. +*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->fb); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); +cairo_set_operator (cr,CAIRO_OPERATOR_SOURCE ); -/* Hardware Test - enable cursor and get PF CRC */ cursor_enable (data); -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); + +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc[i]); + } +igt_put_cairo_ctx (cr);cursor_disable (data);igt_remove_fb (data->drm_fd, &data->fb); -/* Software Test - render cursor in software, drawn it directly on PF */ +/* Software Test - render cursor in software, drawn it directly on PF*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); - -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -/* Compare CRC from Hardware/Software tests */ -igt_assert_crc_equal (&crc, &ref_crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); -/*Clear Screen*/ - cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, -0.0 ,0.0 ,0.0 ); -igt_put_cairo_ctx (cr); -} +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -static void test_cursor_transparent (data_t *data) -{ -test_cursor_alpha (data,0.0 ); +/* Compare CRC from Hardware/Software tests */ +if (igt_find_crc_mismatch (&crc[i], &ref_crc, &index)) { + mismatch = true; +igt_debug ("CRC mismatch for alpha %.2f: 0x%x != 0x%x\n" , + alpha, crc[i].crc[index], ref_crc.crc[index]); + } -} +/*Clear Screen*/ +igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, +0.0 ,0.0 ,0.0 ); + } +igt_put_cairo_ctx (cr); -static void test_cursor_opaque (data_t *data) -{ -test_cursor_alpha (data,1.0 ); +igt_assert_f (!mismatch,"At least one CRC mismatch detected\n" ); }static void run_test (data_t *data,void (*testfunc)(data_t *),int cursor_w,int cursor_h)@@ -655,15 +663,10 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)run_test (data, test_cursor_size, data->cursor_max_w, data->cursor_max_h); -igt_describe ("Validates the composition of a fully opaque cursor " -"plane, i.e., alpha channel equal to 1.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-opaque", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_opaque, data->cursor_max_w, data->cursor_max_h); - -igt_describe ("Validates the composition of a fully transparent cursor " -"plane, i.e., alpha channel equal to 0.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-transparent", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_transparent, data->cursor_max_w, data->cursor_max_h); +igt_describe ("Validates the composition of alpha cursor plane " +"from fully opaque to fully transparent alpha range" ); + igt_subtest_f("pipe-%s-cursor-alpha", kmstest_pipe_name(pipe)) +run_test (data, test_cursor_alpha, data->cursor_max_w, data->cursor_max_h); igt_fixture create_cursor_fb(data, data->cursor_max_w, data->cursor_max_h);Signature · 1 line
2.28.0
Quoted 5 lines
Quoted 4 lines
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 27 lines · Juha-Pekka Heikkila
Quoted 21 lines · Ville Syrjälä
Quoted 10 lines · Melissa Wen
Considering just a fully opaque or fully transparent cursor is not enough to check the composition of an ARGB cursor plane. For example, the cairo ARGB32 format uses pre-multiplied alpha, and this representation may only be evident when testing a translucent cursor.
Therefore, this patch refactors the cursor-alpha-opaque and cursor-alpha-transparent subtests into just one subtest (cursor-alpha) that checks the alpha blending of a white cursor, with different alpha values, in the primary plane. This refactoring also generates some setup stuffs savings.
Black background means you can't actually tell the difference between premultiplied blending and no blending.
Oh, I guess
restore_image()does end up painting the test pattern into the primary plane's fb? Are we guaranteed to position the cursor over some non-black parts?Quoted 4 lines
The other obvious concern is whether hardware and software blending will produce the exact same results or not. I do see you use 1/4 steps for the alpha, which I guess can make that more likely.
Quoted 6 lines
I don't think verifying those blending levels will be possible when comparing hw vs sw image, to me it seemed different gens behave different with cursor alpha. On this test to make it fail reliably even with alpha value 1.0 one just need to change from cursor image white sub block into grey level 0.5.
Hi, Ville and Juha-Pekka
Thanks for feedback.
To be honest, I'm a little confused by the issues you raised. Maybe I'm not getting it right.
(1) We currently have two test cases to check the composition of the cursor plane with the primary: alpha = 0 and alpha = 1, both with solid black background and white cursor. For these cases, the premultiplied or straight alpha blending behave equally, since the cursor is just all 00 or all FF.
but for any other non-extreme alpha value, if the alpha blending is straight, it will end up "applying alpha twice". For example, if I remember correctly, cairo draws a white cursor alpha 0.5 = 80808080; and doing a *straight* alpha blending on black background results in FF404040. And this is why this patch checks the composition for extreme and non-extreme alpha values.
Another way could be just to check a third alpha value, without all these alpha levels... I mean, if you think checking non-extreme values makes sense.
(2) On the other hand, I guess that the "CRC mismatch for alpha = 0.5" for IGTPW_5080 is not really related to the proper composition, but it is a rounding issue (225 * 0.5 = 127.5). Because it didn't fail for any other non-extreme alpha levels and to get 128 without rounding issue, alpha should be 0.502.
Therefore, if the problem here is rounding, would be better to take this problematic case off, right?
Quoted 143 lines
Quoted 2 lines
Side note: data->primary_fb[RESTOREBUFFER] looks to be dead weight
Seems it was left when rendercopy was taken out from this test.
Quoted 137 lines
Quoted 136 lines
v2:
- debug log states the alpha whenever CRC mismatch (Arek)
- checking all alpha values before asserting the result (Arek)Signed-off-by Melissa Wen <[email protected]>--- tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 42 deletions(-)tests/kms_cursor_crc.c +45
-42@@ -428,65 +428,73 @@ static void prepare_crtc(data_t *data, igt_output_t *output,igt_pipe_crc_start (data->pipe_crc); } -static void test_cursor_alpha (data_t *data,double a) +static void test_cursor_alpha (data_t *data) {igt_display_t *display = &data->display;igt_pipe_crc_t *pipe_crc = data->pipe_crc; -igt_crc_t crc, ref_crc; +igt_crc_t crc[5 ], ref_crc;cairo_t *cr;uint32_t fb_id;int curw = data->curw;int curh = data->curh; +int i, index; +double alpha; +bool mismatch = false; -/* Alpha cursor fb with white color */ +/* Alpha cursor fb */ fb_id =igt_create_fb (data->drm_fd, curw, curh,DRM_FORMAT_ARGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , &data->fb);igt_assert (fb_id); + +/* +* Hardware Test +* With the cursor enabled, get the PF CRCs from the composition with a +* white cursor with different alpha values. +*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->fb); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); +cairo_set_operator (cr,CAIRO_OPERATOR_SOURCE ); -/* Hardware Test - enable cursor and get PF CRC */ cursor_enable (data); -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); + +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc[i]); + } +igt_put_cairo_ctx (cr);cursor_disable (data);igt_remove_fb (data->drm_fd, &data->fb); -/* Software Test - render cursor in software, drawn it directly on PF */ +/* Software Test - render cursor in software, drawn it directly on PF*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); - -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -/* Compare CRC from Hardware/Software tests */ -igt_assert_crc_equal (&crc, &ref_crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); -/*Clear Screen*/ - cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, -0.0 ,0.0 ,0.0 ); -igt_put_cairo_ctx (cr); -} +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -static void test_cursor_transparent (data_t *data) -{ -test_cursor_alpha (data,0.0 ); +/* Compare CRC from Hardware/Software tests */ +if (igt_find_crc_mismatch (&crc[i], &ref_crc, &index)) { + mismatch = true; +igt_debug ("CRC mismatch for alpha %.2f: 0x%x != 0x%x\n" , + alpha, crc[i].crc[index], ref_crc.crc[index]); + } -} +/*Clear Screen*/ +igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, +0.0 ,0.0 ,0.0 ); + } +igt_put_cairo_ctx (cr); -static void test_cursor_opaque (data_t *data) -{ -test_cursor_alpha (data,1.0 ); +igt_assert_f (!mismatch,"At least one CRC mismatch detected\n" ); }static void run_test (data_t *data,void (*testfunc)(data_t *),int cursor_w,int cursor_h)@@ -655,15 +663,10 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)run_test (data, test_cursor_size, data->cursor_max_w, data->cursor_max_h); -igt_describe ("Validates the composition of a fully opaque cursor " -"plane, i.e., alpha channel equal to 1.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-opaque", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_opaque, data->cursor_max_w, data->cursor_max_h); - -igt_describe ("Validates the composition of a fully transparent cursor " -"plane, i.e., alpha channel equal to 0.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-transparent", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_transparent, data->cursor_max_w, data->cursor_max_h); +igt_describe ("Validates the composition of alpha cursor plane " +"from fully opaque to fully transparent alpha range" ); + igt_subtest_f("pipe-%s-cursor-alpha", kmstest_pipe_name(pipe)) +run_test (data, test_cursor_alpha, data->cursor_max_w, data->cursor_max_h); igt_fixture create_cursor_fb(data, data->cursor_max_w, data->cursor_max_h);Signature · 6 lines
2.28.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 57 lines · Melissa Wen
Quoted 27 lines · Juha-Pekka Heikkila
Quoted 21 lines · Ville Syrjälä
Quoted 10 lines · Melissa Wen
Considering just a fully opaque or fully transparent cursor is not enough to check the composition of an ARGB cursor plane. For example, the cairo ARGB32 format uses pre-multiplied alpha, and this representation may only be evident when testing a translucent cursor.
Therefore, this patch refactors the cursor-alpha-opaque and cursor-alpha-transparent subtests into just one subtest (cursor-alpha) that checks the alpha blending of a white cursor, with different alpha values, in the primary plane. This refactoring also generates some setup stuffs savings.
Black background means you can't actually tell the difference between premultiplied blending and no blending.
Oh, I guess
restore_image()does end up painting the test pattern into the primary plane's fb? Are we guaranteed to position the cursor over some non-black parts?Quoted 4 lines
The other obvious concern is whether hardware and software blending will produce the exact same results or not. I do see you use 1/4 steps for the alpha, which I guess can make that more likely.
Quoted 6 lines
I don't think verifying those blending levels will be possible when comparing hw vs sw image, to me it seemed different gens behave different with cursor alpha. On this test to make it fail reliably even with alpha value 1.0 one just need to change from cursor image white sub block into grey level 0.5.
Hi, Ville and Juha-Pekka
Thanks for feedback.
To be honest, I'm a little confused by the issues you raised. Maybe I'm not getting it right.
(1) We currently have two test cases to check the composition of the cursor plane with the primary: alpha = 0 and alpha = 1, both with solid black background and white cursor. For these cases, the premultiplied or straight alpha blending behave equally, since the cursor is just all 00 or all FF.
but for any other non-extreme alpha value, if the alpha blending is straight, it will end up "applying alpha twice". For example, if I remember correctly, cairo draws a white cursor alpha 0.5 = 80808080; and doing a *straight* alpha blending on black background results in FF404040. And this is why this patch checks the composition for extreme and non-extreme alpha values.
Another way could be just to check a third alpha value, without all these alpha levels... I mean, if you think checking non-extreme values makes sense.
Quoted 9 lines
(2) On the other hand, I guess that the "CRC mismatch for alpha = 0.5" for
IGTPW_5080is not really related to the proper composition, but it is a rounding issue (225 * 0.5 = 127.5). Because it didn't fail for any other non-extreme alpha levels and to get 128 without rounding issue, alpha should be 0.502.Therefore, if the problem here is rounding, would be better to take this problematic case off, right?
..just some random thoughts..
All cursor tests are running with alpha enabled, most of them just set it to maximum value. This is because cursor plane did support only pixel formats with alpha. As for those alphas, this test for example kms_cursor_crc@pipe-*-cursor-*x*-onscreen is quite fragile across platforms with alphas even if it explicitly doesn't try to test alpha, from this I draw those alphas generally are not behaving same in all platforms.
For those differences on gens with alpha behavior on kernel side you'll find in intel_display.c icl_set_pipe_chicken(..) where is set display wa #1153 which was put in place just to make cursor tests happy for icl back in time. I was checking same bit for tgl but didn't find one hence I was correcting colors some time ago on this test to 'safe' colors (see 43fa6db in igt git log). Earlier there was in use colors which had 0.5 value failing the test, this sound really familiar to your 0.5 alpha problem. TBH it is interesting when you run test on tgl with 0.5 alpha and it _doesn't_ fail because using those 0.5 colors on tgl did fail this test.
As for your conclusion I think you are spot on this issue is about rounding but I don't know was there a promise on hw side 0.5 means same as what Cairo does. It was on test results now failing only on glk for you? With those terms knowing alpha subtest is as fragile as everything else on kms_cursor_crc that could be pushed upstream knowing there is history baggage to drag on. IGT anyway is already committed to idea of what some alpha/color/.. value mean for cairo will mean same thing for display hw, there is kms_color struggling with similar problems.
I wonder what does Ville think about that Cairo vs hw issue?
Quoted 137 lines
Quoted 137 lines
Quoted 2 lines
Side note: data->primary_fb[RESTOREBUFFER] looks to be dead weight
Seems it was left when rendercopy was taken out from this test.
Quoted 132 lines
Quoted 132 lines
v2:
- debug log states the alpha whenever CRC mismatch (Arek)
- checking all alpha values before asserting the result (Arek)Signed-off-by Melissa Wen <[email protected]>--- tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 42 deletions(-)tests/kms_cursor_crc.c +45
-42@@ -428,65 +428,73 @@ static void prepare_crtc(data_t *data, igt_output_t *output,igt_pipe_crc_start (data->pipe_crc); } -static void test_cursor_alpha (data_t *data,double a) +static void test_cursor_alpha (data_t *data) {igt_display_t *display = &data->display;igt_pipe_crc_t *pipe_crc = data->pipe_crc; -igt_crc_t crc, ref_crc; +igt_crc_t crc[5 ], ref_crc;cairo_t *cr;uint32_t fb_id;int curw = data->curw;int curh = data->curh; +int i, index; +double alpha; +bool mismatch = false; -/* Alpha cursor fb with white color */ +/* Alpha cursor fb */ fb_id =igt_create_fb (data->drm_fd, curw, curh,DRM_FORMAT_ARGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , &data->fb);igt_assert (fb_id); + +/* +* Hardware Test +* With the cursor enabled, get the PF CRCs from the composition with a +* white cursor with different alpha values. +*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->fb); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); +cairo_set_operator (cr,CAIRO_OPERATOR_SOURCE ); -/* Hardware Test - enable cursor and get PF CRC */ cursor_enable (data); -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); + +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &crc[i]); + } +igt_put_cairo_ctx (cr);cursor_disable (data);igt_remove_fb (data->drm_fd, &data->fb); -/* Software Test - render cursor in software, drawn it directly on PF */ +/* Software Test - render cursor in software, drawn it directly on PF*/ cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , a); -igt_put_cairo_ctx (cr); - -igt_display_commit (display); -igt_wait_for_vblank (data->drm_fd, - display->pipes[data->pipe].crtc_offset); -igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -/* Compare CRC from Hardware/Software tests */ -igt_assert_crc_equal (&crc, &ref_crc); +for (i =0 , alpha =1.0 ; alpha >=0.0 ; alpha -=0.25 , i++) { +igt_paint_color_alpha (cr,0 ,0 , curw, curh,1.0 ,1.0 ,1.0 , alpha); -/*Clear Screen*/ - cr =igt_get_cairo_ctx (data->drm_fd, &data->primary_fb[FRONTBUFFER ]); -igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, -0.0 ,0.0 ,0.0 ); -igt_put_cairo_ctx (cr); -} +igt_display_commit (display); +igt_wait_for_vblank (data->drm_fd, + display->pipes[data->pipe].crtc_offset); +igt_pipe_crc_get_current (data->drm_fd, pipe_crc, &ref_crc); -static void test_cursor_transparent (data_t *data) -{ -test_cursor_alpha (data,0.0 ); +/* Compare CRC from Hardware/Software tests */ +if (igt_find_crc_mismatch (&crc[i], &ref_crc, &index)) { + mismatch = true; +igt_debug ("CRC mismatch for alpha %.2f: 0x%x != 0x%x\n" , + alpha, crc[i].crc[index], ref_crc.crc[index]); + } -} +/*Clear Screen*/ +igt_paint_color (cr,0 ,0 , data->screenw, data->screenh, +0.0 ,0.0 ,0.0 ); + } +igt_put_cairo_ctx (cr); -static void test_cursor_opaque (data_t *data) -{ -test_cursor_alpha (data,1.0 ); +igt_assert_f (!mismatch,"At least one CRC mismatch detected\n" ); }static void run_test (data_t *data,void (*testfunc)(data_t *),int cursor_w,int cursor_h)@@ -655,15 +663,10 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe)run_test (data, test_cursor_size, data->cursor_max_w, data->cursor_max_h); -igt_describe ("Validates the composition of a fully opaque cursor " -"plane, i.e., alpha channel equal to 1.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-opaque", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_opaque, data->cursor_max_w, data->cursor_max_h); - -igt_describe ("Validates the composition of a fully transparent cursor " -"plane, i.e., alpha channel equal to 0.0." ); - igt_subtest_f("pipe-%s-cursor-alpha-transparent", kmstest_pipe_name(pipe)) -run_test (data, test_cursor_transparent, data->cursor_max_w, data->cursor_max_h); +igt_describe ("Validates the composition of alpha cursor plane " +"from fully opaque to fully transparent alpha range" ); + igt_subtest_f("pipe-%s-cursor-alpha", kmstest_pipe_name(pipe)) +run_test (data, test_cursor_alpha, data->cursor_max_w, data->cursor_max_h); igt_fixture create_cursor_fb(data, data->cursor_max_w, data->cursor_max_h);Signature · 1 line
2.28.0
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 98 lines · Juha-Pekka Heikkila
Quoted 57 lines · Melissa Wen
Quoted 27 lines · Juha-Pekka Heikkila
Quoted 21 lines · Ville Syrjälä
Quoted 10 lines · Melissa Wen
Considering just a fully opaque or fully transparent cursor is not enough to check the composition of an ARGB cursor plane. For example, the cairo ARGB32 format uses pre-multiplied alpha, and this representation may only be evident when testing a translucent cursor.
Therefore, this patch refactors the cursor-alpha-opaque and cursor-alpha-transparent subtests into just one subtest (cursor-alpha) that checks the alpha blending of a white cursor, with different alpha values, in the primary plane. This refactoring also generates some setup stuffs savings.
Black background means you can't actually tell the difference between premultiplied blending and no blending.
Oh, I guess
restore_image()does end up painting the test pattern into the primary plane's fb? Are we guaranteed to position the cursor over some non-black parts?Quoted 4 lines
The other obvious concern is whether hardware and software blending will produce the exact same results or not. I do see you use 1/4 steps for the alpha, which I guess can make that more likely.
Quoted 6 lines
I don't think verifying those blending levels will be possible when comparing hw vs sw image, to me it seemed different gens behave different with cursor alpha. On this test to make it fail reliably even with alpha value 1.0 one just need to change from cursor image white sub block into grey level 0.5.
Hi, Ville and Juha-Pekka
Thanks for feedback.
To be honest, I'm a little confused by the issues you raised. Maybe I'm not getting it right.
(1) We currently have two test cases to check the composition of the cursor plane with the primary: alpha = 0 and alpha = 1, both with solid black background and white cursor. For these cases, the premultiplied or straight alpha blending behave equally, since the cursor is just all 00 or all FF.
but for any other non-extreme alpha value, if the alpha blending is straight, it will end up "applying alpha twice". For example, if I remember correctly, cairo draws a white cursor alpha 0.5 = 80808080; and doing a *straight* alpha blending on black background results in FF404040. And this is why this patch checks the composition for extreme and non-extreme alpha values.
Another way could be just to check a third alpha value, without all these alpha levels... I mean, if you think checking non-extreme values makes sense.Quoted 9 lines
(2) On the other hand, I guess that the "CRC mismatch for alpha = 0.5" for
IGTPW_5080is not really related to the proper composition, but it is a rounding issue (225 * 0.5 = 127.5). Because it didn't fail for any other non-extreme alpha levels and to get 128 without rounding issue, alpha should be 0.502.Therefore, if the problem here is rounding, would be better to take this problematic case off, right?
..just some random thoughts..
All cursor tests are running with alpha enabled, most of them just set it to maximum value. This is because cursor plane did support only pixel formats with alpha. As for those alphas, this test for example kms_cursor_crc@pipe-*-cursor-*x*-onscreen is quite fragile across platforms with alphas even if it explicitly doesn't try to test alpha, from this I draw those alphas generally are not behaving same in all platforms.
For those differences on gens with alpha behavior on kernel side you'll find in
intel_display.cicl_set_pipe_chicken(..)where is set display wa #1153 which was put in place just to make cursor tests happy for icl back in time. I was checking same bit for tgl but didn't find one hence I was correcting colors some time ago on this test to 'safe' colors (see 43fa6db in igt git log). Earlier there was in use colors which had 0.5 value failing the test, this sound really familiar to your 0.5 alpha problem. TBH it is interesting when you run test on tgl with 0.5 alpha and it _doesn't_ fail because using those 0.5 colors on tgl did fail this test.As for your conclusion I think you are spot on this issue is about rounding but I don't know was there a promise on hw side 0.5 means same as what Cairo does. It was on test results now failing only on glk for you? With those terms knowing alpha subtest is as fragile as everything else on
kms_cursor_crcthat could be pushed upstream knowing there is history baggage to drag on. IGT anyway is already committed to idea of what some alpha/color/.. value mean for cairo will mean same thing for display hw, there iskms_colorstruggling with similar problems.
Quoted 1 line
I wonder what does Ville think about that Cairo vs hw issue?
One thing we could try is the "throw away some lsbs using the LUT" trick from kms_plane pixel format tests. But depending on the blending formula implemented in the hw I guess even that might not always work.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev