gem_stress: option to override the number of rounds to complete

gem_stress -c 1

... sometimes takes a while to hit a problem.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2011-06-07 22:30:03 +02:00
parent e0532d4eb0
commit 9649dd7ef0
2 changed files with 10 additions and 3 deletions

View File

@ -617,7 +617,8 @@ static void parse_options(int argc, char **argv)
{"disable-render", 0, 0, 'r'},
{"untiled", 0, 0, 'u'},
{"x-tiled", 0, 0, 'x'},
{"use-cpu-maps", 0, 0, 'm'}
{"use-cpu-maps", 0, 0, 'm'},
{"rounds", 1, 0, 'o'},
};
options.scratch_buf_size = 256*4096;
@ -629,8 +630,9 @@ static void parse_options(int argc, char **argv)
options.use_blt = 1;
options.forced_tiling = -1;
options.use_cpu_maps = 0;
options.total_rounds = 512;
while((c = getopt_long(argc, argv, "ds:g:c:t:rbuxm",
while((c = getopt_long(argc, argv, "ds:g:c:t:rbuxmo:",
long_options, &option_index)) != -1) {
switch(c) {
case 'd':
@ -691,6 +693,10 @@ static void parse_options(int argc, char **argv)
options.forced_tiling = I915_TILING_NONE;
printf("disabling tiling\n");
break;
case 'o':
options.total_rounds = atoi(optarg);
printf("total rounds %i\n", options.total_rounds);
break;
default:
printf("unkown command options\n");
break;
@ -816,7 +822,7 @@ int main(int argc, char **argv)
fan_out();
for (i = 0; i < 512; i++) {
for (i = 0; i < options.total_rounds; i++) {
printf("round %i\n", i);
if (i % 64 == 63) {
fan_in_and_check();

View File

@ -36,6 +36,7 @@ struct option_struct {
int use_blt;
int forced_tiling;
int use_cpu_maps;
int total_rounds;
};
extern struct option_struct options;