All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos
@ 2020-03-12  7:51 Swati Sharma
  2020-03-12  8:39 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_atomic: add test to validate immutable zpos (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Swati Sharma @ 2020-03-12  7:51 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

i915 implements immutable zpos property whereas the existing test
case is written to validate mutable zpos.

Added new sub-test to validate immutable zpos. In the test, to validate
reported zpos of the plane is correct by making sure a full-screen plane
covers all other planes with the lower zpos, and the plane with the next
available zpos is indeed partially covering the full-screen plane.

v2: -Removed intel only checks [Martin]
    -Used XRGB8888 pixel format as used in other IGTs
    -Added documentation [Martin]
    -Removed skip, instead continue if plane doesn't support zpos [Martin]
    -Sorted planes in increasing order of zpos [Martin]

Issue: https://gitlab.freedesktop.org/drm/intel/issues/404
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_atomic.c | 156 ++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 146 insertions(+), 10 deletions(-)

diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
index 8462d128..2a6a407e 100644
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -121,7 +121,7 @@ static void plane_check_current_state(igt_plane_t *plane, const uint64_t *values
 }
 
 static void plane_commit(igt_plane_t *plane, enum igt_commit_style s,
-                                enum kms_atomic_check_relax relax)
+                         enum kms_atomic_check_relax relax)
 {
 	igt_display_commit2(plane->pipe->display, s);
 	plane_check_current_state(plane, plane->values, relax);
@@ -277,9 +277,9 @@ static uint32_t plane_get_igt_format(igt_plane_t *plane)
 }
 
 static void
-plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
-			   igt_plane_t *primary, igt_plane_t *overlay,
-			   uint32_t format_primary, uint32_t format_overlay)
+plane_primary_overlay_mutable_zpos(igt_pipe_t *pipe, igt_output_t *output,
+			           igt_plane_t *primary, igt_plane_t *overlay,
+			           uint32_t format_primary, uint32_t format_overlay)
 {
 	struct igt_fb fb_primary, fb_overlay;
 	drmModeModeInfo *mode = igt_output_get_mode(output);
@@ -320,7 +320,7 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
 	igt_plane_set_prop_value(overlay, IGT_PLANE_ZPOS, 1);
 
 	igt_info("Committing with overlay on top, it has a hole "\
-		  "through which the primary should be seen\n");
+		 "through which the primary should be seen\n");
 	plane_commit(primary, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);
 
 	igt_assert_eq_u64(igt_plane_get_prop(primary, IGT_PLANE_ZPOS), 0);
@@ -346,7 +346,7 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
 	igt_put_cairo_ctx(pipe->display->drm_fd, &fb_primary, cr);
 
 	igt_info("Committing with a hole in the primary through "\
-		  "which the underlay should be seen\n");
+		 "which the underlay should be seen\n");
 	plane_commit(primary, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);
 
 	/* reset it back to initial state */
@@ -358,6 +358,127 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
 	igt_assert_eq_u64(igt_plane_get_prop(overlay, IGT_PLANE_ZPOS), 1);
 }
 
+static void
+plane_immutable_zpos(igt_display_t *display, igt_pipe_t *pipe,
+		     igt_output_t *output)
+{
+	cairo_t *cr;
+	int min_idx;
+	struct igt_fb fb_ref;
+	igt_plane_t *primary;
+	drmModeModeInfo *mode;
+	igt_pipe_crc_t *pipe_crc;
+	igt_crc_t ref_crc, new_crc;
+	int n_planes = pipe->n_planes;
+	igt_plane_t *plane_ptr[n_planes];
+	igt_plane_t *plane_lower, *plane_upper;
+	uint32_t w_lower, h_lower, w_upper, h_upper;
+
+	mode = igt_output_get_mode(output);
+	primary = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
+
+	/* for lower plane */
+	w_lower = mode->hdisplay;
+	h_lower = mode->vdisplay;
+
+	/* for upper plane */
+	w_upper = mode->hdisplay / 2;
+	h_upper = mode->vdisplay / 2;
+
+	igt_create_color_fb(display->drm_fd,
+			    w_lower, h_lower,
+			    DRM_FORMAT_XRGB8888,
+			    I915_TILING_NONE,
+			    0.0, 0.0, 0.0, &fb_ref);
+
+	/* create reference image */
+	cr = igt_get_cairo_ctx(display->drm_fd, &fb_ref);
+	igt_assert(cairo_status(cr) == 0);
+	igt_paint_color(cr, 0, 0, w_lower, h_lower, 0.0, 0.0, 1.0);
+	igt_paint_color(cr, w_upper / 2, h_upper / 2, w_upper, h_upper, 1.0, 1.0, 0.0);
+	igt_put_cairo_ctx(display->drm_fd, &fb_ref, cr);
+	igt_plane_set_fb(primary, &fb_ref);
+	igt_display_commit2(display, COMMIT_ATOMIC);
+
+	/* create the pipe_crc object for this pipe */
+	pipe_crc = igt_pipe_crc_new(pipe->display->drm_fd, pipe->pipe,
+				    INTEL_PIPE_CRC_SOURCE_AUTO);
+
+	/* get reference crc */
+	igt_pipe_crc_start(pipe_crc);
+	igt_pipe_crc_get_current(display->drm_fd, pipe_crc, &ref_crc);
+
+	igt_plane_set_fb(primary, NULL);
+
+	/* sort planes in increasing order of zpos */
+	for (int k = 0; k < n_planes; k++)
+		plane_ptr[k] = &display->pipes[pipe->pipe].planes[k];
+
+	for (int l = 0; l < n_planes - 1; l++) {
+		min_idx = l;
+		for (int m = l + 1; m < n_planes; m++) {
+			int zpos1, zpos2;
+
+			if (!igt_plane_has_prop(plane_ptr[min_idx], IGT_PLANE_ZPOS) ||
+			    !igt_plane_has_prop(plane_ptr[m], IGT_PLANE_ZPOS))
+				continue;
+
+			zpos1 = igt_plane_get_prop(plane_ptr[min_idx], IGT_PLANE_ZPOS);
+			zpos2 = igt_plane_get_prop(plane_ptr[m], IGT_PLANE_ZPOS);
+
+			if (zpos1 == zpos2)
+				continue;
+
+			if (zpos2 < zpos1)
+				min_idx = m;
+		}
+
+		igt_swap(plane_ptr[min_idx], plane_ptr[l]);
+	}
+
+	/* checking only pairs of plane in increasing fashion
+	 * to avoid combinatorial explosion
+	 */
+	for (int i = 0; i < n_planes - 1; i++) {
+		struct igt_fb fb_lower, fb_upper;
+
+		plane_lower = plane_ptr[i];
+		plane_upper = plane_ptr[i + 1];
+
+		if ((plane_lower->type == DRM_PLANE_TYPE_CURSOR) ||
+		    (plane_upper->type == DRM_PLANE_TYPE_CURSOR))
+			continue;
+
+		igt_create_color_fb(display->drm_fd,
+				    w_lower, h_lower,
+				    DRM_FORMAT_XRGB8888,
+				    I915_TILING_NONE,
+				    0.0, 0.0, 1.0, &fb_lower);
+
+		igt_create_color_fb(display->drm_fd,
+				    w_upper, h_upper,
+				    DRM_FORMAT_XRGB8888,
+				    I915_TILING_NONE,
+				    1.0, 1.0, 0.0, &fb_upper);
+
+		igt_plane_set_position(plane_lower, 0, 0);
+		igt_plane_set_fb(plane_lower, &fb_lower);
+
+		igt_plane_set_position(plane_upper, w_upper / 2, h_upper / 2);
+		igt_plane_set_fb(plane_upper, &fb_upper);
+
+		igt_info("Committing with the plane[%d] underneath "\
+			 "plane[%d]\n", i, (i + 1));
+		igt_display_commit2(display, COMMIT_ATOMIC);
+		igt_pipe_crc_get_current(pipe->display->drm_fd, pipe_crc, &new_crc);
+
+		igt_assert_crc_equal(&ref_crc, &new_crc);
+
+		igt_plane_set_fb(plane_lower, NULL);
+		igt_plane_set_fb(plane_upper, NULL);
+	}
+}
+
 static void plane_overlay(igt_pipe_t *pipe, igt_output_t *output, igt_plane_t *plane)
 {
 	drmModeModeInfo *mode = igt_output_get_mode(output);
@@ -987,14 +1108,18 @@ igt_main
 		plane_primary(pipe_obj, primary, &fb);
 	}
 
-	igt_subtest("plane_primary_overlay_zpos") {
+	igt_describe("Tests mutable zpos where zpos is modified for "\
+		     "primary and overlay planes, order of planes is validated "\
+		     "visually where top plane has hole through which underlay plane "\
+		     "can be seen");
+	igt_subtest("plane_primary_overlay_mutable_zpos") {
 		uint32_t format_primary = DRM_FORMAT_ARGB8888;
 		uint32_t format_overlay = DRM_FORMAT_ARGB1555;
 
 		igt_plane_t *overlay =
 			igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_OVERLAY);
-
 		igt_require(overlay);
+
 		igt_require(igt_plane_has_prop(primary, IGT_PLANE_ZPOS));
 		igt_require(igt_plane_has_prop(overlay, IGT_PLANE_ZPOS));
 
@@ -1002,8 +1127,18 @@ igt_main
 		igt_require(igt_plane_has_format_mod(overlay, format_overlay, 0x0));
 
 		igt_output_set_pipe(output, pipe);
-		plane_primary_overlay_zpos(pipe_obj, output, primary, overlay,
-					   format_primary, format_overlay);
+		plane_primary_overlay_mutable_zpos(pipe_obj, output, primary, overlay,
+						   format_primary, format_overlay);
+	}
+
+	igt_describe("Tests immutable zpos where zpos cannot be modified such that "\
+		     "reported zpos of the plane is correct by making sure a "\
+		     "full-screen plane covers all other planes with the lower zpos,"\
+		     "and the plane with the next available zpos is indeed partially "\
+		     "covering the full-screen plane");
+	igt_subtest("plane_immutable_zpos") {
+		igt_output_set_pipe(output, pipe);
+		plane_immutable_zpos(&display, pipe_obj, output);
 	}
 
 	igt_subtest("test_only") {
@@ -1011,6 +1146,7 @@ igt_main
 
 		test_only(pipe_obj, primary, output);
 	}
+
 	igt_subtest("plane_cursor_legacy") {
 		igt_plane_t *cursor =
 			igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_CURSOR);
-- 
2.25.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_atomic: add test to validate immutable zpos (rev2)
  2020-03-12  7:51 [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos Swati Sharma
@ 2020-03-12  8:39 ` Patchwork
  2020-03-13  1:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2020-03-13 14:26 ` [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos Martin Peres
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2020-03-12  8:39 UTC (permalink / raw)
  To: Sharma, Swati2; +Cc: igt-dev

== Series Details ==

Series: tests/kms_atomic: add test to validate immutable zpos (rev2)
URL   : https://patchwork.freedesktop.org/series/73956/
State : success

== Summary ==

CI Bug Log - changes from IGT_5506 -> IGTPW_4294
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/index.html

Known issues
------------

  Here are the changes found in IGTPW_4294 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@gem_contexts:
    - fi-cml-s:           [PASS][1] -> [DMESG-FAIL][2] ([i915#877])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/fi-cml-s/igt@i915_selftest@live@gem_contexts.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/fi-cml-s/igt@i915_selftest@live@gem_contexts.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-tgl-y:           [FAIL][3] ([CI#94]) -> [PASS][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html

  * igt@i915_selftest@live@active:
    - fi-bxt-dsi:         [DMESG-FAIL][5] ([i915#666]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/fi-bxt-dsi/igt@i915_selftest@live@active.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/fi-bxt-dsi/igt@i915_selftest@live@active.html

  * igt@i915_selftest@live@execlists:
    - fi-skl-6770hq:      [INCOMPLETE][7] ([i915#1430]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/fi-skl-6770hq/igt@i915_selftest@live@execlists.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/fi-skl-6770hq/igt@i915_selftest@live@execlists.html

  * igt@i915_selftest@live@gt_heartbeat:
    - fi-kbl-soraka:      [DMESG-FAIL][9] ([fdo#112406]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html

  * igt@kms_flip@basic-flip-vs-dpms:
    - {fi-kbl-7560u}:     [FAIL][11] ([i915#998]) -> [PASS][12] +5 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/fi-kbl-7560u/igt@kms_flip@basic-flip-vs-dpms.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/fi-kbl-7560u/igt@kms_flip@basic-flip-vs-dpms.html

  
#### Warnings ####

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [FAIL][13] ([i915#323]) -> [FAIL][14] ([fdo#111407])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [CI#94]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/94
  [fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
  [fdo#112406]: https://bugs.freedesktop.org/show_bug.cgi?id=112406
  [i915#1430]: https://gitlab.freedesktop.org/drm/intel/issues/1430
  [i915#323]: https://gitlab.freedesktop.org/drm/intel/issues/323
  [i915#666]: https://gitlab.freedesktop.org/drm/intel/issues/666
  [i915#877]: https://gitlab.freedesktop.org/drm/intel/issues/877
  [i915#998]: https://gitlab.freedesktop.org/drm/intel/issues/998


Participating hosts (47 -> 43)
------------------------------

  Missing    (4): fi-byt-clapper fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5506 -> IGTPW_4294

  CI-20190529: 20190529
  CI_DRM_8126: 2bd9e989a5653d4cd710e9dd2b42b0a080f1add8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4294: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/index.html
  IGT_5506: 59fd8a0d01dac58dc6c7d86ef391ed4393ab5aae @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_atomic@plane_immutable_zpos
+igt@kms_atomic@plane_primary_overlay_mutable_zpos
-igt@kms_atomic@plane_primary_overlay_zpos

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for tests/kms_atomic: add test to validate immutable zpos (rev2)
  2020-03-12  7:51 [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos Swati Sharma
  2020-03-12  8:39 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_atomic: add test to validate immutable zpos (rev2) Patchwork
@ 2020-03-13  1:51 ` Patchwork
  2020-03-13 14:26 ` [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos Martin Peres
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2020-03-13  1:51 UTC (permalink / raw)
  To: Sharma, Swati2; +Cc: igt-dev

== Series Details ==

Series: tests/kms_atomic: add test to validate immutable zpos (rev2)
URL   : https://patchwork.freedesktop.org/series/73956/
State : success

== Summary ==

CI Bug Log - changes from IGT_5506_full -> IGTPW_4294_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_4294_full:

### IGT changes ###

#### Possible regressions ####

  * {igt@kms_atomic@plane_primary_overlay_mutable_zpos} (NEW):
    - shard-iclb:         NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb2/igt@kms_atomic@plane_primary_overlay_mutable_zpos.html
    - shard-tglb:         NOTRUN -> [SKIP][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-tglb6/igt@kms_atomic@plane_primary_overlay_mutable_zpos.html

  
New tests
---------

  New tests have been introduced between IGT_5506_full and IGTPW_4294_full:

### New IGT tests (2) ###

  * igt@kms_atomic@plane_immutable_zpos:
    - Statuses : 7 pass(s)
    - Exec time: [0.14, 0.37] s

  * igt@kms_atomic@plane_primary_overlay_mutable_zpos:
    - Statuses : 7 skip(s)
    - Exec time: [0.0] s

  

Known issues
------------

  Here are the changes found in IGTPW_4294_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@vcs1-nonpriv:
    - shard-iclb:         [PASS][3] -> [SKIP][4] ([fdo#112080]) +7 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb4/igt@gem_ctx_isolation@vcs1-nonpriv.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb7/igt@gem_ctx_isolation@vcs1-nonpriv.html

  * igt@gem_eio@in-flight-suspend:
    - shard-kbl:          [PASS][5] -> [DMESG-WARN][6] ([i915#180]) +2 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-kbl7/igt@gem_eio@in-flight-suspend.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-kbl1/igt@gem_eio@in-flight-suspend.html

  * igt@gem_exec_schedule@implicit-both-bsd1:
    - shard-iclb:         [PASS][7] -> [SKIP][8] ([fdo#109276] / [i915#677]) +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb1/igt@gem_exec_schedule@implicit-both-bsd1.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb8/igt@gem_exec_schedule@implicit-both-bsd1.html

  * igt@gem_exec_schedule@pi-shared-iova-bsd:
    - shard-iclb:         [PASS][9] -> [SKIP][10] ([i915#677])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb8/igt@gem_exec_schedule@pi-shared-iova-bsd.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb2/igt@gem_exec_schedule@pi-shared-iova-bsd.html

  * igt@gem_exec_schedule@preempt-other-chain-bsd:
    - shard-iclb:         [PASS][11] -> [SKIP][12] ([fdo#112146]) +4 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb8/igt@gem_exec_schedule@preempt-other-chain-bsd.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb1/igt@gem_exec_schedule@preempt-other-chain-bsd.html

  * igt@gem_exec_whisper@basic-fds-forked:
    - shard-tglb:         [PASS][13] -> [INCOMPLETE][14] ([i915#1318] / [i915#1401])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-tglb2/igt@gem_exec_whisper@basic-fds-forked.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-tglb5/igt@gem_exec_whisper@basic-fds-forked.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-apl:          [PASS][15] -> [FAIL][16] ([i915#644])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-apl4/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-apl6/igt@gem_ppgtt@flink-and-close-vma-leak.html
    - shard-iclb:         [PASS][17] -> [FAIL][18] ([i915#644])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb4/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb1/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@kms_atomic_transition@plane-toggle-modeset-transition:
    - shard-snb:          [PASS][19] -> [SKIP][20] ([fdo#109271]) +2 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-snb2/igt@kms_atomic_transition@plane-toggle-modeset-transition.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-snb6/igt@kms_atomic_transition@plane-toggle-modeset-transition.html

  * igt@kms_cursor_crc@pipe-b-cursor-suspend:
    - shard-apl:          [PASS][21] -> [DMESG-WARN][22] ([i915#180])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-apl4/igt@kms_cursor_crc@pipe-b-cursor-suspend.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-apl1/igt@kms_cursor_crc@pipe-b-cursor-suspend.html

  * igt@kms_cursor_crc@pipe-c-cursor-64x21-onscreen:
    - shard-apl:          [PASS][23] -> [FAIL][24] ([i915#54]) +1 similar issue
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-apl2/igt@kms_cursor_crc@pipe-c-cursor-64x21-onscreen.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-apl8/igt@kms_cursor_crc@pipe-c-cursor-64x21-onscreen.html
    - shard-glk:          [PASS][25] -> [FAIL][26] ([i915#54])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-glk4/igt@kms_cursor_crc@pipe-c-cursor-64x21-onscreen.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-glk6/igt@kms_cursor_crc@pipe-c-cursor-64x21-onscreen.html
    - shard-kbl:          [PASS][27] -> [FAIL][28] ([i915#54])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-kbl2/igt@kms_cursor_crc@pipe-c-cursor-64x21-onscreen.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-kbl7/igt@kms_cursor_crc@pipe-c-cursor-64x21-onscreen.html

  * igt@kms_flip@flip-vs-panning:
    - shard-kbl:          [PASS][29] -> [DMESG-WARN][30] ([i915#1297])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-kbl2/igt@kms_flip@flip-vs-panning.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-kbl4/igt@kms_flip@flip-vs-panning.html
    - shard-apl:          [PASS][31] -> [DMESG-WARN][32] ([i915#1297])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-apl3/igt@kms_flip@flip-vs-panning.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-apl2/igt@kms_flip@flip-vs-panning.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [PASS][33] -> [SKIP][34] ([fdo#109642] / [fdo#111068])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb2/igt@kms_psr2_su@frontbuffer.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb1/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@psr2_suspend:
    - shard-iclb:         [PASS][35] -> [SKIP][36] ([fdo#109441])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb2/igt@kms_psr@psr2_suspend.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb1/igt@kms_psr@psr2_suspend.html

  * igt@kms_setmode@basic:
    - shard-kbl:          [PASS][37] -> [FAIL][38] ([i915#31])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-kbl7/igt@kms_setmode@basic.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-kbl7/igt@kms_setmode@basic.html

  * igt@prime_busy@hang-bsd2:
    - shard-iclb:         [PASS][39] -> [SKIP][40] ([fdo#109276]) +21 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb4/igt@prime_busy@hang-bsd2.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb6/igt@prime_busy@hang-bsd2.html

  
#### Possible fixes ####

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [SKIP][41] ([fdo#110841]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb1/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb7/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_exec_parallel@vcs1-fds:
    - shard-iclb:         [SKIP][43] ([fdo#112080]) -> [PASS][44] +9 similar issues
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb7/igt@gem_exec_parallel@vcs1-fds.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb1/igt@gem_exec_parallel@vcs1-fds.html

  * igt@gem_exec_schedule@fifo-bsd1:
    - shard-iclb:         [SKIP][45] ([fdo#109276]) -> [PASS][46] +12 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb8/igt@gem_exec_schedule@fifo-bsd1.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb1/igt@gem_exec_schedule@fifo-bsd1.html

  * igt@gem_exec_schedule@implicit-both-bsd:
    - shard-iclb:         [SKIP][47] ([i915#677]) -> [PASS][48] +2 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb1/igt@gem_exec_schedule@implicit-both-bsd.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb8/igt@gem_exec_schedule@implicit-both-bsd.html

  * igt@gem_exec_schedule@implicit-write-read-bsd1:
    - shard-iclb:         [SKIP][49] ([fdo#109276] / [i915#677]) -> [PASS][50] +1 similar issue
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb8/igt@gem_exec_schedule@implicit-write-read-bsd1.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb4/igt@gem_exec_schedule@implicit-write-read-bsd1.html

  * igt@gem_exec_schedule@in-order-bsd:
    - shard-iclb:         [SKIP][51] ([fdo#112146]) -> [PASS][52] +4 similar issues
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb2/igt@gem_exec_schedule@in-order-bsd.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb5/igt@gem_exec_schedule@in-order-bsd.html

  * igt@gem_exec_whisper@basic-fds-priority:
    - shard-tglb:         [INCOMPLETE][53] ([i915#1401]) -> [PASS][54]
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-tglb6/igt@gem_exec_whisper@basic-fds-priority.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-tglb2/igt@gem_exec_whisper@basic-fds-priority.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-glk:          [FAIL][55] ([i915#644]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-glk2/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-glk5/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-apl:          [DMESG-WARN][57] ([i915#180]) -> [PASS][58] +4 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-apl6/igt@gem_workarounds@suspend-resume-context.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-apl6/igt@gem_workarounds@suspend-resume-context.html

  * igt@i915_pm_rps@reset:
    - shard-tglb:         [FAIL][59] ([i915#413]) -> [PASS][60]
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-tglb7/igt@i915_pm_rps@reset.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-tglb6/igt@i915_pm_rps@reset.html

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
    - shard-glk:          [FAIL][61] ([i915#72]) -> [PASS][62]
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-glk1/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-glk4/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-kbl:          [DMESG-WARN][63] ([i915#180]) -> [PASS][64] +1 similar issue
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-kbl2/igt@kms_flip@flip-vs-suspend-interruptible.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-kbl6/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [SKIP][65] ([fdo#109441]) -> [PASS][66] +2 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-iclb3/igt@kms_psr@psr2_primary_mmap_cpu.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_setmode@basic:
    - shard-apl:          [FAIL][67] ([i915#31]) -> [PASS][68]
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-apl3/igt@kms_setmode@basic.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-apl8/igt@kms_setmode@basic.html

  
#### Warnings ####

  * igt@gem_userptr_blits@sync-unmap-after-close:
    - shard-snb:          [DMESG-WARN][69] ([fdo#110789] / [fdo#111870] / [i915#478]) -> [DMESG-WARN][70] ([fdo#111870] / [i915#478])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5506/shard-snb6/igt@gem_userptr_blits@sync-unmap-after-close.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/shard-snb4/igt@gem_userptr_blits@sync-unmap-after-close.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#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110789]: https://bugs.freedesktop.org/show_bug.cgi?id=110789
  [fdo#110841]: https://bugs.freedesktop.org/show_bug.cgi?id=110841
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111870]: https://bugs.freedesktop.org/show_bug.cgi?id=111870
  [fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
  [fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
  [i915#1297]: https://gitlab.freedesktop.org/drm/intel/issues/1297
  [i915#1318]: https://gitlab.freedesktop.org/drm/intel/issues/1318
  [i915#1401]: https://gitlab.freedesktop.org/drm/intel/issues/1401
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
  [i915#413]: https://gitlab.freedesktop.org/drm/intel/issues/413
  [i915#478]: https://gitlab.freedesktop.org/drm/intel/issues/478
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#644]: https://gitlab.freedesktop.org/drm/intel/issues/644
  [i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
  [i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72


Participating hosts (8 -> 8)
------------------------------

  No changes in participating hosts


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5506 -> IGTPW_4294

  CI-20190529: 20190529
  CI_DRM_8126: 2bd9e989a5653d4cd710e9dd2b42b0a080f1add8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4294: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/index.html
  IGT_5506: 59fd8a0d01dac58dc6c7d86ef391ed4393ab5aae @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4294/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos
  2020-03-12  7:51 [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos Swati Sharma
  2020-03-12  8:39 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_atomic: add test to validate immutable zpos (rev2) Patchwork
  2020-03-13  1:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2020-03-13 14:26 ` Martin Peres
  2020-03-13 15:28   ` Nautiyal, Ankit K
  2 siblings, 1 reply; 6+ messages in thread
From: Martin Peres @ 2020-03-13 14:26 UTC (permalink / raw)
  To: Swati Sharma, igt-dev; +Cc: petri.latvala

On 2020-03-12 09:51, Swati Sharma wrote:
> i915 implements immutable zpos property whereas the existing test
> case is written to validate mutable zpos.
> 
> Added new sub-test to validate immutable zpos. In the test, to validate
> reported zpos of the plane is correct by making sure a full-screen plane
> covers all other planes with the lower zpos, and the plane with the next
> available zpos is indeed partially covering the full-screen plane.
> 
> v2: -Removed intel only checks [Martin]
>     -Used XRGB8888 pixel format as used in other IGTs
>     -Added documentation [Martin]
>     -Removed skip, instead continue if plane doesn't support zpos [Martin]
>     -Sorted planes in increasing order of zpos [Martin]
> 
> Issue: https://gitlab.freedesktop.org/drm/intel/issues/404
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>  tests/kms_atomic.c | 156 ++++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 146 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
> index 8462d128..2a6a407e 100644
> --- a/tests/kms_atomic.c
> +++ b/tests/kms_atomic.c
> @@ -121,7 +121,7 @@ static void plane_check_current_state(igt_plane_t *plane, const uint64_t *values
>  }
>  
>  static void plane_commit(igt_plane_t *plane, enum igt_commit_style s,
> -                                enum kms_atomic_check_relax relax)
> +                         enum kms_atomic_check_relax relax)
>  {
>  	igt_display_commit2(plane->pipe->display, s);
>  	plane_check_current_state(plane, plane->values, relax);
> @@ -277,9 +277,9 @@ static uint32_t plane_get_igt_format(igt_plane_t *plane)
>  }
>  
>  static void
> -plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
> -			   igt_plane_t *primary, igt_plane_t *overlay,
> -			   uint32_t format_primary, uint32_t format_overlay)
> +plane_primary_overlay_mutable_zpos(igt_pipe_t *pipe, igt_output_t *output,
> +			           igt_plane_t *primary, igt_plane_t *overlay,
> +			           uint32_t format_primary, uint32_t format_overlay)
>  {
>  	struct igt_fb fb_primary, fb_overlay;
>  	drmModeModeInfo *mode = igt_output_get_mode(output);
> @@ -320,7 +320,7 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>  	igt_plane_set_prop_value(overlay, IGT_PLANE_ZPOS, 1);
>  
>  	igt_info("Committing with overlay on top, it has a hole "\
> -		  "through which the primary should be seen\n");
> +		 "through which the primary should be seen\n");
>  	plane_commit(primary, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);
>  
>  	igt_assert_eq_u64(igt_plane_get_prop(primary, IGT_PLANE_ZPOS), 0);
> @@ -346,7 +346,7 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>  	igt_put_cairo_ctx(pipe->display->drm_fd, &fb_primary, cr);
>  
>  	igt_info("Committing with a hole in the primary through "\
> -		  "which the underlay should be seen\n");
> +		 "which the underlay should be seen\n");
>  	plane_commit(primary, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);
>  
>  	/* reset it back to initial state */
> @@ -358,6 +358,127 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>  	igt_assert_eq_u64(igt_plane_get_prop(overlay, IGT_PLANE_ZPOS), 1);
>  }
>  
> +static void
> +plane_immutable_zpos(igt_display_t *display, igt_pipe_t *pipe,
> +		     igt_output_t *output)
> +{
> +	cairo_t *cr;
> +	int min_idx;
> +	struct igt_fb fb_ref;
> +	igt_plane_t *primary;
> +	drmModeModeInfo *mode;
> +	igt_pipe_crc_t *pipe_crc;
> +	igt_crc_t ref_crc, new_crc;
> +	int n_planes = pipe->n_planes;
> +	igt_plane_t *plane_ptr[n_planes];
> +	igt_plane_t *plane_lower, *plane_upper;
> +	uint32_t w_lower, h_lower, w_upper, h_upper;
> +
> +	mode = igt_output_get_mode(output);

Make sure to set a low resolution so that we don't run out of memory
bandwidth when having a ton of planes enabled.

> +	primary = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
> +
> +	/* for lower plane */
> +	w_lower = mode->hdisplay;
> +	h_lower = mode->vdisplay;
> +
> +	/* for upper plane */
> +	w_upper = mode->hdisplay / 2;
> +	h_upper = mode->vdisplay / 2;
> +
> +	igt_create_color_fb(display->drm_fd,
> +			    w_lower, h_lower,
> +			    DRM_FORMAT_XRGB8888,
> +			    I915_TILING_NONE,
> +			    0.0, 0.0, 0.0, &fb_ref);
> +
> +	/* create reference image */
> +	cr = igt_get_cairo_ctx(display->drm_fd, &fb_ref);
> +	igt_assert(cairo_status(cr) == 0);
> +	igt_paint_color(cr, 0, 0, w_lower, h_lower, 0.0, 0.0, 1.0);
> +	igt_paint_color(cr, w_upper / 2, h_upper / 2, w_upper, h_upper, 1.0, 1.0, 0.0);
> +	igt_put_cairo_ctx(display->drm_fd, &fb_ref, cr);
> +	igt_plane_set_fb(primary, &fb_ref);
> +	igt_display_commit2(display, COMMIT_ATOMIC);
> +
> +	/* create the pipe_crc object for this pipe */
> +	pipe_crc = igt_pipe_crc_new(pipe->display->drm_fd, pipe->pipe,
> +				    INTEL_PIPE_CRC_SOURCE_AUTO);
> +
> +	/* get reference crc */
> +	igt_pipe_crc_start(pipe_crc);
> +	igt_pipe_crc_get_current(display->drm_fd, pipe_crc, &ref_crc);
> +
> +	igt_plane_set_fb(primary, NULL);
> +
> +	/* sort planes in increasing order of zpos */
> +	for (int k = 0; k < n_planes; k++)
> +		plane_ptr[k] = &display->pipes[pipe->pipe].planes[k];
> +
> +	for (int l = 0; l < n_planes - 1; l++) {
> +		min_idx = l;
> +		for (int m = l + 1; m < n_planes; m++) {
> +			int zpos1, zpos2;
> +
> +			if (!igt_plane_has_prop(plane_ptr[min_idx], IGT_PLANE_ZPOS) ||
> +			    !igt_plane_has_prop(plane_ptr[m], IGT_PLANE_ZPOS))
> +				continue;
> +
> +			zpos1 = igt_plane_get_prop(plane_ptr[min_idx], IGT_PLANE_ZPOS);
> +			zpos2 = igt_plane_get_prop(plane_ptr[m], IGT_PLANE_ZPOS);
> +
> +			if (zpos1 == zpos2)
> +				continue;
> +
> +			if (zpos2 < zpos1)
> +				min_idx = m;
> +		}
> +
> +		igt_swap(plane_ptr[min_idx], plane_ptr[l]);
> +	}
> +
> +	/* checking only pairs of plane in increasing fashion
> +	 * to avoid combinatorial explosion
> +	 */
> +	for (int i = 0; i < n_planes - 1; i++) {
> +		struct igt_fb fb_lower, fb_upper;
> +
> +		plane_lower = plane_ptr[i];
> +		plane_upper = plane_ptr[i + 1];
> +
> +		if ((plane_lower->type == DRM_PLANE_TYPE_CURSOR) ||
> +		    (plane_upper->type == DRM_PLANE_TYPE_CURSOR))
> +			continue;
> +
> +		igt_create_color_fb(display->drm_fd,
> +				    w_lower, h_lower,
> +				    DRM_FORMAT_XRGB8888,
> +				    I915_TILING_NONE,
> +				    0.0, 0.0, 1.0, &fb_lower);
> +
> +		igt_create_color_fb(display->drm_fd,
> +				    w_upper, h_upper,
> +				    DRM_FORMAT_XRGB8888,
> +				    I915_TILING_NONE,
> +				    1.0, 1.0, 0.0, &fb_upper);

Do you need to re-create the fb at every loop?

> +
> +		igt_plane_set_position(plane_lower, 0, 0);
> +		igt_plane_set_fb(plane_lower, &fb_lower);
> +
> +		igt_plane_set_position(plane_upper, w_upper / 2, h_upper / 2);
> +		igt_plane_set_fb(plane_upper, &fb_upper);
> +
> +		igt_info("Committing with the plane[%d] underneath "\
> +			 "plane[%d]\n", i, (i + 1));
> +		igt_display_commit2(display, COMMIT_ATOMIC);
> +		igt_pipe_crc_get_current(pipe->display->drm_fd, pipe_crc, &new_crc);
> +
> +		igt_assert_crc_equal(&ref_crc, &new_crc);
> +
> +		igt_plane_set_fb(plane_lower, NULL);
> +		igt_plane_set_fb(plane_upper, NULL);

So, you don't set all the planes under the lower one to another color or
something?

> +	}
> +}
> +
>  static void plane_overlay(igt_pipe_t *pipe, igt_output_t *output, igt_plane_t *plane)
>  {
>  	drmModeModeInfo *mode = igt_output_get_mode(output);
> @@ -987,14 +1108,18 @@ igt_main
>  		plane_primary(pipe_obj, primary, &fb);
>  	}
>  
> -	igt_subtest("plane_primary_overlay_zpos") {
> +	igt_describe("Tests mutable zpos where zpos is modified for "\
> +		     "primary and overlay planes, order of planes is validated "\
> +		     "visually where top plane has hole through which underlay plane "\
> +		     "can be seen");

The wording is a little odd and the description is more focused on the
how, rather than what it is trying to check.

How about: "Verify that the overlay plane can cover the primary one (and
vice versa) by changing their zpos property."

> +	igt_subtest("plane_primary_overlay_mutable_zpos") {
>  		uint32_t format_primary = DRM_FORMAT_ARGB8888;
>  		uint32_t format_overlay = DRM_FORMAT_ARGB1555;
>  
>  		igt_plane_t *overlay =
>  			igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_OVERLAY);
> -
>  		igt_require(overlay);
> +
>  		igt_require(igt_plane_has_prop(primary, IGT_PLANE_ZPOS));
>  		igt_require(igt_plane_has_prop(overlay, IGT_PLANE_ZPOS));
>  
> @@ -1002,8 +1127,18 @@ igt_main
>  		igt_require(igt_plane_has_format_mod(overlay, format_overlay, 0x0));
>  
>  		igt_output_set_pipe(output, pipe);
> -		plane_primary_overlay_zpos(pipe_obj, output, primary, overlay,
> -					   format_primary, format_overlay);
> +		plane_primary_overlay_mutable_zpos(pipe_obj, output, primary, overlay,
> +						   format_primary, format_overlay);
> +	}
> +
> +	igt_describe("Tests immutable zpos where zpos cannot be modified such that "\
> +		     "reported zpos of the plane is correct by making sure a "\
> +		     "full-screen plane covers all other planes with the lower zpos,"\
> +		     "and the plane with the next available zpos is indeed partially "\
> +		     "covering the full-screen plane");

How about: "Verify the reported zpos property of planes by making sure
only higher zpos planes cover the lower zpos ones".

> +	igt_subtest("plane_immutable_zpos") {

Do we want a per-pipe test? The current exec time is [0.14, 0.37] s, so
good job here, and we could test every pipe!

Anyway, all of these comments are nit picks. If you fix the description,
this is:
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>

Martin

> +		igt_output_set_pipe(output, pipe);
> +		plane_immutable_zpos(&display, pipe_obj, output);
>  	}
>  
>  	igt_subtest("test_only") {
> @@ -1011,6 +1146,7 @@ igt_main
>  
>  		test_only(pipe_obj, primary, output);
>  	}
> +
>  	igt_subtest("plane_cursor_legacy") {
>  		igt_plane_t *cursor =
>  			igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_CURSOR);
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos
  2020-03-13 14:26 ` [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos Martin Peres
@ 2020-03-13 15:28   ` Nautiyal, Ankit K
  2020-03-16 18:21     ` Sharma, Swati2
  0 siblings, 1 reply; 6+ messages in thread
From: Nautiyal, Ankit K @ 2020-03-13 15:28 UTC (permalink / raw)
  To: Martin Peres, Sharma, Swati2, igt-dev; +Cc: Latvala, Petri

Hi Swati,

I think we can avoid the sorting if we use 'zpos %  num_planes' as the index.
Something like:
plane_ptr[zpos % n_planes]  = &display->pipes[pipe].planes[i]

-Ankit

-----Original Message-----
From: Martin Peres <martin.peres@linux.intel.com> 
Sent: Friday, March 13, 2020 7:56 PM
To: Sharma, Swati2 <swati2.sharma@intel.com>; igt-dev@lists.freedesktop.org
Cc: maarten.lankhorst@linux.intel.com; Hiler, Arkadiusz <arkadiusz.hiler@intel.com>; Latvala, Petri <petri.latvala@intel.com>; Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>
Subject: Re: [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos

On 2020-03-12 09:51, Swati Sharma wrote:
> i915 implements immutable zpos property whereas the existing test case 
> is written to validate mutable zpos.
> 
> Added new sub-test to validate immutable zpos. In the test, to 
> validate reported zpos of the plane is correct by making sure a 
> full-screen plane covers all other planes with the lower zpos, and the 
> plane with the next available zpos is indeed partially covering the full-screen plane.
> 
> v2: -Removed intel only checks [Martin]
>     -Used XRGB8888 pixel format as used in other IGTs
>     -Added documentation [Martin]
>     -Removed skip, instead continue if plane doesn't support zpos [Martin]
>     -Sorted planes in increasing order of zpos [Martin]
> 
> Issue: https://gitlab.freedesktop.org/drm/intel/issues/404
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>  tests/kms_atomic.c | 156 
> ++++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 146 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c index 
> 8462d128..2a6a407e 100644
> --- a/tests/kms_atomic.c
> +++ b/tests/kms_atomic.c
> @@ -121,7 +121,7 @@ static void plane_check_current_state(igt_plane_t 
> *plane, const uint64_t *values  }
>  
>  static void plane_commit(igt_plane_t *plane, enum igt_commit_style s,
> -                                enum kms_atomic_check_relax relax)
> +                         enum kms_atomic_check_relax relax)
>  {
>  	igt_display_commit2(plane->pipe->display, s);
>  	plane_check_current_state(plane, plane->values, relax); @@ -277,9 
> +277,9 @@ static uint32_t plane_get_igt_format(igt_plane_t *plane)  }
>  
>  static void
> -plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
> -			   igt_plane_t *primary, igt_plane_t *overlay,
> -			   uint32_t format_primary, uint32_t format_overlay)
> +plane_primary_overlay_mutable_zpos(igt_pipe_t *pipe, igt_output_t *output,
> +			           igt_plane_t *primary, igt_plane_t *overlay,
> +			           uint32_t format_primary, uint32_t format_overlay)
>  {
>  	struct igt_fb fb_primary, fb_overlay;
>  	drmModeModeInfo *mode = igt_output_get_mode(output); @@ -320,7 
> +320,7 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>  	igt_plane_set_prop_value(overlay, IGT_PLANE_ZPOS, 1);
>  
>  	igt_info("Committing with overlay on top, it has a hole "\
> -		  "through which the primary should be seen\n");
> +		 "through which the primary should be seen\n");
>  	plane_commit(primary, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);
>  
>  	igt_assert_eq_u64(igt_plane_get_prop(primary, IGT_PLANE_ZPOS), 0); 
> @@ -346,7 +346,7 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>  	igt_put_cairo_ctx(pipe->display->drm_fd, &fb_primary, cr);
>  
>  	igt_info("Committing with a hole in the primary through "\
> -		  "which the underlay should be seen\n");
> +		 "which the underlay should be seen\n");
>  	plane_commit(primary, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);
>  
>  	/* reset it back to initial state */ @@ -358,6 +358,127 @@ 
> plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>  	igt_assert_eq_u64(igt_plane_get_prop(overlay, IGT_PLANE_ZPOS), 1);  
> }
>  
> +static void
> +plane_immutable_zpos(igt_display_t *display, igt_pipe_t *pipe,
> +		     igt_output_t *output)
> +{
> +	cairo_t *cr;
> +	int min_idx;
> +	struct igt_fb fb_ref;
> +	igt_plane_t *primary;
> +	drmModeModeInfo *mode;
> +	igt_pipe_crc_t *pipe_crc;
> +	igt_crc_t ref_crc, new_crc;
> +	int n_planes = pipe->n_planes;
> +	igt_plane_t *plane_ptr[n_planes];
> +	igt_plane_t *plane_lower, *plane_upper;
> +	uint32_t w_lower, h_lower, w_upper, h_upper;
> +
> +	mode = igt_output_get_mode(output);

Make sure to set a low resolution so that we don't run out of memory bandwidth when having a ton of planes enabled.

> +	primary = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
> +
> +	/* for lower plane */
> +	w_lower = mode->hdisplay;
> +	h_lower = mode->vdisplay;
> +
> +	/* for upper plane */
> +	w_upper = mode->hdisplay / 2;
> +	h_upper = mode->vdisplay / 2;
> +
> +	igt_create_color_fb(display->drm_fd,
> +			    w_lower, h_lower,
> +			    DRM_FORMAT_XRGB8888,
> +			    I915_TILING_NONE,
> +			    0.0, 0.0, 0.0, &fb_ref);
> +
> +	/* create reference image */
> +	cr = igt_get_cairo_ctx(display->drm_fd, &fb_ref);
> +	igt_assert(cairo_status(cr) == 0);
> +	igt_paint_color(cr, 0, 0, w_lower, h_lower, 0.0, 0.0, 1.0);
> +	igt_paint_color(cr, w_upper / 2, h_upper / 2, w_upper, h_upper, 1.0, 1.0, 0.0);
> +	igt_put_cairo_ctx(display->drm_fd, &fb_ref, cr);
> +	igt_plane_set_fb(primary, &fb_ref);
> +	igt_display_commit2(display, COMMIT_ATOMIC);
> +
> +	/* create the pipe_crc object for this pipe */
> +	pipe_crc = igt_pipe_crc_new(pipe->display->drm_fd, pipe->pipe,
> +				    INTEL_PIPE_CRC_SOURCE_AUTO);
> +
> +	/* get reference crc */
> +	igt_pipe_crc_start(pipe_crc);
> +	igt_pipe_crc_get_current(display->drm_fd, pipe_crc, &ref_crc);
> +
> +	igt_plane_set_fb(primary, NULL);
> +
> +	/* sort planes in increasing order of zpos */
> +	for (int k = 0; k < n_planes; k++)
> +		plane_ptr[k] = &display->pipes[pipe->pipe].planes[k];
> +
> +	for (int l = 0; l < n_planes - 1; l++) {
> +		min_idx = l;
> +		for (int m = l + 1; m < n_planes; m++) {
> +			int zpos1, zpos2;
> +
> +			if (!igt_plane_has_prop(plane_ptr[min_idx], IGT_PLANE_ZPOS) ||
> +			    !igt_plane_has_prop(plane_ptr[m], IGT_PLANE_ZPOS))
> +				continue;
> +
> +			zpos1 = igt_plane_get_prop(plane_ptr[min_idx], IGT_PLANE_ZPOS);
> +			zpos2 = igt_plane_get_prop(plane_ptr[m], IGT_PLANE_ZPOS);
> +
> +			if (zpos1 == zpos2)
> +				continue;
> +
> +			if (zpos2 < zpos1)
> +				min_idx = m;
> +		}
> +
> +		igt_swap(plane_ptr[min_idx], plane_ptr[l]);
> +	}
> +
> +	/* checking only pairs of plane in increasing fashion
> +	 * to avoid combinatorial explosion
> +	 */
> +	for (int i = 0; i < n_planes - 1; i++) {
> +		struct igt_fb fb_lower, fb_upper;
> +
> +		plane_lower = plane_ptr[i];
> +		plane_upper = plane_ptr[i + 1];
> +
> +		if ((plane_lower->type == DRM_PLANE_TYPE_CURSOR) ||
> +		    (plane_upper->type == DRM_PLANE_TYPE_CURSOR))
> +			continue;
> +
> +		igt_create_color_fb(display->drm_fd,
> +				    w_lower, h_lower,
> +				    DRM_FORMAT_XRGB8888,
> +				    I915_TILING_NONE,
> +				    0.0, 0.0, 1.0, &fb_lower);
> +
> +		igt_create_color_fb(display->drm_fd,
> +				    w_upper, h_upper,
> +				    DRM_FORMAT_XRGB8888,
> +				    I915_TILING_NONE,
> +				    1.0, 1.0, 0.0, &fb_upper);

Do you need to re-create the fb at every loop?

> +
> +		igt_plane_set_position(plane_lower, 0, 0);
> +		igt_plane_set_fb(plane_lower, &fb_lower);
> +
> +		igt_plane_set_position(plane_upper, w_upper / 2, h_upper / 2);
> +		igt_plane_set_fb(plane_upper, &fb_upper);
> +
> +		igt_info("Committing with the plane[%d] underneath "\
> +			 "plane[%d]\n", i, (i + 1));
> +		igt_display_commit2(display, COMMIT_ATOMIC);
> +		igt_pipe_crc_get_current(pipe->display->drm_fd, pipe_crc, 
> +&new_crc);
> +
> +		igt_assert_crc_equal(&ref_crc, &new_crc);
> +
> +		igt_plane_set_fb(plane_lower, NULL);
> +		igt_plane_set_fb(plane_upper, NULL);

So, you don't set all the planes under the lower one to another color or something?

> +	}
> +}
> +
>  static void plane_overlay(igt_pipe_t *pipe, igt_output_t *output, 
> igt_plane_t *plane)  {
>  	drmModeModeInfo *mode = igt_output_get_mode(output); @@ -987,14 
> +1108,18 @@ igt_main
>  		plane_primary(pipe_obj, primary, &fb);
>  	}
>  
> -	igt_subtest("plane_primary_overlay_zpos") {
> +	igt_describe("Tests mutable zpos where zpos is modified for "\
> +		     "primary and overlay planes, order of planes is validated "\
> +		     "visually where top plane has hole through which underlay plane "\
> +		     "can be seen");

The wording is a little odd and the description is more focused on the how, rather than what it is trying to check.

How about: "Verify that the overlay plane can cover the primary one (and vice versa) by changing their zpos property."

> +	igt_subtest("plane_primary_overlay_mutable_zpos") {
>  		uint32_t format_primary = DRM_FORMAT_ARGB8888;
>  		uint32_t format_overlay = DRM_FORMAT_ARGB1555;
>  
>  		igt_plane_t *overlay =
>  			igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_OVERLAY);
> -
>  		igt_require(overlay);
> +
>  		igt_require(igt_plane_has_prop(primary, IGT_PLANE_ZPOS));
>  		igt_require(igt_plane_has_prop(overlay, IGT_PLANE_ZPOS));
>  
> @@ -1002,8 +1127,18 @@ igt_main
>  		igt_require(igt_plane_has_format_mod(overlay, format_overlay, 
> 0x0));
>  
>  		igt_output_set_pipe(output, pipe);
> -		plane_primary_overlay_zpos(pipe_obj, output, primary, overlay,
> -					   format_primary, format_overlay);
> +		plane_primary_overlay_mutable_zpos(pipe_obj, output, primary, overlay,
> +						   format_primary, format_overlay);
> +	}
> +
> +	igt_describe("Tests immutable zpos where zpos cannot be modified such that "\
> +		     "reported zpos of the plane is correct by making sure a "\
> +		     "full-screen plane covers all other planes with the lower zpos,"\
> +		     "and the plane with the next available zpos is indeed partially "\
> +		     "covering the full-screen plane");

How about: "Verify the reported zpos property of planes by making sure only higher zpos planes cover the lower zpos ones".

> +	igt_subtest("plane_immutable_zpos") {

Do we want a per-pipe test? The current exec time is [0.14, 0.37] s, so good job here, and we could test every pipe!

Anyway, all of these comments are nit picks. If you fix the description, this is:
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>

Martin

> +		igt_output_set_pipe(output, pipe);
> +		plane_immutable_zpos(&display, pipe_obj, output);
>  	}
>  
>  	igt_subtest("test_only") {
> @@ -1011,6 +1146,7 @@ igt_main
>  
>  		test_only(pipe_obj, primary, output);
>  	}
> +
>  	igt_subtest("plane_cursor_legacy") {
>  		igt_plane_t *cursor =
>  			igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_CURSOR);
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos
  2020-03-13 15:28   ` Nautiyal, Ankit K
@ 2020-03-16 18:21     ` Sharma, Swati2
  0 siblings, 0 replies; 6+ messages in thread
From: Sharma, Swati2 @ 2020-03-16 18:21 UTC (permalink / raw)
  To: Nautiyal, Ankit K, Martin Peres, igt-dev; +Cc: Latvala, Petri



On 13-Mar-20 8:58 PM, Nautiyal, Ankit K wrote:
> Hi Swati,
> 
> I think we can avoid the sorting if we use 'zpos %  num_planes' as the index.
> Something like:
> plane_ptr[zpos % n_planes]  = &display->pipes[pipe].planes[i]
> 
> -Ankit
Done in v3
> 
> -----Original Message-----
> From: Martin Peres <martin.peres@linux.intel.com>
> Sent: Friday, March 13, 2020 7:56 PM
> To: Sharma, Swati2 <swati2.sharma@intel.com>; igt-dev@lists.freedesktop.org
> Cc: maarten.lankhorst@linux.intel.com; Hiler, Arkadiusz <arkadiusz.hiler@intel.com>; Latvala, Petri <petri.latvala@intel.com>; Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>
> Subject: Re: [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos
> 
> On 2020-03-12 09:51, Swati Sharma wrote:
>> i915 implements immutable zpos property whereas the existing test case
>> is written to validate mutable zpos.
>>
>> Added new sub-test to validate immutable zpos. In the test, to
>> validate reported zpos of the plane is correct by making sure a
>> full-screen plane covers all other planes with the lower zpos, and the
>> plane with the next available zpos is indeed partially covering the full-screen plane.
>>
>> v2: -Removed intel only checks [Martin]
>>      -Used XRGB8888 pixel format as used in other IGTs
>>      -Added documentation [Martin]
>>      -Removed skip, instead continue if plane doesn't support zpos [Martin]
>>      -Sorted planes in increasing order of zpos [Martin]
>>
>> Issue: https://gitlab.freedesktop.org/drm/intel/issues/404
>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>> ---
>>   tests/kms_atomic.c | 156
>> ++++++++++++++++++++++++++++++++++++++++++---
>>   1 file changed, 146 insertions(+), 10 deletions(-)
>>
>> diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c index
>> 8462d128..2a6a407e 100644
>> --- a/tests/kms_atomic.c
>> +++ b/tests/kms_atomic.c
>> @@ -121,7 +121,7 @@ static void plane_check_current_state(igt_plane_t
>> *plane, const uint64_t *values  }
>>   
>>   static void plane_commit(igt_plane_t *plane, enum igt_commit_style s,
>> -                                enum kms_atomic_check_relax relax)
>> +                         enum kms_atomic_check_relax relax)
>>   {
>>   	igt_display_commit2(plane->pipe->display, s);
>>   	plane_check_current_state(plane, plane->values, relax); @@ -277,9
>> +277,9 @@ static uint32_t plane_get_igt_format(igt_plane_t *plane)  }
>>   
>>   static void
>> -plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>> -			   igt_plane_t *primary, igt_plane_t *overlay,
>> -			   uint32_t format_primary, uint32_t format_overlay)
>> +plane_primary_overlay_mutable_zpos(igt_pipe_t *pipe, igt_output_t *output,
>> +			           igt_plane_t *primary, igt_plane_t *overlay,
>> +			           uint32_t format_primary, uint32_t format_overlay)
>>   {
>>   	struct igt_fb fb_primary, fb_overlay;
>>   	drmModeModeInfo *mode = igt_output_get_mode(output); @@ -320,7
>> +320,7 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>>   	igt_plane_set_prop_value(overlay, IGT_PLANE_ZPOS, 1);
>>   
>>   	igt_info("Committing with overlay on top, it has a hole "\
>> -		  "through which the primary should be seen\n");
>> +		 "through which the primary should be seen\n");
>>   	plane_commit(primary, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);
>>   
>>   	igt_assert_eq_u64(igt_plane_get_prop(primary, IGT_PLANE_ZPOS), 0);
>> @@ -346,7 +346,7 @@ plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>>   	igt_put_cairo_ctx(pipe->display->drm_fd, &fb_primary, cr);
>>   
>>   	igt_info("Committing with a hole in the primary through "\
>> -		  "which the underlay should be seen\n");
>> +		 "which the underlay should be seen\n");
>>   	plane_commit(primary, COMMIT_ATOMIC, ATOMIC_RELAX_NONE);
>>   
>>   	/* reset it back to initial state */ @@ -358,6 +358,127 @@
>> plane_primary_overlay_zpos(igt_pipe_t *pipe, igt_output_t *output,
>>   	igt_assert_eq_u64(igt_plane_get_prop(overlay, IGT_PLANE_ZPOS), 1);
>> }
>>   
>> +static void
>> +plane_immutable_zpos(igt_display_t *display, igt_pipe_t *pipe,
>> +		     igt_output_t *output)
>> +{
>> +	cairo_t *cr;
>> +	int min_idx;
>> +	struct igt_fb fb_ref;
>> +	igt_plane_t *primary;
>> +	drmModeModeInfo *mode;
>> +	igt_pipe_crc_t *pipe_crc;
>> +	igt_crc_t ref_crc, new_crc;
>> +	int n_planes = pipe->n_planes;
>> +	igt_plane_t *plane_ptr[n_planes];
>> +	igt_plane_t *plane_lower, *plane_upper;
>> +	uint32_t w_lower, h_lower, w_upper, h_upper;
>> +
>> +	mode = igt_output_get_mode(output);
> 
> Make sure to set a low resolution so that we don't run out of memory bandwidth when having a ton of planes enabled.
We enable only 2 planes at a time, so BW shouldn't be problem.
> 
>> +	primary = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
>> +
>> +	/* for lower plane */
>> +	w_lower = mode->hdisplay;
>> +	h_lower = mode->vdisplay;
>> +
>> +	/* for upper plane */
>> +	w_upper = mode->hdisplay / 2;
>> +	h_upper = mode->vdisplay / 2;
>> +
>> +	igt_create_color_fb(display->drm_fd,
>> +			    w_lower, h_lower,
>> +			    DRM_FORMAT_XRGB8888,
>> +			    I915_TILING_NONE,
>> +			    0.0, 0.0, 0.0, &fb_ref);
>> +
>> +	/* create reference image */
>> +	cr = igt_get_cairo_ctx(display->drm_fd, &fb_ref);
>> +	igt_assert(cairo_status(cr) == 0);
>> +	igt_paint_color(cr, 0, 0, w_lower, h_lower, 0.0, 0.0, 1.0);
>> +	igt_paint_color(cr, w_upper / 2, h_upper / 2, w_upper, h_upper, 1.0, 1.0, 0.0);
>> +	igt_put_cairo_ctx(display->drm_fd, &fb_ref, cr);
>> +	igt_plane_set_fb(primary, &fb_ref);
>> +	igt_display_commit2(display, COMMIT_ATOMIC);
>> +
>> +	/* create the pipe_crc object for this pipe */
>> +	pipe_crc = igt_pipe_crc_new(pipe->display->drm_fd, pipe->pipe,
>> +				    INTEL_PIPE_CRC_SOURCE_AUTO);
>> +
>> +	/* get reference crc */
>> +	igt_pipe_crc_start(pipe_crc);
>> +	igt_pipe_crc_get_current(display->drm_fd, pipe_crc, &ref_crc);
>> +
>> +	igt_plane_set_fb(primary, NULL);
>> +
>> +	/* sort planes in increasing order of zpos */
>> +	for (int k = 0; k < n_planes; k++)
>> +		plane_ptr[k] = &display->pipes[pipe->pipe].planes[k];
>> +
>> +	for (int l = 0; l < n_planes - 1; l++) {
>> +		min_idx = l;
>> +		for (int m = l + 1; m < n_planes; m++) {
>> +			int zpos1, zpos2;
>> +
>> +			if (!igt_plane_has_prop(plane_ptr[min_idx], IGT_PLANE_ZPOS) ||
>> +			    !igt_plane_has_prop(plane_ptr[m], IGT_PLANE_ZPOS))
>> +				continue;
>> +
>> +			zpos1 = igt_plane_get_prop(plane_ptr[min_idx], IGT_PLANE_ZPOS);
>> +			zpos2 = igt_plane_get_prop(plane_ptr[m], IGT_PLANE_ZPOS);
>> +
>> +			if (zpos1 == zpos2)
>> +				continue;
>> +
>> +			if (zpos2 < zpos1)
>> +				min_idx = m;
>> +		}
>> +
>> +		igt_swap(plane_ptr[min_idx], plane_ptr[l]);
>> +	}
>> +
>> +	/* checking only pairs of plane in increasing fashion
>> +	 * to avoid combinatorial explosion
>> +	 */
>> +	for (int i = 0; i < n_planes - 1; i++) {
>> +		struct igt_fb fb_lower, fb_upper;
>> +
>> +		plane_lower = plane_ptr[i];
>> +		plane_upper = plane_ptr[i + 1];
>> +
>> +		if ((plane_lower->type == DRM_PLANE_TYPE_CURSOR) ||
>> +		    (plane_upper->type == DRM_PLANE_TYPE_CURSOR))
>> +			continue;
>> +
>> +		igt_create_color_fb(display->drm_fd,
>> +				    w_lower, h_lower,
>> +				    DRM_FORMAT_XRGB8888,
>> +				    I915_TILING_NONE,
>> +				    0.0, 0.0, 1.0, &fb_lower);
>> +
>> +		igt_create_color_fb(display->drm_fd,
>> +				    w_upper, h_upper,
>> +				    DRM_FORMAT_XRGB8888,
>> +				    I915_TILING_NONE,
>> +				    1.0, 1.0, 0.0, &fb_upper);
> 
> Do you need to re-create the fb at every loop?
Yes, since in each iteration we are changing plane, fb needs to be 
recreated.
> 
>> +
>> +		igt_plane_set_position(plane_lower, 0, 0);
>> +		igt_plane_set_fb(plane_lower, &fb_lower);
>> +
>> +		igt_plane_set_position(plane_upper, w_upper / 2, h_upper / 2);
>> +		igt_plane_set_fb(plane_upper, &fb_upper);
>> +
>> +		igt_info("Committing with the plane[%d] underneath "\
>> +			 "plane[%d]\n", i, (i + 1));
>> +		igt_display_commit2(display, COMMIT_ATOMIC);
>> +		igt_pipe_crc_get_current(pipe->display->drm_fd, pipe_crc,
>> +&new_crc);
>> +
>> +		igt_assert_crc_equal(&ref_crc, &new_crc);
>> +
>> +		igt_plane_set_fb(plane_lower, NULL);
>> +		igt_plane_set_fb(plane_upper, NULL);
> 
> So, you don't set all the planes under the lower one to another color or something?
No, since i m enabling only 2 planes at a time there won't be any planes 
active under lower plane.
> 
>> +	}
>> +}
>> +
>>   static void plane_overlay(igt_pipe_t *pipe, igt_output_t *output,
>> igt_plane_t *plane)  {
>>   	drmModeModeInfo *mode = igt_output_get_mode(output); @@ -987,14
>> +1108,18 @@ igt_main
>>   		plane_primary(pipe_obj, primary, &fb);
>>   	}
>>   
>> -	igt_subtest("plane_primary_overlay_zpos") {
>> +	igt_describe("Tests mutable zpos where zpos is modified for "\
>> +		     "primary and overlay planes, order of planes is validated "\
>> +		     "visually where top plane has hole through which underlay plane "\
>> +		     "can be seen");
> 
> The wording is a little odd and the description is more focused on the how, rather than what it is trying to check.
> 
> How about: "Verify that the overlay plane can cover the primary one (and vice versa) by changing their zpos property."
> 
>> +	igt_subtest("plane_primary_overlay_mutable_zpos") {
>>   		uint32_t format_primary = DRM_FORMAT_ARGB8888;
>>   		uint32_t format_overlay = DRM_FORMAT_ARGB1555;
>>   
>>   		igt_plane_t *overlay =
>>   			igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_OVERLAY);
>> -
>>   		igt_require(overlay);
>> +
>>   		igt_require(igt_plane_has_prop(primary, IGT_PLANE_ZPOS));
>>   		igt_require(igt_plane_has_prop(overlay, IGT_PLANE_ZPOS));
>>   
>> @@ -1002,8 +1127,18 @@ igt_main
>>   		igt_require(igt_plane_has_format_mod(overlay, format_overlay,
>> 0x0));
>>   
>>   		igt_output_set_pipe(output, pipe);
>> -		plane_primary_overlay_zpos(pipe_obj, output, primary, overlay,
>> -					   format_primary, format_overlay);
>> +		plane_primary_overlay_mutable_zpos(pipe_obj, output, primary, overlay,
>> +						   format_primary, format_overlay);
>> +	}
>> +
>> +	igt_describe("Tests immutable zpos where zpos cannot be modified such that "\
>> +		     "reported zpos of the plane is correct by making sure a "\
>> +		     "full-screen plane covers all other planes with the lower zpos,"\
>> +		     "and the plane with the next available zpos is indeed partially "\
>> +		     "covering the full-screen plane");
> 
> How about: "Verify the reported zpos property of planes by making sure only higher zpos planes cover the lower zpos ones".
Done in v3. Thanks, it sounds much better :)
> 
>> +	igt_subtest("plane_immutable_zpos") {
> 
> Do we want a per-pipe test? The current exec time is [0.14, 0.37] s, so good job here, and we could test every pipe!
>
Yes, we can have per-pipe test, but it needs restructuring in whole 
kms_atomic IGT; which i don't think is in the scope of this patch. Even 
if i will make this test per-pipe it will little bit odd and won't go in 
the same flow as other subtests. Is it okay?

> Anyway, all of these comments are nit picks. If you fix the description, this is:
> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
> 
> Martin
> 
>> +		igt_output_set_pipe(output, pipe);
>> +		plane_immutable_zpos(&display, pipe_obj, output);
>>   	}
>>   
>>   	igt_subtest("test_only") {
>> @@ -1011,6 +1146,7 @@ igt_main
>>   
>>   		test_only(pipe_obj, primary, output);
>>   	}
>> +
>>   	igt_subtest("plane_cursor_legacy") {
>>   		igt_plane_t *cursor =
>>   			igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_CURSOR);
>>

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

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

end of thread, other threads:[~2020-03-16 18:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12  7:51 [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos Swati Sharma
2020-03-12  8:39 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_atomic: add test to validate immutable zpos (rev2) Patchwork
2020-03-13  1:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-03-13 14:26 ` [igt-dev] [PATCH i-g-t v2] tests/kms_atomic: add test to validate immutable zpos Martin Peres
2020-03-13 15:28   ` Nautiyal, Ankit K
2020-03-16 18:21     ` Sharma, Swati2

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.