All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion
@ 2017-08-14 20:32 Daniel Vetter
  2017-08-14 20:43 ` Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Daniel Vetter @ 2017-08-14 20:32 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Tomeu Vizoso

The goal of these subtests was just to delay a kms operation a little
bit. The goal wasn't to
- spin until the operation was completed. That results in a gpu hang,
  and gpu hangs need igt_hang for safety.
- complete it before the operation. That's just pointless.

Fix it by using the timeout support.

This was all broken in the initial conversation:

commit 96ec8cb3b5ec1fc2927d6cff8e09930082301d7e
Author: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Date:   Sat Oct 29 01:01:05 2016 +0300

    igt/kms_flip: Use new igt_spin_batch

Note that part of the damage was removed already in

commit b0081ea9cb7d39234fd0fcc64dd56ed4f5d50b05
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Wed Aug 9 11:11:52 2017 +0200

    tests/kms_flip: Remove $engine-flip-vs-dpms/modeset

Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/kms_flip.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index ea860e191a67..6d315b3793a8 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -693,13 +693,19 @@ static unsigned int run_test_step(struct test_output *o)
 	if (!(o->flags & TEST_SINGLE_BUFFER))
 		o->current_fb_id = !o->current_fb_id;
 
-	if (o->flags & TEST_WITH_DUMMY_BCS)
+	if (o->flags & TEST_WITH_DUMMY_BCS) {
 		spin_bcs = igt_spin_batch_new(drm_fd, I915_EXEC_BLT,
 					      o->fb_info[o->current_fb_id].gem_handle);
+		igt_spin_batch_set_timeout(spin_bcs,
+					   1000*1000*1000);
+	}
 
-	if (o->flags & TEST_WITH_DUMMY_RCS)
+	if (o->flags & TEST_WITH_DUMMY_RCS) {
 		spin_rcs = igt_spin_batch_new(drm_fd, I915_EXEC_RENDER,
 					      o->fb_info[o->current_fb_id].gem_handle);
+		igt_spin_batch_set_timeout(spin_rcs,
+					   1000*1000*1000);
+	}
 
 	if (o->flags & TEST_FB_RECREATE)
 		recreate_fb(o);
@@ -789,13 +795,8 @@ static unsigned int run_test_step(struct test_output *o)
 		igt_assert(__wait_for_vblank(TEST_VBLANK_BLOCK, o->pipe, 1, 0, &reply) == 0);
 	}
 
-	if (do_flip) {
+	if (do_flip)
 		do_or_die(do_page_flip(o, new_fb_id, !(o->flags & TEST_NOEVENT)));
-		if (spin_rcs)
-			igt_spin_batch_end(spin_rcs);
-		if (spin_bcs)
-			igt_spin_batch_end(spin_bcs);
-	}
 
 	if (o->flags & TEST_FENCE_STRESS)
 		emit_fence_stress(o);
@@ -809,10 +810,6 @@ static unsigned int run_test_step(struct test_output *o)
 				      vbl_reply.ts.tv_usec);
 			completed_events = EVENT_VBLANK;
 		}
-		if (spin_rcs)
-			igt_spin_batch_end(spin_rcs);
-		if (spin_bcs)
-			igt_spin_batch_end(spin_bcs);
 	}
 	if (spin_rcs)
 		igt_spin_batch_free(drm_fd, spin_rcs);
-- 
2.5.5

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

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

* Re: [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion
  2017-08-14 20:32 [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion Daniel Vetter
@ 2017-08-14 20:43 ` Chris Wilson
  2017-08-14 20:50 ` Chris Wilson
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2017-08-14 20:43 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Tomeu Vizoso

Quoting Daniel Vetter (2017-08-14 21:32:00)
> The goal of these subtests was just to delay a kms operation a little
> bit. The goal wasn't to
> - spin until the operation was completed. That results in a gpu hang,
>   and gpu hangs need igt_hang for safety.
> - complete it before the operation. That's just pointless.

It didn't use the arbitrary timeout to avoid the race condition of it
finishing before the flip was queued.
 
> Fix it by using the timeout support.

Find the path that was broken and fix it. At a guess just the pair of
TEST_DPMS need to consider how exactly they want to interact with the
busy fb.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion
  2017-08-14 20:32 [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion Daniel Vetter
  2017-08-14 20:43 ` Chris Wilson
@ 2017-08-14 20:50 ` Chris Wilson
  2017-08-15  8:05   ` Daniel Vetter
  2017-08-14 21:04 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-08-15  7:29 ` [PATCH i-g-t] " Maarten Lankhorst
  3 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2017-08-14 20:50 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Tomeu Vizoso

Quoting Daniel Vetter (2017-08-14 21:32:00)
> The goal of these subtests was just to delay a kms operation a little
> bit. The goal wasn't to
> - spin until the operation was completed. That results in a gpu hang,
>   and gpu hangs need igt_hang for safety.
> - complete it before the operation. That's just pointless.
> 
> Fix it by using the timeout support.
> 
> This was all broken in the initial conversation:
> 
> commit 96ec8cb3b5ec1fc2927d6cff8e09930082301d7e
> Author: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> Date:   Sat Oct 29 01:01:05 2016 +0300
> 
>     igt/kms_flip: Use new igt_spin_batch
> 
> Note that part of the damage was removed already in

Ah no, that patch removed the timeouts! I remember there being
set_timeout in there and was baffled to see them gone.

Indeed, the breakage is 

> commit b0081ea9cb7d39234fd0fcc64dd56ed4f5d50b05
> Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Date:   Wed Aug 9 11:11:52 2017 +0200
> 
>     tests/kms_flip: Remove $engine-flip-vs-dpms/modeset


due to

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index ede5fd2b..ea860e19 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -755,13 +755,8 @@ static unsigned int run_test_step(struct test_output *o)
        if (o->flags & TEST_MODESET)
                igt_assert(set_mode(o, o->fb_ids[o->current_fb_id], 0, 0) == 0);
 
-       if (o->flags & TEST_DPMS) {
-               if (spin_rcs)
-                       igt_spin_batch_set_timeout(spin_rcs, NSEC_PER_SEC);
-               if (spin_bcs)
-                       igt_spin_batch_set_timeout(spin_bcs, NSEC_PER_SEC);
+       if (o->flags & TEST_DPMS)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for tests/kms_flip: fix spin_batch conversion
  2017-08-14 20:32 [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion Daniel Vetter
  2017-08-14 20:43 ` Chris Wilson
  2017-08-14 20:50 ` Chris Wilson
@ 2017-08-14 21:04 ` Patchwork
  2017-08-15  7:29 ` [PATCH i-g-t] " Maarten Lankhorst
  3 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-08-14 21:04 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: tests/kms_flip: fix spin_batch conversion
URL   : https://patchwork.freedesktop.org/series/28765/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
3685dabb0ab25eb1bc2df867f749701777153056 igt/gem_exec_fence: Exercise syncobj API

with latest DRM-Tip kernel build CI_DRM_2961
7906e62b6a40 drm-tip: 2017y-08m-14d-17h-43m-51s UTC integration manifest

fi-bdw-5557u     total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:452s
fi-bsw-n3050     total:279  pass:243  dwarn:0   dfail:0   fail:0   skip:36  time:542s
fi-bxt-j4205     total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:511s
fi-byt-j1900     total:279  pass:254  dwarn:1   dfail:0   fail:0   skip:24  time:519s
fi-byt-n2820     total:279  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:511s
fi-glk-2a        total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:601s
fi-hsw-4770r     total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:422s
fi-ivb-3520m     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:502s
fi-kbl-7560u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:585s
fi-pnv-d510      total:279  pass:223  dwarn:1   dfail:0   fail:0   skip:55  time:526s
fi-skl-6700k     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:466s

== Logs ==

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

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

* Re: [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion
  2017-08-14 20:32 [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion Daniel Vetter
                   ` (2 preceding siblings ...)
  2017-08-14 21:04 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-08-15  7:29 ` Maarten Lankhorst
  3 siblings, 0 replies; 8+ messages in thread
From: Maarten Lankhorst @ 2017-08-15  7:29 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics Development; +Cc: Tomeu Vizoso

Op 14-08-17 om 22:32 schreef Daniel Vetter:
> The goal of these subtests was just to delay a kms operation a little
> bit. The goal wasn't to
> - spin until the operation was completed. That results in a gpu hang,
>   and gpu hangs need igt_hang for safety.
> - complete it before the operation. That's just pointless.
>
> Fix it by using the timeout support.
>
> This was all broken in the initial conversation:
>
> commit 96ec8cb3b5ec1fc2927d6cff8e09930082301d7e
> Author: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> Date:   Sat Oct 29 01:01:05 2016 +0300
>
>     igt/kms_flip: Use new igt_spin_batch
>
> Note that part of the damage was removed already in
>
> commit b0081ea9cb7d39234fd0fcc64dd56ed4f5d50b05
> Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Date:   Wed Aug 9 11:11:52 2017 +0200
>
>     tests/kms_flip: Remove $engine-flip-vs-dpms/modeset
>
> Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  tests/kms_flip.c | 21 +++++++++------------
>  1 file changed, 9 insertions(+), 12 deletions(-)
Use the NSEC_PER_SEC macro for readability?

Otherwise looks sane..

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> diff --git a/tests/kms_flip.c b/tests/kms_flip.c
> index ea860e191a67..6d315b3793a8 100644
> --- a/tests/kms_flip.c
> +++ b/tests/kms_flip.c
> @@ -693,13 +693,19 @@ static unsigned int run_test_step(struct test_output *o)
>  	if (!(o->flags & TEST_SINGLE_BUFFER))
>  		o->current_fb_id = !o->current_fb_id;
>  
> -	if (o->flags & TEST_WITH_DUMMY_BCS)
> +	if (o->flags & TEST_WITH_DUMMY_BCS) {
>  		spin_bcs = igt_spin_batch_new(drm_fd, I915_EXEC_BLT,
>  					      o->fb_info[o->current_fb_id].gem_handle);
> +		igt_spin_batch_set_timeout(spin_bcs,
> +					   1000*1000*1000);
> +	}
>  
> -	if (o->flags & TEST_WITH_DUMMY_RCS)
> +	if (o->flags & TEST_WITH_DUMMY_RCS) {
>  		spin_rcs = igt_spin_batch_new(drm_fd, I915_EXEC_RENDER,
>  					      o->fb_info[o->current_fb_id].gem_handle);
> +		igt_spin_batch_set_timeout(spin_rcs,
> +					   1000*1000*1000);
> +	}
>  
>  	if (o->flags & TEST_FB_RECREATE)
>  		recreate_fb(o);
> @@ -789,13 +795,8 @@ static unsigned int run_test_step(struct test_output *o)
>  		igt_assert(__wait_for_vblank(TEST_VBLANK_BLOCK, o->pipe, 1, 0, &reply) == 0);
>  	}
>  
> -	if (do_flip) {
> +	if (do_flip)
>  		do_or_die(do_page_flip(o, new_fb_id, !(o->flags & TEST_NOEVENT)));
> -		if (spin_rcs)
> -			igt_spin_batch_end(spin_rcs);
> -		if (spin_bcs)
> -			igt_spin_batch_end(spin_bcs);
> -	}
>  
>  	if (o->flags & TEST_FENCE_STRESS)
>  		emit_fence_stress(o);
> @@ -809,10 +810,6 @@ static unsigned int run_test_step(struct test_output *o)
>  				      vbl_reply.ts.tv_usec);
>  			completed_events = EVENT_VBLANK;
>  		}
> -		if (spin_rcs)
> -			igt_spin_batch_end(spin_rcs);
> -		if (spin_bcs)
> -			igt_spin_batch_end(spin_bcs);
>  	}
>  	if (spin_rcs)
>  		igt_spin_batch_free(drm_fd, spin_rcs);


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

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

* Re: [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion
  2017-08-14 20:50 ` Chris Wilson
@ 2017-08-15  8:05   ` Daniel Vetter
  2017-08-15  8:08     ` Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2017-08-15  8:05 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, Intel Graphics Development, Tomeu Vizoso

On Mon, Aug 14, 2017 at 09:50:01PM +0100, Chris Wilson wrote:
> Quoting Daniel Vetter (2017-08-14 21:32:00)
> > The goal of these subtests was just to delay a kms operation a little
> > bit. The goal wasn't to
> > - spin until the operation was completed. That results in a gpu hang,
> >   and gpu hangs need igt_hang for safety.
> > - complete it before the operation. That's just pointless.
> > 
> > Fix it by using the timeout support.
> > 
> > This was all broken in the initial conversation:
> > 
> > commit 96ec8cb3b5ec1fc2927d6cff8e09930082301d7e
> > Author: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> > Date:   Sat Oct 29 01:01:05 2016 +0300
> > 
> >     igt/kms_flip: Use new igt_spin_batch
> > 
> > Note that part of the damage was removed already in
> 
> Ah no, that patch removed the timeouts! I remember there being
> set_timeout in there and was baffled to see them gone.
> 
> Indeed, the breakage is 
> 
> > commit b0081ea9cb7d39234fd0fcc64dd56ed4f5d50b05
> > Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Date:   Wed Aug 9 11:11:52 2017 +0200
> > 
> >     tests/kms_flip: Remove $engine-flip-vs-dpms/modeset
> 
> 
> due to
> 
> diff --git a/tests/kms_flip.c b/tests/kms_flip.c
> index ede5fd2b..ea860e19 100644
> --- a/tests/kms_flip.c
> +++ b/tests/kms_flip.c
> @@ -755,13 +755,8 @@ static unsigned int run_test_step(struct test_output *o)
>         if (o->flags & TEST_MODESET)
>                 igt_assert(set_mode(o, o->fb_ids[o->current_fb_id], 0, 0) == 0);
>  
> -       if (o->flags & TEST_DPMS) {
> -               if (spin_rcs)
> -                       igt_spin_batch_set_timeout(spin_rcs, NSEC_PER_SEC);
> -               if (spin_bcs)
> -                       igt_spin_batch_set_timeout(spin_bcs, NSEC_PER_SEC);
> +       if (o->flags & TEST_DPMS)

This doesn't fix the case where TEST_DPMS is not set. I seen hangs
everywhere, because we only stop the spinning _after_ the operation is
completed. The only way for the operation to complete is by a gpu reset,
and resetting a live spinner on snb blt is not a good idea (it kills the
box eventually).

And yes there's a a race with just setting a timeout, but we have other
checks that make sure an atomic flip doesn't take one full second. So I
don't think the race is relevant in practice for testing (because it would
indicate a broken kernel, and we catch those bugs already).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion
  2017-08-15  8:05   ` Daniel Vetter
@ 2017-08-15  8:08     ` Daniel Vetter
  2017-08-16  9:45       ` Chris Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2017-08-15  8:08 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, Intel Graphics Development, Tomeu Vizoso

On Tue, Aug 15, 2017 at 10:05:42AM +0200, Daniel Vetter wrote:
> On Mon, Aug 14, 2017 at 09:50:01PM +0100, Chris Wilson wrote:
> > Quoting Daniel Vetter (2017-08-14 21:32:00)
> > > The goal of these subtests was just to delay a kms operation a little
> > > bit. The goal wasn't to
> > > - spin until the operation was completed. That results in a gpu hang,
> > >   and gpu hangs need igt_hang for safety.
> > > - complete it before the operation. That's just pointless.
> > > 
> > > Fix it by using the timeout support.
> > > 
> > > This was all broken in the initial conversation:
> > > 
> > > commit 96ec8cb3b5ec1fc2927d6cff8e09930082301d7e
> > > Author: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> > > Date:   Sat Oct 29 01:01:05 2016 +0300
> > > 
> > >     igt/kms_flip: Use new igt_spin_batch
> > > 
> > > Note that part of the damage was removed already in
> > 
> > Ah no, that patch removed the timeouts! I remember there being
> > set_timeout in there and was baffled to see them gone.
> > 
> > Indeed, the breakage is 
> > 
> > > commit b0081ea9cb7d39234fd0fcc64dd56ed4f5d50b05
> > > Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > Date:   Wed Aug 9 11:11:52 2017 +0200
> > > 
> > >     tests/kms_flip: Remove $engine-flip-vs-dpms/modeset
> > 
> > 
> > due to
> > 
> > diff --git a/tests/kms_flip.c b/tests/kms_flip.c
> > index ede5fd2b..ea860e19 100644
> > --- a/tests/kms_flip.c
> > +++ b/tests/kms_flip.c
> > @@ -755,13 +755,8 @@ static unsigned int run_test_step(struct test_output *o)
> >         if (o->flags & TEST_MODESET)
> >                 igt_assert(set_mode(o, o->fb_ids[o->current_fb_id], 0, 0) == 0);
> >  
> > -       if (o->flags & TEST_DPMS) {
> > -               if (spin_rcs)
> > -                       igt_spin_batch_set_timeout(spin_rcs, NSEC_PER_SEC);
> > -               if (spin_bcs)
> > -                       igt_spin_batch_set_timeout(spin_bcs, NSEC_PER_SEC);
> > +       if (o->flags & TEST_DPMS)
> 
> This doesn't fix the case where TEST_DPMS is not set. I seen hangs
> everywhere, because we only stop the spinning _after_ the operation is
> completed. The only way for the operation to complete is by a gpu reset,
> and resetting a live spinner on snb blt is not a good idea (it kills the
> box eventually).
> 
> And yes there's a a race with just setting a timeout, but we have other
> checks that make sure an atomic flip doesn't take one full second. So I
> don't think the race is relevant in practice for testing (because it would
> indicate a broken kernel, and we catch those bugs already).

Correction: The patch from Maarten did indeed break stuff even more,
because it removed code that wasn't dead yet (since it didn't remove all
the DPMS vs spin tests). But the breakage I'm trying to fix is older, and
goes back to Abdiel's patch. I'll augment the commit message to explain
this better.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion
  2017-08-15  8:08     ` Daniel Vetter
@ 2017-08-16  9:45       ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2017-08-16  9:45 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, Tomeu Vizoso

Quoting Daniel Vetter (2017-08-15 09:08:01)
> On Tue, Aug 15, 2017 at 10:05:42AM +0200, Daniel Vetter wrote:
> > On Mon, Aug 14, 2017 at 09:50:01PM +0100, Chris Wilson wrote:
> > > Quoting Daniel Vetter (2017-08-14 21:32:00)
> > > > The goal of these subtests was just to delay a kms operation a little
> > > > bit. The goal wasn't to
> > > > - spin until the operation was completed. That results in a gpu hang,
> > > >   and gpu hangs need igt_hang for safety.
> > > > - complete it before the operation. That's just pointless.
> > > > 
> > > > Fix it by using the timeout support.
> > > > 
> > > > This was all broken in the initial conversation:
> > > > 
> > > > commit 96ec8cb3b5ec1fc2927d6cff8e09930082301d7e
> > > > Author: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> > > > Date:   Sat Oct 29 01:01:05 2016 +0300
> > > > 
> > > >     igt/kms_flip: Use new igt_spin_batch
> > > > 
> > > > Note that part of the damage was removed already in
> > > 
> > > Ah no, that patch removed the timeouts! I remember there being
> > > set_timeout in there and was baffled to see them gone.
> > > 
> > > Indeed, the breakage is 
> > > 
> > > > commit b0081ea9cb7d39234fd0fcc64dd56ed4f5d50b05
> > > > Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > > Date:   Wed Aug 9 11:11:52 2017 +0200
> > > > 
> > > >     tests/kms_flip: Remove $engine-flip-vs-dpms/modeset
> > > 
> > > 
> > > due to
> > > 
> > > diff --git a/tests/kms_flip.c b/tests/kms_flip.c
> > > index ede5fd2b..ea860e19 100644
> > > --- a/tests/kms_flip.c
> > > +++ b/tests/kms_flip.c
> > > @@ -755,13 +755,8 @@ static unsigned int run_test_step(struct test_output *o)
> > >         if (o->flags & TEST_MODESET)
> > >                 igt_assert(set_mode(o, o->fb_ids[o->current_fb_id], 0, 0) == 0);
> > >  
> > > -       if (o->flags & TEST_DPMS) {
> > > -               if (spin_rcs)
> > > -                       igt_spin_batch_set_timeout(spin_rcs, NSEC_PER_SEC);
> > > -               if (spin_bcs)
> > > -                       igt_spin_batch_set_timeout(spin_bcs, NSEC_PER_SEC);
> > > +       if (o->flags & TEST_DPMS)
> > 
> > This doesn't fix the case where TEST_DPMS is not set. I seen hangs
> > everywhere, because we only stop the spinning _after_ the operation is
> > completed. The only way for the operation to complete is by a gpu reset,
> > and resetting a live spinner on snb blt is not a good idea (it kills the
> > box eventually).
> > 
> > And yes there's a a race with just setting a timeout, but we have other
> > checks that make sure an atomic flip doesn't take one full second. So I
> > don't think the race is relevant in practice for testing (because it would
> > indicate a broken kernel, and we catch those bugs already).
> 
> Correction: The patch from Maarten did indeed break stuff even more,
> because it removed code that wasn't dead yet (since it didn't remove all
> the DPMS vs spin tests). But the breakage I'm trying to fix is older, and
> goes back to Abdiel's patch. I'll augment the commit message to explain
> this better.

Nope, your commit message is still wrong. And you have not addressed the
underlying issue. If you looked at the patch I sent for this last
week...
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-08-16  9:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-14 20:32 [PATCH i-g-t] tests/kms_flip: fix spin_batch conversion Daniel Vetter
2017-08-14 20:43 ` Chris Wilson
2017-08-14 20:50 ` Chris Wilson
2017-08-15  8:05   ` Daniel Vetter
2017-08-15  8:08     ` Daniel Vetter
2017-08-16  9:45       ` Chris Wilson
2017-08-14 21:04 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-08-15  7:29 ` [PATCH i-g-t] " Maarten Lankhorst

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.