summaryrefslogtreecommitdiff
path: root/tests/i915/gem_workarounds.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-07-03 17:58:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-07-04 17:18:07 +0100
commit9f45069f9b5136d07e053d8086e8df51e14332eb (patch)
treeb12b5f0e6cc2a35dced41358a1d1606d497f0ee5 /tests/i915/gem_workarounds.c
parent4d710ea530aca69304df37191802476f406746ca (diff)
i915/gem_workarounds: Adapt to change in file format for per-engine wa
To reduce the assumptions of RCS0 in the kernel, we want to make the debugfs engine agnostic and so we need to adapt the igt parser for flexibility. If we could just adequately simulate S3/S4 in the kernel we could forgo this test entirely... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests/i915/gem_workarounds.c')
-rw-r--r--tests/i915/gem_workarounds.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/i915/gem_workarounds.c b/tests/i915/gem_workarounds.c
index 403863c0..81c356f0 100644
--- a/tests/i915/gem_workarounds.c
+++ b/tests/i915/gem_workarounds.c
@@ -249,6 +249,7 @@ igt_main
igt_fixture {
FILE *file;
char *line = NULL;
+ char *str;
size_t line_size;
int i, fd;
@@ -261,9 +262,13 @@ igt_main
fd = igt_debugfs_open(device, "i915_wa_registers", O_RDONLY);
file = fdopen(fd, "r");
- igt_assert(getline(&line, &line_size, file) > 0);
+ igt_require(getline(&line, &line_size, file) > 0);
igt_debug("i915_wa_registers: %s", line);
- sscanf(line, "Workarounds applied: %d", &num_wa_regs);
+
+ /* We assume that the first batch is for rcs */
+ str = strstr(line, "Workarounds applied:");
+ igt_assert(str);
+ sscanf(str, "Workarounds applied: %d", &num_wa_regs);
igt_require(num_wa_regs > 0);
wa_regs = malloc(num_wa_regs * sizeof(*wa_regs));
@@ -271,6 +276,9 @@ igt_main
i = 0;
while (getline(&line, &line_size, file) > 0) {
+ if (strstr(line, "Workarounds applied:"))
+ break;
+
igt_debug("%s", line);
if (sscanf(line, "0x%X: 0x%08X, mask: 0x%08X",
&wa_regs[i].addr,