diff mbox

[i-g-t,2/2] tests/kms_chv_cursor_fail: Run the tests with fewer steps.

Message ID 1465385132-17605-2-git-send-email-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst June 8, 2016, 11:25 a.m. UTC
This reduces the runtime of the tests from ~200s on my 30 fps 4k panel
to 10s.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_chv_cursor_fail.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

Comments

Ville Syrjälä June 8, 2016, 1:12 p.m. UTC | #1
On Wed, Jun 08, 2016 at 01:25:32PM +0200, Maarten Lankhorst wrote:
> This reduces the runtime of the tests from ~200s on my 30 fps 4k panel
> to 10s.

Does it still find the problem reliably on CHV pipe C (if you remove the
kernel w/a)?

> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  tests/kms_chv_cursor_fail.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/kms_chv_cursor_fail.c b/tests/kms_chv_cursor_fail.c
> index 11d01f54e511..8f878cbffe96 100644
> --- a/tests/kms_chv_cursor_fail.c
> +++ b/tests/kms_chv_cursor_fail.c
> @@ -109,24 +109,26 @@ static void cursor_move(data_t *data, int x, int y, int i)
>  }
>  
>  #define XSTEP 8
> -#define YSTEP 32
> -#define XOFF 0
> +#define YSTEP 8
>  #define NCRC 128
>  
>  static void test_edge_pos(data_t *data, int sx, int ex, int y, bool swap_axis)
>  {
>  	igt_crc_t *crc = NULL;
> -	int i, n, x, xdir;
> +	int i, n, x, xdir, dx;
>  
>  	if (sx > ex)
>  		xdir = -1;
>  	else
>  		xdir = 1;
>  
> +	dx = (ex - sx)/XSTEP;
> +
>  	igt_pipe_crc_start(data->pipe_crc);
>  
>  	i = 0;
> -	for (x = sx + XOFF; xdir * (x - ex - XOFF) <= 0; x += xdir * XSTEP) {
> +
> +	for (x = sx; xdir * (x - ex) <= 0; x += dx) {
>  		int xx, yy;
>  
>  		if (swap_axis) {
> @@ -168,21 +170,23 @@ static void test_edge_pos(data_t *data, int sx, int ex, int y, bool swap_axis)
>  static void test_edge(data_t *data, int sy, int ey, int sx, int ex, bool swap_axis)
>  {
>  	int crtc_id = data->output->config.crtc->crtc_id;
> -	int y, ydir;
> +	int y, ydir, dy;
>  
>  	if (sy > ey)
>  		ydir = -1;
>  	else
>  		ydir = 1;
>  
> +	dy = (ey - sy) / YSTEP;
> +
>  	igt_assert_eq(drmModeMoveCursor(data->drm_fd, crtc_id, -data->curw, -data->curh), 0);
>  	igt_assert_eq(drmModeSetCursor(data->drm_fd, crtc_id, data->fb.gem_handle, data->curw, data->curh), 0);
>  
>  	for (y = sy; ydir * (y - ey) <= 0; ) {
>  		test_edge_pos(data, sx, ex, y, swap_axis);
> -		y += ydir * YSTEP;
> +		y += dy;
>  		test_edge_pos(data, ex, sx, y, swap_axis);
> -		y += ydir * YSTEP;
> +		y += dy;
>  	}
>  
>  	igt_assert_eq(drmModeMoveCursor(data->drm_fd, crtc_id, -data->curw, -data->curh), 0);
> -- 
> 2.5.5
Maarten Lankhorst June 8, 2016, 1:23 p.m. UTC | #2
Op 08-06-16 om 15:12 schreef Ville Syrjälä:
> On Wed, Jun 08, 2016 at 01:25:32PM +0200, Maarten Lankhorst wrote:
>> This reduces the runtime of the tests from ~200s on my 30 fps 4k panel
>> to 10s.
> Does it still find the problem reliably on CHV pipe C (if you remove the
> kernel w/a)?
Yeah, a single coordinate is enough to trigger the fifo underrun. Rest is probably still slightly overkill. :)

~Maarten
Ville Syrjälä June 8, 2016, 1:35 p.m. UTC | #3
On Wed, Jun 08, 2016 at 03:23:33PM +0200, Maarten Lankhorst wrote:
> Op 08-06-16 om 15:12 schreef Ville Syrjälä:
> > On Wed, Jun 08, 2016 at 01:25:32PM +0200, Maarten Lankhorst wrote:
> >> This reduces the runtime of the tests from ~200s on my 30 fps 4k panel
> >> to 10s.
> > Does it still find the problem reliably on CHV pipe C (if you remove the
> > kernel w/a)?
> Yeah, a single coordinate is enough to trigger the fifo underrun. Rest is probably still slightly overkill. :)

Hmm. IIRC it wasn't quite that easy to trigger on my CHV. Sometime
it survived for a few iterations. But I'm too lazy to retest it now,
so I'll take your word for it.
Maarten Lankhorst June 8, 2016, 2:47 p.m. UTC | #4
Op 08-06-16 om 15:35 schreef Ville Syrjälä:
> On Wed, Jun 08, 2016 at 03:23:33PM +0200, Maarten Lankhorst wrote:
>> Op 08-06-16 om 15:12 schreef Ville Syrjälä:
>>> On Wed, Jun 08, 2016 at 01:25:32PM +0200, Maarten Lankhorst wrote:
>>>> This reduces the runtime of the tests from ~200s on my 30 fps 4k panel
>>>> to 10s.
>>> Does it still find the problem reliably on CHV pipe C (if you remove the
>>> kernel w/a)?
>> Yeah, a single coordinate is enough to trigger the fifo underrun. Rest is probably still slightly overkill. :)
> Hmm. IIRC it wasn't quite that easy to trigger on my CHV. Sometime
> it survived for a few iterations. But I'm too lazy to retest it now,
> so I'll take your word for it.
>
Weird, even kms_cursor_crc random test triggered it for me on the first try with negative coordinates.

~Maarten
Ville Syrjälä June 8, 2016, 2:52 p.m. UTC | #5
On Wed, Jun 08, 2016 at 04:47:48PM +0200, Maarten Lankhorst wrote:
> Op 08-06-16 om 15:35 schreef Ville Syrjälä:
> > On Wed, Jun 08, 2016 at 03:23:33PM +0200, Maarten Lankhorst wrote:
> >> Op 08-06-16 om 15:12 schreef Ville Syrjälä:
> >>> On Wed, Jun 08, 2016 at 01:25:32PM +0200, Maarten Lankhorst wrote:
> >>>> This reduces the runtime of the tests from ~200s on my 30 fps 4k panel
> >>>> to 10s.
> >>> Does it still find the problem reliably on CHV pipe C (if you remove the
> >>> kernel w/a)?
> >> Yeah, a single coordinate is enough to trigger the fifo underrun. Rest is probably still slightly overkill. :)
> > Hmm. IIRC it wasn't quite that easy to trigger on my CHV. Sometime
> > it survived for a few iterations. But I'm too lazy to retest it now,
> > so I'll take your word for it.
> >
> Weird, even kms_cursor_crc random test triggered it for me on the first try with negative coordinates.

Might be that I'm only recalling the visual feedback. That is, maybe I
sometimes failed to see the underrun even though it did happen.
Maarten Lankhorst June 13, 2016, 1:45 p.m. UTC | #6
Op 08-06-16 om 16:52 schreef Ville Syrjälä:
> On Wed, Jun 08, 2016 at 04:47:48PM +0200, Maarten Lankhorst wrote:
>> Op 08-06-16 om 15:35 schreef Ville Syrjälä:
>>> On Wed, Jun 08, 2016 at 03:23:33PM +0200, Maarten Lankhorst wrote:
>>>> Op 08-06-16 om 15:12 schreef Ville Syrjälä:
>>>>> On Wed, Jun 08, 2016 at 01:25:32PM +0200, Maarten Lankhorst wrote:
>>>>>> This reduces the runtime of the tests from ~200s on my 30 fps 4k panel
>>>>>> to 10s.
>>>>> Does it still find the problem reliably on CHV pipe C (if you remove the
>>>>> kernel w/a)?
>>>> Yeah, a single coordinate is enough to trigger the fifo underrun. Rest is probably still slightly overkill. :)
>>> Hmm. IIRC it wasn't quite that easy to trigger on my CHV. Sometime
>>> it survived for a few iterations. But I'm too lazy to retest it now,
>>> so I'll take your word for it.
>>>
>> Weird, even kms_cursor_crc random test triggered it for me on the first try with negative coordinates.
> Might be that I'm only recalling the visual feedback. That is, maybe I
> sometimes failed to see the underrun even though it did happen.
>
Can I take this as a r-b?
diff mbox

Patch

diff --git a/tests/kms_chv_cursor_fail.c b/tests/kms_chv_cursor_fail.c
index 11d01f54e511..8f878cbffe96 100644
--- a/tests/kms_chv_cursor_fail.c
+++ b/tests/kms_chv_cursor_fail.c
@@ -109,24 +109,26 @@  static void cursor_move(data_t *data, int x, int y, int i)
 }
 
 #define XSTEP 8
-#define YSTEP 32
-#define XOFF 0
+#define YSTEP 8
 #define NCRC 128
 
 static void test_edge_pos(data_t *data, int sx, int ex, int y, bool swap_axis)
 {
 	igt_crc_t *crc = NULL;
-	int i, n, x, xdir;
+	int i, n, x, xdir, dx;
 
 	if (sx > ex)
 		xdir = -1;
 	else
 		xdir = 1;
 
+	dx = (ex - sx)/XSTEP;
+
 	igt_pipe_crc_start(data->pipe_crc);
 
 	i = 0;
-	for (x = sx + XOFF; xdir * (x - ex - XOFF) <= 0; x += xdir * XSTEP) {
+
+	for (x = sx; xdir * (x - ex) <= 0; x += dx) {
 		int xx, yy;
 
 		if (swap_axis) {
@@ -168,21 +170,23 @@  static void test_edge_pos(data_t *data, int sx, int ex, int y, bool swap_axis)
 static void test_edge(data_t *data, int sy, int ey, int sx, int ex, bool swap_axis)
 {
 	int crtc_id = data->output->config.crtc->crtc_id;
-	int y, ydir;
+	int y, ydir, dy;
 
 	if (sy > ey)
 		ydir = -1;
 	else
 		ydir = 1;
 
+	dy = (ey - sy) / YSTEP;
+
 	igt_assert_eq(drmModeMoveCursor(data->drm_fd, crtc_id, -data->curw, -data->curh), 0);
 	igt_assert_eq(drmModeSetCursor(data->drm_fd, crtc_id, data->fb.gem_handle, data->curw, data->curh), 0);
 
 	for (y = sy; ydir * (y - ey) <= 0; ) {
 		test_edge_pos(data, sx, ex, y, swap_axis);
-		y += ydir * YSTEP;
+		y += dy;
 		test_edge_pos(data, ex, sx, y, swap_axis);
-		y += ydir * YSTEP;
+		y += dy;
 	}
 
 	igt_assert_eq(drmModeMoveCursor(data->drm_fd, crtc_id, -data->curw, -data->curh), 0);