Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state.
@ 2018-03-20 13:55 Maarten Lankhorst
  2018-03-20 13:55 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_cursor_crc: Remove DPMS/suspend tests Maarten Lankhorst
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Maarten Lankhorst @ 2018-03-20 13:55 UTC (permalink / raw)
  To: igt-dev

Instead of doing a DPMS/suspend-resume cycle to verify state, we should
be able to verify by comparing atomic state with what we set.

This will obsolete the suspend/resume and dpms tests in kms_cursor_crc,
which saves us about 5 minutes.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_cursor_legacy.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index d0a28b3c442c..771e501e5ce0 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -1355,6 +1355,81 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
 	igt_remove_fb(display->drm_fd, &cursor_fb);
 }
 
+static void verify_cursor_parameters(igt_display_t *display)
+{
+	struct drm_mode_cursor arg[2];
+	struct igt_fb fb_info, cursor_fb, cursor_fb2;
+	enum pipe pipe = find_connected_pipe(display, false);
+	igt_pipe_t *pipe_obj = &display->pipes[pipe];
+	igt_plane_t *cursor = igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_CURSOR);
+	drmModePlane *drm_cursor;
+
+	/* Must support universal plane API for cursor plane for this test. */
+	igt_require(cursor->drm_plane);
+	igt_require(set_fb_on_crtc(display, pipe, &fb_info));
+
+	igt_create_color_fb(display->drm_fd, 64, 64, DRM_FORMAT_ARGB8888, 0, 1., 1., 1., &cursor_fb);
+	igt_create_color_fb(display->drm_fd, 64, 64, DRM_FORMAT_ARGB8888, 0, .5, .5, .5, &cursor_fb2);
+
+	igt_plane_set_fb(cursor, &cursor_fb);
+	populate_cursor_args(display, pipe, arg, &cursor_fb);
+
+	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+	/* Move Cursor with legacy cursor move. */
+	do_ioctl(display->drm_fd, DRM_IOCTL_MODE_CURSOR, arg);
+
+	drm_cursor = drmModeGetPlane(display->drm_fd, cursor->drm_plane->plane_id);
+	igt_assert(drm_cursor);
+
+	igt_assert_eq(drm_cursor->crtc_id, pipe_obj->crtc_id);
+	if (display->is_atomic) {
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_FB_ID), cursor_fb.fb_id);
+
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_SRC_X), 0);
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_SRC_Y), 0);
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_SRC_W), IGT_FIXED(cursor_fb.width, 0));
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_SRC_H), IGT_FIXED(cursor_fb.height, 0));
+
+		/* Make sure legacy cursor move overwriting atomic pos (0,0) is picked up. */
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_CRTC_X), arg->x);
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_CRTC_Y), arg->y);
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_CRTC_W), cursor_fb.width);
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_CRTC_H), cursor_fb.height);
+
+		/* COMMIT_ATOMIC specifies the fb id, do a strict check. */
+		igt_assert_eq(drm_cursor->fb_id, cursor_fb.fb_id);
+	} else {
+		/* Legacy cursor ioctl generates a new fb id */
+		igt_assert(drm_cursor->fb_id);
+	}
+	drmModeFreePlane(drm_cursor);
+
+	/* Use setplane API. */
+	igt_plane_set_fb(cursor, &cursor_fb2);
+	igt_plane_set_position(cursor, 1, 2);
+	igt_display_commit2(display, COMMIT_UNIVERSAL);
+
+	drm_cursor = drmModeGetPlane(display->drm_fd, cursor->drm_plane->plane_id);
+	igt_assert(drm_cursor);
+
+	/* SetPlane specifies the fb id, do a strict check. */
+	igt_assert_eq(drm_cursor->fb_id, cursor_fb2.fb_id);
+
+	/* And compare atomic properties, to make sure the change sticks. */
+	if (display->is_atomic) {
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_FB_ID), cursor_fb2.fb_id);
+
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_CRTC_X), 1);
+		igt_assert_eq(igt_plane_get_prop(cursor, IGT_PLANE_CRTC_Y), 2);
+	}
+	drmModeFreePlane(drm_cursor);
+
+	igt_remove_fb(display->drm_fd, &cursor_fb2);
+	igt_remove_fb(display->drm_fd, &cursor_fb);
+	igt_remove_fb(display->drm_fd, &fb_info);
+}
+
 igt_main
 {
 	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
@@ -1458,6 +1533,9 @@ igt_main
 	igt_subtest("flip-vs-cursor-busy-crc-atomic")
 		flip_vs_cursor_busy_crc(&display, true);
 
+	igt_subtest("verify-cursor-parameters")
+		verify_cursor_parameters(&display);
+
 	for (i = 0; i <= flip_test_last; i++) {
 		const char *modes[flip_test_last+1] = {
 			"legacy",
-- 
2.16.2

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

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

* [igt-dev] [PATCH i-g-t 2/2] tests/kms_cursor_crc: Remove DPMS/suspend tests.
  2018-03-20 13:55 [igt-dev] [PATCH i-g-t 1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state Maarten Lankhorst
@ 2018-03-20 13:55 ` Maarten Lankhorst
  2018-03-20 17:30 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state Patchwork
  2018-03-20 21:08 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Maarten Lankhorst @ 2018-03-20 13:55 UTC (permalink / raw)
  To: igt-dev

All the tests care about are that we save cursor parameters
correctly. The new test in kms_cursor_legacy verifies that
a legacy cursor update updates all properties, so
suspend/resume and dpms would work as intended.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_cursor_crc.c | 42 ++----------------------------------------
 1 file changed, 2 insertions(+), 40 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index a164839ee2cc..de0cc0812da5 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -60,12 +60,8 @@ typedef struct {
 	int cursor_max_w, cursor_max_h;
 	igt_pipe_crc_t *pipe_crc;
 	uint32_t devid;
-	unsigned flags;
 } data_t;
 
-#define TEST_DPMS (1<<0)
-#define TEST_SUSPEND (1<<1)
-
 static void draw_cursor(cairo_t *cr, int x, int y, int cw, int ch)
 {
 	int wl, wr, ht, hb;
@@ -168,27 +164,6 @@ static void do_single_test(data_t *data, int x, int y)
 	igt_wait_for_vblank(data->drm_fd, data->pipe);
 	igt_pipe_crc_collect_crc(pipe_crc, &crc);
 
-	if (data->flags & (TEST_DPMS | TEST_SUSPEND)) {
-		igt_crc_t crc_after;
-
-		if (data->flags & TEST_DPMS) {
-			igt_debug("dpms off/on cycle\n");
-			kmstest_set_connector_dpms(data->drm_fd,
-						   data->output->config.connector,
-						   DRM_MODE_DPMS_OFF);
-			kmstest_set_connector_dpms(data->drm_fd,
-						   data->output->config.connector,
-						   DRM_MODE_DPMS_ON);
-		}
-
-		if (data->flags & TEST_SUSPEND)
-			igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
-						      SUSPEND_TEST_NONE);
-
-		igt_pipe_crc_collect_crc(pipe_crc, &crc_after);
-		igt_assert_crc_equal(&crc, &crc_after);
-	}
-
 	cursor_disable(data);
 	igt_display_commit(display);
 
@@ -319,12 +294,10 @@ static void test_crc_sliding(data_t *data)
 
 static void test_crc_random(data_t *data)
 {
-	int i, max;
-
-	max = data->flags & (TEST_DPMS | TEST_SUSPEND) ? 2 : 50;
+	int i;
 
 	/* Random cursor placement */
-	for (i = 0; i < max; i++) {
+	for (i = 0; i < 50; i++) {
 		int x = rand() % (data->screenw + data->curw * 2) - data->curw;
 		int y = rand() % (data->screenh + data->curh * 2) - data->curh;
 		do_single_test(data, x, y);
@@ -585,17 +558,6 @@ static void run_test_generic(data_t *data)
 			run_test(data, test_crc_sliding, w, h);
 		igt_subtest_f("cursor-%dx%d-random", w, h)
 			run_test(data, test_crc_random, w, h);
-		igt_subtest_f("cursor-%dx%d-dpms", w, h) {
-			data->flags = TEST_DPMS;
-			run_test(data, test_crc_random, w, h);
-			data->flags = 0;
-		}
-
-		igt_subtest_f("cursor-%dx%d-suspend", w, h) {
-			data->flags = TEST_SUSPEND;
-			run_test(data, test_crc_random, w, h);
-			data->flags = 0;
-		}
 
 		igt_subtest_f("cursor-%dx%d-rapid-movement", w, h) {
 			run_test(data, test_rapid_movement, w, h);
-- 
2.16.2

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state.
  2018-03-20 13:55 [igt-dev] [PATCH i-g-t 1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state Maarten Lankhorst
  2018-03-20 13:55 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_cursor_crc: Remove DPMS/suspend tests Maarten Lankhorst
@ 2018-03-20 17:30 ` Patchwork
  2018-03-20 21:08 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-03-20 17:30 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state.
URL   : https://patchwork.freedesktop.org/series/40280/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
178e7f3da66cd02660a86257df75708a0efa3bbc tests/kms_frontbuffer_tracking: Update check for PSR status

with latest DRM-Tip kernel build CI_DRM_3958
9d737cebc219 drm-tip: 2018y-03m-20d-14h-56m-05s UTC integration manifest

Testlist changes:
+igt@kms_cursor_legacy@verify-cursor-parameters
-igt@kms_cursor_crc@cursor-64x64-dpms
-igt@kms_cursor_crc@cursor-64x64-suspend
-igt@kms_cursor_crc@cursor-128x128-dpms
-igt@kms_cursor_crc@cursor-128x128-suspend
-igt@kms_cursor_crc@cursor-256x256-dpms
-igt@kms_cursor_crc@cursor-256x256-suspend
-igt@kms_cursor_crc@cursor-512x512-dpms
-igt@kms_cursor_crc@cursor-512x512-suspend

---- Possible new issues:

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                incomplete -> PASS       (fi-cfl-s2)

---- Known issues:

Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575

fi-bdw-5557u     total:285  pass:264  dwarn:0   dfail:0   fail:0   skip:21  time:429s
fi-bdw-gvtdvm    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:440s
fi-blb-e6850     total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:381s
fi-bsw-n3050     total:285  pass:239  dwarn:0   dfail:0   fail:0   skip:46  time:542s
fi-bwr-2160      total:285  pass:180  dwarn:0   dfail:0   fail:0   skip:105 time:302s
fi-bxt-dsi       total:285  pass:255  dwarn:0   dfail:0   fail:0   skip:30  time:514s
fi-bxt-j4205     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:512s
fi-byt-j1900     total:285  pass:250  dwarn:0   dfail:0   fail:0   skip:35  time:519s
fi-byt-n2820     total:285  pass:246  dwarn:0   dfail:0   fail:0   skip:39  time:505s
fi-cfl-8700k     total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:413s
fi-cfl-s2        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:576s
fi-cfl-u         total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:515s
fi-cnl-drrs      total:285  pass:254  dwarn:3   dfail:0   fail:0   skip:28  time:521s
fi-elk-e7500     total:285  pass:225  dwarn:1   dfail:0   fail:0   skip:59  time:433s
fi-gdg-551       total:285  pass:176  dwarn:0   dfail:0   fail:1   skip:108 time:320s
fi-glk-1         total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:539s
fi-hsw-4770      total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:404s
fi-ilk-650       total:285  pass:225  dwarn:0   dfail:0   fail:0   skip:60  time:423s
fi-ivb-3520m     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:474s
fi-ivb-3770      total:285  pass:252  dwarn:0   dfail:0   fail:0   skip:33  time:430s
fi-kbl-7500u     total:285  pass:260  dwarn:1   dfail:0   fail:0   skip:24  time:477s
fi-kbl-7567u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:471s
fi-kbl-r         total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:512s
fi-pnv-d510      total:285  pass:219  dwarn:1   dfail:0   fail:0   skip:65  time:655s
fi-skl-6260u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:439s
fi-skl-6600u     total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:532s
fi-skl-6700hq    total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:541s
fi-skl-6700k2    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:510s
fi-skl-6770hq    total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:496s
fi-skl-guc       total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:429s
fi-skl-gvtdvm    total:285  pass:262  dwarn:0   dfail:0   fail:0   skip:23  time:446s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:402s

== Logs ==

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

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

* [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state.
  2018-03-20 13:55 [igt-dev] [PATCH i-g-t 1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state Maarten Lankhorst
  2018-03-20 13:55 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_cursor_crc: Remove DPMS/suspend tests Maarten Lankhorst
  2018-03-20 17:30 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state Patchwork
@ 2018-03-20 21:08 ` Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-03-20 21:08 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state.
URL   : https://patchwork.freedesktop.org/series/40280/
State : failure

== Summary ==

---- Possible new issues:

Test kms_rotation_crc:
        Subgroup cursor-rotation-180:
                pass       -> FAIL       (shard-apl)
Test vgem_basic:
        Subgroup unload:
                pass       -> SKIP       (shard-apl)

---- Known issues:

Test kms_flip:
        Subgroup flip-vs-wf_vblank-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#100368
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-apl) fdo#99912
Test kms_vblank:
        Subgroup pipe-b-ts-continuation-dpms-suspend:
                incomplete -> PASS       (shard-hsw) fdo#105054

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#105054 https://bugs.freedesktop.org/show_bug.cgi?id=105054

shard-apl        total:3471 pass:1807 dwarn:1   dfail:0   fail:8   skip:1654 time:12735s
shard-hsw        total:3471 pass:1762 dwarn:1   dfail:0   fail:2   skip:1705 time:11168s
shard-snb        total:3471 pass:1353 dwarn:1   dfail:0   fail:2   skip:2115 time:7077s
Blacklisted hosts:
shard-kbl        total:3443 pass:1869 dwarn:48  dfail:0   fail:9   skip:1516 time:9290s

== Logs ==

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

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

end of thread, other threads:[~2018-03-20 21:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-20 13:55 [igt-dev] [PATCH i-g-t 1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state Maarten Lankhorst
2018-03-20 13:55 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_cursor_crc: Remove DPMS/suspend tests Maarten Lankhorst
2018-03-20 17:30 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_cursor_legacy: Add subtest to verify cursor update state Patchwork
2018-03-20 21:08 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox