diff mbox

[i-g-t,2/2] tests/chamelium: Don't sleep so much in basic hpd tests

Message ID 20170223031833.13442-2-lyude@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lyude Paul Feb. 23, 2017, 3:18 a.m. UTC
Now that we can just disable HPD storm detection, there's no need to
sleep between each hotplug cycle.

Signed-off-by: Lyude <lyude@redhat.com>
---
 tests/chamelium.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Chris Wilson Feb. 23, 2017, 7:26 a.m. UTC | #1
On Wed, Feb 22, 2017 at 10:18:33PM -0500, Lyude wrote:
> Now that we can just disable HPD storm detection, there's no need to
> sleep between each hotplug cycle.
> 
> Signed-off-by: Lyude <lyude@redhat.com>
> ---
>  tests/chamelium.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/chamelium.c b/tests/chamelium.c
> index 849e1ac..810c955 100644
> --- a/tests/chamelium.c
> +++ b/tests/chamelium.c
> @@ -154,6 +154,7 @@ test_basic_hotplug(data_t *data, struct chamelium_port *port)
>  	int i;
>  
>  	reset_state(data, port);
> +	igt_hpd_storm_set_threshold(0);

You will want to check that you have the debugfs interface first and
skip the test otherwise. Or was there a fallback? Or is it already
checkd?
-Chris
Lyude Paul Feb. 23, 2017, 8:31 p.m. UTC | #2
On Thu, 2017-02-23 at 07:26 +0000, Chris Wilson wrote:
> On Wed, Feb 22, 2017 at 10:18:33PM -0500, Lyude wrote:
> > Now that we can just disable HPD storm detection, there's no need
> > to
> > sleep between each hotplug cycle.
> > 
> > Signed-off-by: Lyude <lyude@redhat.com>
> > ---
> >  tests/chamelium.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tests/chamelium.c b/tests/chamelium.c
> > index 849e1ac..810c955 100644
> > --- a/tests/chamelium.c
> > +++ b/tests/chamelium.c
> > @@ -154,6 +154,7 @@ test_basic_hotplug(data_t *data, struct
> > chamelium_port *port)
> >  	int i;
> >  
> >  	reset_state(data, port);
> > +	igt_hpd_storm_set_threshold(0);
> 
> You will want to check that you have the debugfs interface first and
> skip the test otherwise. Or was there a fallback? Or is it already
> checkd?
> 
> -Chris
If the debugfs interface isn't there, the function just doesn't do
anything and returns immediately

>
Chris Wilson Feb. 23, 2017, 10:53 p.m. UTC | #3
On Thu, Feb 23, 2017 at 03:31:09PM -0500, Lyude Paul wrote:
> On Thu, 2017-02-23 at 07:26 +0000, Chris Wilson wrote:
> > On Wed, Feb 22, 2017 at 10:18:33PM -0500, Lyude wrote:
> > > Now that we can just disable HPD storm detection, there's no need
> > > to
> > > sleep between each hotplug cycle.
> > > 
> > > Signed-off-by: Lyude <lyude@redhat.com>
> > > ---
> > >  tests/chamelium.c | 5 ++---
> > >  1 file changed, 2 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/tests/chamelium.c b/tests/chamelium.c
> > > index 849e1ac..810c955 100644
> > > --- a/tests/chamelium.c
> > > +++ b/tests/chamelium.c
> > > @@ -154,6 +154,7 @@ test_basic_hotplug(data_t *data, struct
> > > chamelium_port *port)
> > >  	int i;
> > >  
> > >  	reset_state(data, port);
> > > +	igt_hpd_storm_set_threshold(0);
> > 
> > You will want to check that you have the debugfs interface first and
> > skip the test otherwise. Or was there a fallback? Or is it already
> > checkd?
> > 
> > -Chris
> If the debugfs interface isn't there, the function just doesn't do
> anything and returns immediately

Ok, it just sounded like you depended upon the new feature and dropped
the old method.
-Chris
diff mbox

Patch

diff --git a/tests/chamelium.c b/tests/chamelium.c
index 849e1ac..810c955 100644
--- a/tests/chamelium.c
+++ b/tests/chamelium.c
@@ -154,6 +154,7 @@  test_basic_hotplug(data_t *data, struct chamelium_port *port)
 	int i;
 
 	reset_state(data, port);
+	igt_hpd_storm_set_threshold(0);
 
 	for (i = 0; i < 15; i++) {
 		igt_flush_hotplugs(mon);
@@ -171,12 +172,10 @@  test_basic_hotplug(data_t *data, struct chamelium_port *port)
 		igt_assert(igt_hotplug_detected(mon, HOTPLUG_TIMEOUT));
 		igt_assert_eq(reprobe_connector(data, port),
 			      DRM_MODE_DISCONNECTED);
-
-		/* Sleep so we don't accidentally cause an hpd storm */
-		usleep(500 * 1000);
 	}
 
 	igt_cleanup_hotplug(mon);
+	igt_hpd_storm_reset();
 }
 
 static void