Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: Kunal Joshi <kunal1.joshi@intel.com>, igt-dev@lists.freedesktop.org
Cc: Nemesa Garg <nemesa.garg@intel.com>,
	Arun R Murthy <arun.r.murthy@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 2/2] tests/kms_pipe_crc_basic: added new subtest for darkscreen detection
Date: Tue, 14 Nov 2023 19:37:47 +0200	[thread overview]
Message-ID: <7450e0a5-e869-42a1-b3bc-614d6a6c9d82@gmail.com> (raw)
In-Reply-To: <20231102062304.1204625-3-kunal1.joshi@intel.com>

This patch has some indentations with spaces. With those fixed you can add

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>


On 2.11.2023 8.23, Kunal Joshi wrote:
> dark screen detection feature when enable will monitor frames
> and if black frame is detcted it will raise drm_error, added
> two tests for positive (black frame) and negative case (white frame)
> 
> Cc: Nemesa Garg <nemesa.garg@intel.com>
> Cc: Arun R Murthy <arun.r.murthy@intel.com>
> Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
> ---
>   tests/kms_pipe_crc_basic.c | 60 +++++++++++++++++++++++++++++++++-----
>   1 file changed, 52 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
> index d980c3786..479241e79 100644
> --- a/tests/kms_pipe_crc_basic.c
> +++ b/tests/kms_pipe_crc_basic.c
> @@ -47,13 +47,10 @@ typedef struct {
>   	struct igt_fb fb;
>   } data_t;
>   
> -static struct {
> +typedef struct {
>   	double r, g, b;
>   	igt_crc_t crc;
> -} colors[2] = {
> -	{ .r = 0.0, .g = 1.0, .b = 0.0 },
> -	{ .r = 0.0, .g = 1.0, .b = 1.0 },
> -};
> +} color;
>   
>   static bool simulation_constraint(enum pipe pipe)
>   {
> @@ -92,6 +89,8 @@ enum {
>   	TEST_NONBLOCK = 1 << 1,
>   	TEST_SUSPEND = 1 << 2,
>   	TEST_HANG = 1 << 3,
> +	TEST_DARK_SCREEN = 1 << 4,
> +	TEST_DARK_SCREEN_NEGATIVE = 1 << 5,
>   };
>   
>   /**
> @@ -136,6 +135,21 @@ enum {
>    * Test category: functionality test
>    * Functionality: crc, hang
>    * Mega feature: General Display Features
> + *
> + * SUBTEST: darkscreen-read-crc
> + * Description: Test dark screen detection works
> + * Driver requirement: i915, xe
> + * Test category: functionality test
> + * Functionality: crc, hang, darkscreen
> + * Mega feature: General Display Features
> + *
> + * SUBTEST: negative-darkscreen-read-crc
> + * Description: Test false positives aren't reported by dark screen detection
> + * Driver requirement: i915, xe
> + * Test category: functionality test
> + * Functionality: crc, hang, darkscreen
> + * Mega feature: General Display Features
> + *
>    */
>   static void test_read_crc(data_t *data, enum pipe pipe,
>   			  igt_output_t *output, unsigned flags)
> @@ -144,7 +158,8 @@ static void test_read_crc(data_t *data, enum pipe pipe,
>   	igt_plane_t *primary;
>   	drmModeModeInfo *mode;
>   	igt_crc_t *crcs = NULL;
> -	int c, j;
> +        color *colors;
> +	int c, j, no_of_colors;
>   
>   	igt_display_reset(display);
>   
> @@ -153,7 +168,24 @@ static void test_read_crc(data_t *data, enum pipe pipe,
>   
>   	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
>   
> -	for (c = 0; c < ARRAY_SIZE(colors); c++) {
> +	if (flags & TEST_DARK_SCREEN) {
> +		no_of_colors = 1;
> +		colors = (color*)malloc(no_of_colors * sizeof(color));
> +		colors[0] = (color){ .r = 0.0, .g = 0.0, .b = 0.0 };
> +	}
> +	else if (flags & TEST_DARK_SCREEN_NEGATIVE) {
> +                no_of_colors = 1;
> +                colors = (color*)malloc(no_of_colors * sizeof(color));
> +                colors[0] = (color){ .r = 1.0, .g = 1.0, .b = 1.0 };
> +	}
> +	else {
> +		no_of_colors = 2;
> +		colors = (color*)malloc(no_of_colors * sizeof(color));
> +		colors[0] = (color){ .r = 0.0, .g = 1.0, .b = 0.0 };
> +		colors[1] = (color){ .r = 0.0, .g = 1.0, .b = 1.0 };
> +	}
> +
> +	for (c = 0; c < no_of_colors; c++) {
>   		char *crc_str;
>   		int n_crcs;
>   
> @@ -229,6 +261,7 @@ static void test_read_crc(data_t *data, enum pipe pipe,
>   	}
>   
>   	/* Clean-up */
> +	free(colors);
>   	igt_output_set_pipe(output, PIPE_NONE);
>   	igt_plane_set_fb(primary, NULL);
>   	igt_display_commit(display);
> @@ -422,6 +455,10 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
>   			"Suspend test for pipe CRC reads." },
>   		{ "hang-read-crc", TEST_HANG,
>   			"Hang test for pipe CRC read." },
> +		{"darkscreen-read-crc", TEST_DARK_SCREEN,
> +			"Test dark screen detection works."},
> +		{"negative-darkscreen-read-crc", TEST_DARK_SCREEN_NEGATIVE,
> +			"Test false positives aren't reported by dark screen detection."},
>   	};
>   	int i;
>   	last_pipe = 0;
> @@ -475,7 +512,14 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
>   						test_read_crc(&data, pipe, output, 0);
>   
>   						igt_disallow_hang(data.drm_fd, hang);
> -					} else {
> +					} else if (tests[i].flags & TEST_DARK_SCREEN || tests[i].flags & TEST_DARK_SCREEN_NEGATIVE) {
> +						igt_require_f(igt_is_dark_screen_supported(data.drm_fd, pipe),
> +							     "Dark Screen Detection not supported\n");
> +						igt_enable_dark_screen_detection(data.drm_fd, pipe);
> +						test_read_crc(&data, pipe, output, tests[i].flags);
> +						igt_disable_dark_screen_detection(data.drm_fd, pipe);
> +					}
> +					else {
>   						test_read_crc(&data, pipe, output, tests[i].flags);
>   					}
>   				}

  reply	other threads:[~2023-11-14 17:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02  6:23 [igt-dev] [PATCH i-g-t 0/2] add new subtests for dark screen detection Kunal Joshi
2023-11-02  6:23 ` [igt-dev] [PATCH i-g-t 1/2] lib/igt_debugfs: added helper to enable/disable " Kunal Joshi
2023-11-14 17:37   ` Juha-Pekka Heikkila
2023-11-02  6:23 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_pipe_crc_basic: added new subtest for darkscreen detection Kunal Joshi
2023-11-14 17:37   ` Juha-Pekka Heikkila [this message]
2023-11-02  7:47 ` [igt-dev] ✓ CI.xeBAT: success for add new subtests for dark screen detection Patchwork
2023-11-02  7:52 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-11-03  8:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-11-15  6:42 [igt-dev] [PATCH i-g-t 0/2] " Kunal Joshi
2023-11-15  6:42 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_pipe_crc_basic: added new subtest for darkscreen detection Kunal Joshi
2023-11-17  7:03 [igt-dev] [PATCH i-g-t 0/2] add new subtests for dark screen detection Kunal Joshi
2023-11-17  7:03 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_pipe_crc_basic: added new subtest for darkscreen detection Kunal Joshi
2023-11-23  6:29 [igt-dev] [PATCH i-g-t 0/2] add new subtests for dark screen detection Kunal Joshi
2023-11-23  6:29 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_pipe_crc_basic: added new subtest for darkscreen detection Kunal Joshi

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=7450e0a5-e869-42a1-b3bc-614d6a6c9d82@gmail.com \
    --to=juhapekka.heikkila@gmail.com \
    --cc=arun.r.murthy@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kunal1.joshi@intel.com \
    --cc=nemesa.garg@intel.com \
    /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