All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] igt/kms_cursor_legacy: Use common spinbatch
@ 2017-09-14 13:19 Chris Wilson
  2017-09-14 13:41 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Wilson @ 2017-09-14 13:19 UTC (permalink / raw)
  To: intel-gfx

Remove the local recursive spinner in favour of igt_spin_t.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/kms_cursor_legacy.c | 103 ++++------------------------------------------
 1 file changed, 9 insertions(+), 94 deletions(-)

diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 2d32d3a9..fb365f12 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -490,92 +490,6 @@ enum basic_flip_cursor {
 	FLIP_AFTER_CURSOR
 };
 
-static uint32_t *make_busy(int fd, uint32_t target)
-{
-	const int gen = intel_gen(intel_get_drm_devid(fd));
-	struct drm_i915_gem_exec_object2 obj[2];
-	struct drm_i915_gem_relocation_entry reloc[2];
-	struct drm_i915_gem_execbuffer2 execbuf;
-	uint32_t *batch;
-	int i;
-
-	memset(&execbuf, 0, sizeof(execbuf));
-	execbuf.buffers_ptr = (uintptr_t)obj;
-	execbuf.buffer_count = 2;
-
-	memset(obj, 0, sizeof(obj));
-	obj[0].handle = target;
-	obj[1].handle = gem_create(fd, 4096);
-	batch = gem_mmap__wc(fd, obj[1].handle, 0, 4096, PROT_WRITE);
-	gem_set_domain(fd, obj[1].handle,
-			I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
-
-
-	obj[1].relocs_ptr = (uintptr_t)reloc;
-	obj[1].relocation_count = 2;
-	memset(reloc, 0, sizeof(reloc));
-
-	reloc[0].target_handle = obj[1].handle; /* recurse */
-	reloc[0].presumed_offset = 0;
-	reloc[0].offset = sizeof(uint32_t);
-	reloc[0].delta = 0;
-	reloc[0].read_domains = I915_GEM_DOMAIN_COMMAND;
-	reloc[0].write_domain = 0;
-
-	reloc[1].target_handle = target;
-	reloc[1].presumed_offset = 0;
-	reloc[1].offset = 1024;
-	reloc[1].delta = 0;
-	reloc[1].read_domains = I915_GEM_DOMAIN_COMMAND;
-	reloc[1].write_domain = I915_GEM_DOMAIN_COMMAND;
-
-	i = 0;
-	batch[i] = MI_BATCH_BUFFER_START;
-	if (gen >= 8) {
-		batch[i] |= 1 << 8 | 1;
-		batch[++i] = 0;
-		batch[++i] = 0;
-	} else if (gen >= 6) {
-		batch[i] |= 1 << 8;
-		batch[++i] = 0;
-	} else {
-		batch[i] |= 2 << 6;
-		batch[++i] = 0;
-		if (gen < 4) {
-			batch[i] |= 1;
-			reloc[0].delta = 1;
-		}
-	}
-	i++;
-
-	gem_execbuf(fd, &execbuf);
-	gem_close(fd, obj[1].handle);
-
-	return batch;
-}
-
-static void cancel_busy(uint32_t *busy)
-{
-	*busy = MI_BATCH_BUFFER_END;
-	munmap(busy, 4096);
-}
-
-static uint32_t *
-make_fb_busy(int fd, const struct igt_fb *fb)
-{
-	uint32_t *busy;
-
-	busy = make_busy(fd, fb->gem_handle);
-	igt_assert(gem_bo_busy(fd, fb->gem_handle));
-
-	return busy;
-}
-
-static void finish_fb_busy(uint32_t *busy)
-{
-	cancel_busy(busy);
-}
-
 #define BASIC_BUSY 0x1
 
 static void basic_flip_cursor(igt_display_t *display,
@@ -588,7 +502,7 @@ static void basic_flip_cursor(igt_display_t *display,
 	struct igt_fb fb_info, cursor_fb, cursor_fb2, argb_fb;
 	unsigned vblank_start;
 	enum pipe pipe = find_connected_pipe(display, false);
-	uint32_t *busy;
+	igt_spin_t *spin;
 	int i, miss1 = 0, miss2 = 0, delta;
 
 	if (mode >= flip_test_atomic)
@@ -616,9 +530,9 @@ static void basic_flip_cursor(igt_display_t *display,
 		/* Bind the cursor first to warm up */
 		do_ioctl(display->drm_fd, DRM_IOCTL_MODE_CURSOR, &arg[0]);
 
-		busy = NULL;
+		spin = NULL;
 		if (flags & BASIC_BUSY)
-			busy = make_fb_busy(display->drm_fd, &fb_info);
+			spin = igt_spin_batch_new(display->drm_fd, 0, 0, fb_info.gem_handle);
 
 		/* Start with a synchronous query to align with the vblank */
 		vblank_start = get_vblank(display->drm_fd, pipe, DRM_VBLANK_NEXTONMISS);
@@ -660,10 +574,10 @@ static void basic_flip_cursor(igt_display_t *display,
 
 		delta = get_vblank(display->drm_fd, pipe, 0) - vblank_start;
 
-		if (busy) {
+		if (spin) {
 			struct pollfd pfd = { display->drm_fd, POLLIN };
 			igt_assert(poll(&pfd, 1, 0) == 0);
-			finish_fb_busy(busy);
+			igt_spin_batch_free(display->drm_fd, spin);
 		}
 
 		if (miss)
@@ -1373,9 +1287,10 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
 
 	/* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */
 	for (int i = 1; i >= 0; i--) {
-		uint32_t *busy;
+		igt_spin_t *spin;
 
-		busy = make_fb_busy(display->drm_fd, &fb_info[1]);
+		spin = igt_spin_batch_new(display->drm_fd, 0, 0,
+					  fb_info[1].gem_handle);
 
 		vblank_start = get_vblank(display->drm_fd, pipe, DRM_VBLANK_NEXTONMISS);
 
@@ -1386,7 +1301,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
 
 		igt_pipe_crc_collect_crc(pipe_crc, &crcs[2]);
 
-		finish_fb_busy(busy);
+		igt_spin_batch_free(display->drm_fd, spin);
 
 		igt_set_timeout(1, "Stuck page flip");
 		igt_ignore_warn(read(display->drm_fd, &vbl, sizeof(vbl)));
-- 
2.14.1

_______________________________________________
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: success for igt/kms_cursor_legacy: Use common spinbatch
  2017-09-14 13:19 [PATCH igt] igt/kms_cursor_legacy: Use common spinbatch Chris Wilson
@ 2017-09-14 13:41 ` Patchwork
  2017-09-14 16:11 ` ✓ Fi.CI.IGT: " Patchwork
  2017-09-21 11:14 ` [PATCH igt] " Ville Syrjälä
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-09-14 13:41 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt/kms_cursor_legacy: Use common spinbatch
URL   : https://patchwork.freedesktop.org/series/30364/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
c718ba805208e55d675defe9b2a66852e2ae038c lib/igt_kmod: Allow specifying libkmod config via environment variables

with latest DRM-Tip kernel build CI_DRM_3088
36b5aec0a505 drm-tip: 2017y-09m-14d-12h-08m-39s UTC integration manifest

Test chamelium:
        Subgroup dp-crc-fast:
                fail       -> PASS       (fi-kbl-7500u) fdo#102514
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                fail       -> PASS       (fi-snb-2600) fdo#100215

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:454s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:455s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:382s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:531s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:266s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:509s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:503s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:505s
fi-cfl-s         total:289  pass:223  dwarn:34  dfail:0   fail:0   skip:32  time:552s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:454s
fi-glk-2a        total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:595s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:432s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:405s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:439s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:493s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:464s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:494s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:581s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:597s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:549s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:461s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:524s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:502s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:460s
fi-skl-x1585l    total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:480s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:582s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:437s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_186/
_______________________________________________
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

* ✓ Fi.CI.IGT: success for igt/kms_cursor_legacy: Use common spinbatch
  2017-09-14 13:19 [PATCH igt] igt/kms_cursor_legacy: Use common spinbatch Chris Wilson
  2017-09-14 13:41 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-09-14 16:11 ` Patchwork
  2017-09-21 11:14 ` [PATCH igt] " Ville Syrjälä
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-09-14 16:11 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt/kms_cursor_legacy: Use common spinbatch
URL   : https://patchwork.freedesktop.org/series/30364/
State : success

== Summary ==

Test kms_setmode:
        Subgroup basic:
                fail       -> PASS       (shard-hsw) fdo#99912
Test perf:
        Subgroup polling:
                pass       -> FAIL       (shard-hsw) fdo#102252

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

shard-hsw        total:2313 pass:1245 dwarn:0   dfail:0   fail:13  skip:1055 time:9497s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_186/shards.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 igt] igt/kms_cursor_legacy: Use common spinbatch
  2017-09-14 13:19 [PATCH igt] igt/kms_cursor_legacy: Use common spinbatch Chris Wilson
  2017-09-14 13:41 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-09-14 16:11 ` ✓ Fi.CI.IGT: " Patchwork
@ 2017-09-21 11:14 ` Ville Syrjälä
  2 siblings, 0 replies; 4+ messages in thread
From: Ville Syrjälä @ 2017-09-21 11:14 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Thu, Sep 14, 2017 at 02:19:34PM +0100, Chris Wilson wrote:
> Remove the local recursive spinner in favour of igt_spin_t.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

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

> ---
>  tests/kms_cursor_legacy.c | 103 ++++------------------------------------------
>  1 file changed, 9 insertions(+), 94 deletions(-)
> 
> diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
> index 2d32d3a9..fb365f12 100644
> --- a/tests/kms_cursor_legacy.c
> +++ b/tests/kms_cursor_legacy.c
> @@ -490,92 +490,6 @@ enum basic_flip_cursor {
>  	FLIP_AFTER_CURSOR
>  };
>  
> -static uint32_t *make_busy(int fd, uint32_t target)
> -{
> -	const int gen = intel_gen(intel_get_drm_devid(fd));
> -	struct drm_i915_gem_exec_object2 obj[2];
> -	struct drm_i915_gem_relocation_entry reloc[2];
> -	struct drm_i915_gem_execbuffer2 execbuf;
> -	uint32_t *batch;
> -	int i;
> -
> -	memset(&execbuf, 0, sizeof(execbuf));
> -	execbuf.buffers_ptr = (uintptr_t)obj;
> -	execbuf.buffer_count = 2;
> -
> -	memset(obj, 0, sizeof(obj));
> -	obj[0].handle = target;
> -	obj[1].handle = gem_create(fd, 4096);
> -	batch = gem_mmap__wc(fd, obj[1].handle, 0, 4096, PROT_WRITE);
> -	gem_set_domain(fd, obj[1].handle,
> -			I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> -
> -
> -	obj[1].relocs_ptr = (uintptr_t)reloc;
> -	obj[1].relocation_count = 2;
> -	memset(reloc, 0, sizeof(reloc));
> -
> -	reloc[0].target_handle = obj[1].handle; /* recurse */
> -	reloc[0].presumed_offset = 0;
> -	reloc[0].offset = sizeof(uint32_t);
> -	reloc[0].delta = 0;
> -	reloc[0].read_domains = I915_GEM_DOMAIN_COMMAND;
> -	reloc[0].write_domain = 0;
> -
> -	reloc[1].target_handle = target;
> -	reloc[1].presumed_offset = 0;
> -	reloc[1].offset = 1024;
> -	reloc[1].delta = 0;
> -	reloc[1].read_domains = I915_GEM_DOMAIN_COMMAND;
> -	reloc[1].write_domain = I915_GEM_DOMAIN_COMMAND;
> -
> -	i = 0;
> -	batch[i] = MI_BATCH_BUFFER_START;
> -	if (gen >= 8) {
> -		batch[i] |= 1 << 8 | 1;
> -		batch[++i] = 0;
> -		batch[++i] = 0;
> -	} else if (gen >= 6) {
> -		batch[i] |= 1 << 8;
> -		batch[++i] = 0;
> -	} else {
> -		batch[i] |= 2 << 6;
> -		batch[++i] = 0;
> -		if (gen < 4) {
> -			batch[i] |= 1;
> -			reloc[0].delta = 1;
> -		}
> -	}
> -	i++;
> -
> -	gem_execbuf(fd, &execbuf);
> -	gem_close(fd, obj[1].handle);
> -
> -	return batch;
> -}
> -
> -static void cancel_busy(uint32_t *busy)
> -{
> -	*busy = MI_BATCH_BUFFER_END;
> -	munmap(busy, 4096);
> -}
> -
> -static uint32_t *
> -make_fb_busy(int fd, const struct igt_fb *fb)
> -{
> -	uint32_t *busy;
> -
> -	busy = make_busy(fd, fb->gem_handle);
> -	igt_assert(gem_bo_busy(fd, fb->gem_handle));
> -
> -	return busy;
> -}
> -
> -static void finish_fb_busy(uint32_t *busy)
> -{
> -	cancel_busy(busy);
> -}
> -
>  #define BASIC_BUSY 0x1
>  
>  static void basic_flip_cursor(igt_display_t *display,
> @@ -588,7 +502,7 @@ static void basic_flip_cursor(igt_display_t *display,
>  	struct igt_fb fb_info, cursor_fb, cursor_fb2, argb_fb;
>  	unsigned vblank_start;
>  	enum pipe pipe = find_connected_pipe(display, false);
> -	uint32_t *busy;
> +	igt_spin_t *spin;
>  	int i, miss1 = 0, miss2 = 0, delta;
>  
>  	if (mode >= flip_test_atomic)
> @@ -616,9 +530,9 @@ static void basic_flip_cursor(igt_display_t *display,
>  		/* Bind the cursor first to warm up */
>  		do_ioctl(display->drm_fd, DRM_IOCTL_MODE_CURSOR, &arg[0]);
>  
> -		busy = NULL;
> +		spin = NULL;
>  		if (flags & BASIC_BUSY)
> -			busy = make_fb_busy(display->drm_fd, &fb_info);
> +			spin = igt_spin_batch_new(display->drm_fd, 0, 0, fb_info.gem_handle);
>  
>  		/* Start with a synchronous query to align with the vblank */
>  		vblank_start = get_vblank(display->drm_fd, pipe, DRM_VBLANK_NEXTONMISS);
> @@ -660,10 +574,10 @@ static void basic_flip_cursor(igt_display_t *display,
>  
>  		delta = get_vblank(display->drm_fd, pipe, 0) - vblank_start;
>  
> -		if (busy) {
> +		if (spin) {
>  			struct pollfd pfd = { display->drm_fd, POLLIN };
>  			igt_assert(poll(&pfd, 1, 0) == 0);
> -			finish_fb_busy(busy);
> +			igt_spin_batch_free(display->drm_fd, spin);
>  		}
>  
>  		if (miss)
> @@ -1373,9 +1287,10 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
>  
>  	/* Disable cursor, and immediately queue a flip. Check if resulting crc is correct. */
>  	for (int i = 1; i >= 0; i--) {
> -		uint32_t *busy;
> +		igt_spin_t *spin;
>  
> -		busy = make_fb_busy(display->drm_fd, &fb_info[1]);
> +		spin = igt_spin_batch_new(display->drm_fd, 0, 0,
> +					  fb_info[1].gem_handle);
>  
>  		vblank_start = get_vblank(display->drm_fd, pipe, DRM_VBLANK_NEXTONMISS);
>  
> @@ -1386,7 +1301,7 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
>  
>  		igt_pipe_crc_collect_crc(pipe_crc, &crcs[2]);
>  
> -		finish_fb_busy(busy);
> +		igt_spin_batch_free(display->drm_fd, spin);
>  
>  		igt_set_timeout(1, "Stuck page flip");
>  		igt_ignore_warn(read(display->drm_fd, &vbl, sizeof(vbl)));
> -- 
> 2.14.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
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-09-21 11:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-14 13:19 [PATCH igt] igt/kms_cursor_legacy: Use common spinbatch Chris Wilson
2017-09-14 13:41 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-14 16:11 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-21 11:14 ` [PATCH igt] " Ville Syrjälä

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.