public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips
@ 2020-04-14 10:11 Karthik B S
  2020-04-14 14:42 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_async: Add test to validate asynchronous flips (rev2) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Karthik B S @ 2020-04-14 10:11 UTC (permalink / raw)
  To: igt-dev

Asynchronous flips are issued using the page flip IOCTL.
The test consists of two subtests. The first subtest waits for
the page flip event to be received before giving the next flip,
and the second subtest doesn't wait for page flip events.

The test passes if the IOCTL is successful.

v2: Add authors in the test file. (Paulo)
    Reduce the run time and timeouts to suit IGT needs. (Paulo)
    Replace igt_debug's with igt_assert's to catch slow flips. (Paulo)
    Follow IGT coding style regarding spaces. (Paulo)
    Make set up code part of igt_fixture. (Paulo)
    Skip the test if async flips are not supported. (Paulo)
    Replace suggested-by. (Paulo)
    Added description for test and subtests.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Karthik B S <karthik.b.s@intel.com>
---
 tests/Makefile.sources |   1 +
 tests/kms_async.c      | 243 +++++++++++++++++++++++++++++++++++++++++
 tests/meson.build      |   1 +
 3 files changed, 245 insertions(+)
 create mode 100644 tests/kms_async.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 4e44c98c..eedf4fcb 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -29,6 +29,7 @@ TESTS_progs = \
 	fbdev \
 	kms_3d \
 	kms_addfb_basic \
+	kms_async \
 	kms_atomic \
 	kms_atomic_interruptible \
 	kms_atomic_transition \
diff --git a/tests/kms_async.c b/tests/kms_async.c
new file mode 100644
index 00000000..6031ff4e
--- /dev/null
+++ b/tests/kms_async.c
@@ -0,0 +1,243 @@
+/*
+ * Copyright © 2020 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *  Paulo Zanoni <paulo.r.zanoni@intel.com>
+ *  Karthik B S <karthik.b.s@intel.com>
+ */
+
+#include "igt.h"
+#include "igt_aux.h"
+#include <sys/ioctl.h>
+#include <poll.h>
+
+#define BUFS 4
+#define WARM_UP_TIME 1
+#define RUN_TIME 2
+#define THRESHOLD 10 /* TODO: May need tuning */
+
+IGT_TEST_DESCRIPTION("Test asynchrous page flips.");
+
+typedef struct {
+	int drm_fd;
+	uint32_t crtc_id;
+	struct igt_fb bufs[BUFS];
+	igt_display_t display;
+} data_t;
+
+uint32_t refresh_rate;
+
+static drmModeConnectorPtr find_connector_for_modeset(data_t *data)
+{
+	igt_output_t *output;
+	drmModeConnectorPtr ret = NULL;
+
+	for_each_connected_output(&data->display, output) {
+		if (output->config.connector->count_modes > 0) {
+			ret = output->config.connector;
+			break;
+		}
+	}
+
+	igt_assert_f(ret, "Connector NOT found\n");
+	return ret;
+}
+
+static void flip_handler(int fd_, unsigned int sequence, unsigned int tv_sec,
+			 unsigned int tv_usec, void *_data)
+{
+	static unsigned int last_ms;
+	static bool flag;
+	unsigned int cur_ms, flip_interval;
+
+	igt_assert(_data == NULL);
+
+	cur_ms = tv_sec * 1000 + tv_usec / 1000;
+	flip_interval = cur_ms - last_ms;
+
+	igt_debug("Flip interval: %dms, sequence = %u\n", flip_interval, sequence);
+
+	if (!flag)
+		flag = 1;
+	else
+		igt_assert_f(flip_interval <= 1000 / (refresh_rate * THRESHOLD),
+			     "Flip interval not significantly smaller than vblank interval\n");
+
+	last_ms = cur_ms;
+}
+
+static void wait_flip_event(data_t *data)
+{
+	int ret;
+	drmEventContext evctx;
+	struct pollfd pfd;
+
+	evctx.version = 2;
+	evctx.vblank_handler = NULL;
+	evctx.page_flip_handler = flip_handler;
+
+	pfd.fd = data->drm_fd;
+	pfd.events = POLLIN;
+	pfd.revents = 0;
+
+	ret = poll(&pfd, 1, 2000);
+
+	switch (ret) {
+	case 0:
+		igt_assert_f(0, "Flip Timeout\n");
+		break;
+	case 1:
+		ret = drmHandleEvent(data->drm_fd, &evctx);
+		igt_assert(ret == 0);
+		break;
+	default:
+		/* unexpected */
+		igt_assert(0);
+	}
+}
+
+static void make_fb(data_t *data, struct igt_fb *fb,
+		    drmModeConnectorPtr connector, int index)
+{
+	uint32_t width, height;
+	int rec_width;
+
+	width = connector->modes[0].hdisplay;
+	height = connector->modes[0].vdisplay;
+
+	rec_width = width / (BUFS * 2);
+
+	igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_ARGB8888,
+		      LOCAL_I915_FORMAT_MOD_X_TILED, fb);
+	igt_draw_fill_fb(data->drm_fd, fb, 0x88);
+	igt_draw_rect_fb(data->drm_fd, NULL, NULL, fb, IGT_DRAW_MMAP_CPU,
+			 rec_width * 2 + rec_width * index,
+			 height / 4, rec_width,
+			 height / 2, rand());
+}
+
+static void test_async_flip(data_t *data, bool wait_for_flips)
+{
+	int ret, frame, warm_end_frame;
+	long long int fps;
+	struct timeval start, end, diff;
+	bool warming_up = true;
+
+	gettimeofday(&start, NULL);
+	frame = 1;
+	do {
+		int flags = DRM_MODE_PAGE_FLIP_ASYNC;
+
+		if (wait_for_flips)
+			flags |= DRM_MODE_PAGE_FLIP_EVENT;
+
+		ret = drmModePageFlip(data->drm_fd, data->crtc_id,
+				      data->bufs[frame % 4].fb_id,
+				      flags, NULL);
+
+		igt_assert(ret == 0 || ret == -EBUSY);
+
+		if (wait_for_flips)
+			wait_flip_event(data);
+
+		gettimeofday(&end, NULL);
+		timersub(&end, &start, &diff);
+
+		/* 1s of warm-up time for the freq to stabilize */
+		if (warming_up && diff.tv_sec >= WARM_UP_TIME) {
+			warming_up = false;
+			warm_end_frame = frame;
+			start = end;
+		}
+
+		frame++;
+	} while (diff.tv_sec < RUN_TIME);
+
+	fps = (frame - warm_end_frame) * 1000 / RUN_TIME;
+	igt_assert_f((fps / 1000) > (refresh_rate * THRESHOLD),
+		     "FPS should be significantly higher than the refresh rate\n");
+}
+
+static bool has_async(int fd)
+{
+	struct drm_get_cap cap = { .capability = DRM_CAP_ASYNC_PAGE_FLIP };
+
+	ioctl(fd, DRM_IOCTL_GET_CAP, &cap);
+	return cap.value;
+}
+
+igt_main
+{
+	data_t data;
+	drmModeResPtr res;
+	drmModeConnectorPtr connector;
+	int i, ret;
+	bool async_capable;
+
+	igt_fixture {
+		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
+		kmstest_set_vt_graphics_mode();
+		igt_display_require(&data.display, data.drm_fd);
+		igt_display_require_output(&data.display);
+
+		async_capable = has_async(data.drm_fd);
+		igt_require_f(async_capable, "Async Flip is not supported\n");
+	}
+
+	igt_describe("Make sure kernel is able to accept asynchronous flips at a fast pace.");
+	igt_subtest_group {
+		igt_fixture {
+			res = drmModeGetResources(data.drm_fd);
+			igt_assert(res);
+
+			kmstest_unset_all_crtcs(data.drm_fd, res);
+
+			connector = find_connector_for_modeset(&data);
+			data.crtc_id = kmstest_find_crtc_for_connector(data.drm_fd,
+								       res, connector, 0);
+
+			refresh_rate = connector->modes[0].vrefresh;
+
+			for (i = 0; i < BUFS; i++)
+				make_fb(&data, &data.bufs[i], connector, i);
+
+			ret = drmModeSetCrtc(data.drm_fd, data.crtc_id, data.bufs[0].fb_id, 0, 0,
+					     &connector->connector_id, 1, &connector->modes[0]);
+			igt_assert(ret == 0);
+		}
+
+		igt_describe("Wait for page flip events in between successive asynchronous flips");
+		igt_subtest("async-flip-with-page-flip-events")
+			test_async_flip(&data, true);
+		igt_describe("DO NOT wait for page flip events in between successive asynchronous flips");
+		igt_subtest("async-flip-without-page-flip-events")
+			test_async_flip(&data, false);
+
+		igt_fixture {
+			for (i = 0; i < BUFS; i++)
+				igt_remove_fb(data.drm_fd, &data.bufs[i]);
+		}
+	}
+
+	igt_fixture
+		igt_display_fini(&data.display);
+}
diff --git a/tests/meson.build b/tests/meson.build
index e882f4dc..0830b1c9 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -13,6 +13,7 @@ test_progs = [
 	'fbdev',
 	'kms_3d',
 	'kms_addfb_basic',
+	'kms_async',
 	'kms_atomic',
 	'kms_atomic_interruptible',
 	'kms_atomic_transition',
-- 
2.22.0

_______________________________________________
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_async: Add test to validate asynchronous flips (rev2)
  2020-04-14 10:11 [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Karthik B S
@ 2020-04-14 14:42 ` Patchwork
  2020-04-14 22:35 ` [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Paulo Zanoni
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2020-04-14 14:42 UTC (permalink / raw)
  To: Karthik B S; +Cc: igt-dev

== Series Details ==

Series: tests/kms_async: Add test to validate asynchronous flips (rev2)
URL   : https://patchwork.freedesktop.org/series/75453/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8295 -> IGTPW_4457
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-cml-u2:          [PASS][1] -> [DMESG-WARN][2] ([IGT#4])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/fi-cml-u2/igt@kms_chamelium@common-hpd-after-suspend.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/fi-cml-u2/igt@kms_chamelium@common-hpd-after-suspend.html

  * igt@kms_chamelium@dp-crc-fast:
    - fi-cml-u2:          [PASS][3] -> [FAIL][4] ([i915#262])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/fi-cml-u2/igt@kms_chamelium@dp-crc-fast.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/fi-cml-u2/igt@kms_chamelium@dp-crc-fast.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-skl-6600u:       [INCOMPLETE][5] ([i915#69]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/fi-skl-6600u/igt@gem_exec_suspend@basic-s3.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/fi-skl-6600u/igt@gem_exec_suspend@basic-s3.html

  
  [IGT#4]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/4
  [i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
  [i915#69]: https://gitlab.freedesktop.org/drm/intel/issues/69


Participating hosts (49 -> 44)
------------------------------

  Missing    (5): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5589 -> IGTPW_4457

  CI-20190529: 20190529
  CI_DRM_8295: 4cb6dbe0a641129fd07ad1fbfcd6e7b4f03ec5c1 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4457: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/index.html
  IGT_5589: 31962324ac86f029e2841e56e97c42cf9d572956 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_async@async-flip-without-page-flip-events
+igt@kms_async@async-flip-with-page-flip-events

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/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_async: Add test to validate asynchronous flips
  2020-04-14 10:11 [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Karthik B S
  2020-04-14 14:42 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_async: Add test to validate asynchronous flips (rev2) Patchwork
@ 2020-04-14 22:35 ` Paulo Zanoni
  2020-04-15  9:05   ` Petri Latvala
  2020-04-15 10:04 ` [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_async: Add test to validate asynchronous flips (rev2) Patchwork
  2020-04-24  0:40 ` [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Paulo Zanoni
  3 siblings, 1 reply; 6+ messages in thread
From: Paulo Zanoni @ 2020-04-14 22:35 UTC (permalink / raw)
  To: Karthik B S, igt-dev

Em ter, 2020-04-14 às 15:41 +0530, Karthik B S escreveu:
> Asynchronous flips are issued using the page flip IOCTL.
> The test consists of two subtests. The first subtest waits for
> the page flip event to be received before giving the next flip,
> and the second subtest doesn't wait for page flip events.
> 
> The test passes if the IOCTL is successful.
> 
> v2: Add authors in the test file. (Paulo)
>     Reduce the run time and timeouts to suit IGT needs. (Paulo)
>     Replace igt_debug's with igt_assert's to catch slow flips. (Paulo)
>     Follow IGT coding style regarding spaces. (Paulo)
>     Make set up code part of igt_fixture. (Paulo)
>     Skip the test if async flips are not supported. (Paulo)
>     Replace suggested-by. (Paulo)
>     Added description for test and subtests.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
> ---
>  tests/Makefile.sources |   1 +
>  tests/kms_async.c      | 243 +++++++++++++++++++++++++++++++++++++++++
>  tests/meson.build      |   1 +
>  3 files changed, 245 insertions(+)
>  create mode 100644 tests/kms_async.c
> 
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 4e44c98c..eedf4fcb 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -29,6 +29,7 @@ TESTS_progs = \
>  	fbdev \
>  	kms_3d \
>  	kms_addfb_basic \
> +	kms_async \
>  	kms_atomic \
>  	kms_atomic_interruptible \
>  	kms_atomic_transition \
> diff --git a/tests/kms_async.c b/tests/kms_async.c
> new file mode 100644
> index 00000000..6031ff4e
> --- /dev/null
> +++ b/tests/kms_async.c

Async what? :)

kms_async_flips.c is probably better IMHO since it's clearer on what
the test tests.

Also, do we have to add this to some IGT test list file if we want this
in CI? Can the IGT/CI people comment here please?


> @@ -0,0 +1,243 @@
> +/*
> + * Copyright © 2020 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *  Paulo Zanoni <paulo.r.zanoni@intel.com>
> + *  Karthik B S <karthik.b.s@intel.com>
> + */
> +
> +#include "igt.h"
> +#include "igt_aux.h"
> +#include <sys/ioctl.h>
> +#include <poll.h>
> +
> +#define BUFS 4

Perhaps instead of the TODO comment below we could have something like
this in this line:


/*
 * These constants can be tuned in case we start getting unexpected
 * results in CI.
 */

> +#define WARM_UP_TIME 1
> +#define RUN_TIME 2
> +#define THRESHOLD 10 /* TODO: May need tuning */
> +
> +IGT_TEST_DESCRIPTION("Test asynchrous page flips.");
> +
> +typedef struct {
> +	int drm_fd;
> +	uint32_t crtc_id;
> +	struct igt_fb bufs[BUFS];
> +	igt_display_t display;
> +} data_t;
> +
> +uint32_t refresh_rate;
> +
> +static drmModeConnectorPtr find_connector_for_modeset(data_t *data)
> +{
> +	igt_output_t *output;
> +	drmModeConnectorPtr ret = NULL;
> +
> +	for_each_connected_output(&data->display, output) {
> +		if (output->config.connector->count_modes > 0) {
> +			ret = output->config.connector;
> +			break;
> +		}
> +	}
> +
> +	igt_assert_f(ret, "Connector NOT found\n");
> +	return ret;
> +}
> +
> +static void flip_handler(int fd_, unsigned int sequence, unsigned int tv_sec,
> +			 unsigned int tv_usec, void *_data)
> +{
> +	static unsigned int last_ms;
> +	static bool flag;

This variable serves no purpose.


> +	unsigned int cur_ms, flip_interval;
> +
> +	igt_assert(_data == NULL);
> +
> +	cur_ms = tv_sec * 1000 + tv_usec / 1000;
> +	flip_interval = cur_ms - last_ms;
> +
> +	igt_debug("Flip interval: %dms, sequence = %u\n", flip_interval, sequence);

My previous comment regarding this debug statement here is still valid.
This is going to spam the logs needlessly, and possibly significantly
affect timings. It should probably be removed (or left commented out).



> +
> +	if (!flag)
> +		flag = 1;
> +	else
> +		igt_assert_f(flip_interval <= 1000 / (refresh_rate * THRESHOLD),
> +			     "Flip interval not significantly smaller than vblank interval\n");
> +
> +	last_ms = cur_ms;
> +}
> +
> +static void wait_flip_event(data_t *data)
> +{
> +	int ret;
> +	drmEventContext evctx;
> +	struct pollfd pfd;
> +
> +	evctx.version = 2;
> +	evctx.vblank_handler = NULL;
> +	evctx.page_flip_handler = flip_handler;
> +
> +	pfd.fd = data->drm_fd;
> +	pfd.events = POLLIN;
> +	pfd.revents = 0;
> +
> +	ret = poll(&pfd, 1, 2000);
> +
> +	switch (ret) {
> +	case 0:
> +		igt_assert_f(0, "Flip Timeout\n");
> +		break;
> +	case 1:
> +		ret = drmHandleEvent(data->drm_fd, &evctx);
> +		igt_assert(ret == 0);
> +		break;
> +	default:
> +		/* unexpected */
> +		igt_assert(0);
> +	}
> +}
> +
> +static void make_fb(data_t *data, struct igt_fb *fb,
> +		    drmModeConnectorPtr connector, int index)
> +{
> +	uint32_t width, height;
> +	int rec_width;
> +
> +	width = connector->modes[0].hdisplay;
> +	height = connector->modes[0].vdisplay;
> +
> +	rec_width = width / (BUFS * 2);
> +
> +	igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_ARGB8888,
> +		      LOCAL_I915_FORMAT_MOD_X_TILED, fb);
> +	igt_draw_fill_fb(data->drm_fd, fb, 0x88);
> +	igt_draw_rect_fb(data->drm_fd, NULL, NULL, fb, IGT_DRAW_MMAP_CPU,
> +			 rec_width * 2 + rec_width * index,
> +			 height / 4, rec_width,
> +			 height / 2, rand());
> +}
> +
> +static void test_async_flip(data_t *data, bool wait_for_flips)
> +{
> +	int ret, frame, warm_end_frame;
> +	long long int fps;
> +	struct timeval start, end, diff;
> +	bool warming_up = true;
> +
> +	gettimeofday(&start, NULL);
> +	frame = 1;
> +	do {
> +		int flags = DRM_MODE_PAGE_FLIP_ASYNC;
> +
> +		if (wait_for_flips)
> +			flags |= DRM_MODE_PAGE_FLIP_EVENT;
> +
> +		ret = drmModePageFlip(data->drm_fd, data->crtc_id,
> +				      data->bufs[frame % 4].fb_id,
> +				      flags, NULL);
> +
> +		igt_assert(ret == 0 || ret == -EBUSY);
> +
> +		if (wait_for_flips)
> +			wait_flip_event(data);
> +
> +		gettimeofday(&end, NULL);
> +		timersub(&end, &start, &diff);
> +
> +		/* 1s of warm-up time for the freq to stabilize */
> +		if (warming_up && diff.tv_sec >= WARM_UP_TIME) {
> +			warming_up = false;
> +			warm_end_frame = frame;
> +			start = end;
> +		}
> +
> +		frame++;
> +	} while (diff.tv_sec < RUN_TIME);
> +
> +	fps = (frame - warm_end_frame) * 1000 / RUN_TIME;
> +	igt_assert_f((fps / 1000) > (refresh_rate * THRESHOLD),
> +		     "FPS should be significantly higher than the refresh rate\n");
> +}
> +
> +static bool has_async(int fd)
> +{
> +	struct drm_get_cap cap = { .capability = DRM_CAP_ASYNC_PAGE_FLIP };
> +
> +	ioctl(fd, DRM_IOCTL_GET_CAP, &cap);

Please use drmIoctl(). Also check the return code of the call.


Except for the little details I pointed above, this patch seems to be
in good shape now, but I'm hesitant on giving a Reviewed-by tag since
the Kernel patches that pass these tests are still under development. I
would prefer to wait them to come out before we merge this.


> +	return cap.value;
> +}
> +
> +igt_main
> +{
> +	data_t data;
> +	drmModeResPtr res;
> +	drmModeConnectorPtr connector;
> +	int i, ret;
> +	bool async_capable;
> +
> +	igt_fixture {
> +		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> +		kmstest_set_vt_graphics_mode();
> +		igt_display_require(&data.display, data.drm_fd);
> +		igt_display_require_output(&data.display);
> +
> +		async_capable = has_async(data.drm_fd);
> +		igt_require_f(async_capable, "Async Flip is not supported\n");
> +	}
> +
> +	igt_describe("Make sure kernel is able to accept asynchronous flips at a fast pace.");
> +	igt_subtest_group {
> +		igt_fixture {
> +			res = drmModeGetResources(data.drm_fd);
> +			igt_assert(res);
> +
> +			kmstest_unset_all_crtcs(data.drm_fd, res);
> +
> +			connector = find_connector_for_modeset(&data);
> +			data.crtc_id = kmstest_find_crtc_for_connector(data.drm_fd,
> +								       res, connector, 0);
> +
> +			refresh_rate = connector->modes[0].vrefresh;
> +
> +			for (i = 0; i < BUFS; i++)
> +				make_fb(&data, &data.bufs[i], connector, i);
> +
> +			ret = drmModeSetCrtc(data.drm_fd, data.crtc_id, data.bufs[0].fb_id, 0, 0,
> +					     &connector->connector_id, 1, &connector->modes[0]);
> +			igt_assert(ret == 0);
> +		}
> +
> +		igt_describe("Wait for page flip events in between successive asynchronous flips");
> +		igt_subtest("async-flip-with-page-flip-events")
> +			test_async_flip(&data, true);
> +		igt_describe("DO NOT wait for page flip events in between successive asynchronous flips");
> +		igt_subtest("async-flip-without-page-flip-events")
> +			test_async_flip(&data, false);
> +
> +		igt_fixture {
> +			for (i = 0; i < BUFS; i++)
> +				igt_remove_fb(data.drm_fd, &data.bufs[i]);
> +		}
> +	}
> +
> +	igt_fixture
> +		igt_display_fini(&data.display);
> +}
> diff --git a/tests/meson.build b/tests/meson.build
> index e882f4dc..0830b1c9 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -13,6 +13,7 @@ test_progs = [
>  	'fbdev',
>  	'kms_3d',
>  	'kms_addfb_basic',
> +	'kms_async',
>  	'kms_atomic',
>  	'kms_atomic_interruptible',
>  	'kms_atomic_transition',

_______________________________________________
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_async: Add test to validate asynchronous flips
  2020-04-14 22:35 ` [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Paulo Zanoni
@ 2020-04-15  9:05   ` Petri Latvala
  0 siblings, 0 replies; 6+ messages in thread
From: Petri Latvala @ 2020-04-15  9:05 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: igt-dev

On Tue, Apr 14, 2020 at 03:35:37PM -0700, Paulo Zanoni wrote:
> Em ter, 2020-04-14 às 15:41 +0530, Karthik B S escreveu:
> > Asynchronous flips are issued using the page flip IOCTL.
> > The test consists of two subtests. The first subtest waits for
> > the page flip event to be received before giving the next flip,
> > and the second subtest doesn't wait for page flip events.
> > 
> > The test passes if the IOCTL is successful.
> > 
> > v2: Add authors in the test file. (Paulo)
> >     Reduce the run time and timeouts to suit IGT needs. (Paulo)
> >     Replace igt_debug's with igt_assert's to catch slow flips. (Paulo)
> >     Follow IGT coding style regarding spaces. (Paulo)
> >     Make set up code part of igt_fixture. (Paulo)
> >     Skip the test if async flips are not supported. (Paulo)
> >     Replace suggested-by. (Paulo)
> >     Added description for test and subtests.
> > 
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > Signed-off-by: Karthik B S <karthik.b.s@intel.com>
> > ---
> >  tests/Makefile.sources |   1 +
> >  tests/kms_async.c      | 243 +++++++++++++++++++++++++++++++++++++++++
> >  tests/meson.build      |   1 +
> >  3 files changed, 245 insertions(+)
> >  create mode 100644 tests/kms_async.c
> > 
> > diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> > index 4e44c98c..eedf4fcb 100644
> > --- a/tests/Makefile.sources
> > +++ b/tests/Makefile.sources
> > @@ -29,6 +29,7 @@ TESTS_progs = \
> >  	fbdev \
> >  	kms_3d \
> >  	kms_addfb_basic \
> > +	kms_async \
> >  	kms_atomic \
> >  	kms_atomic_interruptible \
> >  	kms_atomic_transition \
> > diff --git a/tests/kms_async.c b/tests/kms_async.c
> > new file mode 100644
> > index 00000000..6031ff4e
> > --- /dev/null
> > +++ b/tests/kms_async.c
> 
> Async what? :)
> 
> kms_async_flips.c is probably better IMHO since it's clearer on what
> the test tests.
> 
> Also, do we have to add this to some IGT test list file if we want this
> in CI? Can the IGT/CI people comment here please?

No. The full round executes everything except the tests matching
tests/intel-ci/blacklist.txt.


-- 
Petri Latvala
_______________________________________________
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: failure for tests/kms_async: Add test to validate asynchronous flips (rev2)
  2020-04-14 10:11 [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Karthik B S
  2020-04-14 14:42 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_async: Add test to validate asynchronous flips (rev2) Patchwork
  2020-04-14 22:35 ` [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Paulo Zanoni
@ 2020-04-15 10:04 ` Patchwork
  2020-04-24  0:40 ` [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Paulo Zanoni
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2020-04-15 10:04 UTC (permalink / raw)
  To: Karthik B S; +Cc: igt-dev

== Series Details ==

Series: tests/kms_async: Add test to validate asynchronous flips (rev2)
URL   : https://patchwork.freedesktop.org/series/75453/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8295_full -> IGTPW_4457_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_4457_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_4457_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_4457/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@kms_async@async-flip-with-page-flip-events} (NEW):
    - shard-iclb:         NOTRUN -> [SKIP][1] +1 similar issue
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb7/igt@kms_async@async-flip-with-page-flip-events.html

  * {igt@kms_async@async-flip-without-page-flip-events} (NEW):
    - shard-tglb:         NOTRUN -> [SKIP][2] +1 similar issue
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-tglb2/igt@kms_async@async-flip-without-page-flip-events.html

  * igt@kms_busy@basic-modeset-pipe-c:
    - shard-kbl:          [PASS][3] -> [INCOMPLETE][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl1/igt@kms_busy@basic-modeset-pipe-c.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl1/igt@kms_busy@basic-modeset-pipe-c.html

  
New tests
---------

  New tests have been introduced between CI_DRM_8295_full and IGTPW_4457_full:

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

  * igt@kms_async@async-flip-with-page-flip-events:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_async@async-flip-without-page-flip-events:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_params@invalid-bsd-ring:
    - shard-iclb:         [PASS][5] -> [SKIP][6] ([fdo#109276])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb4/igt@gem_exec_params@invalid-bsd-ring.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb8/igt@gem_exec_params@invalid-bsd-ring.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-apl:          [PASS][7] -> [DMESG-WARN][8] ([i915#180]) +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl2/igt@gem_workarounds@suspend-resume-context.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl4/igt@gem_workarounds@suspend-resume-context.html

  * igt@gem_workarounds@suspend-resume-fd:
    - shard-kbl:          [PASS][9] -> [DMESG-WARN][10] ([i915#180])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl3/igt@gem_workarounds@suspend-resume-fd.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl3/igt@gem_workarounds@suspend-resume-fd.html

  * igt@i915_selftest@live@requests:
    - shard-tglb:         [PASS][11] -> [INCOMPLETE][12] ([i915#1531] / [i915#1658])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-tglb8/igt@i915_selftest@live@requests.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-tglb5/igt@i915_selftest@live@requests.html

  * igt@i915_suspend@fence-restore-tiled2untiled:
    - shard-apl:          [PASS][13] -> [DMESG-WARN][14] ([i915#180] / [i915#95])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl4/igt@i915_suspend@fence-restore-tiled2untiled.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl6/igt@i915_suspend@fence-restore-tiled2untiled.html

  * igt@kms_cursor_crc@pipe-a-cursor-256x256-onscreen:
    - shard-apl:          [PASS][15] -> [FAIL][16] ([i915#54] / [i915#95])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl4/igt@kms_cursor_crc@pipe-a-cursor-256x256-onscreen.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl3/igt@kms_cursor_crc@pipe-a-cursor-256x256-onscreen.html

  * igt@kms_cursor_crc@pipe-a-cursor-64x64-offscreen:
    - shard-kbl:          [PASS][17] -> [FAIL][18] ([i915#54] / [i915#93] / [i915#95]) +1 similar issue
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl3/igt@kms_cursor_crc@pipe-a-cursor-64x64-offscreen.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-64x64-offscreen.html

  * igt@kms_dp_dsc@basic-dsc-enable-edp:
    - shard-iclb:         [PASS][19] -> [SKIP][20] ([fdo#109349])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb5/igt@kms_dp_dsc@basic-dsc-enable-edp.html

  * igt@kms_draw_crc@draw-method-rgb565-blt-ytiled:
    - shard-glk:          [PASS][21] -> [FAIL][22] ([i915#52] / [i915#54]) +5 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-glk7/igt@kms_draw_crc@draw-method-rgb565-blt-ytiled.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-glk7/igt@kms_draw_crc@draw-method-rgb565-blt-ytiled.html

  * igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled:
    - shard-glk:          [PASS][23] -> [FAIL][24] ([i915#177] / [i915#52] / [i915#54])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-glk1/igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-glk9/igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled.html

  * igt@kms_flip@plain-flip-fb-recreate-interruptible:
    - shard-apl:          [PASS][25] -> [FAIL][26] ([i915#34])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl4/igt@kms_flip@plain-flip-fb-recreate-interruptible.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl3/igt@kms_flip@plain-flip-fb-recreate-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu:
    - shard-kbl:          [PASS][27] -> [FAIL][28] ([i915#49])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl6/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu.html
    - shard-glk:          [PASS][29] -> [FAIL][30] ([i915#49])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-glk4/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-glk9/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu.html
    - shard-apl:          [PASS][31] -> [FAIL][32] ([i915#49])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl4/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-a:
    - shard-apl:          [PASS][33] -> [FAIL][34] ([i915#53] / [i915#95])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl4/igt@kms_pipe_crc_basic@read-crc-pipe-a.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl2/igt@kms_pipe_crc_basic@read-crc-pipe-a.html
    - shard-kbl:          [PASS][35] -> [FAIL][36] ([i915#53] / [i915#93] / [i915#95])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl1/igt@kms_pipe_crc_basic@read-crc-pipe-a.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl3/igt@kms_pipe_crc_basic@read-crc-pipe-a.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [PASS][37] -> [SKIP][38] ([fdo#109642] / [fdo#111068])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb2/igt@kms_psr2_su@frontbuffer.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb4/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@no_drrs:
    - shard-iclb:         [PASS][39] -> [FAIL][40] ([i915#173])
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb7/igt@kms_psr@no_drrs.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb1/igt@kms_psr@no_drrs.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [PASS][41] -> [SKIP][42] ([fdo#109441]) +2 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb8/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_setmode@basic:
    - shard-glk:          [PASS][43] -> [FAIL][44] ([i915#31])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-glk8/igt@kms_setmode@basic.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-glk2/igt@kms_setmode@basic.html

  * igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm:
    - shard-glk:          [PASS][45] -> [SKIP][46] ([fdo#109271])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-glk2/igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-glk2/igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm.html
    - shard-iclb:         [PASS][47] -> [SKIP][48] ([fdo#109278])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb7/igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb5/igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm.html
    - shard-tglb:         [PASS][49] -> [SKIP][50] ([fdo#112015])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-tglb8/igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-tglb6/igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm.html

  
#### Possible fixes ####

  * igt@gem_softpin@noreloc-s3:
    - shard-apl:          [DMESG-WARN][51] ([i915#180]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl4/igt@gem_softpin@noreloc-s3.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl1/igt@gem_softpin@noreloc-s3.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-apl:          [DMESG-WARN][53] ([i915#716]) -> [PASS][54]
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl6/igt@gen9_exec_parse@allowed-all.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl1/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [FAIL][55] ([i915#454]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb6/igt@i915_pm_dc@dc6-psr.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb8/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_rpm@dpms-lpsp:
    - shard-iclb:         [SKIP][57] ([i915#1316] / [i915#579]) -> [PASS][58] +1 similar issue
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb8/igt@i915_pm_rpm@dpms-lpsp.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb1/igt@i915_pm_rpm@dpms-lpsp.html
    - shard-tglb:         [SKIP][59] ([i915#1316] / [i915#579]) -> [PASS][60] +1 similar issue
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-tglb1/igt@i915_pm_rpm@dpms-lpsp.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-tglb7/igt@i915_pm_rpm@dpms-lpsp.html

  * igt@i915_pm_rpm@sysfs-read:
    - shard-glk:          [SKIP][61] ([fdo#109271]) -> [PASS][62] +1 similar issue
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-glk8/igt@i915_pm_rpm@sysfs-read.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-glk8/igt@i915_pm_rpm@sysfs-read.html

  * igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen:
    - shard-kbl:          [FAIL][63] ([i915#54] / [i915#93] / [i915#95]) -> [PASS][64]
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl3/igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen.html

  * igt@kms_draw_crc@draw-method-rgb565-render-untiled:
    - shard-glk:          [FAIL][65] ([i915#52] / [i915#54]) -> [PASS][66] +2 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-glk7/igt@kms_draw_crc@draw-method-rgb565-render-untiled.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-glk8/igt@kms_draw_crc@draw-method-rgb565-render-untiled.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - shard-kbl:          [DMESG-WARN][67] ([i915#180]) -> [PASS][68] +4 similar issues
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl7/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl6/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
    - shard-apl:          [FAIL][69] ([fdo#108145] / [i915#265] / [i915#95]) -> [PASS][70]
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl1/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl2/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html

  * igt@kms_psr@psr2_no_drrs:
    - shard-iclb:         [SKIP][71] ([fdo#109441]) -> [PASS][72] +2 similar issues
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb3/igt@kms_psr@psr2_no_drrs.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb2/igt@kms_psr@psr2_no_drrs.html

  * igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm:
    - shard-tglb:         [SKIP][73] ([fdo#112015]) -> [PASS][74]
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-tglb1/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-tglb6/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html
    - shard-iclb:         [SKIP][75] ([fdo#109278]) -> [PASS][76]
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb8/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb8/igt@kms_vblank@pipe-a-ts-continuation-dpms-rpm.html

  
#### Warnings ####

  * igt@i915_pm_rpm@pc8-residency:
    - shard-iclb:         [SKIP][77] ([fdo#109293] / [fdo#109506]) -> [SKIP][78] ([i915#1316] / [i915#579])
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-iclb2/igt@i915_pm_rpm@pc8-residency.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-iclb5/igt@i915_pm_rpm@pc8-residency.html
    - shard-tglb:         [SKIP][79] ([fdo#109506]) -> [SKIP][80] ([i915#1316] / [i915#579])
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-tglb6/igt@i915_pm_rpm@pc8-residency.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-tglb6/igt@i915_pm_rpm@pc8-residency.html

  * igt@kms_fbcon_fbt@fbc-suspend:
    - shard-kbl:          [FAIL][81] ([i915#93] / [i915#95]) -> [DMESG-FAIL][82] ([i915#180] / [i915#95])
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl4/igt@kms_fbcon_fbt@fbc-suspend.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl4/igt@kms_fbcon_fbt@fbc-suspend.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-basic:
    - shard-apl:          [FAIL][83] ([fdo#108145] / [i915#265] / [i915#95]) -> [FAIL][84] ([fdo#108145] / [i915#265]) +1 similar issue
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl2/igt@kms_plane_alpha_blend@pipe-a-alpha-basic.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl4/igt@kms_plane_alpha_blend@pipe-a-alpha-basic.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-apl:          [FAIL][85] ([fdo#108145] / [i915#265]) -> [FAIL][86] ([fdo#108145] / [i915#265] / [i915#95])
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl6/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl1/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html
    - shard-kbl:          [FAIL][87] ([fdo#108145] / [i915#265]) -> [FAIL][88] ([fdo#108145] / [i915#265] / [i915#93] / [i915#95])
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl3/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl1/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html

  * igt@kms_plane_alpha_blend@pipe-c-alpha-7efc:
    - shard-kbl:          [FAIL][89] ([fdo#108145] / [i915#265] / [i915#93] / [i915#95]) -> [FAIL][90] ([fdo#108145] / [i915#265]) +1 similar issue
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-kbl3/igt@kms_plane_alpha_blend@pipe-c-alpha-7efc.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-kbl7/igt@kms_plane_alpha_blend@pipe-c-alpha-7efc.html

  * igt@runner@aborted:
    - shard-apl:          ([FAIL][91], [FAIL][92]) ([i915#1423] / [i915#716]) -> [FAIL][93] ([i915#1423])
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl6/igt@runner@aborted.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8295/shard-apl6/igt@runner@aborted.html
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/shard-apl6/igt@runner@aborted.html

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

  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109293]: https://bugs.freedesktop.org/show_bug.cgi?id=109293
  [fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#112015]: https://bugs.freedesktop.org/show_bug.cgi?id=112015
  [i915#1316]: https://gitlab.freedesktop.org/drm/intel/issues/1316
  [i915#1423]: https://gitlab.freedesktop.org/drm/intel/issues/1423
  [i915#1531]: https://gitlab.freedesktop.org/drm/intel/issues/1531
  [i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
  [i915#1658]: https://gitlab.freedesktop.org/drm/intel/issues/1658
  [i915#173]: https://gitlab.freedesktop.org/drm/intel/issues/173
  [i915#177]: https://gitlab.freedesktop.org/drm/intel/issues/177
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
  [i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
  [i915#34]: https://gitlab.freedesktop.org/drm/intel/issues/34
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#52]: https://gitlab.freedesktop.org/drm/intel/issues/52
  [i915#53]: https://gitlab.freedesktop.org/drm/intel/issues/53
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#579]: https://gitlab.freedesktop.org/drm/intel/issues/579
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


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

  Missing    (2): pig-skl-6260u pig-glk-j5005 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5589 -> IGTPW_4457
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_8295: 4cb6dbe0a641129fd07ad1fbfcd6e7b4f03ec5c1 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4457: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4457/index.html
  IGT_5589: 31962324ac86f029e2841e56e97c42cf9d572956 @ 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_4457/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_async: Add test to validate asynchronous flips
  2020-04-14 10:11 [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Karthik B S
                   ` (2 preceding siblings ...)
  2020-04-15 10:04 ` [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_async: Add test to validate asynchronous flips (rev2) Patchwork
@ 2020-04-24  0:40 ` Paulo Zanoni
  3 siblings, 0 replies; 6+ messages in thread
From: Paulo Zanoni @ 2020-04-24  0:40 UTC (permalink / raw)
  To: Karthik B S, igt-dev; +Cc: Antognolli, Rafael

Em ter, 2020-04-14 às 15:41 +0530, Karthik B S escreveu:
> Asynchronous flips are issued using the page flip IOCTL.
> The test consists of two subtests. The first subtest waits for
> the page flip event to be received before giving the next flip,
> and the second subtest doesn't wait for page flip events.
> 
> The test passes if the IOCTL is successful.
> 
> v2: Add authors in the test file. (Paulo)
>     Reduce the run time and timeouts to suit IGT needs. (Paulo)
>     Replace igt_debug's with igt_assert's to catch slow flips. (Paulo)
>     Follow IGT coding style regarding spaces. (Paulo)
>     Make set up code part of igt_fixture. (Paulo)
>     Skip the test if async flips are not supported. (Paulo)
>     Replace suggested-by. (Paulo)
>     Added description for test and subtests.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
> ---
>  tests/Makefile.sources |   1 +
>  tests/kms_async.c      | 243 +++++++++++++++++++++++++++++++++++++++++
>  tests/meson.build      |   1 +
>  3 files changed, 245 insertions(+)
>  create mode 100644 tests/kms_async.c
> 
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 4e44c98c..eedf4fcb 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -29,6 +29,7 @@ TESTS_progs = \
>  	fbdev \
>  	kms_3d \
>  	kms_addfb_basic \
> +	kms_async \
>  	kms_atomic \
>  	kms_atomic_interruptible \
>  	kms_atomic_transition \
> diff --git a/tests/kms_async.c b/tests/kms_async.c
> new file mode 100644
> index 00000000..6031ff4e
> --- /dev/null
> +++ b/tests/kms_async.c
> @@ -0,0 +1,243 @@
> +/*
> + * Copyright © 2020 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *  Paulo Zanoni <paulo.r.zanoni@intel.com>
> + *  Karthik B S <karthik.b.s@intel.com>
> + */
> +
> +#include "igt.h"
> +#include "igt_aux.h"
> +#include <sys/ioctl.h>
> +#include <poll.h>
> +
> +#define BUFS 4
> +#define WARM_UP_TIME 1
> +#define RUN_TIME 2
> +#define THRESHOLD 10 /* TODO: May need tuning */
> +
> +IGT_TEST_DESCRIPTION("Test asynchrous page flips.");
> +
> +typedef struct {
> +	int drm_fd;
> +	uint32_t crtc_id;
> +	struct igt_fb bufs[BUFS];
> +	igt_display_t display;
> +} data_t;
> +
> +uint32_t refresh_rate;
> +
> +static drmModeConnectorPtr find_connector_for_modeset(data_t *data)
> +{
> +	igt_output_t *output;
> +	drmModeConnectorPtr ret = NULL;
> +
> +	for_each_connected_output(&data->display, output) {
> +		if (output->config.connector->count_modes > 0) {
> +			ret = output->config.connector;
> +			break;
> +		}
> +	}
> +
> +	igt_assert_f(ret, "Connector NOT found\n");
> +	return ret;
> +}
> +
> +static void flip_handler(int fd_, unsigned int sequence, unsigned int tv_sec,
> +			 unsigned int tv_usec, void *_data)
> +{
> +	static unsigned int last_ms;
> +	static bool flag;
> +	unsigned int cur_ms, flip_interval;
> +
> +	igt_assert(_data == NULL);
> +
> +	cur_ms = tv_sec * 1000 + tv_usec / 1000;
> +	flip_interval = cur_ms - last_ms;
> +
> +	igt_debug("Flip interval: %dms, sequence = %u\n", flip_interval, sequence);
> +
> +	if (!flag)
> +		flag = 1;
> +	else
> +		igt_assert_f(flip_interval <= 1000 / (refresh_rate * THRESHOLD),
> +			     "Flip interval not significantly smaller than vblank interval\n");

So we just got this report from Rafael:

(kms_async:2165) CRITICAL: Failed assertion: flip_interval <= 1000 /
(refresh_rate * THRESHOLD)
(kms_async:2165) CRITICAL: Flip interval not significantly smaller than
vblank interval

As it turns out, that error message is not very useful: we don't know
if the problem is in our threshold or not. Please print the value of
flip_interval, refresh_rate and THRESHOLD in the error message. This
should make the error messages much more useful.

Thanks,
Paulo

> +
> +	last_ms = cur_ms;
> +}
> +
> +static void wait_flip_event(data_t *data)
> +{
> +	int ret;
> +	drmEventContext evctx;
> +	struct pollfd pfd;
> +
> +	evctx.version = 2;
> +	evctx.vblank_handler = NULL;
> +	evctx.page_flip_handler = flip_handler;
> +
> +	pfd.fd = data->drm_fd;
> +	pfd.events = POLLIN;
> +	pfd.revents = 0;
> +
> +	ret = poll(&pfd, 1, 2000);
> +
> +	switch (ret) {
> +	case 0:
> +		igt_assert_f(0, "Flip Timeout\n");
> +		break;
> +	case 1:
> +		ret = drmHandleEvent(data->drm_fd, &evctx);
> +		igt_assert(ret == 0);
> +		break;
> +	default:
> +		/* unexpected */
> +		igt_assert(0);
> +	}
> +}
> +
> +static void make_fb(data_t *data, struct igt_fb *fb,
> +		    drmModeConnectorPtr connector, int index)
> +{
> +	uint32_t width, height;
> +	int rec_width;
> +
> +	width = connector->modes[0].hdisplay;
> +	height = connector->modes[0].vdisplay;
> +
> +	rec_width = width / (BUFS * 2);
> +
> +	igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_ARGB8888,
> +		      LOCAL_I915_FORMAT_MOD_X_TILED, fb);
> +	igt_draw_fill_fb(data->drm_fd, fb, 0x88);
> +	igt_draw_rect_fb(data->drm_fd, NULL, NULL, fb, IGT_DRAW_MMAP_CPU,
> +			 rec_width * 2 + rec_width * index,
> +			 height / 4, rec_width,
> +			 height / 2, rand());
> +}
> +
> +static void test_async_flip(data_t *data, bool wait_for_flips)
> +{
> +	int ret, frame, warm_end_frame;
> +	long long int fps;
> +	struct timeval start, end, diff;
> +	bool warming_up = true;
> +
> +	gettimeofday(&start, NULL);
> +	frame = 1;
> +	do {
> +		int flags = DRM_MODE_PAGE_FLIP_ASYNC;
> +
> +		if (wait_for_flips)
> +			flags |= DRM_MODE_PAGE_FLIP_EVENT;
> +
> +		ret = drmModePageFlip(data->drm_fd, data->crtc_id,
> +				      data->bufs[frame % 4].fb_id,
> +				      flags, NULL);
> +
> +		igt_assert(ret == 0 || ret == -EBUSY);
> +
> +		if (wait_for_flips)
> +			wait_flip_event(data);
> +
> +		gettimeofday(&end, NULL);
> +		timersub(&end, &start, &diff);
> +
> +		/* 1s of warm-up time for the freq to stabilize */
> +		if (warming_up && diff.tv_sec >= WARM_UP_TIME) {
> +			warming_up = false;
> +			warm_end_frame = frame;
> +			start = end;
> +		}
> +
> +		frame++;
> +	} while (diff.tv_sec < RUN_TIME);
> +
> +	fps = (frame - warm_end_frame) * 1000 / RUN_TIME;
> +	igt_assert_f((fps / 1000) > (refresh_rate * THRESHOLD),
> +		     "FPS should be significantly higher than the refresh rate\n");
> +}
> +
> +static bool has_async(int fd)
> +{
> +	struct drm_get_cap cap = { .capability = DRM_CAP_ASYNC_PAGE_FLIP };
> +
> +	ioctl(fd, DRM_IOCTL_GET_CAP, &cap);
> +	return cap.value;
> +}
> +
> +igt_main
> +{
> +	data_t data;
> +	drmModeResPtr res;
> +	drmModeConnectorPtr connector;
> +	int i, ret;
> +	bool async_capable;
> +
> +	igt_fixture {
> +		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> +		kmstest_set_vt_graphics_mode();
> +		igt_display_require(&data.display, data.drm_fd);
> +		igt_display_require_output(&data.display);
> +
> +		async_capable = has_async(data.drm_fd);
> +		igt_require_f(async_capable, "Async Flip is not supported\n");
> +	}
> +
> +	igt_describe("Make sure kernel is able to accept asynchronous flips at a fast pace.");
> +	igt_subtest_group {
> +		igt_fixture {
> +			res = drmModeGetResources(data.drm_fd);
> +			igt_assert(res);
> +
> +			kmstest_unset_all_crtcs(data.drm_fd, res);
> +
> +			connector = find_connector_for_modeset(&data);
> +			data.crtc_id = kmstest_find_crtc_for_connector(data.drm_fd,
> +								       res, connector, 0);
> +
> +			refresh_rate = connector->modes[0].vrefresh;
> +
> +			for (i = 0; i < BUFS; i++)
> +				make_fb(&data, &data.bufs[i], connector, i);
> +
> +			ret = drmModeSetCrtc(data.drm_fd, data.crtc_id, data.bufs[0].fb_id, 0, 0,
> +					     &connector->connector_id, 1, &connector->modes[0]);
> +			igt_assert(ret == 0);
> +		}
> +
> +		igt_describe("Wait for page flip events in between successive asynchronous flips");
> +		igt_subtest("async-flip-with-page-flip-events")
> +			test_async_flip(&data, true);
> +		igt_describe("DO NOT wait for page flip events in between successive asynchronous flips");
> +		igt_subtest("async-flip-without-page-flip-events")
> +			test_async_flip(&data, false);
> +
> +		igt_fixture {
> +			for (i = 0; i < BUFS; i++)
> +				igt_remove_fb(data.drm_fd, &data.bufs[i]);
> +		}
> +	}
> +
> +	igt_fixture
> +		igt_display_fini(&data.display);
> +}
> diff --git a/tests/meson.build b/tests/meson.build
> index e882f4dc..0830b1c9 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -13,6 +13,7 @@ test_progs = [
>  	'fbdev',
>  	'kms_3d',
>  	'kms_addfb_basic',
> +	'kms_async',
>  	'kms_atomic',
>  	'kms_atomic_interruptible',
>  	'kms_atomic_transition',

_______________________________________________
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-04-24  0:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-14 10:11 [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Karthik B S
2020-04-14 14:42 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_async: Add test to validate asynchronous flips (rev2) Patchwork
2020-04-14 22:35 ` [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Paulo Zanoni
2020-04-15  9:05   ` Petri Latvala
2020-04-15 10:04 ` [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_async: Add test to validate asynchronous flips (rev2) Patchwork
2020-04-24  0:40 ` [igt-dev] [PATCH i-g-t v2] tests/kms_async: Add test to validate asynchronous flips Paulo Zanoni

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