From: Kunal Joshi <kunal1.joshi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kunal Joshi <kunal1.joshi@intel.com>,
Nemesa Garg <nemesa.garg@intel.com>,
Arun R Murthy <arun.r.murthy@intel.com>
Subject: [igt-dev] [PATCH i-g-t 2/2] tests/kms_pipe_crc_basic: added new subtest for darkscreen detection
Date: Fri, 17 Nov 2023 12:33:56 +0530 [thread overview]
Message-ID: <20231117070356.1727656-3-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20231117070356.1727656-1-kunal1.joshi@intel.com>
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>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
tests/kms_pipe_crc_basic.c | 55 +++++++++++++++++++++++++++++++++-----
1 file changed, 48 insertions(+), 7 deletions(-)
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 94252415b..3c1ad3097 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,22 @@ 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 +259,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 +453,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,6 +510,12 @@ 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 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_set_dark_screen_detection(data.drm_fd, pipe, true);
+ test_read_crc(&data, pipe, output, tests[i].flags);
+ igt_set_dark_screen_detection(data.drm_fd, pipe, false);
} else {
test_read_crc(&data, pipe, output, tests[i].flags);
}
--
2.25.1
next prev parent reply other threads:[~2023-11-17 6:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 1/2] lib/igt_debugfs: added helper to enable/disable " Kunal Joshi
2023-11-22 21:01 ` Juha-Pekka Heikkila
2023-11-17 7:03 ` Kunal Joshi [this message]
2023-11-17 7:58 ` [igt-dev] ✗ Fi.CI.BAT: failure for add new subtests for dark screen detection (rev3) Patchwork
-- strict thread matches above, loose matches on Subject: below --
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
2023-11-15 6:42 [igt-dev] [PATCH i-g-t 0/2] add new subtests for dark screen detection 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-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 2/2] tests/kms_pipe_crc_basic: added new subtest for darkscreen detection Kunal Joshi
2023-11-14 17:37 ` Juha-Pekka Heikkila
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=20231117070356.1727656-3-kunal1.joshi@intel.com \
--to=kunal1.joshi@intel.com \
--cc=arun.r.murthy@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--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