diff mbox

[i-g-t] igt/kms_vblank: Check if hangs are allowed

Message ID 20180712073142.21364-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson July 12, 2018, 7:31 a.m. UTC
Before running a hang test, check if we can inject a hang and expect
recover to work. If we can't control a hang, skip the subtest.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/kms_vblank.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Chris Wilson July 17, 2018, 11:51 a.m. UTC | #1
Quoting Chris Wilson (2018-07-12 08:31:42)
> Before running a hang test, check if we can inject a hang and expect
> recover to work. If we can't control a hang, skip the subtest.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Any takers?
-Chris

> ---
>  tests/kms_vblank.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
> index 2bee49de5..508c0fa03 100644
> --- a/tests/kms_vblank.c
> +++ b/tests/kms_vblank.c
> @@ -442,10 +442,14 @@ static void run_subtests_for_pipe(data_t *data)
>                         igt_subtest_f("pipe-%s-%s-%s-hang",
>                                       kmstest_pipe_name(data->pipe),
>                                       f->name, m->name) {
> +                               igt_hang_t hang;
> +
> +                               hang = igt_allow_hang(data->display.drm_fd, 0, 0);
>                                 for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
>                                         data->flags = m->flags;
>                                         run_test(data, f->func);
>                                 }
> +                               igt_disallow_hang(data->display.drm_fd, hang);
>                         }
>                 }
>         }
> -- 
> 2.18.0
>
Ville Syrjälä July 17, 2018, 12:08 p.m. UTC | #2
On Tue, Jul 17, 2018 at 12:51:55PM +0100, Chris Wilson wrote:
> Quoting Chris Wilson (2018-07-12 08:31:42)
> > Before running a hang test, check if we can inject a hang and expect
> > recover to work. If we can't control a hang, skip the subtest.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Any takers?

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

> -Chris
> 
> > ---
> >  tests/kms_vblank.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
> > index 2bee49de5..508c0fa03 100644
> > --- a/tests/kms_vblank.c
> > +++ b/tests/kms_vblank.c
> > @@ -442,10 +442,14 @@ static void run_subtests_for_pipe(data_t *data)
> >                         igt_subtest_f("pipe-%s-%s-%s-hang",
> >                                       kmstest_pipe_name(data->pipe),
> >                                       f->name, m->name) {
> > +                               igt_hang_t hang;
> > +
> > +                               hang = igt_allow_hang(data->display.drm_fd, 0, 0);
> >                                 for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
> >                                         data->flags = m->flags;
> >                                         run_test(data, f->func);
> >                                 }
> > +                               igt_disallow_hang(data->display.drm_fd, hang);
> >                         }
> >                 }
> >         }
> > -- 
> > 2.18.0
> > 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
Chris Wilson July 17, 2018, 12:26 p.m. UTC | #3
Quoting Ville Syrjälä (2018-07-17 13:08:01)
> On Tue, Jul 17, 2018 at 12:51:55PM +0100, Chris Wilson wrote:
> > Quoting Chris Wilson (2018-07-12 08:31:42)
> > > Before running a hang test, check if we can inject a hang and expect
> > > recover to work. If we can't control a hang, skip the subtest.
> > > 
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > 
> > Any takers?
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Ta. Gradually turning skl-iommu gray.
-Chris
diff mbox

Patch

diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 2bee49de5..508c0fa03 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -442,10 +442,14 @@  static void run_subtests_for_pipe(data_t *data)
 			igt_subtest_f("pipe-%s-%s-%s-hang",
 				      kmstest_pipe_name(data->pipe),
 				      f->name, m->name) {
+				igt_hang_t hang;
+
+				hang = igt_allow_hang(data->display.drm_fd, 0, 0);
 				for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
 					data->flags = m->flags;
 					run_test(data, f->func);
 				}
+				igt_disallow_hang(data->display.drm_fd, hang);
 			}
 		}
 	}