mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-13 02:46:23 +00:00
tests: run igt.cocci
Re-run with correct igt_fail rules. Again manually fixup missing includes for igt_core.h. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
87042d671f
commit
c9c554594e
@ -618,16 +618,8 @@ int main(void)
|
|||||||
unsigned r2, n2, p;
|
unsigned r2, n2, p;
|
||||||
|
|
||||||
wrpll_compute_rnp(ref->clock, &r2, &n2, &p);
|
wrpll_compute_rnp(ref->clock, &r2, &n2, &p);
|
||||||
if (ref->r2 != r2 || ref->n2 != n2 || ref->p != p) {
|
igt_fail_on_f(ref->r2 != r2 || ref->n2 != n2 || ref->p != p,
|
||||||
printf("Computed value differs for %li Hz:\n"
|
"Computed value differs for %li Hz:\n"" Reference: (%u,%u,%u)\n"" Computed: (%u,%u,%u)\n", (int64_t)ref->clock * 1000, ref->r2, ref->n2, ref->p, r2, n2, p);
|
||||||
" Reference: (%u,%u,%u)\n"
|
|
||||||
" Computed: (%u,%u,%u)\n",
|
|
||||||
(int64_t)ref->clock * 1000,
|
|
||||||
ref->r2, ref->n2, ref->p,
|
|
||||||
r2, n2, p);
|
|
||||||
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -118,17 +118,11 @@ static void _assert_dfs_entry(const char *fname, const char *s, bool inverse)
|
|||||||
|
|
||||||
read_dfs(fname, tmp, l + 1);
|
read_dfs(fname, tmp, l + 1);
|
||||||
if (!inverse) {
|
if (!inverse) {
|
||||||
if (strncmp(tmp, s, l) != 0) {
|
igt_fail_on_f(strncmp(tmp, s, l) != 0,
|
||||||
fprintf(stderr, "contents of %s: '%s' (expected '%s')\n",
|
"contents of %s: '%s' (expected '%s')\n", fname, tmp, s);
|
||||||
fname, tmp, s);
|
|
||||||
igt_fail(1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (strncmp(tmp, s, l) == 0) {
|
igt_fail_on_f(strncmp(tmp, s, l) == 0,
|
||||||
fprintf(stderr, "contents of %s: '%s' (expected not '%s'\n",
|
"contents of %s: '%s' (expected not '%s'\n", fname, tmp, s);
|
||||||
fname, tmp, s);
|
|
||||||
igt_fail(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ static int negative_reloc(int fd, unsigned flags)
|
|||||||
&execbuf));
|
&execbuf));
|
||||||
gem_close(fd, gem_exec[1].handle);
|
gem_close(fd, gem_exec[1].handle);
|
||||||
|
|
||||||
printf("Found offset %ld for 4k batch\n", (long)gem_exec[0].offset);
|
igt_info("Found offset %ld for 4k batch\n", (long)gem_exec[0].offset);
|
||||||
igt_require(gem_exec[0].offset < BIAS);
|
igt_require(gem_exec[0].offset < BIAS);
|
||||||
|
|
||||||
memset(gem_reloc, 0, sizeof(gem_reloc));
|
memset(gem_reloc, 0, sizeof(gem_reloc));
|
||||||
@ -106,7 +106,7 @@ static int negative_reloc(int fd, unsigned flags)
|
|||||||
DRM_IOCTL_I915_GEM_EXECBUFFER2,
|
DRM_IOCTL_I915_GEM_EXECBUFFER2,
|
||||||
&execbuf));
|
&execbuf));
|
||||||
|
|
||||||
printf("Batch is now at offset %ld\n", (long)gem_exec[0].offset);
|
igt_info("Batch is now at offset %ld\n", (long)gem_exec[0].offset);
|
||||||
|
|
||||||
gem_read(fd, gem_exec[0].handle, 0, buf, sizeof(buf));
|
gem_read(fd, gem_exec[0].handle, 0, buf, sizeof(buf));
|
||||||
gem_close(fd, gem_exec[0].handle);
|
gem_close(fd, gem_exec[0].handle);
|
||||||
|
@ -81,8 +81,7 @@ static void performance(void)
|
|||||||
gettimeofday(&end, NULL);
|
gettimeofday(&end, NULL);
|
||||||
|
|
||||||
linear[count != 2] = count * loop / elapsed(&start, &end);
|
linear[count != 2] = count * loop / elapsed(&start, &end);
|
||||||
printf("Upload rate for %d linear surfaces: %7.3fMiB/s\n",
|
igt_info("Upload rate for %d linear surfaces: %7.3fMiB/s\n", count, linear[count != 2]);
|
||||||
count, linear[count != 2]);
|
|
||||||
|
|
||||||
for (n = 0; n < count; n++)
|
for (n = 0; n < count; n++)
|
||||||
gem_set_tiling(fd, handle[n], I915_TILING_X, 1024);
|
gem_set_tiling(fd, handle[n], I915_TILING_X, 1024);
|
||||||
@ -95,8 +94,7 @@ static void performance(void)
|
|||||||
gettimeofday(&end, NULL);
|
gettimeofday(&end, NULL);
|
||||||
|
|
||||||
tiled[count != 2] = count * loop / elapsed(&start, &end);
|
tiled[count != 2] = count * loop / elapsed(&start, &end);
|
||||||
printf("Upload rate for %d tiled surfaces: %7.3fMiB/s\n",
|
igt_info("Upload rate for %d tiled surfaces: %7.3fMiB/s\n", count, tiled[count != 2]);
|
||||||
count, tiled[count != 2]);
|
|
||||||
|
|
||||||
for (n = 0; n < count; n++) {
|
for (n = 0; n < count; n++) {
|
||||||
munmap(ptr[n], OBJECT_SIZE);
|
munmap(ptr[n], OBJECT_SIZE);
|
||||||
@ -215,8 +213,7 @@ static void thread_performance(unsigned mask)
|
|||||||
gettimeofday(&end, NULL);
|
gettimeofday(&end, NULL);
|
||||||
|
|
||||||
linear[count != 2] = nthreads * loops / elapsed(&start, &end) / (OBJECT_SIZE / 4096);
|
linear[count != 2] = nthreads * loops / elapsed(&start, &end) / (OBJECT_SIZE / 4096);
|
||||||
printf("%s rate for %d linear surfaces, %d threads: %7.3fMiB/s\n",
|
igt_info("%s rate for %d linear surfaces, %d threads: %7.3fMiB/s\n", direction_string(mask), count, nthreads, linear[count != 2]);
|
||||||
direction_string(mask), count, nthreads, linear[count != 2]);
|
|
||||||
|
|
||||||
for (n = 0; n < count; n++)
|
for (n = 0; n < count; n++)
|
||||||
gem_set_tiling(fd, handle[n], I915_TILING_X, 1024);
|
gem_set_tiling(fd, handle[n], I915_TILING_X, 1024);
|
||||||
@ -237,8 +234,7 @@ static void thread_performance(unsigned mask)
|
|||||||
gettimeofday(&end, NULL);
|
gettimeofday(&end, NULL);
|
||||||
|
|
||||||
tiled[count != 2] = nthreads * loops / elapsed(&start, &end) / (OBJECT_SIZE / 4096);
|
tiled[count != 2] = nthreads * loops / elapsed(&start, &end) / (OBJECT_SIZE / 4096);
|
||||||
printf("%s rate for %d tiled surfaces, %d threads: %7.3fMiB/s\n",
|
igt_info("%s rate for %d tiled surfaces, %d threads: %7.3fMiB/s\n", direction_string(mask), count, nthreads, tiled[count != 2]);
|
||||||
direction_string(mask), count, nthreads, tiled[count != 2]);
|
|
||||||
|
|
||||||
for (n = 0; n < count; n++) {
|
for (n = 0; n < count; n++) {
|
||||||
munmap(ptr[n], OBJECT_SIZE);
|
munmap(ptr[n], OBJECT_SIZE);
|
||||||
@ -300,8 +296,7 @@ static void thread_contention(void)
|
|||||||
gettimeofday(&end, NULL);
|
gettimeofday(&end, NULL);
|
||||||
|
|
||||||
linear[count != 2] = count * loops / elapsed(&start, &end) / (OBJECT_SIZE / 4096);
|
linear[count != 2] = count * loops / elapsed(&start, &end) / (OBJECT_SIZE / 4096);
|
||||||
printf("Contended upload rate for %d threads: %7.3fMiB/s\n",
|
igt_info("Contended upload rate for %d threads: %7.3fMiB/s\n", count, linear[count != 2]);
|
||||||
count, linear[count != 2]);
|
|
||||||
|
|
||||||
for (n = 0; n < count; n++)
|
for (n = 0; n < count; n++)
|
||||||
gem_set_tiling(fd, threads[n].handle, I915_TILING_X, 1024);
|
gem_set_tiling(fd, threads[n].handle, I915_TILING_X, 1024);
|
||||||
@ -314,8 +309,7 @@ static void thread_contention(void)
|
|||||||
gettimeofday(&end, NULL);
|
gettimeofday(&end, NULL);
|
||||||
|
|
||||||
tiled[count != 2] = count * loops / elapsed(&start, &end) / (OBJECT_SIZE / 4096);
|
tiled[count != 2] = count * loops / elapsed(&start, &end) / (OBJECT_SIZE / 4096);
|
||||||
printf("Contended upload rate for %d threads: %7.3fMiB/s\n",
|
igt_info("Contended upload rate for %d threads: %7.3fMiB/s\n", count, tiled[count != 2]);
|
||||||
count, tiled[count != 2]);
|
|
||||||
|
|
||||||
for (n = 0; n < count; n++) {
|
for (n = 0; n < count; n++) {
|
||||||
gem_close(fd, threads[n].handle);
|
gem_close(fd, threads[n].handle);
|
||||||
|
@ -44,10 +44,8 @@ static uint64_t timer_query(int fd)
|
|||||||
struct local_drm_i915_reg_read reg_read;
|
struct local_drm_i915_reg_read reg_read;
|
||||||
|
|
||||||
reg_read.offset = 0x2358;
|
reg_read.offset = 0x2358;
|
||||||
if (drmIoctl(fd, REG_READ_IOCTL, ®_read)) {
|
igt_fail_on_f(drmIoctl(fd, REG_READ_IOCTL, ®_read),
|
||||||
perror("positive test case failed: ");
|
"positive test case failed: ");
|
||||||
igt_fail(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return reg_read.val;
|
return reg_read.val;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ int main(int argc, char **argv)
|
|||||||
if (count == 0)
|
if (count == 0)
|
||||||
count = 3 * gem_aperture_size(fd) / SIZE / 2;
|
count = 3 * gem_aperture_size(fd) / SIZE / 2;
|
||||||
else if (count < 2) {
|
else if (count < 2) {
|
||||||
fprintf(stderr, "count must be >= 2\n");
|
igt_warn("count must be >= 2\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ int main(int argc, char **argv)
|
|||||||
if (count == 0)
|
if (count == 0)
|
||||||
count = 3 * gem_aperture_size(fd) / SIZE / 2;
|
count = 3 * gem_aperture_size(fd) / SIZE / 2;
|
||||||
else if (count < 2) {
|
else if (count < 2) {
|
||||||
fprintf(stderr, "count must be >= 2\n");
|
igt_warn("count must be >= 2\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ static void run_test(data_t *data, enum ring r1, enum ring r2, enum test test)
|
|||||||
bo_check(data, b, 0xc);
|
bo_check(data, b, 0xc);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort();
|
igt_fail(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
r1_ops->busy_fini(data);
|
r1_ops->busy_fini(data);
|
||||||
|
@ -157,8 +157,7 @@ static void render_copyfunc(struct igt_buf *src,
|
|||||||
intel_batchbuffer_flush(batch_3d);
|
intel_batchbuffer_flush(batch_3d);
|
||||||
} else {
|
} else {
|
||||||
if (!warned) {
|
if (!warned) {
|
||||||
printf("No render copy found for this gen, "
|
igt_info("No render copy found for this gen, ""test is shallow!\n");
|
||||||
"test is shallow!\n");
|
|
||||||
warned = 1;
|
warned = 1;
|
||||||
}
|
}
|
||||||
igt_assert(dst->bo);
|
igt_assert(dst->bo);
|
||||||
@ -290,12 +289,12 @@ static int run_cmd(char *s)
|
|||||||
int i;
|
int i;
|
||||||
r = wordexp(s, &wexp, 0);
|
r = wordexp(s, &wexp, 0);
|
||||||
if (r != 0) {
|
if (r != 0) {
|
||||||
printf("can't parse %s\n", s);
|
igt_info("can't parse %s\n", s);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = 0; i < wexp.we_wordc; i++)
|
for(i = 0; i < wexp.we_wordc; i++)
|
||||||
printf("argv[%d] = %s\n", i, wexp.we_wordv[i]);
|
igt_info("argv[%d] = %s\n", i, wexp.we_wordv[i]);
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
|
|
||||||
@ -303,14 +302,12 @@ static int run_cmd(char *s)
|
|||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
char full_path[PATH_MAX];
|
char full_path[PATH_MAX];
|
||||||
|
|
||||||
if (getcwd(path, PATH_MAX) == NULL)
|
igt_warn_on_f(getcwd(path, PATH_MAX) == NULL, "getcwd");
|
||||||
perror("getcwd");
|
|
||||||
|
|
||||||
igt_assert(snprintf(full_path, PATH_MAX, "%s/%s", path, wexp.we_wordv[0]) > 0);
|
igt_assert(snprintf(full_path, PATH_MAX, "%s/%s", path, wexp.we_wordv[0]) > 0);
|
||||||
|
|
||||||
r = execv(full_path, wexp.we_wordv);
|
r = execv(full_path, wexp.we_wordv);
|
||||||
if (r == -1)
|
igt_warn_on_f(r == -1, "execv failed");
|
||||||
perror("execv failed");
|
|
||||||
} else {
|
} else {
|
||||||
int waitcount = options.timeout;
|
int waitcount = options.timeout;
|
||||||
|
|
||||||
@ -318,14 +315,12 @@ static int run_cmd(char *s)
|
|||||||
r = waitpid(pid, &status, WNOHANG);
|
r = waitpid(pid, &status, WNOHANG);
|
||||||
if (r == pid) {
|
if (r == pid) {
|
||||||
if(WIFEXITED(status)) {
|
if(WIFEXITED(status)) {
|
||||||
if (WEXITSTATUS(status))
|
igt_warn_on_f(WEXITSTATUS(status),
|
||||||
fprintf(stderr,
|
"child returned with %d\n", WEXITSTATUS(status));
|
||||||
"child returned with %d\n",
|
|
||||||
WEXITSTATUS(status));
|
|
||||||
return WEXITSTATUS(status);
|
return WEXITSTATUS(status);
|
||||||
}
|
}
|
||||||
} else if (r != 0) {
|
} else if (r != 0) {
|
||||||
perror("waitpid");
|
igt_warn("waitpid");
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,7 +364,7 @@ static int __read_seqno(uint32_t *seqno)
|
|||||||
r = read(fh, buf, sizeof(buf) - 1);
|
r = read(fh, buf, sizeof(buf) - 1);
|
||||||
close(fh);
|
close(fh);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
perror("read");
|
igt_warn("read");
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,7 +377,7 @@ static int __read_seqno(uint32_t *seqno)
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
tmp = strtoul(p, NULL, 0);
|
tmp = strtoul(p, NULL, 0);
|
||||||
if (tmp == ULONG_MAX && errno) {
|
if (tmp == ULONG_MAX && errno) {
|
||||||
perror("strtoul");
|
igt_warn("strtoul");
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,7 +434,7 @@ static int write_seqno(uint32_t seqno)
|
|||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (rb != seqno) {
|
if (rb != seqno) {
|
||||||
printf("seqno readback differs rb:0x%x vs w:0x%x\n", rb, seqno);
|
igt_info("seqno readback differs rb:0x%x vs w:0x%x\n", rb, seqno);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,16 +513,16 @@ static void background_run_once(void)
|
|||||||
|
|
||||||
static void print_usage(const char *s)
|
static void print_usage(const char *s)
|
||||||
{
|
{
|
||||||
printf("%s: [OPTION]...\n", s);
|
igt_info("%s: [OPTION]...\n", s);
|
||||||
printf(" where options are:\n");
|
igt_info(" where options are:\n");
|
||||||
printf(" -b --background run in background inducing wraps\n");
|
igt_info(" -b --background run in background inducing wraps\n");
|
||||||
printf(" -c --cmd=cmdstring use cmdstring to cross wrap\n");
|
igt_info(" -c --cmd=cmdstring use cmdstring to cross wrap\n");
|
||||||
printf(" -n --rounds=num run num times across wrap boundary, 0 == forever\n");
|
igt_info(" -n --rounds=num run num times across wrap boundary, 0 == forever\n");
|
||||||
printf(" -t --timeout=sec set timeout to wait for testrun to sec seconds\n");
|
igt_info(" -t --timeout=sec set timeout to wait for testrun to sec seconds\n");
|
||||||
printf(" -d --dontwrap don't wrap just run the test\n");
|
igt_info(" -d --dontwrap don't wrap just run the test\n");
|
||||||
printf(" -p --prewrap=n set seqno to WRAP - n for each testrun\n");
|
igt_info(" -p --prewrap=n set seqno to WRAP - n for each testrun\n");
|
||||||
printf(" -r --norandom dont randomize prewrap space\n");
|
igt_info(" -r --norandom dont randomize prewrap space\n");
|
||||||
printf(" -i --buffers number of buffers to copy\n");
|
igt_info(" -i --buffers number of buffers to copy\n");
|
||||||
igt_fail(-1);
|
igt_fail(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,50 +555,47 @@ static void parse_options(int argc, char **argv)
|
|||||||
switch(c) {
|
switch(c) {
|
||||||
case 'b':
|
case 'b':
|
||||||
options.background = 1;
|
options.background = 1;
|
||||||
printf("running in background inducing wraps\n");
|
igt_info("running in background inducing wraps\n");
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
options.dontwrap = 1;
|
options.dontwrap = 1;
|
||||||
printf("won't wrap after testruns\n");
|
igt_info("won't wrap after testruns\n");
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
options.rounds = atoi(optarg);
|
options.rounds = atoi(optarg);
|
||||||
printf("running %d rounds\n", options.rounds);
|
igt_info("running %d rounds\n", options.rounds);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
strncpy(options.cmd, optarg, sizeof(options.cmd) - 1);
|
strncpy(options.cmd, optarg, sizeof(options.cmd) - 1);
|
||||||
options.cmd[sizeof(options.cmd) - 1] = 0;
|
options.cmd[sizeof(options.cmd) - 1] = 0;
|
||||||
printf("cmd set to %s\n", options.cmd);
|
igt_info("cmd set to %s\n", options.cmd);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
options.buffers = atoi(optarg);
|
options.buffers = atoi(optarg);
|
||||||
printf("buffers %d\n", options.buffers);
|
igt_info("buffers %d\n", options.buffers);
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
options.timeout = atoi(optarg);
|
options.timeout = atoi(optarg);
|
||||||
if (options.timeout == 0)
|
if (options.timeout == 0)
|
||||||
options.timeout = 10;
|
options.timeout = 10;
|
||||||
printf("setting timeout to %d seconds\n",
|
igt_info("setting timeout to %d seconds\n", options.timeout);
|
||||||
options.timeout);
|
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
options.random = 0;
|
options.random = 0;
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
options.prewrap_space = atoi(optarg);
|
options.prewrap_space = atoi(optarg);
|
||||||
printf("prewrap set to %d (0x%x)\n",
|
igt_info("prewrap set to %d (0x%x)\n", options.prewrap_space, UINT32_MAX - options.prewrap_space);
|
||||||
options.prewrap_space, UINT32_MAX -
|
|
||||||
options.prewrap_space);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("unkown command options\n");
|
igt_info("unkown command options\n");
|
||||||
print_usage(argv[0]);
|
print_usage(argv[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optind < argc) {
|
if (optind < argc) {
|
||||||
printf("unkown command options\n");
|
igt_info("unkown command options\n");
|
||||||
print_usage(argv[0]);
|
print_usage(argv[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,18 +223,15 @@ static void cpucpy2d(uint32_t *src, unsigned src_stride, unsigned src_x, unsigne
|
|||||||
+ i*options.tile_size + j;
|
+ i*options.tile_size + j;
|
||||||
uint32_t tmp = src[src_ofs];
|
uint32_t tmp = src[src_ofs];
|
||||||
if (tmp != expect) {
|
if (tmp != expect) {
|
||||||
printf("mismatch at tile %i pos %i, read %i, expected %i, diff %i\n",
|
igt_info("mismatch at tile %i pos %i, read %i, expected %i, diff %i\n", logical_tile_no, i * options.tile_size + j, tmp, expect, (int)tmp - expect);
|
||||||
logical_tile_no, i*options.tile_size + j, tmp, expect, (int) tmp - expect);
|
igt_fail_on(options.trace_tile >= 0 && options.fail);
|
||||||
if (options.trace_tile >= 0 && options.fail)
|
|
||||||
igt_fail(1);
|
|
||||||
failed++;
|
failed++;
|
||||||
}
|
}
|
||||||
/* when not aborting, correct any errors */
|
/* when not aborting, correct any errors */
|
||||||
dst[dst_ofs] = expect;
|
dst[dst_ofs] = expect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (failed && options.fail)
|
igt_fail_on(failed && options.fail);
|
||||||
igt_fail(1);
|
|
||||||
|
|
||||||
if (failed > stats.max_failed_reads)
|
if (failed > stats.max_failed_reads)
|
||||||
stats.max_failed_reads = failed;
|
stats.max_failed_reads = failed;
|
||||||
@ -370,35 +367,35 @@ static void next_copyfunc(int tile)
|
|||||||
{
|
{
|
||||||
if (fence_storm) {
|
if (fence_storm) {
|
||||||
if (tile == options.trace_tile)
|
if (tile == options.trace_tile)
|
||||||
printf(" using fence storm\n");
|
igt_info(" using fence storm\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copyfunc_seq % 61 == 0
|
if (copyfunc_seq % 61 == 0
|
||||||
&& options.forced_tiling != I915_TILING_NONE) {
|
&& options.forced_tiling != I915_TILING_NONE) {
|
||||||
if (tile == options.trace_tile)
|
if (tile == options.trace_tile)
|
||||||
printf(" using fence storm\n");
|
igt_info(" using fence storm\n");
|
||||||
fence_storm = num_fences;
|
fence_storm = num_fences;
|
||||||
copyfunc = blitter_copyfunc;
|
copyfunc = blitter_copyfunc;
|
||||||
} else if (copyfunc_seq % 17 == 0) {
|
} else if (copyfunc_seq % 17 == 0) {
|
||||||
if (tile == options.trace_tile)
|
if (tile == options.trace_tile)
|
||||||
printf(" using cpu\n");
|
igt_info(" using cpu\n");
|
||||||
copyfunc = cpu_copyfunc;
|
copyfunc = cpu_copyfunc;
|
||||||
} else if (copyfunc_seq % 19 == 0) {
|
} else if (copyfunc_seq % 19 == 0) {
|
||||||
if (tile == options.trace_tile)
|
if (tile == options.trace_tile)
|
||||||
printf(" using prw\n");
|
igt_info(" using prw\n");
|
||||||
copyfunc = prw_copyfunc;
|
copyfunc = prw_copyfunc;
|
||||||
} else if (copyfunc_seq % 3 == 0 && options.use_render) {
|
} else if (copyfunc_seq % 3 == 0 && options.use_render) {
|
||||||
if (tile == options.trace_tile)
|
if (tile == options.trace_tile)
|
||||||
printf(" using render\n");
|
igt_info(" using render\n");
|
||||||
copyfunc = render_copyfunc;
|
copyfunc = render_copyfunc;
|
||||||
} else if (options.use_blt){
|
} else if (options.use_blt){
|
||||||
if (tile == options.trace_tile)
|
if (tile == options.trace_tile)
|
||||||
printf(" using blitter\n");
|
igt_info(" using blitter\n");
|
||||||
copyfunc = blitter_copyfunc;
|
copyfunc = blitter_copyfunc;
|
||||||
} else if (options.use_render){
|
} else if (options.use_render){
|
||||||
if (tile == options.trace_tile)
|
if (tile == options.trace_tile)
|
||||||
printf(" using render\n");
|
igt_info(" using render\n");
|
||||||
copyfunc = render_copyfunc;
|
copyfunc = render_copyfunc;
|
||||||
} else {
|
} else {
|
||||||
copyfunc = cpu_copyfunc;
|
copyfunc = cpu_copyfunc;
|
||||||
@ -563,9 +560,7 @@ static void init_set(unsigned set)
|
|||||||
buffers[set][i].stride);
|
buffers[set][i].stride);
|
||||||
|
|
||||||
if (options.trace_tile != -1 && i == options.trace_tile/options.tiles_per_buf)
|
if (options.trace_tile != -1 && i == options.trace_tile/options.tiles_per_buf)
|
||||||
printf("changing buffer %i containing tile %i: tiling %i, stride %i\n", i,
|
igt_info("changing buffer %i containing tile %i: tiling %i, stride %i\n", i, options.trace_tile, buffers[set][i].tiling, buffers[set][i].stride);
|
||||||
options.trace_tile,
|
|
||||||
buffers[set][i].tiling, buffers[set][i].stride);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -602,9 +597,7 @@ static void copy_tiles(unsigned *permutation)
|
|||||||
tile2xy(dst_buf, dst_tile, &dst_x, &dst_y);
|
tile2xy(dst_buf, dst_tile, &dst_x, &dst_y);
|
||||||
|
|
||||||
if (options.trace_tile == i)
|
if (options.trace_tile == i)
|
||||||
printf("copying tile %i from %i (%i, %i) to %i (%i, %i)", i,
|
igt_info("copying tile %i from %i (%i, %i) to %i (%i, %i)", i, tile_permutation[i], src_buf_idx, src_tile, permutation[idx], dst_buf_idx, dst_tile);
|
||||||
tile_permutation[i], src_buf_idx, src_tile,
|
|
||||||
permutation[idx], dst_buf_idx, dst_tile);
|
|
||||||
|
|
||||||
if (options.no_hw) {
|
if (options.no_hw) {
|
||||||
cpucpy2d(src_buf->data,
|
cpucpy2d(src_buf->data,
|
||||||
@ -681,21 +674,20 @@ static void parse_options(int argc, char **argv)
|
|||||||
switch(c) {
|
switch(c) {
|
||||||
case 'd':
|
case 'd':
|
||||||
options.no_hw = 1;
|
options.no_hw = 1;
|
||||||
printf("no-hw debug mode\n");
|
igt_info("no-hw debug mode\n");
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
options.use_signal_helper = 0;
|
options.use_signal_helper = 0;
|
||||||
printf("disabling that pesky nuisance who keeps interrupting us\n");
|
igt_info("disabling that pesky nuisance who keeps interrupting us\n");
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
tmp = atoi(optarg);
|
tmp = atoi(optarg);
|
||||||
if (tmp < options.tile_size*8192)
|
if (tmp < options.tile_size*8192)
|
||||||
printf("scratch buffer size needs to be at least %i\n",
|
igt_info("scratch buffer size needs to be at least %i\n", options.tile_size * 8192);
|
||||||
options.tile_size*8192);
|
|
||||||
else if (tmp & (tmp - 1)) {
|
else if (tmp & (tmp - 1)) {
|
||||||
printf("scratch buffer size needs to be a power-of-two\n");
|
igt_info("scratch buffer size needs to be a power-of-two\n");
|
||||||
} else {
|
} else {
|
||||||
printf("fixed scratch buffer size to %u\n", tmp);
|
igt_info("fixed scratch buffer size to %u\n", tmp);
|
||||||
options.scratch_buf_size = tmp;
|
options.scratch_buf_size = tmp;
|
||||||
sanitize_tiles_per_buf();
|
sanitize_tiles_per_buf();
|
||||||
}
|
}
|
||||||
@ -703,78 +695,78 @@ static void parse_options(int argc, char **argv)
|
|||||||
case 'g':
|
case 'g':
|
||||||
tmp = atoi(optarg);
|
tmp = atoi(optarg);
|
||||||
if (tmp < 0 || tmp > 10)
|
if (tmp < 0 || tmp > 10)
|
||||||
printf("gpu busy load needs to be bigger than 0 and smaller than 10\n");
|
igt_info("gpu busy load needs to be bigger than 0 and smaller than 10\n");
|
||||||
else {
|
else {
|
||||||
printf("gpu busy load factor set to %i\n", tmp);
|
igt_info("gpu busy load factor set to %i\n", tmp);
|
||||||
gpu_busy_load = options.gpu_busy_load = tmp;
|
gpu_busy_load = options.gpu_busy_load = tmp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
options.num_buffers = atoi(optarg);
|
options.num_buffers = atoi(optarg);
|
||||||
printf("buffer count set to %i\n", options.num_buffers);
|
igt_info("buffer count set to %i\n", options.num_buffers);
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
options.trace_tile = atoi(optarg);
|
options.trace_tile = atoi(optarg);
|
||||||
printf("tracing tile %i\n", options.trace_tile);
|
igt_info("tracing tile %i\n", options.trace_tile);
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
options.use_render = 0;
|
options.use_render = 0;
|
||||||
printf("disabling render copy\n");
|
igt_info("disabling render copy\n");
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
options.use_blt = 0;
|
options.use_blt = 0;
|
||||||
printf("disabling blt copy\n");
|
igt_info("disabling blt copy\n");
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
options.forced_tiling = I915_TILING_NONE;
|
options.forced_tiling = I915_TILING_NONE;
|
||||||
printf("disabling tiling\n");
|
igt_info("disabling tiling\n");
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
if (options.use_cpu_maps) {
|
if (options.use_cpu_maps) {
|
||||||
printf("tiling not possible with cpu maps\n");
|
igt_info("tiling not possible with cpu maps\n");
|
||||||
} else {
|
} else {
|
||||||
options.forced_tiling = I915_TILING_X;
|
options.forced_tiling = I915_TILING_X;
|
||||||
printf("using only X-tiling\n");
|
igt_info("using only X-tiling\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
options.use_cpu_maps = 1;
|
options.use_cpu_maps = 1;
|
||||||
options.forced_tiling = I915_TILING_NONE;
|
options.forced_tiling = I915_TILING_NONE;
|
||||||
printf("disabling tiling\n");
|
igt_info("disabling tiling\n");
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
options.total_rounds = atoi(optarg);
|
options.total_rounds = atoi(optarg);
|
||||||
printf("total rounds %i\n", options.total_rounds);
|
igt_info("total rounds %i\n", options.total_rounds);
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
options.fail = 0;
|
options.fail = 0;
|
||||||
printf("not failing when detecting errors\n");
|
igt_info("not failing when detecting errors\n");
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
options.tiles_per_buf = atoi(optarg);
|
options.tiles_per_buf = atoi(optarg);
|
||||||
printf("tiles per buffer %i\n", options.tiles_per_buf);
|
igt_info("tiles per buffer %i\n", options.tiles_per_buf);
|
||||||
break;
|
break;
|
||||||
case DUCTAPE:
|
case DUCTAPE:
|
||||||
options.ducttape = 0;
|
options.ducttape = 0;
|
||||||
printf("applying duct-tape\n");
|
igt_info("applying duct-tape\n");
|
||||||
break;
|
break;
|
||||||
case TILESZ:
|
case TILESZ:
|
||||||
options.tile_size = atoi(optarg);
|
options.tile_size = atoi(optarg);
|
||||||
sanitize_tiles_per_buf();
|
sanitize_tiles_per_buf();
|
||||||
printf("til size %i\n", options.tile_size);
|
igt_info("til size %i\n", options.tile_size);
|
||||||
break;
|
break;
|
||||||
case CHCK_RENDER:
|
case CHCK_RENDER:
|
||||||
options.check_render_cpyfn = 1;
|
options.check_render_cpyfn = 1;
|
||||||
printf("checking render copy function\n");
|
igt_info("checking render copy function\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("unkown command options\n");
|
igt_info("unkown command options\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optind < argc)
|
if (optind < argc)
|
||||||
printf("unkown command options\n");
|
igt_info("unkown command options\n");
|
||||||
|
|
||||||
/* actually 32767, according to docs, but that kills our nice pot calculations. */
|
/* actually 32767, according to docs, but that kills our nice pot calculations. */
|
||||||
options.max_dimension = 16*1024;
|
options.max_dimension = 16*1024;
|
||||||
@ -784,8 +776,7 @@ static void parse_options(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
options.max_dimension = 8192;
|
options.max_dimension = 8192;
|
||||||
}
|
}
|
||||||
printf("Limiting buffer to %dx%d\n",
|
igt_info("Limiting buffer to %dx%d\n", options.max_dimension, options.max_dimension);
|
||||||
options.max_dimension, options.max_dimension);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void init(void)
|
static void init(void)
|
||||||
@ -798,7 +789,7 @@ static void init(void)
|
|||||||
tmp = tmp > 256*(1024*1024) ? 256*(1024*1024) : tmp;
|
tmp = tmp > 256*(1024*1024) ? 256*(1024*1024) : tmp;
|
||||||
num_buffers = 2 * tmp / options.scratch_buf_size / 3;
|
num_buffers = 2 * tmp / options.scratch_buf_size / 3;
|
||||||
num_buffers /= 2;
|
num_buffers /= 2;
|
||||||
printf("using %u buffers\n", num_buffers);
|
igt_info("using %u buffers\n", num_buffers);
|
||||||
} else
|
} else
|
||||||
num_buffers = options.num_buffers;
|
num_buffers = options.num_buffers;
|
||||||
|
|
||||||
@ -862,8 +853,7 @@ static void check_render_copyfunc(void)
|
|||||||
ptr = (uint32_t*)((char *)dst.data + dx*4 + (dy+j) * dst.stride);
|
ptr = (uint32_t*)((char *)dst.data + dx*4 + (dy+j) * dst.stride);
|
||||||
for (i = 0; i < options.tile_size; i++)
|
for (i = 0; i < options.tile_size; i++)
|
||||||
if (ptr[i] != j * options.tile_size + i) {
|
if (ptr[i] != j * options.tile_size + i) {
|
||||||
printf("render copyfunc mismatch at (%d, %d): found %d, expected %d\n",
|
igt_info("render copyfunc mismatch at (%d, %d): found %d, expected %d\n", i, j, ptr[i], j * options.tile_size + i);
|
||||||
i, j, ptr[i], j*options.tile_size + i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -898,10 +888,10 @@ int main(int argc, char **argv)
|
|||||||
fan_out();
|
fan_out();
|
||||||
|
|
||||||
for (i = 0; i < options.total_rounds; i++) {
|
for (i = 0; i < options.total_rounds; i++) {
|
||||||
printf("round %i\n", i);
|
igt_info("round %i\n", i);
|
||||||
if (i % 64 == 63) {
|
if (i % 64 == 63) {
|
||||||
fan_in_and_check();
|
fan_in_and_check();
|
||||||
printf("everything correct after %i rounds\n", i + 1);
|
igt_info("everything correct after %i rounds\n", i + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
target_set = (current_set + 1) & 1;
|
target_set = (current_set + 1) & 1;
|
||||||
@ -924,8 +914,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
fan_in_and_check();
|
fan_in_and_check();
|
||||||
|
|
||||||
fprintf(stdout, "num failed tiles %u, max incoherent bytes %zd\n",
|
igt_info("num failed tiles %u, max incoherent bytes %zd\n", stats.num_failed, stats.max_failed_reads * sizeof(uint32_t));
|
||||||
stats.num_failed, stats.max_failed_reads*sizeof(uint32_t));
|
|
||||||
|
|
||||||
intel_batchbuffer_free(batch);
|
intel_batchbuffer_free(batch);
|
||||||
drm_intel_bufmgr_destroy(bufmgr);
|
drm_intel_bufmgr_destroy(bufmgr);
|
||||||
|
@ -173,7 +173,7 @@ static bool run_single_test(data_t *data, enum pipe pipe, igt_output_t *output)
|
|||||||
igt_plane_set_fb(primary, &fb[!(i&1)]);
|
igt_plane_set_fb(primary, &fb[!(i&1)]);
|
||||||
igt_display_commit(display);
|
igt_display_commit(display);
|
||||||
|
|
||||||
printf(".");
|
igt_info(".");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ static bool run_single_test(data_t *data, enum pipe pipe, igt_output_t *output)
|
|||||||
igt_remove_fb(data->drm_fd, &fb[1]);
|
igt_remove_fb(data->drm_fd, &fb[1]);
|
||||||
igt_remove_fb(data->drm_fd, &fb[0]);
|
igt_remove_fb(data->drm_fd, &fb[0]);
|
||||||
|
|
||||||
printf("\n");
|
igt_info("\n");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -269,8 +269,8 @@ static bool psr_sink_support(data_t *data)
|
|||||||
igt_require(file);
|
igt_require(file);
|
||||||
|
|
||||||
ret = fscanf(file, "Sink_Support: %s\n", str);
|
ret = fscanf(file, "Sink_Support: %s\n", str);
|
||||||
if (ret == 0)
|
igt_skip_on_f(ret == 0,
|
||||||
igt_skip("i915_edp_psr_status format not supported by this test case\n");
|
"i915_edp_psr_status format not supported by this test case\n");
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
return strcmp(str, "yes") == 0;
|
return strcmp(str, "yes") == 0;
|
||||||
@ -381,7 +381,7 @@ static void test_crc(data_t *data)
|
|||||||
ptr = gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE);
|
ptr = gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE);
|
||||||
gem_set_domain(data->drm_fd, handle,
|
gem_set_domain(data->drm_fd, handle,
|
||||||
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
|
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
|
||||||
fprintf(stdout, "Sleeping for 10 sec...\n");
|
igt_info("Sleeping for 10 sec...\n");
|
||||||
sleep(10);
|
sleep(10);
|
||||||
memset(ptr, 0xff, 4);
|
memset(ptr, 0xff, 4);
|
||||||
munmap(ptr, 4096);
|
munmap(ptr, 4096);
|
||||||
@ -390,12 +390,12 @@ static void test_crc(data_t *data)
|
|||||||
ptr = gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE);
|
ptr = gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE);
|
||||||
gem_set_domain(data->drm_fd, handle,
|
gem_set_domain(data->drm_fd, handle,
|
||||||
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
|
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
|
||||||
fprintf(stdout, "Sleeping for 10 sec...\n");
|
igt_info("Sleeping for 10 sec...\n");
|
||||||
sleep(10);
|
sleep(10);
|
||||||
fill_blt(data, handle, 0xff);
|
fill_blt(data, handle, 0xff);
|
||||||
igt_assert(wait_psr_entry(data, 10));
|
igt_assert(wait_psr_entry(data, 10));
|
||||||
get_sink_crc(data, ref_crc);
|
get_sink_crc(data, ref_crc);
|
||||||
fprintf(stdout, "Sleeping for 10 sec...\n");
|
igt_info("Sleeping for 10 sec...\n");
|
||||||
sleep(10);
|
sleep(10);
|
||||||
memset(ptr, 0xff, 4);
|
memset(ptr, 0xff, 4);
|
||||||
munmap(ptr, 4096);
|
munmap(ptr, 4096);
|
||||||
@ -404,12 +404,12 @@ static void test_crc(data_t *data)
|
|||||||
ptr = gem_mmap__cpu(data->drm_fd, handle, 4096, PROT_WRITE);
|
ptr = gem_mmap__cpu(data->drm_fd, handle, 4096, PROT_WRITE);
|
||||||
gem_set_domain(data->drm_fd, handle,
|
gem_set_domain(data->drm_fd, handle,
|
||||||
I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
|
I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
|
||||||
fprintf(stdout, "Sleeping for 10 sec...\n");
|
igt_info("Sleeping for 10 sec...\n");
|
||||||
sleep(10);
|
sleep(10);
|
||||||
fill_blt(data, handle, 0xff);
|
fill_blt(data, handle, 0xff);
|
||||||
igt_assert(wait_psr_entry(data, 10));
|
igt_assert(wait_psr_entry(data, 10));
|
||||||
get_sink_crc(data, ref_crc);
|
get_sink_crc(data, ref_crc);
|
||||||
fprintf(stdout, "Sleeping for 10 sec...\n");
|
igt_info("Sleeping for 10 sec...\n");
|
||||||
sleep(10);
|
sleep(10);
|
||||||
memset(ptr, 0xff, 4);
|
memset(ptr, 0xff, 4);
|
||||||
munmap(ptr, 4096);
|
munmap(ptr, 4096);
|
||||||
|
@ -118,45 +118,36 @@ static void dump_connectors_fd(int drmfd)
|
|||||||
drmModeRes *mode_resources = drmModeGetResources(drmfd);
|
drmModeRes *mode_resources = drmModeGetResources(drmfd);
|
||||||
|
|
||||||
if (!mode_resources) {
|
if (!mode_resources) {
|
||||||
fprintf(stderr, "drmModeGetResources failed: %s\n",
|
igt_warn("drmModeGetResources failed: %s\n", strerror(errno));
|
||||||
strerror(errno));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Connectors:\n");
|
igt_info("Connectors:\n");
|
||||||
printf("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\n");
|
igt_info("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\n");
|
||||||
for (i = 0; i < mode_resources->count_connectors; i++) {
|
for (i = 0; i < mode_resources->count_connectors; i++) {
|
||||||
drmModeConnector *connector;
|
drmModeConnector *connector;
|
||||||
|
|
||||||
connector = drmModeGetConnector(drmfd, mode_resources->connectors[i]);
|
connector = drmModeGetConnector(drmfd, mode_resources->connectors[i]);
|
||||||
if (!connector) {
|
if (!connector) {
|
||||||
fprintf(stderr, "could not get connector %i: %s\n",
|
igt_warn("could not get connector %i: %s\n", mode_resources->connectors[i], strerror(errno));
|
||||||
mode_resources->connectors[i], strerror(errno));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%d\t%d\t%s\t%s\t%dx%d\t\t%d\n",
|
igt_info("%d\t%d\t%s\t%s\t%dx%d\t\t%d\n", connector->connector_id, connector->encoder_id, kmstest_connector_status_str(connector->connection), kmstest_connector_type_str(connector->connector_type), connector->mmWidth, connector->mmHeight, connector->count_modes);
|
||||||
connector->connector_id,
|
|
||||||
connector->encoder_id,
|
|
||||||
kmstest_connector_status_str(connector->connection),
|
|
||||||
kmstest_connector_type_str(connector->connector_type),
|
|
||||||
connector->mmWidth, connector->mmHeight,
|
|
||||||
connector->count_modes);
|
|
||||||
|
|
||||||
if (!connector->count_modes)
|
if (!connector->count_modes)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
printf(" modes:\n");
|
igt_info(" modes:\n");
|
||||||
printf(" name refresh (Hz) hdisp hss hse htot vdisp "
|
igt_info(" name refresh (Hz) hdisp hss hse htot vdisp ""vss vse vtot flags type clock\n");
|
||||||
"vss vse vtot flags type clock\n");
|
|
||||||
for (j = 0; j < connector->count_modes; j++){
|
for (j = 0; j < connector->count_modes; j++){
|
||||||
fprintf(stdout, "[%d]", j );
|
igt_info("[%d]", j);
|
||||||
kmstest_dump_mode(&connector->modes[j]);
|
kmstest_dump_mode(&connector->modes[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
drmModeFreeConnector(connector);
|
drmModeFreeConnector(connector);
|
||||||
}
|
}
|
||||||
printf("\n");
|
igt_info("\n");
|
||||||
|
|
||||||
drmModeFreeResources(mode_resources);
|
drmModeFreeResources(mode_resources);
|
||||||
}
|
}
|
||||||
@ -166,27 +157,22 @@ static void dump_crtcs_fd(int drmfd)
|
|||||||
int i;
|
int i;
|
||||||
drmModeRes *mode_resources = drmModeGetResources(drmfd);
|
drmModeRes *mode_resources = drmModeGetResources(drmfd);
|
||||||
|
|
||||||
printf("CRTCs:\n");
|
igt_info("CRTCs:\n");
|
||||||
printf("id\tfb\tpos\tsize\n");
|
igt_info("id\tfb\tpos\tsize\n");
|
||||||
for (i = 0; i < mode_resources->count_crtcs; i++) {
|
for (i = 0; i < mode_resources->count_crtcs; i++) {
|
||||||
drmModeCrtc *crtc;
|
drmModeCrtc *crtc;
|
||||||
|
|
||||||
crtc = drmModeGetCrtc(drmfd, mode_resources->crtcs[i]);
|
crtc = drmModeGetCrtc(drmfd, mode_resources->crtcs[i]);
|
||||||
if (!crtc) {
|
if (!crtc) {
|
||||||
fprintf(stderr, "could not get crtc %i: %s\n",
|
igt_warn("could not get crtc %i: %s\n", mode_resources->crtcs[i], strerror(errno));
|
||||||
mode_resources->crtcs[i], strerror(errno));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
printf("%d\t%d\t(%d,%d)\t(%dx%d)\n",
|
igt_info("%d\t%d\t(%d,%d)\t(%dx%d)\n", crtc->crtc_id, crtc->buffer_id, crtc->x, crtc->y, crtc->width, crtc->height);
|
||||||
crtc->crtc_id,
|
|
||||||
crtc->buffer_id,
|
|
||||||
crtc->x, crtc->y,
|
|
||||||
crtc->width, crtc->height);
|
|
||||||
kmstest_dump_mode(&crtc->mode);
|
kmstest_dump_mode(&crtc->mode);
|
||||||
|
|
||||||
drmModeFreeCrtc(crtc);
|
drmModeFreeCrtc(crtc);
|
||||||
}
|
}
|
||||||
printf("\n");
|
igt_info("\n");
|
||||||
|
|
||||||
drmModeFreeResources(mode_resources);
|
drmModeFreeResources(mode_resources);
|
||||||
}
|
}
|
||||||
@ -343,8 +329,8 @@ static void set_single(void)
|
|||||||
|
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
|
|
||||||
if (sigaction(sigs[0], &sa, NULL) == -1)
|
igt_warn_on_f(sigaction(sigs[0], &sa, NULL) == -1,
|
||||||
perror("Could not set signal handler");
|
"Could not set signal handler");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -384,13 +370,11 @@ set_mode(struct connector *c)
|
|||||||
paint_output_info(c, &fb_info[current_fb]);
|
paint_output_info(c, &fb_info[current_fb]);
|
||||||
paint_color_key(&fb_info[current_fb]);
|
paint_color_key(&fb_info[current_fb]);
|
||||||
|
|
||||||
fprintf(stdout, "CRTC(%u):[%d]",c->crtc, j);
|
igt_info("CRTC(%u):[%d]", c->crtc, j);
|
||||||
kmstest_dump_mode(&c->mode);
|
kmstest_dump_mode(&c->mode);
|
||||||
if (drmModeSetCrtc(drm_fd, c->crtc, fb_id, 0, 0,
|
if (drmModeSetCrtc(drm_fd, c->crtc, fb_id, 0, 0,
|
||||||
&c->id, 1, &c->mode)) {
|
&c->id, 1, &c->mode)) {
|
||||||
fprintf(stderr, "failed to set mode (%dx%d@%dHz): %s\n",
|
igt_warn("failed to set mode (%dx%d@%dHz): %s\n", width, height, c->mode.vrefresh, strerror(errno));
|
||||||
width, height, c->mode.vrefresh,
|
|
||||||
strerror(errno));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -541,12 +525,8 @@ static void do_set_stereo_mode(struct connector *c)
|
|||||||
|
|
||||||
fb_id = create_stereo_fb(&c->mode, &fb_info);
|
fb_id = create_stereo_fb(&c->mode, &fb_info);
|
||||||
|
|
||||||
if (drmModeSetCrtc(drm_fd, c->crtc, fb_id, 0, 0,
|
igt_warn_on_f(drmModeSetCrtc(drm_fd, c->crtc, fb_id, 0, 0, &c->id, 1, &c->mode),
|
||||||
&c->id, 1, &c->mode)) {
|
"failed to set mode (%dx%d@%dHz): %s\n", width, height, c->mode.vrefresh, strerror(errno));
|
||||||
fprintf(stderr, "failed to set mode (%dx%d@%dHz): %s\n",
|
|
||||||
width, height, c->mode.vrefresh,
|
|
||||||
strerror(errno));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -570,7 +550,7 @@ set_stereo_mode(struct connector *c)
|
|||||||
if (!(c->mode.flags & DRM_MODE_FLAG_3D_MASK))
|
if (!(c->mode.flags & DRM_MODE_FLAG_3D_MASK))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
fprintf(stdout, "CRTC(%u): [%d]", c->crtc, i);
|
igt_info("CRTC(%u): [%d]", c->crtc, i);
|
||||||
kmstest_dump_mode(&c->mode);
|
kmstest_dump_mode(&c->mode);
|
||||||
do_set_stereo_mode(c);
|
do_set_stereo_mode(c);
|
||||||
|
|
||||||
@ -607,8 +587,7 @@ int update_display(void)
|
|||||||
|
|
||||||
resources = drmModeGetResources(drm_fd);
|
resources = drmModeGetResources(drm_fd);
|
||||||
if (!resources) {
|
if (!resources) {
|
||||||
fprintf(stderr, "drmModeGetResources failed: %s\n",
|
igt_warn("drmModeGetResources failed: %s\n", strerror(errno));
|
||||||
strerror(errno));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -675,22 +654,22 @@ static char optstr[] = "3hiaf:s:d:p:mrto:j:";
|
|||||||
|
|
||||||
static void __attribute__((noreturn)) usage(char *name)
|
static void __attribute__((noreturn)) usage(char *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "usage: %s [-hiasdpmtf]\n", name);
|
igt_info("usage: %s [-hiasdpmtf]\n", name);
|
||||||
fprintf(stdout, "\t-i\tdump info\n");
|
igt_info("\t-i\tdump info\n");
|
||||||
fprintf(stdout, "\t-a\ttest all modes\n");
|
igt_info("\t-a\ttest all modes\n");
|
||||||
fprintf(stdout, "\t-s\t<duration>\tsleep between each mode test\n");
|
igt_info("\t-s\t<duration>\tsleep between each mode test\n");
|
||||||
fprintf(stdout, "\t-d\t<depth>\tbit depth of scanout buffer\n");
|
igt_info("\t-d\t<depth>\tbit depth of scanout buffer\n");
|
||||||
fprintf(stdout, "\t-p\t<planew,h>,<crtcx,y>,<crtcw,h> test overlay plane\n");
|
igt_info("\t-p\t<planew,h>,<crtcx,y>,<crtcw,h> test overlay plane\n");
|
||||||
fprintf(stdout, "\t-m\ttest the preferred mode\n");
|
igt_info("\t-m\ttest the preferred mode\n");
|
||||||
fprintf(stdout, "\t-3\ttest all 3D modes\n");
|
igt_info("\t-3\ttest all 3D modes\n");
|
||||||
fprintf(stdout, "\t-t\tuse a tiled framebuffer\n");
|
igt_info("\t-t\tuse a tiled framebuffer\n");
|
||||||
fprintf(stdout, "\t-j\tdo dpms off, optional arg to select dpms leve (1-3)\n");
|
igt_info("\t-j\tdo dpms off, optional arg to select dpms leve (1-3)\n");
|
||||||
fprintf(stdout, "\t-r\tprint a QR code on the screen whose content is \"pass\" for the automatic test\n");
|
igt_info("\t-r\tprint a QR code on the screen whose content is \"pass\" for the automatic test\n");
|
||||||
fprintf(stdout, "\t-o\t<id of the display>,<number of the mode>\tonly test specified mode on the specified display\n");
|
igt_info("\t-o\t<id of the display>,<number of the mode>\tonly test specified mode on the specified display\n");
|
||||||
fprintf(stdout, "\t-f\t<clock MHz>,<hdisp>,<hsync-start>,<hsync-end>,<htotal>,\n");
|
igt_info("\t-f\t<clock MHz>,<hdisp>,<hsync-start>,<hsync-end>,<htotal>,\n");
|
||||||
fprintf(stdout, "\t\t<vdisp>,<vsync-start>,<vsync-end>,<vtotal>\n");
|
igt_info("\t\t<vdisp>,<vsync-start>,<vsync-end>,<vtotal>\n");
|
||||||
fprintf(stdout, "\t\ttest force mode\n");
|
igt_info("\t\ttest force mode\n");
|
||||||
fprintf(stdout, "\tDefault is to test all modes.\n");
|
igt_info("\tDefault is to test all modes.\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,7 +776,7 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
depth = atoi(optarg);
|
depth = atoi(optarg);
|
||||||
fprintf(stdout, "using depth %d\n", depth);
|
igt_info("using depth %d\n", depth);
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
if (sscanf(optarg, "%d,%d,%d,%d,%d,%d", &plane_width,
|
if (sscanf(optarg, "%d,%d,%d,%d,%d,%d", &plane_width,
|
||||||
@ -843,7 +822,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (test_stereo_modes &&
|
if (test_stereo_modes &&
|
||||||
drmSetClientCap(drm_fd, DRM_CLIENT_CAP_STEREO_3D, 1) < 0) {
|
drmSetClientCap(drm_fd, DRM_CLIENT_CAP_STEREO_3D, 1) < 0) {
|
||||||
fprintf(stderr, "DRM_CLIENT_CAP_STEREO_3D failed\n");
|
igt_warn("DRM_CLIENT_CAP_STEREO_3D failed\n");
|
||||||
goto out_close;
|
goto out_close;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -856,26 +835,26 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
mainloop = g_main_loop_new(NULL, FALSE);
|
mainloop = g_main_loop_new(NULL, FALSE);
|
||||||
if (!mainloop) {
|
if (!mainloop) {
|
||||||
fprintf(stderr, "failed to create glib mainloop\n");
|
igt_warn("failed to create glib mainloop\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto out_close;
|
goto out_close;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!testdisplay_setup_hotplug()) {
|
if (!testdisplay_setup_hotplug()) {
|
||||||
fprintf(stderr, "failed to initialize hotplug support\n");
|
igt_warn("failed to initialize hotplug support\n");
|
||||||
goto out_mainloop;
|
goto out_mainloop;
|
||||||
}
|
}
|
||||||
|
|
||||||
stdinchannel = g_io_channel_unix_new(0);
|
stdinchannel = g_io_channel_unix_new(0);
|
||||||
if (!stdinchannel) {
|
if (!stdinchannel) {
|
||||||
fprintf(stderr, "failed to create stdin GIO channel\n");
|
igt_warn("failed to create stdin GIO channel\n");
|
||||||
goto out_hotplug;
|
goto out_hotplug;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = g_io_add_watch(stdinchannel, G_IO_IN | G_IO_ERR, input_event,
|
ret = g_io_add_watch(stdinchannel, G_IO_IN | G_IO_ERR, input_event,
|
||||||
NULL);
|
NULL);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr, "failed to add watch on stdin GIO channel\n");
|
igt_warn("failed to add watch on stdin GIO channel\n");
|
||||||
goto out_stdio;
|
goto out_stdio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "igt_core.h"
|
||||||
|
|
||||||
#if HAVE_UDEV
|
#if HAVE_UDEV
|
||||||
#include <libudev.h>
|
#include <libudev.h>
|
||||||
static struct udev_monitor *uevent_monitor;
|
static struct udev_monitor *uevent_monitor;
|
||||||
@ -69,13 +71,13 @@ gboolean testdisplay_setup_hotplug(void)
|
|||||||
|
|
||||||
udev = udev_new();
|
udev = udev_new();
|
||||||
if (!udev) {
|
if (!udev) {
|
||||||
fprintf(stderr, "failed to create udev object\n");
|
igt_warn("failed to create udev object\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
uevent_monitor = udev_monitor_new_from_netlink(udev, "udev");
|
uevent_monitor = udev_monitor_new_from_netlink(udev, "udev");
|
||||||
if (!uevent_monitor) {
|
if (!uevent_monitor) {
|
||||||
fprintf(stderr, "failed to create udev event monitor\n");
|
igt_warn("failed to create udev event monitor\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,27 +85,27 @@ gboolean testdisplay_setup_hotplug(void)
|
|||||||
"drm",
|
"drm",
|
||||||
"drm_minor");
|
"drm_minor");
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr, "failed to filter for drm events\n");
|
igt_warn("failed to filter for drm events\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = udev_monitor_enable_receiving(uevent_monitor);
|
ret = udev_monitor_enable_receiving(uevent_monitor);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr, "failed to enable udev event reception\n");
|
igt_warn("failed to enable udev event reception\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
udevchannel =
|
udevchannel =
|
||||||
g_io_channel_unix_new(udev_monitor_get_fd(uevent_monitor));
|
g_io_channel_unix_new(udev_monitor_get_fd(uevent_monitor));
|
||||||
if (!udevchannel) {
|
if (!udevchannel) {
|
||||||
fprintf(stderr, "failed to create udev GIO channel\n");
|
igt_warn("failed to create udev GIO channel\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = g_io_add_watch(udevchannel, G_IO_IN | G_IO_ERR, hotplug_event,
|
ret = g_io_add_watch(udevchannel, G_IO_IN | G_IO_ERR, hotplug_event,
|
||||||
udev);
|
udev);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
fprintf(stderr, "failed to add watch on udev GIO channel\n");
|
igt_warn("failed to add watch on udev GIO channel\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +128,7 @@ void testdisplay_cleanup_hotplug(void)
|
|||||||
#else
|
#else
|
||||||
gboolean testdisplay_setup_hotplug(void)
|
gboolean testdisplay_setup_hotplug(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "no hotplug support on this platform\n");
|
igt_warn("no hotplug support on this platform\n");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user