Message ID | 20161109161602.2402-7-robert@sixbynine.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 9 November 2016 at 16:15, Robert Bragg <robert@sixbynine.org> wrote: > This adapts the basic-rejected test to focus on invalid commands that > will result in an EINVAL errno being returned to userspace even with the > upcoming version 8 parser change to stop reporting access violations as > EINVAL errors. > > Signed-off-by: Robert Bragg <robert@sixbynine.org> > --- > tests/gem_exec_parse.c | 28 +++++++++++++++++----------- > 1 file changed, 17 insertions(+), 11 deletions(-) > > diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c > index 368f30b..63f4efe 100644 > --- a/tests/gem_exec_parse.c > +++ b/tests/gem_exec_parse.c > @@ -386,33 +386,39 @@ igt_main > } > > igt_subtest("basic-rejected") { > - uint32_t arb_on_off[] = { > - MI_ARB_ON_OFF, > + uint32_t invalid_cmd[] = { > + (0x7<<29), /* Reserved command type, > + across all engines */ Maybe make this more clear with something like: (INSTR_INVALID_CLIENT << INSTR_CLIENT_SHIFT) Anyway: Reviewed-by: Matthew Auld <matthew.auld@intel.com>
diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index 368f30b..63f4efe 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -386,33 +386,39 @@ igt_main } igt_subtest("basic-rejected") { - uint32_t arb_on_off[] = { - MI_ARB_ON_OFF, + uint32_t invalid_cmd[] = { + (0x7<<29), /* Reserved command type, + across all engines */ MI_BATCH_BUFFER_END, }; - uint32_t display_flip[] = { - MI_DISPLAY_FLIP, - 0, 0, 0, + uint32_t invalid_set_context[] = { + MI_SET_CONTEXT | 32, /* invalid length */ MI_BATCH_BUFFER_END, - 0 }; exec_batch(fd, handle, - arb_on_off, sizeof(arb_on_off), + invalid_cmd, sizeof(invalid_cmd), I915_EXEC_RENDER, -EINVAL); exec_batch(fd, handle, - arb_on_off, sizeof(arb_on_off), + invalid_cmd, sizeof(invalid_cmd), I915_EXEC_BSD, -EINVAL); + if (gem_has_blt(fd)) { + exec_batch(fd, handle, + invalid_cmd, sizeof(invalid_cmd), + I915_EXEC_BLT, + -EINVAL); + } if (gem_has_vebox(fd)) { exec_batch(fd, handle, - arb_on_off, sizeof(arb_on_off), + invalid_cmd, sizeof(invalid_cmd), I915_EXEC_VEBOX, -EINVAL); } + exec_batch(fd, handle, - display_flip, sizeof(display_flip), - I915_EXEC_BLT, + invalid_set_context, sizeof(invalid_set_context), + I915_EXEC_RENDER, -EINVAL); }
This adapts the basic-rejected test to focus on invalid commands that will result in an EINVAL errno being returned to userspace even with the upcoming version 8 parser change to stop reporting access violations as EINVAL errors. Signed-off-by: Robert Bragg <robert@sixbynine.org> --- tests/gem_exec_parse.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-)