All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] tests/kms_psr_sink_crc: Do not test sink crc
Date: Mon, 2 Jul 2018 17:13:24 -0700	[thread overview]
Message-ID: <20180703001324.GK31287@intel.com> (raw)
In-Reply-To: <20180702233559.8226-1-dhinakaran.pandiyan@intel.com>

On Mon, Jul 02, 2018 at 04:35:58PM -0700, Dhinakaran Pandiyan wrote:
> eDP sink crc reads use vblank interrupts that cause PSR exit and
> therefore makes them unsuitable for PSR testing.
> 
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  tests/kms_psr_sink_crc.c | 56 ++++++++----------------------------------------
>  1 file changed, 9 insertions(+), 47 deletions(-)
> 
> diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> index 28818e25..d36be7dd 100644
> --- a/tests/kms_psr_sink_crc.c
> +++ b/tests/kms_psr_*sink_crc*.c

^^ ;)

rename the file now?
start a kms_psr.c from scratch?

> @@ -28,12 +28,8 @@
>  #include <stdbool.h>
>  #include <stdio.h>
>  #include <string.h>
> -
>  #include "intel_bufmgr.h"
>  
> -#define CRC_BLACK "000000000000"
> -#define CRC_LEN 12
> -
>  enum operations {
>  	PAGE_FLIP,
>  	MMAP_GTT,
> @@ -220,36 +216,9 @@ static bool wait_psr_entry(data_t *data)
>  	return false;
>  }
>  
> -static void get_sink_crc(data_t *data, char *crc)
> -{
> -	if (igt_interactive_debug)
> -		return;
> -
> -	igt_require_f(igt_sysfs_read(data->debugfs_fd, "i915_sink_crc_eDP1",
> -				     crc, CRC_LEN) == CRC_LEN,
> -		      "Sink CRC is unreliable on this machine. Try manual debug with --interactive-debug=no-crc\n");
> -	igt_debug("sink CRC: %.*s\n", CRC_LEN, crc);
> -
> -	/* Black screen is always invalid */
> -	igt_assert(strncmp(crc, CRC_BLACK, CRC_LEN));
> -}
> -
> -static bool is_green(char *crc)
> -{
> -	const char *mask = "0000FFFF0000";
> -	uint32_t *p = (uint32_t *)crc, *mask_p = (uint32_t *)mask;
> -	if (igt_interactive_debug)
> -		return false;
> -
> -	/* Check R and B components are 0 and G is non-zero */
> -	return *p == *mask_p && *(p + 2) == *(mask_p + 2) &&
> -	       (*(p + 1) & *(mask_p + 1)) != 0;
> -}
> -
> -static void assert_or_manual(bool condition, const char *expected)
> +static inline void manual(const char *expected)
>  {
> -	igt_debug_manual_check("no-crc", expected);
> -	igt_assert(igt_interactive_debug || condition);
> +	igt_debug_manual_check("all", expected);
>  }
>  
>  static bool drrs_disabled(data_t *data)
> @@ -266,18 +235,14 @@ static void run_test(data_t *data)
>  	uint32_t handle = data->fb_white.gem_handle;
>  	igt_plane_t *test_plane = data->test_plane;
>  	void *ptr;
> -	char ref_crc[CRC_LEN];
> -	char crc[CRC_LEN];
>  	const char *expected = "";
>  
>  	/* Confirm that screen became Green */
> -	get_sink_crc(data, ref_crc);
> -	assert_or_manual(is_green(ref_crc), "screen GREEN");
> +	manual("screen GREEN");
>  
>  	/* Confirm screen stays Green after PSR got active */
>  	igt_assert(wait_psr_entry(data));
> -	get_sink_crc(data, ref_crc);
> -	assert_or_manual(is_green(ref_crc), "screen GREEN");
> +	manual("screen GREEN");
>  
>  	/* Setting a secondary fb/plane */
>  	igt_plane_set_fb(test_plane, &data->fb_white);
> @@ -285,19 +250,17 @@ static void run_test(data_t *data)
>  
>  	/* Confirm it is not Green anymore */
>  	igt_assert(wait_psr_entry(data));
> -	get_sink_crc(data, ref_crc);
>  	if (test_plane->type == DRM_PLANE_TYPE_PRIMARY)
> -		assert_or_manual(!is_green(ref_crc), "screen WHITE");
> +		manual("screen WHITE");
>  	else
> -		assert_or_manual(!is_green(ref_crc), "GREEN background with WHITE box");
> +		manual("GREEN background with WHITE box");
>  
>  	switch (data->op) {
>  	case PAGE_FLIP:
>  		/* Only in use when testing primary plane */
>  		igt_assert(drmModePageFlip(data->drm_fd, data->crtc_id,
>  					   data->fb_green.fb_id, 0, NULL) == 0);
> -		get_sink_crc(data, crc);
> -		assert_or_manual(is_green(crc), "screen GREEN");
> +		manual("screen GREEN");
>  		expected = "still GREEN";
>  		break;
>  	case MMAP_GTT:
> @@ -340,8 +303,7 @@ static void run_test(data_t *data)
>  		expected = "screen GREEN";
>  		break;
>  	}
> -	get_sink_crc(data, crc);
> -	assert_or_manual(strncmp(ref_crc, crc, CRC_LEN) != 0, expected);
> +	manual(expected);
>  }
>  
>  static void test_cleanup(data_t *data) {
> @@ -442,7 +404,7 @@ static int opt_handler(int opt, int opt_index, void *_data)
>  int main(int argc, char *argv[])
>  {
>  	const char *help_str =
> -	       "  --no-psr\tRun test without PSR to check the CRC test logic.";
> +	       "  --no-psr\tRun test without PSR.";
>  	static struct option long_options[] = {
>  		{"no-psr", 0, 0, 'n'},
>  		{ 0, 0, 0, 0 }
> -- 
> 2.14.1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2018-07-03  0:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 23:35 [igt-dev] [PATCH i-g-t 1/2] tests/kms_psr_sink_crc: Do not test sink crc Dhinakaran Pandiyan
2018-07-02 23:35 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_psr_sink_crc: Test PSR source HW status Dhinakaran Pandiyan
2018-07-03  0:17   ` Rodrigo Vivi
2018-07-03  1:00     ` Dhinakaran Pandiyan
2018-07-03  8:43   ` Daniel Vetter
2018-07-03  8:44     ` Daniel Vetter
2018-07-03 16:32       ` Rodrigo Vivi
2018-07-03 18:43         ` Dhinakaran Pandiyan
2018-07-03 21:35           ` Daniel Vetter
2018-07-04 14:19             ` Daniel Vetter
2018-07-05  8:31               ` Pandiyan, Dhinakaran
2018-07-05  9:39                 ` Daniel Vetter
2018-07-03  0:06 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/2] tests/kms_psr_sink_crc: Do not test sink crc Patchwork
2018-07-03  0:13 ` Rodrigo Vivi [this message]
2018-07-03  1:01   ` [igt-dev] [PATCH i-g-t 1/2] " Dhinakaran Pandiyan

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=20180703001324.GK31287@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=igt-dev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.