Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH i-g-t 3/9] tests/kms_psr_sink_crc: Make mmaps visible to human eyes
Date: Tue,  9 Dec 2014 21:01:51 -0500	[thread overview]
Message-ID: <1418176917-16598-3-git-send-email-rodrigo.vivi@intel.com> (raw)
In-Reply-To: <1418176917-16598-1-git-send-email-rodrigo.vivi@intel.com>

this will allow manual tests when crc isn't available.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 tests/kms_psr_sink_crc.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 892bba6..865ac70 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)
@@ -335,19 +336,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);
 
@@ -355,15 +358,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:
@@ -431,6 +434,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,
@@ -454,6 +460,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;
 		}
 
-- 
1.9.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2014-12-10  2:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10  2:01 [PATCH i-g-t 1/9] tests/kms_psr_sink_crc: Make blt visible to human eyes Rodrigo Vivi
2014-12-10  2:01 ` [PATCH i-g-t 2/9] tests/kms_psr_sink_crc: Make render " Rodrigo Vivi
2014-12-10  2:01 ` Rodrigo Vivi [this message]
2014-12-10  2:01 ` [PATCH i-g-t 4/9] tests/kms_psr_sink_crc: Make plane_move " Rodrigo Vivi
2014-12-10  2:01 ` [PATCH i-g-t 5/9] lib/igt_aux: Don't remove echo from terminal Rodrigo Vivi
2014-12-10  2:01 ` [PATCH i-g-t 6/9] lib: s/IGT_DEBUG_INTERACTIVE/--interactive-debug=var Rodrigo Vivi
2014-12-10 10:17   ` Daniel Vetter
2014-12-10  2:01 ` [PATCH i-g-t 7/9] tests/kms_psr_sink_crc: Add manual mode Rodrigo Vivi
2014-12-10  2:01 ` [PATCH i-g-t 8/9] lib/igt_aux: Extend igt_debug_wait_for_keypres Rodrigo Vivi
2014-12-10 10:20   ` Daniel Vetter
2014-12-10  2:01 ` [PATCH i-g-t 9/9] tests/kms_psr_sink_crc: Use pressed key to pass/fail Rodrigo Vivi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1418176917-16598-3-git-send-email-rodrigo.vivi@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox