tests/kms_pipe_crc_basic: Add suspend tests
PATCH 1/2 tests/kms_pipe_crc_basic: Add suspend tests
Currently broken ...
Signed-off-by Daniel Vetter <[email protected]>
--- tests/kms_pipe_crc_basic.c | 7 +++++++ 1 file changed, 7 insertions(+)
tests/kms_pipe_crc_basic.c +7 -0
@@ -30,6 +30,7 @@#include "drmtest.h" #include "igt_debugfs.h" #include "igt_kms.h" +#include "igt_aux.h" typedef struct { int drm_fd;
@@ -160,6 +161,12 @@ igt_main igt_subtest_f("read-crc-pipe-%c-frame-sequence", 'A'+i)test_read_crc (&data, i,TEST_SEQUENCE ); + + igt_subtest_f("suspend-read-crc-pipe-%c", 'A'+i) { +igt_system_suspend_autoresume (); + +test_read_crc (&data, i,0 ); + } } igt_fixture {
Signature · 1 line
1.8.4.rc3
PATCH 2/2 tests/kms_pipe_crc_basic: Add gpu hang tests
Currently pipe CRC support is broken after gpu hangs. This tests for this bug.
Signed-off-by Daniel Vetter <[email protected]>
--- tests/kms_pipe_crc_basic.c | 60 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-)
tests/kms_pipe_crc_basic.c +58 -2
@@ -31,6 +31,7 @@#include "igt_debugfs.h" #include "igt_kms.h" #include "igt_aux.h" +#include "ioctl_wrappers.h" typedef struct { int drm_fd;
@@ -38,6 +39,55 @@ typedef struct {struct igt_fb fb; } data_t; +static uint64_t submit_batch (int fd,unsigned ring_id) +{ +const uint32_t batch[] = {MI_NOOP , +MI_BATCH_BUFFER_END }; +struct drm_i915_gem_execbuffer2 execbuf; +struct drm_i915_gem_exec_object2 exec; +uint64_t presumed_offset; + +gem_require_ring (fd, ring_id); + + exec.handle =gem_create (fd,4096 ); +gem_write (fd, exec.handle,0 , batch,sizeof (batch)); + exec.relocation_count =0 ; + exec.relocs_ptr =0 ; + exec.alignment =0 ; + exec.offset =0 ; + exec.flags =0 ; + exec.rsvd1 =0 ; + exec.rsvd2 =0 ; + + execbuf.buffers_ptr = (uintptr_t )&exec; + execbuf.buffer_count =1 ; + execbuf.batch_start_offset =0 ; + execbuf.batch_len =sizeof (batch); + execbuf.cliprects_ptr =0 ; + execbuf.num_cliprects =0 ; + execbuf.DR1 =0 ; + execbuf.DR4 =0 ; + execbuf.flags = ring_id; +i915_execbuffer2_set_context_id (execbuf,0 ); + execbuf.rsvd2 =0 ; + +gem_execbuf (fd, &execbuf); +gem_sync (fd, exec.handle); + presumed_offset = exec.offset; + +igt_set_stop_rings (igt_to_stop_ring_flag (ring_id)); + +gem_execbuf (fd, &execbuf); +gem_sync (fd, exec.handle); + +igt_assert (igt_get_stop_rings () ==STOP_RING_NONE ); +igt_assert (presumed_offset == exec.offset); + +gem_close (fd, exec.handle); + +return exec.offset; +} +static void test_bad_command (data_t *data,const char *cmd) {FILE *ctl;
@@ -127,10 +177,10 @@ static void test_read_crc(data_t *data, int pipe, unsigned flags) } +data_t data = {0 , }; +igt_main { -data_t data = {0 , }; -igt_skip_on_simulation (); igt_fixture {
@@ -167,6 +217,12 @@ igt_maintest_read_crc (&data, i,0 ); } + + igt_subtest_f("hang-read-crc-pipe-%c", 'A'+i) { +submit_batch (data.drm_fd,I915_EXEC_RENDER ); + +test_read_crc (&data, i,0 ); + } } igt_fixture {
Signature · 1 line
1.8.4.rc3