All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v2][CI] tests/psr: Test vblank continuity with PSR enabled
@ 2017-12-13 19:23 Dhinakaran Pandiyan
  2017-12-13 19:56 ` ✗ Fi.CI.BAT: failure for " Patchwork
  2017-12-19 21:54 ` [PATCH i-g-t v2][CI] " Rodrigo Vivi
  0 siblings, 2 replies; 4+ messages in thread
From: Dhinakaran Pandiyan @ 2017-12-13 19:23 UTC (permalink / raw)
  To: intel-gfx; +Cc: Dhinakaran Pandiyan

PSR allows DMC to put the system to low power states when active, but
this can reset the frame counter on some platforms. The frame counter reset
leads to a negative diff applied to vblank count. This subtest checks
for that.

v2: Some optimizations and data type changes.
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 tests/intel-ci/fast-feedback.testlist |  1 +
 tests/kms_psr_sink_crc.c              | 66 +++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index f71a16bc..72338b72 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -247,6 +247,7 @@ igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a
 igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b
 igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c
 igt@kms_psr_sink_crc@psr_basic
+igt@kms_psr_sink_crc@vblank
 igt@kms_setmode@basic-clone-single-crtc
 igt@kms_sink_crc_basic
 igt@pm_backlight@basic-brightness
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 83a69f0b..831368b2 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -69,6 +69,7 @@ typedef struct {
 	enum operations op;
 	uint32_t devid;
 	uint32_t crtc_id;
+	enum pipe pipe;
 	igt_display_t display;
 	drm_intel_bufmgr *bufmgr;
 	struct igt_fb fb_green, fb_white;
@@ -107,6 +108,7 @@ static void setup_output(data_t *data)
 		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
 			continue;
 
+		data->pipe = pipe;
 		igt_output_set_pipe(output, pipe);
 		data->crtc_id = output->config.crtc->crtc_id;
 		data->output = output;
@@ -285,6 +287,63 @@ static void assert_or_manual(bool condition, const char *expected)
 	igt_assert(igt_interactive_debug || condition);
 }
 
+static unsigned int get_vblank(int fd, unsigned int pipe)
+{
+	union drm_wait_vblank vbl;
+
+	memset(&vbl, 0, sizeof(vbl));
+	vbl.request.type = DRM_VBLANK_RELATIVE | kmstest_get_vbl_flag(pipe);
+	igt_ioctl(fd, DRM_IOCTL_WAIT_VBLANK, &vbl);
+
+	return vbl.reply.sequence;
+}
+
+static void dmc_read_counts(unsigned int fd, unsigned int *count)
+{
+	char buf[512];
+
+	igt_debugfs_read(fd, "i915_dmc_info", buf);
+	igt_assert_eq(sscanf(strstr(buf, "DC3 -> DC5"), "DC3 -> DC5 count: %u", &count[0]),
+		      1);
+	igt_assert_eq(sscanf(strstr(buf, "DC5 -> DC6"), "DC5 -> DC6 count: %u", &count[1]),
+		      1);
+	igt_debug("DC3->DC5 count=%u, DC5->DC6 count=%u\n", count[0], count[1]);
+}
+
+static void check_vblanks(data_t *data)
+{
+	unsigned int first_vbl, second_vbl;
+	int wait = 30; /* Takes about 2.5 seconds for DC_OFF disable */
+	char buf[512];
+	bool has_dmc;
+
+	first_vbl = get_vblank(data->drm_fd, data->pipe);
+
+	igt_debugfs_read(data->drm_fd, "i915_dmc_info", buf);
+	has_dmc = strstr(buf, "fw loaded: yes");
+
+	if (has_dmc) {
+		unsigned int new_dc[2], old_dc[2];
+
+		dmc_read_counts(data->drm_fd, new_dc);
+		do {
+			memcpy(old_dc, new_dc, sizeof(new_dc));
+			usleep(100 * 1000);
+			dmc_read_counts(data->drm_fd, new_dc);
+		} while (!memcmp(old_dc, new_dc, sizeof(new_dc)) && --wait);
+
+		igt_assert_f(wait, "Timed out waiting for DC state transition 3s.\n");
+	} else {
+		sleep(3);
+	}
+
+	second_vbl = get_vblank(data->drm_fd, data->pipe);
+	igt_debug("vblank count went from %u to %u in %d ms.\n",
+		  first_vbl, second_vbl, has_dmc ? (30 - wait) * 100 : 3000);
+
+	igt_assert_lt(first_vbl, second_vbl);
+}
+
 static bool drrs_disabled(data_t *data)
 {
 	char buf[512];
@@ -572,6 +631,13 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	igt_subtest("vblank") {
+		setup_test_plane(&data);
+		igt_assert(wait_psr_entry(&data));
+		check_vblanks(&data);
+		test_cleanup(&data);
+	}
+
 	igt_subtest_f("dpms_off_psr_active") {
 		data.test_plane = DRM_PLANE_TYPE_PRIMARY;
 		data.op = RENDER;
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: failure for tests/psr: Test vblank continuity with PSR enabled
  2017-12-13 19:23 [PATCH i-g-t v2][CI] tests/psr: Test vblank continuity with PSR enabled Dhinakaran Pandiyan
@ 2017-12-13 19:56 ` Patchwork
  2017-12-19 21:54 ` [PATCH i-g-t v2][CI] " Rodrigo Vivi
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-12-13 19:56 UTC (permalink / raw)
  To: Dhinakaran Pandiyan; +Cc: intel-gfx

== Series Details ==

Series: tests/psr: Test vblank continuity with PSR enabled
URL   : https://patchwork.freedesktop.org/series/35306/
State : failure

== Summary ==

IGT patchset tested on top of latest successful build
ea7015f1fabbdfdd52a145162c658d2e90161ec5 lib/core: Don't leak dummyloads between subtests

with latest DRM-Tip kernel build CI_DRM_3508
1a717c76c96c drm-tip: 2017y-12m-13d-14h-48m-36s UTC integration manifest

Testlist changes:
+igt@kms_psr_sink_crc@vblank

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-warn -> PASS       (fi-elk-e7500) fdo#103989
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575
Test gem_sync:
        Subgroup basic-all:
                pass       -> SKIP       (fi-pnv-d510)
        Subgroup basic-each:
                pass       -> SKIP       (fi-pnv-d510)
        Subgroup basic-many-each:
                pass       -> SKIP       (fi-pnv-d510)
        Subgroup basic-store-all:
                pass       -> SKIP       (fi-pnv-d510)
        Subgroup basic-store-each:
                pass       -> SKIP       (fi-pnv-d510)
Test gem_tiled_blits:
        Subgroup basic:
                pass       -> SKIP       (fi-pnv-d510)
Test gem_tiled_fence_blits:
        Subgroup basic:
                pass       -> SKIP       (fi-pnv-d510)
Test gem_wait:
        Subgroup basic-busy-all:
                pass       -> SKIP       (fi-pnv-d510)
        Subgroup basic-wait-all:
                pass       -> SKIP       (fi-pnv-d510)
        Subgroup basic-await-all:
                pass       -> SKIP       (fi-pnv-d510)
Test kms_busy:
        Subgroup basic-flip-a:
                pass       -> SKIP       (fi-pnv-d510)
        Subgroup basic-flip-b:
                pass       -> SKIP       (fi-pnv-d510)
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> SKIP       (fi-pnv-d510)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                pass       -> DMESG-WARN (fi-kbl-r) fdo#104172 +1
Test kms_setmode:
        Subgroup basic-clone-single-crtc:
                pass       -> DMESG-WARN (fi-skl-6600u)
                pass       -> DMESG-WARN (fi-kbl-7560u)
                pass       -> DMESG-WARN (fi-kbl-r)
Test kms_sink_crc_basic:
                skip       -> INCOMPLETE (fi-skl-6600u)
                skip       -> INCOMPLETE (fi-kbl-7560u)
                skip       -> INCOMPLETE (fi-kbl-r)

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

fi-bdw-5557u     total:289  pass:267  dwarn:0   dfail:0   fail:0   skip:22  time:440s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:382s
fi-bsw-n3050     total:289  pass:242  dwarn:0   dfail:0   fail:0   skip:47  time:511s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:282s
fi-bxt-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:0   skip:31  time:511s
fi-bxt-j4205     total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:511s
fi-byt-j1900     total:289  pass:253  dwarn:0   dfail:0   fail:0   skip:36  time:490s
fi-byt-n2820     total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:475s
fi-elk-e7500     total:224  pass:164  dwarn:14  dfail:0   fail:0   skip:45 
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:268s
fi-glk-1         total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:536s
fi-hsw-4770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:409s
fi-hsw-4770r     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:415s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:390s
fi-ivb-3520m     total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:474s
fi-ivb-3770      total:289  pass:255  dwarn:0   dfail:0   fail:0   skip:34  time:435s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:0   skip:25  time:486s
fi-kbl-7560u     total:250  pass:231  dwarn:1   dfail:1   fail:0   skip:16 
fi-kbl-7567u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:474s
fi-kbl-r         total:250  pass:222  dwarn:2   dfail:1   fail:0   skip:24 
fi-pnv-d510      total:289  pass:209  dwarn:1   dfail:0   fail:0   skip:79  time:612s
fi-skl-6260u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:448s
fi-skl-6600u     total:250  pass:223  dwarn:1   dfail:1   fail:0   skip:24 
fi-skl-6700hq    total:289  pass:262  dwarn:0   dfail:0   fail:1   skip:26  time:570s
fi-skl-6770hq    total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:495s
fi-skl-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:445s
fi-snb-2520m     total:289  pass:248  dwarn:0   dfail:0   fail:0   skip:41  time:550s
fi-snb-2600      total:289  pass:248  dwarn:0   dfail:0   fail:0   skip:41  time:418s
Blacklisted hosts:
fi-cfl-s2        total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:602s
fi-glk-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:0   skip:31  time:493s

== Logs ==

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

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

* Re: [PATCH i-g-t v2][CI] tests/psr: Test vblank continuity with PSR enabled
  2017-12-13 19:23 [PATCH i-g-t v2][CI] tests/psr: Test vblank continuity with PSR enabled Dhinakaran Pandiyan
  2017-12-13 19:56 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2017-12-19 21:54 ` Rodrigo Vivi
  2017-12-19 22:02   ` Pandiyan, Dhinakaran
  1 sibling, 1 reply; 4+ messages in thread
From: Rodrigo Vivi @ 2017-12-19 21:54 UTC (permalink / raw)
  To: Dhinakaran Pandiyan; +Cc: intel-gfx

On Wed, Dec 13, 2017 at 07:23:45PM +0000, Dhinakaran Pandiyan wrote:
> PSR allows DMC to put the system to low power states when active, but
> this can reset the frame counter on some platforms. The frame counter reset
> leads to a negative diff applied to vblank count. This subtest checks
> for that.
> 
> v2: Some optimizations and data type changes.
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  tests/intel-ci/fast-feedback.testlist |  1 +
>  tests/kms_psr_sink_crc.c              | 66 +++++++++++++++++++++++++++++++++++
>  2 files changed, 67 insertions(+)
> 
> diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
> index f71a16bc..72338b72 100644
> --- a/tests/intel-ci/fast-feedback.testlist
> +++ b/tests/intel-ci/fast-feedback.testlist
> @@ -247,6 +247,7 @@ igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a
>  igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b
>  igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c
>  igt@kms_psr_sink_crc@psr_basic
> +igt@kms_psr_sink_crc@vblank

just a note that we need ack from CI devs
specially because it introduces some sleeps/waits below

>  igt@kms_setmode@basic-clone-single-crtc
>  igt@kms_sink_crc_basic
>  igt@pm_backlight@basic-brightness
> diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> index 83a69f0b..831368b2 100644
> --- a/tests/kms_psr_sink_crc.c
> +++ b/tests/kms_psr_sink_crc.c
> @@ -69,6 +69,7 @@ typedef struct {
>  	enum operations op;
>  	uint32_t devid;
>  	uint32_t crtc_id;
> +	enum pipe pipe;
>  	igt_display_t display;
>  	drm_intel_bufmgr *bufmgr;
>  	struct igt_fb fb_green, fb_white;
> @@ -107,6 +108,7 @@ static void setup_output(data_t *data)
>  		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
>  			continue;
>  
> +		data->pipe = pipe;
>  		igt_output_set_pipe(output, pipe);
>  		data->crtc_id = output->config.crtc->crtc_id;
>  		data->output = output;
> @@ -285,6 +287,63 @@ static void assert_or_manual(bool condition, const char *expected)
>  	igt_assert(igt_interactive_debug || condition);
>  }
>  
> +static unsigned int get_vblank(int fd, unsigned int pipe)
> +{
> +	union drm_wait_vblank vbl;
> +
> +	memset(&vbl, 0, sizeof(vbl));
> +	vbl.request.type = DRM_VBLANK_RELATIVE | kmstest_get_vbl_flag(pipe);
> +	igt_ioctl(fd, DRM_IOCTL_WAIT_VBLANK, &vbl);
> +
> +	return vbl.reply.sequence;
> +}
> +
> +static void dmc_read_counts(unsigned int fd, unsigned int *count)
> +{
> +	char buf[512];
> +
> +	igt_debugfs_read(fd, "i915_dmc_info", buf);
> +	igt_assert_eq(sscanf(strstr(buf, "DC3 -> DC5"), "DC3 -> DC5 count: %u", &count[0]),
> +		      1);
> +	igt_assert_eq(sscanf(strstr(buf, "DC5 -> DC6"), "DC5 -> DC6 count: %u", &count[1]),
> +		      1);

we already have platforms where this counter doesn't exist. We might have platforms
where even DC3_TO_DC5 is not present or not reliable :/

> +	igt_debug("DC3->DC5 count=%u, DC5->DC6 count=%u\n", count[0], count[1]);
> +}
> +
> +static void check_vblanks(data_t *data)
> +{
> +	unsigned int first_vbl, second_vbl;
> +	int wait = 30; /* Takes about 2.5 seconds for DC_OFF disable */
> +	char buf[512];
> +	bool has_dmc;
> +
> +	first_vbl = get_vblank(data->drm_fd, data->pipe);
> +
> +	igt_debugfs_read(data->drm_fd, "i915_dmc_info", buf);
> +	has_dmc = strstr(buf, "fw loaded: yes");
> +
> +	if (has_dmc) {
> +		unsigned int new_dc[2], old_dc[2];
> +
> +		dmc_read_counts(data->drm_fd, new_dc);
> +		do {
> +			memcpy(old_dc, new_dc, sizeof(new_dc));
> +			usleep(100 * 1000);
> +			dmc_read_counts(data->drm_fd, new_dc);
> +		} while (!memcmp(old_dc, new_dc, sizeof(new_dc)) && --wait);
> +
> +		igt_assert_f(wait, "Timed out waiting for DC state transition 3s.\n");
> +	} else {
> +		sleep(3);
> +	}
> +
> +	second_vbl = get_vblank(data->drm_fd, data->pipe);
> +	igt_debug("vblank count went from %u to %u in %d ms.\n",
> +		  first_vbl, second_vbl, has_dmc ? (30 - wait) * 100 : 3000);
> +
> +	igt_assert_lt(first_vbl, second_vbl);
> +}
> +
>  static bool drrs_disabled(data_t *data)
>  {
>  	char buf[512];
> @@ -572,6 +631,13 @@ int main(int argc, char *argv[])
>  		}
>  	}
>  
> +	igt_subtest("vblank") {
> +		setup_test_plane(&data);
> +		igt_assert(wait_psr_entry(&data));
> +		check_vblanks(&data);
> +		test_cleanup(&data);
> +	}
> +
>  	igt_subtest_f("dpms_off_psr_active") {
>  		data.test_plane = DRM_PLANE_TYPE_PRIMARY;
>  		data.op = RENDER;
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t v2][CI] tests/psr: Test vblank continuity with PSR enabled
  2017-12-19 21:54 ` [PATCH i-g-t v2][CI] " Rodrigo Vivi
@ 2017-12-19 22:02   ` Pandiyan, Dhinakaran
  0 siblings, 0 replies; 4+ messages in thread
From: Pandiyan, Dhinakaran @ 2017-12-19 22:02 UTC (permalink / raw)
  To: Vivi, Rodrigo; +Cc: intel-gfx




On Tue, 2017-12-19 at 13:54 -0800, Rodrigo Vivi wrote:
> On Wed, Dec 13, 2017 at 07:23:45PM +0000, Dhinakaran Pandiyan wrote:
> > PSR allows DMC to put the system to low power states when active, but
> > this can reset the frame counter on some platforms. The frame counter reset
> > leads to a negative diff applied to vblank count. This subtest checks
> > for that.
> > 
> > v2: Some optimizations and data type changes.
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > ---
> >  tests/intel-ci/fast-feedback.testlist |  1 +
> >  tests/kms_psr_sink_crc.c              | 66 +++++++++++++++++++++++++++++++++++
> >  2 files changed, 67 insertions(+)
> > 
> > diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
> > index f71a16bc..72338b72 100644
> > --- a/tests/intel-ci/fast-feedback.testlist
> > +++ b/tests/intel-ci/fast-feedback.testlist
> > @@ -247,6 +247,7 @@ igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a
> >  igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b
> >  igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c
> >  igt@kms_psr_sink_crc@psr_basic
> > +igt@kms_psr_sink_crc@vblank
> 
> just a note that we need ack from CI devs
> specially because it introduces some sleeps/waits below
> 
> >  igt@kms_setmode@basic-clone-single-crtc
> >  igt@kms_sink_crc_basic
> >  igt@pm_backlight@basic-brightness
> > diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> > index 83a69f0b..831368b2 100644
> > --- a/tests/kms_psr_sink_crc.c
> > +++ b/tests/kms_psr_sink_crc.c
> > @@ -69,6 +69,7 @@ typedef struct {
> >  	enum operations op;
> >  	uint32_t devid;
> >  	uint32_t crtc_id;
> > +	enum pipe pipe;
> >  	igt_display_t display;
> >  	drm_intel_bufmgr *bufmgr;
> >  	struct igt_fb fb_green, fb_white;
> > @@ -107,6 +108,7 @@ static void setup_output(data_t *data)
> >  		if (c->connector_type != DRM_MODE_CONNECTOR_eDP)
> >  			continue;
> >  
> > +		data->pipe = pipe;
> >  		igt_output_set_pipe(output, pipe);
> >  		data->crtc_id = output->config.crtc->crtc_id;
> >  		data->output = output;
> > @@ -285,6 +287,63 @@ static void assert_or_manual(bool condition, const char *expected)
> >  	igt_assert(igt_interactive_debug || condition);
> >  }
> >  
> > +static unsigned int get_vblank(int fd, unsigned int pipe)
> > +{
> > +	union drm_wait_vblank vbl;
> > +
> > +	memset(&vbl, 0, sizeof(vbl));
> > +	vbl.request.type = DRM_VBLANK_RELATIVE | kmstest_get_vbl_flag(pipe);
> > +	igt_ioctl(fd, DRM_IOCTL_WAIT_VBLANK, &vbl);
> > +
> > +	return vbl.reply.sequence;
> > +}
> > +
> > +static void dmc_read_counts(unsigned int fd, unsigned int *count)
> > +{
> > +	char buf[512];
> > +
> > +	igt_debugfs_read(fd, "i915_dmc_info", buf);
> > +	igt_assert_eq(sscanf(strstr(buf, "DC3 -> DC5"), "DC3 -> DC5 count: %u", &count[0]),
> > +		      1);
> > +	igt_assert_eq(sscanf(strstr(buf, "DC5 -> DC6"), "DC5 -> DC6 count: %u", &count[1]),
> > +		      1);
> 
> we already have platforms where this counter doesn't exist. We might have platforms
> where even DC3_TO_DC5 is not present or not reliable :/

I can check that the dc_off refcount has gone to zero (from
i915_power_domain_info) and then add a small delay after that.

> 
> > +	igt_debug("DC3->DC5 count=%u, DC5->DC6 count=%u\n", count[0], count[1]);
> > +}
> > +
> > +static void check_vblanks(data_t *data)
> > +{
> > +	unsigned int first_vbl, second_vbl;
> > +	int wait = 30; /* Takes about 2.5 seconds for DC_OFF disable */
> > +	char buf[512];
> > +	bool has_dmc;
> > +
> > +	first_vbl = get_vblank(data->drm_fd, data->pipe);
> > +
> > +	igt_debugfs_read(data->drm_fd, "i915_dmc_info", buf);
> > +	has_dmc = strstr(buf, "fw loaded: yes");
> > +
> > +	if (has_dmc) {
> > +		unsigned int new_dc[2], old_dc[2];
> > +
> > +		dmc_read_counts(data->drm_fd, new_dc);
> > +		do {
> > +			memcpy(old_dc, new_dc, sizeof(new_dc));
> > +			usleep(100 * 1000);
> > +			dmc_read_counts(data->drm_fd, new_dc);
> > +		} while (!memcmp(old_dc, new_dc, sizeof(new_dc)) && --wait);
> > +
> > +		igt_assert_f(wait, "Timed out waiting for DC state transition 3s.\n");
> > +	} else {
> > +		sleep(3);
> > +	}
> > +
> > +	second_vbl = get_vblank(data->drm_fd, data->pipe);
> > +	igt_debug("vblank count went from %u to %u in %d ms.\n",
> > +		  first_vbl, second_vbl, has_dmc ? (30 - wait) * 100 : 3000);
> > +
> > +	igt_assert_lt(first_vbl, second_vbl);
> > +}
> > +
> >  static bool drrs_disabled(data_t *data)
> >  {
> >  	char buf[512];
> > @@ -572,6 +631,13 @@ int main(int argc, char *argv[])
> >  		}
> >  	}
> >  
> > +	igt_subtest("vblank") {
> > +		setup_test_plane(&data);
> > +		igt_assert(wait_psr_entry(&data));
> > +		check_vblanks(&data);
> > +		test_cleanup(&data);
> > +	}
> > +
> >  	igt_subtest_f("dpms_off_psr_active") {
> >  		data.test_plane = DRM_PLANE_TYPE_PRIMARY;
> >  		data.op = RENDER;
> > -- 
> > 2.11.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-12-19 22:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-13 19:23 [PATCH i-g-t v2][CI] tests/psr: Test vblank continuity with PSR enabled Dhinakaran Pandiyan
2017-12-13 19:56 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-12-19 21:54 ` [PATCH i-g-t v2][CI] " Rodrigo Vivi
2017-12-19 22:02   ` Pandiyan, Dhinakaran

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.