[PATCH i-g-t 7/7] kms_cursor_crc: Add random cursor placement test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Antti Koskipaa <antti.koskipaa@xxxxxxxxxxxxxxx>
---
 tests/kms_cursor_crc.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 1e1d348..d461d72 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -208,6 +208,18 @@ static void test_crc_sliding(test_data_t *test_data)
 	}
 }
 
+static void test_crc_random(test_data_t *test_data)
+{
+	int i;
+
+	/* Random cursor placement */
+	for (i = 0; i < 50; i++) {
+		int x = rand() % (test_data->screenw + test_data->curw * 2) - test_data->curw;
+		int y = rand() % (test_data->screenh + test_data->curh * 2) - test_data->curh;
+		do_single_test(test_data, x, y);
+	}
+}
+
 static bool prepare_crtc(test_data_t *test_data, igt_output_t *output,
 			 int cursor_w, int cursor_h)
 {
@@ -353,6 +365,8 @@ static void run_test_generic(data_t *data, int cursor_max_size)
 			run_test(data, test_crc_offscreen, cursor_size, cursor_size);
 		igt_subtest_f("cursor-%s-sliding", c_size)
 			run_test(data, test_crc_sliding, cursor_size, cursor_size);
+		igt_subtest_f("cursor-%s-random", c_size)
+			run_test(data, test_crc_random, cursor_size, cursor_size);
 	}
 
 }
-- 
1.8.3.2

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux