All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests
@ 2020-10-21  8:59 Melissa Wen
  2020-10-21  9:47 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Melissa Wen @ 2020-10-21  8:59 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, kernel-usp

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 <melissa.srw@gmail.com>
---
 tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++--------------------
 1 file changed, 45 insertions(+), 42 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 0be8f7f8..83c74a69 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -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);
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2)
  2020-10-21  8:59 [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests Melissa Wen
@ 2020-10-21  9:47 ` Patchwork
  2020-10-21 11:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2020-10-21  9:47 UTC (permalink / raw)
  To: Melissa Wen; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 3521 bytes --]

== 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@i915_pm_rpm@basic-pci-d3-state.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/fi-byt-j1900/igt@i915_pm_rpm@basic-pci-d3-state.html

  * 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@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * 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@basic-flip-vs-wf_vblank@c-edp1.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/fi-icl-u2/igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1.html

  
  {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

[-- Attachment #1.2: Type: text/html, Size: 4368 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2)
  2020-10-21  8:59 [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests Melissa Wen
  2020-10-21  9:47 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2) Patchwork
@ 2020-10-21 11:10 ` Patchwork
  2020-10-21 16:57 ` [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests Melissa Wen
  2020-10-22 10:37 ` Ville Syrjälä
  3 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2020-10-21 11:10 UTC (permalink / raw)
  To: Melissa Wen; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 22264 bytes --]

== 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@gem_exec_flush@basic-wb-ro-before-default.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb4/igt@gem_exec_flush@basic-wb-ro-before-default.html

  * 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@kms_big_fb@linear-16bpp-rotate-0.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk4/igt@kms_big_fb@linear-16bpp-rotate-0.html

  * {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@kms_cursor_crc@pipe-c-cursor-alpha.html

  
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@core_setmaster@master-drop-set-user.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb8/igt@core_setmaster@master-drop-set-user.html
    - shard-kbl:          [PASS][8] -> [FAIL][9] ([i915#2247])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl1/igt@core_setmaster@master-drop-set-user.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl4/igt@core_setmaster@master-drop-set-user.html
    - shard-snb:          [PASS][10] -> [FAIL][11] ([i915#2247])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-snb2/igt@core_setmaster@master-drop-set-user.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb2/igt@core_setmaster@master-drop-set-user.html
    - shard-tglb:         [PASS][12] -> [FAIL][13] ([i915#2247])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-tglb8/igt@core_setmaster@master-drop-set-user.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb5/igt@core_setmaster@master-drop-set-user.html
    - 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@core_setmaster@master-drop-set-user.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl7/igt@core_setmaster@master-drop-set-user.html
    - shard-glk:          [PASS][16] -> [FAIL][17] ([i915#2247])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-glk7/igt@core_setmaster@master-drop-set-user.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk3/igt@core_setmaster@master-drop-set-user.html
    - shard-hsw:          [PASS][18] -> [FAIL][19] ([i915#2247])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw8/igt@core_setmaster@master-drop-set-user.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw5/igt@core_setmaster@master-drop-set-user.html

  * 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@feature_discovery@psr2.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb5/igt@feature_discovery@psr2.html

  * 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@basic-many-active@rcs0.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw7/igt@gem_exec_reloc@basic-many-active@rcs0.html

  * 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@gem_exec_reloc@basic-range.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk4/igt@gem_exec_reloc@basic-range.html

  * 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@gem_exec_whisper@basic-queues-forked-all.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk4/igt@gem_exec_whisper@basic-queues-forked-all.html

  * 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@gem_partial_pwrite_pread@writes-after-reads-display.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw5/igt@gem_partial_pwrite_pread@writes-after-reads-display.html
    - shard-snb:          [PASS][30] -> [INCOMPLETE][31] ([i915#82])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-snb2/igt@gem_partial_pwrite_pread@writes-after-reads-display.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb5/igt@gem_partial_pwrite_pread@writes-after-reads-display.html

  * 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@i915_pm_rpm@modeset-non-lpsp-stress-no-wait.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl6/igt@i915_pm_rpm@modeset-non-lpsp-stress-no-wait.html
    - 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@i915_pm_rpm@modeset-non-lpsp-stress-no-wait.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl6/igt@i915_pm_rpm@modeset-non-lpsp-stress-no-wait.html

  * 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@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk3/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2.html

  * 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@kms_frontbuffer_tracking@fbc-rgb565-draw-mmap-wc.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb5/igt@kms_frontbuffer_tracking@fbc-rgb565-draw-mmap-wc.html

  * 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@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-plflip-blt.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb2/igt@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-plflip-blt.html

  * 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@kms_vblank@pipe-b-wait-idle.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl4/igt@kms_vblank@pipe-b-wait-idle.html

  * 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@perf@invalid-oa-format-id.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl1/igt@perf@invalid-oa-format-id.html
    - shard-hsw:          [PASS][48] -> [SKIP][49] ([fdo#109271])
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw2/igt@perf@invalid-oa-format-id.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw6/igt@perf@invalid-oa-format-id.html
    - shard-tglb:         [PASS][50] -> [SKIP][51] ([i915#1354])
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-tglb3/igt@perf@invalid-oa-format-id.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb2/igt@perf@invalid-oa-format-id.html
    - shard-iclb:         [PASS][52] -> [SKIP][53] ([i915#1354])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-iclb1/igt@perf@invalid-oa-format-id.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb4/igt@perf@invalid-oa-format-id.html
    - 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@perf@invalid-oa-format-id.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl4/igt@perf@invalid-oa-format-id.html

  
#### 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@basic-many-active@vecs0.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk5/igt@gem_exec_reloc@basic-many-active@vecs0.html

  * 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@gem_exec_whisper@basic-forked-all.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk2/igt@gem_exec_whisper@basic-forked-all.html

  * 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@gem_exec_whisper@basic-queues-priority-all.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk2/igt@gem_exec_whisper@basic-queues-priority-all.html

  * 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@i915_suspend@debugfs-reader.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl4/igt@i915_suspend@debugfs-reader.html

  * 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@plane-use-after-nonblocking-unbind@vga-1-pipe-a.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw7/igt@kms_atomic_transition@plane-use-after-nonblocking-unbind@vga-1-pipe-a.html

  * 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@kms_big_fb@linear-32bpp-rotate-180.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk8/igt@kms_big_fb@linear-32bpp-rotate-180.html

  * 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@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl4/igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html
    - shard-kbl:          [FAIL][70] ([i915#54]) -> [PASS][71]
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-kbl4/igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl4/igt@kms_cursor_crc@pipe-c-cursor-64x21-sliding.html

  * 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@kms_draw_crc@draw-method-xrgb2101010-blt-untiled.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb7/igt@kms_draw_crc@draw-method-xrgb2101010-blt-untiled.html

  * 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@blocking-wf_vblank@a-edp1.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb2/igt@kms_flip@blocking-wf_vblank@a-edp1.html

  * 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@flip-vs-expired-vblank@b-hdmi-a2.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk2/igt@kms_flip@flip-vs-expired-vblank@b-hdmi-a2.html

  * 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@kms_setmode@basic.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk9/igt@kms_setmode@basic.html

  * 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@kms_universal_plane@universal-plane-gen9-features-pipe-a.html
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl7/igt@kms_universal_plane@universal-plane-gen9-features-pipe-a.html

  * 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@perf@polling.html
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-glk9/igt@perf@polling.html
    - shard-tglb:         [SKIP][86] ([i915#1354]) -> [PASS][87]
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-tglb2/igt@perf@polling.html
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb5/igt@perf@polling.html
    - 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@perf@polling.html
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl2/igt@perf@polling.html
    - 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@perf@polling.html
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-kbl7/igt@perf@polling.html
    - shard-hsw:          [SKIP][92] ([fdo#109271]) -> [PASS][93]
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw8/igt@perf@polling.html
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw8/igt@perf@polling.html
    - shard-iclb:         [SKIP][94] ([i915#1354]) -> [PASS][95]
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-iclb5/igt@perf@polling.html
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-iclb1/igt@perf@polling.html

  * 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@perf_pmu@module-unload.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl3/igt@perf_pmu@module-unload.html

  * 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@prime_vgem@coherency-blt.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-snb7/igt@prime_vgem@coherency-blt.html
    - shard-hsw:          [FAIL][100] -> [PASS][101]
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9174/shard-hsw8/igt@prime_vgem@coherency-blt.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-hsw7/igt@prime_vgem@coherency-blt.html

  
#### 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@kms_content_protection@atomic-dpms.html
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl2/igt@kms_content_protection@atomic-dpms.html

  * 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@kms_content_protection@lic.html
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-apl8/igt@kms_content_protection@lic.html

  * 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@kms_frontbuffer_tracking@fbcpsr-suspend.html
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5080/shard-tglb1/igt@kms_frontbuffer_tracking@fbcpsr-suspend.html

  
  {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

[-- Attachment #1.2: Type: text/html, Size: 27214 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests
  2020-10-21  8:59 [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests Melissa Wen
  2020-10-21  9:47 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2) Patchwork
  2020-10-21 11:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
@ 2020-10-21 16:57 ` Melissa Wen
  2020-10-22 10:00   ` Petri Latvala
  2020-10-22 10:37 ` Ville Syrjälä
  3 siblings, 1 reply; 10+ messages in thread
From: Melissa Wen @ 2020-10-21 16:57 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, kernel-usp

Hey,

I saw that the CI reported a failure again for alpha = 0.5.
Could it be a rounding issue?

Melissa Wen

On Wed, Oct 21, 2020 at 6:00 AM Melissa Wen <melissa.srw@gmail.com> wrote:
>
> 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 <melissa.srw@gmail.com>
> ---
>  tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++--------------------
>  1 file changed, 45 insertions(+), 42 deletions(-)
>
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index 0be8f7f8..83c74a69 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -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);
> --
> 2.28.0
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests
  2020-10-21 16:57 ` [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests Melissa Wen
@ 2020-10-22 10:00   ` Petri Latvala
  0 siblings, 0 replies; 10+ messages in thread
From: Petri Latvala @ 2020-10-22 10:00 UTC (permalink / raw)
  To: Melissa Wen, Swati Sharma, Juha-Pekka Heikkila; +Cc: igt-dev, kernel-usp

On Wed, Oct 21, 2020 at 01:57:27PM -0300, Melissa Wen wrote:
> 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.


-- 
Petri Latvala



> 
> Melissa Wen
> 
> On Wed, Oct 21, 2020 at 6:00 AM Melissa Wen <melissa.srw@gmail.com> wrote:
> >
> > 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 <melissa.srw@gmail.com>
> > ---
> >  tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++--------------------
> >  1 file changed, 45 insertions(+), 42 deletions(-)
> >
> > diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> > index 0be8f7f8..83c74a69 100644
> > --- a/tests/kms_cursor_crc.c
> > +++ b/tests/kms_cursor_crc.c
> > @@ -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);
> > --
> > 2.28.0
> >
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests
  2020-10-21  8:59 [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests Melissa Wen
                   ` (2 preceding siblings ...)
  2020-10-21 16:57 ` [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests Melissa Wen
@ 2020-10-22 10:37 ` Ville Syrjälä
  2020-10-22 13:41   ` Juha-Pekka Heikkila
  3 siblings, 1 reply; 10+ messages in thread
From: Ville Syrjälä @ 2020-10-22 10:37 UTC (permalink / raw)
  To: Melissa Wen; +Cc: igt-dev, Petri Latvala, kernel-usp

On Wed, Oct 21, 2020 at 05:59:56AM -0300, Melissa Wen wrote:
> 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

> 
> v2:
> - debug log states the alpha whenever CRC mismatch (Arek)
> - checking all alpha values before asserting the result (Arek)
> 
> Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
> ---
>  tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++--------------------
>  1 file changed, 45 insertions(+), 42 deletions(-)
> 
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index 0be8f7f8..83c74a69 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -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);
> -- 
> 2.28.0
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests
  2020-10-22 10:37 ` Ville Syrjälä
@ 2020-10-22 13:41   ` Juha-Pekka Heikkila
  2020-10-23 11:47     ` Melissa Wen
  0 siblings, 1 reply; 10+ messages in thread
From: Juha-Pekka Heikkila @ 2020-10-22 13:41 UTC (permalink / raw)
  To: Ville Syrjälä, Melissa Wen; +Cc: igt-dev, Petri Latvala, kernel-usp

On 22.10.2020 13.37, Ville Syrjälä wrote:
> On Wed, Oct 21, 2020 at 05:59:56AM -0300, Melissa Wen wrote:
>> 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.

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.

> 
> Side note: data->primary_fb[RESTOREBUFFER] looks to be dead weight

Seems it was left when rendercopy was taken out from this test.

> 
>>
>> v2:
>> - debug log states the alpha whenever CRC mismatch (Arek)
>> - checking all alpha values before asserting the result (Arek)
>>
>> Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
>> ---
>>   tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++--------------------
>>   1 file changed, 45 insertions(+), 42 deletions(-)
>>
>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>> index 0be8f7f8..83c74a69 100644
>> --- a/tests/kms_cursor_crc.c
>> +++ b/tests/kms_cursor_crc.c
>> @@ -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);
>> -- 
>> 2.28.0
>>
>> _______________________________________________
>> igt-dev mailing list
>> igt-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests
  2020-10-22 13:41   ` Juha-Pekka Heikkila
@ 2020-10-23 11:47     ` Melissa Wen
  2020-10-25 22:13       ` Juha-Pekka Heikkila
  0 siblings, 1 reply; 10+ messages in thread
From: Melissa Wen @ 2020-10-23 11:47 UTC (permalink / raw)
  To: Juha-Pekka Heikkila; +Cc: igt-dev, Petri Latvala

On 10/22, Juha-Pekka Heikkila wrote:
> On 22.10.2020 13.37, Ville Syrjälä wrote:
> > On Wed, Oct 21, 2020 at 05:59:56AM -0300, Melissa Wen wrote:
> > > 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.
> 
> 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?

> > 
> > Side note: data->primary_fb[RESTOREBUFFER] looks to be dead weight
> 
> Seems it was left when rendercopy was taken out from this test.
> 
> > 
> > > 
> > > v2:
> > > - debug log states the alpha whenever CRC mismatch (Arek)
> > > - checking all alpha values before asserting the result (Arek)
> > > 
> > > Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
> > > ---
> > >   tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++--------------------
> > >   1 file changed, 45 insertions(+), 42 deletions(-)
> > > 
> > > diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> > > index 0be8f7f8..83c74a69 100644
> > > --- a/tests/kms_cursor_crc.c
> > > +++ b/tests/kms_cursor_crc.c
> > > @@ -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);
> > > -- 
> > > 2.28.0
> > > 
> > > _______________________________________________
> > > igt-dev mailing list
> > > igt-dev@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> > 
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests
  2020-10-23 11:47     ` Melissa Wen
@ 2020-10-25 22:13       ` Juha-Pekka Heikkila
  2020-10-26 10:47         ` Ville Syrjälä
  0 siblings, 1 reply; 10+ messages in thread
From: Juha-Pekka Heikkila @ 2020-10-25 22:13 UTC (permalink / raw)
  To: Melissa Wen; +Cc: igt-dev, Petri Latvala

On 23.10.2020 14.47, Melissa Wen wrote:
> On 10/22, Juha-Pekka Heikkila wrote:
>> On 22.10.2020 13.37, Ville Syrjälä wrote:
>>> On Wed, Oct 21, 2020 at 05:59:56AM -0300, Melissa Wen wrote:
>>>> 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.
>>
>> 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?
> 

..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?


>>>
>>> Side note: data->primary_fb[RESTOREBUFFER] looks to be dead weight
>>
>> Seems it was left when rendercopy was taken out from this test.
>>
>>>
>>>>
>>>> v2:
>>>> - debug log states the alpha whenever CRC mismatch (Arek)
>>>> - checking all alpha values before asserting the result (Arek)
>>>>
>>>> Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
>>>> ---
>>>>    tests/kms_cursor_crc.c | 87 ++++++++++++++++++++++--------------------
>>>>    1 file changed, 45 insertions(+), 42 deletions(-)
>>>>
>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>> index 0be8f7f8..83c74a69 100644
>>>> --- a/tests/kms_cursor_crc.c
>>>> +++ b/tests/kms_cursor_crc.c
>>>> @@ -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);
>>>> -- 
>>>> 2.28.0
>>>>
>>>> _______________________________________________
>>>> igt-dev mailing list
>>>> igt-dev@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/igt-dev
>>>
>>

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests
  2020-10-25 22:13       ` Juha-Pekka Heikkila
@ 2020-10-26 10:47         ` Ville Syrjälä
  0 siblings, 0 replies; 10+ messages in thread
From: Ville Syrjälä @ 2020-10-26 10:47 UTC (permalink / raw)
  To: Juha-Pekka Heikkila; +Cc: igt-dev, Petri Latvala

On Mon, Oct 26, 2020 at 12:13:56AM +0200, Juha-Pekka Heikkila wrote:
> On 23.10.2020 14.47, Melissa Wen wrote:
> > On 10/22, Juha-Pekka Heikkila wrote:
> >> On 22.10.2020 13.37, Ville Syrjälä wrote:
> >>> On Wed, Oct 21, 2020 at 05:59:56AM -0300, Melissa Wen wrote:
> >>>> 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.
> >>
> >> 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?
> > 
> 
> ..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?

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.

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-10-26 10:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21  8:59 [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests Melissa Wen
2020-10-21  9:47 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: refactoring cursor-alpha subtests (rev2) Patchwork
2020-10-21 11:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-10-21 16:57 ` [igt-dev] [PATCH i-g-t v2] tests/kms_cursor_crc: refactoring cursor-alpha subtests Melissa Wen
2020-10-22 10:00   ` Petri Latvala
2020-10-22 10:37 ` Ville Syrjälä
2020-10-22 13:41   ` Juha-Pekka Heikkila
2020-10-23 11:47     ` Melissa Wen
2020-10-25 22:13       ` Juha-Pekka Heikkila
2020-10-26 10:47         ` Ville Syrjälä

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.