Skip to contentSkip to conversation

tests/kms_flip: Make panning tests actually pan all the time

PATCH New [email protected] 1 participant 1 message Jun 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/kms_flip: Make panning tests actually pan all the time

From: Ville Syrjälä <[email protected]>

Currently the panning tests actually stop panning when they hit the right edge fo the framebuffer. Let's make them ping-pong across the fb to make it clear that they are indeed trying to pan around all the time.

---
 tests/kms_flip.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tests/kms_flip.c +4 -1
index 14396d860c5e..ede5fd2ba9c5 100644
@@ -834,7 +834,10 @@ static unsigned int run_test_step(struct test_output *o)
 	if (o->flags & TEST_PAN) {
 		int count = do_flip ?
 			o->flip_state.count : o->vblank_state.count;
-		int x_ofs = min(count * 10, o->fb_width - o->kmode[0].hdisplay);
+		int width = o->fb_width - o->kmode[0].hdisplay;
+		int x_ofs = count * 10 % (2 * width);
+		if (x_ofs >= width)
+			x_ofs = 2 * width - x_ofs;
 
 		/* Make sure DSPSURF changes value */
 		if (o->flags & TEST_HANG)
Signature · 6 lines
2.13.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx