-From ca0a8795495a3b99c841e5a91dfa5de5c56758c6 Mon Sep 17 00:00:00 2001
+From babcb3f7fdc53c25f2c525eea1704498a19c126d Mon Sep 17 00:00:00 2001
 From: Alejandro Hernandez <ajhernandez@ti.com>
-Date: Tue, 23 Sep 2014 09:30:24 -0400
+Date: Wed, 15 Mar 2017 14:25:20 -0400
 Subject: [PATCH] Add option to run a test indefinitely
 
 This patch adds option -t to the modetest cli. When this option is

 {
 	uint32_t handles[4] = {0}, pitches[4] = {0}, offsets[4] = {0};
 	unsigned int other_fb_id;
@@ -1258,7 +1258,7 @@ static void test_page_flip(struct device *dev, struct pipe_arg *pipes, unsigned
 			fprintf(stderr, "select timed out or error (ret %d)\n",
 				ret);
 			continue;
-		} else if (FD_ISSET(0, &fds)) {
+		} else if (!dont_stop && FD_ISSET(0, &fds)) {
 			break;
 		}
 #endif
@@ -1492,7 +1492,7 @@ static int pipe_resolve_connectors(struct device *dev, struct pipe_arg *pipe)
 	return 0;
 }
 

 	unsigned int prop_count = 0;
 	struct pipe_arg *pipe_args = NULL;
 	struct plane_arg *plane_args = NULL;
@@ -1599,6 +1600,10 @@ int main(int argc, char **argv)
 
 			prop_count++;
 			break;
+                case 't':
+			dont_stop = 1;
+			setvbuf(stdout, (char *)NULL, _IOLBF, 0);
+			break;
 		default:
 			usage(argv[0]);
 			break;
@@ -1671,7 +1676,7 @@ int main(int argc, char **argv)
 			set_cursors(&dev, pipe_args, count);
 
 		if (test_vsync)
