diff options
author | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2014-12-05 20:01:41 -0500 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2015-04-16 11:08:37 -0700 |
commit | 00992f7d86b6c821030738932a722c581fd75b5d (patch) | |
tree | a766e1fdf3d189a841bf6fef76ae08bb350205b0 /tests/kms_psr_sink_crc.c | |
parent | f20690d864b5483026a9147bb1cab2b009a87de4 (diff) |
tests/kms_psr_sink_crc: Make mmaps visible to human eyes
this will allow manual tests when crc isn't available.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'tests/kms_psr_sink_crc.c')
-rw-r--r-- | tests/kms_psr_sink_crc.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c index 94d74eca..120bd121 100644 --- a/tests/kms_psr_sink_crc.c +++ b/tests/kms_psr_sink_crc.c @@ -83,6 +83,7 @@ typedef struct { drm_intel_bufmgr *bufmgr; struct igt_fb fb_green, fb_white; igt_plane_t *primary, *sprite, *cursor; + int mod_size; } data_t; static void create_cursor_fb(data_t *data) @@ -350,19 +351,21 @@ static void test_crc(data_t *data) igt_assert(is_green(crc)); break; case MMAP_GTT: - ptr = gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE); + ptr = gem_mmap__gtt(data->drm_fd, handle, data->mod_size, + PROT_WRITE); gem_set_domain(data->drm_fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); - memset(ptr, 0, 4); - munmap(ptr, 4096); + memset(ptr, 0xcc, data->mod_size); + munmap(ptr, data->mod_size); break; case MMAP_GTT_WAITING: - ptr = gem_mmap__gtt(data->drm_fd, handle, 4096, PROT_WRITE); + ptr = gem_mmap__gtt(data->drm_fd, handle, data->mod_size, + PROT_WRITE); gem_set_domain(data->drm_fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); /* Printing white on white so the screen shouldn't change */ - memset(ptr, 0xff, 4); + memset(ptr, 0xff, data->mod_size); get_sink_crc(data, crc); igt_assert(strcmp(ref_crc, crc) == 0); @@ -370,15 +373,15 @@ static void test_crc(data_t *data) sleep(10); /* Now lets print black to change the screen */ - memset(ptr, 0, 4); - munmap(ptr, 4096); + memset(ptr, 0, data->mod_size); + munmap(ptr, data->mod_size); break; case MMAP_CPU: - ptr = gem_mmap__cpu(data->drm_fd, handle, 0, 4096, PROT_WRITE); + ptr = gem_mmap__cpu(data->drm_fd, handle, 0, data->mod_size, PROT_WRITE); gem_set_domain(data->drm_fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); - memset(ptr, 0, 4); - munmap(ptr, 4096); + memset(ptr, 0, data->mod_size); + munmap(ptr, data->mod_size); gem_sw_finish(data->drm_fd, handle); break; case BLT: @@ -447,6 +450,9 @@ static void run_test(data_t *data) white_h = mode->hdisplay; white_v = mode->vdisplay; + /* Ignoring pitch and bpp to avoid changing full screen */ + data->mod_size = white_h * white_v; + switch (data->test_plane) { case SPRITE: data->sprite = igt_output_get_plane(output, @@ -471,6 +477,9 @@ static void run_test(data_t *data) igt_plane_set_fb(data->cursor, NULL); create_cursor_fb(data); igt_plane_set_position(data->cursor, 0, 0); + + /* Cursor is 64 x 64, ignoring pitch and bbp again */ + data->mod_size = 64 * 64; break; } |