All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] tests: Move wait_for_pageflip as library function
@ 2018-05-23 12:20 Mika Kahola
  2018-05-23 13:19 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mika Kahola @ 2018-05-23 12:20 UTC (permalink / raw)
  To: igt-dev

Two tests uses the very same wait_for_pageflip() routine. These tests are
'kms_rotation_crc' and 'kms_flip_tiling'. In order to decrease code
repetition, let's move this function as part of kms function collection
in igt_kms.

No functional changes.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 lib/igt_kms.c            | 24 ++++++++++++++++++++++++
 lib/igt_kms.h            |  1 +
 tests/kms_flip_tiling.c  | 20 +-------------------
 tests/kms_rotation_crc.c | 19 +------------------
 4 files changed, 27 insertions(+), 37 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 0cee0c0..0438f64 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1458,6 +1458,30 @@ unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int flags)
 	return vbl.reply.sequence;
 }
 
+/**
+ * kmstest_wait_for_pageflip:
+ * @fd: Opened drm file descriptor
+ *
+ * Blocks until pageflip is completed
+ *
+ */
+void kmstest_wait_for_pageflip(int fd)
+{
+	drmEventContext evctx = { .version = 2 };
+	struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000 };
+	fd_set fds;
+	int ret;
+
+	/* Wait for pageflip completion, then consume event on fd */
+	FD_ZERO(&fds);
+	FD_SET(fd, &fds);
+	do {
+		ret = select(fd + 1, &fds, NULL, NULL, &timeout);
+	} while (ret < 0 && errno == EINTR);
+	igt_assert_eq(ret, 1);
+	igt_assert(drmHandleEvent(fd, &evctx) == 0);
+}
+
 static void get_plane(char *str, int type, struct kmstest_plane *plane)
 {
 	int ret;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 0e75d0c..4525238 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -222,6 +222,7 @@ uint32_t kmstest_dumb_create(int fd, int width, int height, int bpp,
 
 void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size,
 			      unsigned prot);
+void kmstest_wait_for_pageflip(int fd);
 unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int flags);
 void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility);
 
diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
index 5aae29a..beeb111 100644
--- a/tests/kms_flip_tiling.c
+++ b/tests/kms_flip_tiling.c
@@ -30,7 +30,6 @@
 #include <stdio.h>
 #include <string.h>
 
-
 IGT_TEST_DESCRIPTION("Test page flips and tiling scenarios");
 
 typedef struct {
@@ -62,23 +61,6 @@ static void pipe_crc_free(void)
 	}
 }
 
-static void wait_for_pageflip(int fd)
-{
-	drmEventContext evctx = { .version = 2 };
-	struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000 };
-	fd_set fds;
-	int ret;
-
-	/* Wait for pageflip completion, then consume event on fd */
-	FD_ZERO(&fds);
-	FD_SET(fd, &fds);
-	do {
-		ret = select(fd + 1, &fds, NULL, NULL, &timeout);
-	} while (ret < 0 && errno == EINTR);
-	igt_assert_eq(ret, 1);
-	igt_assert(drmHandleEvent(fd, &evctx) == 0);
-}
-
 static void
 test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t tiling[2])
 {
@@ -139,7 +121,7 @@ test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t ti
 	 */
 	igt_require(ret == 0);
 
-	wait_for_pageflip(data->drm_fd);
+	kmstest_wait_for_pageflip(data->drm_fd);
 
 	/* Get a crc and compare with the reference. */
 	igt_pipe_crc_collect_crc(pipe_crc, &crc);
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 0cd5c6e..6cb5858 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -284,23 +284,6 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 		igt_plane_set_position(plane, data->pos_x, data->pos_y);
 }
 
-static void wait_for_pageflip(int fd)
-{
-	drmEventContext evctx = { .version = 2 };
-	struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000 };
-	fd_set fds;
-	int ret;
-
-	/* Wait for pageflip completion, then consume event on fd */
-	FD_ZERO(&fds);
-	FD_SET(fd, &fds);
-	do {
-		ret = select(fd + 1, &fds, NULL, NULL, &timeout);
-	} while (ret < 0 && errno == EINTR);
-	igt_assert_eq(ret, 1);
-	igt_assert(drmHandleEvent(fd, &evctx) == 0);
-}
-
 static void test_single_case(data_t *data, enum pipe pipe,
 			     igt_output_t *output, igt_plane_t *plane,
 			     enum rectangle_type rect,
@@ -350,7 +333,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 					NULL);
 			igt_assert_eq(ret, 0);
 		}
-		wait_for_pageflip(data->gfx_fd);
+		kmstest_wait_for_pageflip(data->gfx_fd);
 		igt_pipe_crc_drain(data->pipe_crc);
 		igt_pipe_crc_get_single(data->pipe_crc, &crc_output);
 		igt_assert_crc_equal(&data->flip_crc,
-- 
2.7.4

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests: Move wait_for_pageflip as library function
  2018-05-23 12:20 [igt-dev] [PATCH] tests: Move wait_for_pageflip as library function Mika Kahola
@ 2018-05-23 13:19 ` Patchwork
  2018-05-23 13:32 ` [igt-dev] [PATCH] " Ville Syrjälä
  2018-05-23 14:32 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-05-23 13:19 UTC (permalink / raw)
  To: Mika Kahola; +Cc: igt-dev

== Series Details ==

Series: tests: Move wait_for_pageflip as library function
URL   : https://patchwork.freedesktop.org/series/43628/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4222 -> IGTPW_1386 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/43628/revisions/1/mbox/

== Known issues ==

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

  === IGT changes ===

    ==== Possible fixes ====

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-skl-6770hq:      FAIL (fdo#103928, fdo#100368) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       DMESG-FAIL (fdo#106103, fdo#102614) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
  fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103


== Participating hosts (44 -> 39) ==

  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-skl-6700hq 


== Build changes ==

    * IGT: IGT_4492 -> IGTPW_1386
    * Piglit: piglit_4492 -> piglit_4493

  CI_DRM_4222: e783c316409040dab016975896e718fc36cbd8e6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1386: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1386/
  IGT_4492: 0b381c7d1067a4fe520b72d4d391d4920834cbe0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4492: 53aa71861efe0095405673c98ff15f6dcf268901 @ git://anongit.freedesktop.org/piglit
  piglit_4493: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

* Re: [igt-dev] [PATCH] tests: Move wait_for_pageflip as library function
  2018-05-23 12:20 [igt-dev] [PATCH] tests: Move wait_for_pageflip as library function Mika Kahola
  2018-05-23 13:19 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-05-23 13:32 ` Ville Syrjälä
  2018-05-24  7:17   ` Mika Kahola
  2018-05-23 14:32 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
  2 siblings, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2018-05-23 13:32 UTC (permalink / raw)
  To: Mika Kahola; +Cc: igt-dev

On Wed, May 23, 2018 at 03:20:06PM +0300, Mika Kahola wrote:
> Two tests uses the very same wait_for_pageflip() routine. These tests are
> 'kms_rotation_crc' and 'kms_flip_tiling'. In order to decrease code
> repetition, let's move this function as part of kms function collection
> in igt_kms.
> 
> No functional changes.
> 
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  lib/igt_kms.c            | 24 ++++++++++++++++++++++++
>  lib/igt_kms.h            |  1 +
>  tests/kms_flip_tiling.c  | 20 +-------------------
>  tests/kms_rotation_crc.c | 19 +------------------
>  4 files changed, 27 insertions(+), 37 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 0cee0c0..0438f64 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1458,6 +1458,30 @@ unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int flags)
>  	return vbl.reply.sequence;
>  }
>  
> +/**
> + * kmstest_wait_for_pageflip:
> + * @fd: Opened drm file descriptor
> + *
> + * Blocks until pageflip is completed
> + *
> + */
> +void kmstest_wait_for_pageflip(int fd)
> +{
> +	drmEventContext evctx = { .version = 2 };
> +	struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000 };
> +	fd_set fds;
> +	int ret;
> +
> +	/* Wait for pageflip completion, then consume event on fd */
> +	FD_ZERO(&fds);
> +	FD_SET(fd, &fds);
> +	do {
> +		ret = select(fd + 1, &fds, NULL, NULL, &timeout);
> +	} while (ret < 0 && errno == EINTR);
> +	igt_assert_eq(ret, 1);
> +	igt_assert(drmHandleEvent(fd, &evctx) == 0);
> +}
> +
>  static void get_plane(char *str, int type, struct kmstest_plane *plane)
>  {
>  	int ret;
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 0e75d0c..4525238 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -222,6 +222,7 @@ uint32_t kmstest_dumb_create(int fd, int width, int height, int bpp,
>  
>  void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size,
>  			      unsigned prot);
> +void kmstest_wait_for_pageflip(int fd);
>  unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int flags);
>  void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility);
>  
> diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
> index 5aae29a..beeb111 100644
> --- a/tests/kms_flip_tiling.c
> +++ b/tests/kms_flip_tiling.c
> @@ -30,7 +30,6 @@
>  #include <stdio.h>
>  #include <string.h>
>  
> -
>  IGT_TEST_DESCRIPTION("Test page flips and tiling scenarios");
>  
>  typedef struct {
> @@ -62,23 +61,6 @@ static void pipe_crc_free(void)
>  	}
>  }
>  
> -static void wait_for_pageflip(int fd)
> -{
> -	drmEventContext evctx = { .version = 2 };
> -	struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000 };
> -	fd_set fds;
> -	int ret;
> -
> -	/* Wait for pageflip completion, then consume event on fd */
> -	FD_ZERO(&fds);
> -	FD_SET(fd, &fds);
> -	do {
> -		ret = select(fd + 1, &fds, NULL, NULL, &timeout);
> -	} while (ret < 0 && errno == EINTR);
> -	igt_assert_eq(ret, 1);
> -	igt_assert(drmHandleEvent(fd, &evctx) == 0);
> -}
> -
>  static void
>  test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t tiling[2])
>  {
> @@ -139,7 +121,7 @@ test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t ti
>  	 */
>  	igt_require(ret == 0);
>  
> -	wait_for_pageflip(data->drm_fd);
> +	kmstest_wait_for_pageflip(data->drm_fd);
>  
>  	/* Get a crc and compare with the reference. */
>  	igt_pipe_crc_collect_crc(pipe_crc, &crc);
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 0cd5c6e..6cb5858 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -284,23 +284,6 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
>  		igt_plane_set_position(plane, data->pos_x, data->pos_y);
>  }
>  
> -static void wait_for_pageflip(int fd)
> -{
> -	drmEventContext evctx = { .version = 2 };
> -	struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000 };
> -	fd_set fds;
> -	int ret;
> -
> -	/* Wait for pageflip completion, then consume event on fd */
> -	FD_ZERO(&fds);
> -	FD_SET(fd, &fds);
> -	do {
> -		ret = select(fd + 1, &fds, NULL, NULL, &timeout);
> -	} while (ret < 0 && errno == EINTR);
> -	igt_assert_eq(ret, 1);
> -	igt_assert(drmHandleEvent(fd, &evctx) == 0);
> -}
> -
>  static void test_single_case(data_t *data, enum pipe pipe,
>  			     igt_output_t *output, igt_plane_t *plane,
>  			     enum rectangle_type rect,
> @@ -350,7 +333,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
>  					NULL);
>  			igt_assert_eq(ret, 0);
>  		}
> -		wait_for_pageflip(data->gfx_fd);
> +		kmstest_wait_for_pageflip(data->gfx_fd);
>  		igt_pipe_crc_drain(data->pipe_crc);
>  		igt_pipe_crc_get_single(data->pipe_crc, &crc_output);
>  		igt_assert_crc_equal(&data->flip_crc,
> -- 
> 2.7.4
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for tests: Move wait_for_pageflip as library function
  2018-05-23 12:20 [igt-dev] [PATCH] tests: Move wait_for_pageflip as library function Mika Kahola
  2018-05-23 13:19 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2018-05-23 13:32 ` [igt-dev] [PATCH] " Ville Syrjälä
@ 2018-05-23 14:32 ` Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-05-23 14:32 UTC (permalink / raw)
  To: Mika Kahola; +Cc: igt-dev

== Series Details ==

Series: tests: Move wait_for_pageflip as library function
URL   : https://patchwork.freedesktop.org/series/43628/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4492_full -> IGTPW_1386_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1386_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1386_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://patchwork.freedesktop.org/api/1.0/series/43628/revisions/1/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    {igt@kms_available_modes_crc@available_mode_test_crc}:
      shard-snb:          PASS -> FAIL

    
    ==== Warnings ====

    igt@gem_mocs_settings@mocs-rc6-vebox:
      shard-kbl:          PASS -> SKIP +3

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-blt:
      shard-hsw:          PASS -> SKIP

    igt@perf_pmu@rc6:
      shard-kbl:          SKIP -> PASS

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_gtt:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359)

    igt@kms_flip@2x-modeset-vs-vblank-race:
      shard-glk:          PASS -> FAIL (fdo#103060)

    igt@kms_flip@2x-plain-flip-fb-recreate:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_flip@flip-vs-panning-vs-hang:
      shard-snb:          PASS -> DMESG-WARN (fdo#103821)

    igt@kms_flip_tiling@flip-y-tiled:
      shard-glk:          PASS -> FAIL (fdo#104724, fdo#103822)

    igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@perf_pmu@busy-idle-vcs0:
      shard-snb:          PASS -> FAIL (fdo#105286)

    
    ==== Possible fixes ====

    igt@kms_atomic_interruptible@universal-setplane-cursor:
      shard-kbl:          DMESG-WARN (fdo#103558, fdo#105602, fdo#103313) -> PASS +2

    igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
      shard-glk:          FAIL (fdo#105703) -> PASS

    igt@kms_cursor_legacy@flip-vs-cursor-atomic:
      shard-glk:          FAIL (fdo#102670) -> PASS

    igt@kms_flip@2x-flip-vs-expired-vblank:
      shard-hsw:          FAIL (fdo#102887) -> PASS

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-hsw:          FAIL (fdo#105707) -> PASS

    igt@kms_flip@plain-flip-fb-recreate:
      shard-glk:          FAIL (fdo#100368) -> PASS

    igt@kms_flip_tiling@flip-to-x-tiled:
      shard-glk:          FAIL (fdo#104724) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-rte:
      shard-kbl:          DMESG-WARN (fdo#103558, fdo#103313) -> PASS

    igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
      shard-snb:          FAIL (fdo#104724, fdo#103166) -> PASS

    igt@kms_rotation_crc@primary-rotation-180:
      shard-snb:          FAIL (fdo#104724, fdo#103925) -> PASS

    igt@kms_vblank@pipe-b-ts-continuation-suspend:
      shard-glk:          INCOMPLETE (k.org#198133, fdo#103359) -> PASS

    
    ==== Warnings ====

    igt@drv_selftest@live_gtt:
      shard-kbl:          FAIL -> INCOMPLETE (fdo#103665)

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

  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103821 https://bugs.freedesktop.org/show_bug.cgi?id=103821
  fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
  fdo#105286 https://bugs.freedesktop.org/show_bug.cgi?id=105286
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#105703 https://bugs.freedesktop.org/show_bug.cgi?id=105703
  fdo#105707 https://bugs.freedesktop.org/show_bug.cgi?id=105707
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (9 -> 5) ==

  Missing    (4): pig-snb-2600 pig-glk-j5005 pig-skl-6600 pig-hsw-4770r 


== Build changes ==

    * IGT: IGT_4492 -> IGTPW_1386
    * Linux: CI_DRM_4221 -> CI_DRM_4222
    * Piglit: piglit_4492 -> piglit_4493

  CI_DRM_4221: d83aef98e4f2e35440222c69ef80a68daf1abb4e @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4222: e783c316409040dab016975896e718fc36cbd8e6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1386: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1386/
  IGT_4492: 0b381c7d1067a4fe520b72d4d391d4920834cbe0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4492: 53aa71861efe0095405673c98ff15f6dcf268901 @ git://anongit.freedesktop.org/piglit
  piglit_4493: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

* Re: [igt-dev] [PATCH] tests: Move wait_for_pageflip as library function
  2018-05-23 13:32 ` [igt-dev] [PATCH] " Ville Syrjälä
@ 2018-05-24  7:17   ` Mika Kahola
  0 siblings, 0 replies; 5+ messages in thread
From: Mika Kahola @ 2018-05-24  7:17 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev

On Wed, 2018-05-23 at 16:32 +0300, Ville Syrjälä wrote:
> On Wed, May 23, 2018 at 03:20:06PM +0300, Mika Kahola wrote:
> > 
> > Two tests uses the very same wait_for_pageflip() routine. These
> > tests are
> > 'kms_rotation_crc' and 'kms_flip_tiling'. In order to decrease code
> > repetition, let's move this function as part of kms function
> > collection
> > in igt_kms.
> > 
> > No functional changes.
> > 
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pushed. Thanks for the review!
> 
> > 
> > ---
> >  lib/igt_kms.c            | 24 ++++++++++++++++++++++++
> >  lib/igt_kms.h            |  1 +
> >  tests/kms_flip_tiling.c  | 20 +-------------------
> >  tests/kms_rotation_crc.c | 19 +------------------
> >  4 files changed, 27 insertions(+), 37 deletions(-)
> > 
> > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > index 0cee0c0..0438f64 100644
> > --- a/lib/igt_kms.c
> > +++ b/lib/igt_kms.c
> > @@ -1458,6 +1458,30 @@ unsigned int kmstest_get_vblank(int fd, int
> > pipe, unsigned int flags)
> >  	return vbl.reply.sequence;
> >  }
> >  
> > +/**
> > + * kmstest_wait_for_pageflip:
> > + * @fd: Opened drm file descriptor
> > + *
> > + * Blocks until pageflip is completed
> > + *
> > + */
> > +void kmstest_wait_for_pageflip(int fd)
> > +{
> > +	drmEventContext evctx = { .version = 2 };
> > +	struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000
> > };
> > +	fd_set fds;
> > +	int ret;
> > +
> > +	/* Wait for pageflip completion, then consume event on fd
> > */
> > +	FD_ZERO(&fds);
> > +	FD_SET(fd, &fds);
> > +	do {
> > +		ret = select(fd + 1, &fds, NULL, NULL, &timeout);
> > +	} while (ret < 0 && errno == EINTR);
> > +	igt_assert_eq(ret, 1);
> > +	igt_assert(drmHandleEvent(fd, &evctx) == 0);
> > +}
> > +
> >  static void get_plane(char *str, int type, struct kmstest_plane
> > *plane)
> >  {
> >  	int ret;
> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> > index 0e75d0c..4525238 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -222,6 +222,7 @@ uint32_t kmstest_dumb_create(int fd, int width,
> > int height, int bpp,
> >  
> >  void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t
> > size,
> >  			      unsigned prot);
> > +void kmstest_wait_for_pageflip(int fd);
> >  unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int
> > flags);
> >  void igt_assert_plane_visible(int fd, enum pipe pipe, bool
> > visibility);
> >  
> > diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
> > index 5aae29a..beeb111 100644
> > --- a/tests/kms_flip_tiling.c
> > +++ b/tests/kms_flip_tiling.c
> > @@ -30,7 +30,6 @@
> >  #include <stdio.h>
> >  #include <string.h>
> >  
> > -
> >  IGT_TEST_DESCRIPTION("Test page flips and tiling scenarios");
> >  
> >  typedef struct {
> > @@ -62,23 +61,6 @@ static void pipe_crc_free(void)
> >  	}
> >  }
> >  
> > -static void wait_for_pageflip(int fd)
> > -{
> > -	drmEventContext evctx = { .version = 2 };
> > -	struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000
> > };
> > -	fd_set fds;
> > -	int ret;
> > -
> > -	/* Wait for pageflip completion, then consume event on fd
> > */
> > -	FD_ZERO(&fds);
> > -	FD_SET(fd, &fds);
> > -	do {
> > -		ret = select(fd + 1, &fds, NULL, NULL, &timeout);
> > -	} while (ret < 0 && errno == EINTR);
> > -	igt_assert_eq(ret, 1);
> > -	igt_assert(drmHandleEvent(fd, &evctx) == 0);
> > -}
> > -
> >  static void
> >  test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t
> > *output, uint64_t tiling[2])
> >  {
> > @@ -139,7 +121,7 @@ test_flip_tiling(data_t *data, enum pipe pipe,
> > igt_output_t *output, uint64_t ti
> >  	 */
> >  	igt_require(ret == 0);
> >  
> > -	wait_for_pageflip(data->drm_fd);
> > +	kmstest_wait_for_pageflip(data->drm_fd);
> >  
> >  	/* Get a crc and compare with the reference. */
> >  	igt_pipe_crc_collect_crc(pipe_crc, &crc);
> > diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> > index 0cd5c6e..6cb5858 100644
> > --- a/tests/kms_rotation_crc.c
> > +++ b/tests/kms_rotation_crc.c
> > @@ -284,23 +284,6 @@ static void prepare_fbs(data_t *data,
> > igt_output_t *output,
> >  		igt_plane_set_position(plane, data->pos_x, data-
> > >pos_y);
> >  }
> >  
> > -static void wait_for_pageflip(int fd)
> > -{
> > -	drmEventContext evctx = { .version = 2 };
> > -	struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000
> > };
> > -	fd_set fds;
> > -	int ret;
> > -
> > -	/* Wait for pageflip completion, then consume event on fd
> > */
> > -	FD_ZERO(&fds);
> > -	FD_SET(fd, &fds);
> > -	do {
> > -		ret = select(fd + 1, &fds, NULL, NULL, &timeout);
> > -	} while (ret < 0 && errno == EINTR);
> > -	igt_assert_eq(ret, 1);
> > -	igt_assert(drmHandleEvent(fd, &evctx) == 0);
> > -}
> > -
> >  static void test_single_case(data_t *data, enum pipe pipe,
> >  			     igt_output_t *output, igt_plane_t
> > *plane,
> >  			     enum rectangle_type rect,
> > @@ -350,7 +333,7 @@ static void test_single_case(data_t *data, enum
> > pipe pipe,
> >  					NULL);
> >  			igt_assert_eq(ret, 0);
> >  		}
> > -		wait_for_pageflip(data->gfx_fd);
> > +		kmstest_wait_for_pageflip(data->gfx_fd);
> >  		igt_pipe_crc_drain(data->pipe_crc);
> >  		igt_pipe_crc_get_single(data->pipe_crc,
> > &crc_output);
> >  		igt_assert_crc_equal(&data->flip_crc,
> > -- 
> > 2.7.4
> > 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
-- 
Mika Kahola - Intel OTC

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

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

end of thread, other threads:[~2018-05-24  7:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 12:20 [igt-dev] [PATCH] tests: Move wait_for_pageflip as library function Mika Kahola
2018-05-23 13:19 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-05-23 13:32 ` [igt-dev] [PATCH] " Ville Syrjälä
2018-05-24  7:17   ` Mika Kahola
2018-05-23 14:32 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork

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.