From: Mohammed Thasleem <mohammed.thasleem@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: arun.r.murthy@intel.com, Mohammed Thasleem <mohammed.thasleem@intel.com>
Subject: [PATCH i-g-t] tests/kms_histogram: Add test to count the number of histogram events
Date: Wed, 11 Dec 2024 20:44:24 +0530 [thread overview]
Message-ID: <20241211151424.97387-1-mohammed.thasleem@intel.com> (raw)
This test to count the number of histogram events during color flips.
Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>
---
tests/kms_histogram.c | 42 ++++++++++++++++++++++++++++++------------
1 file changed, 30 insertions(+), 12 deletions(-)
diff --git a/tests/kms_histogram.c b/tests/kms_histogram.c
index c25aa022b..9d9112915 100644
--- a/tests/kms_histogram.c
+++ b/tests/kms_histogram.c
@@ -29,6 +29,7 @@
#define GLOBAL_HIST_ENABLE 1
#define GLOBAL_HIST_DELAY 2
#define FLIP_COUNT 20
+#define CHK_FLIP_COUNT 200
/**
* SUBTEST: global-basic
@@ -229,9 +230,10 @@ static void flip_fb(data_t *data, enum pipe pipe, igt_output_t *output, struct i
igt_display_commit2(&data->display, COMMIT_ATOMIC);
}
-static void prepare_pipe(data_t *data, enum pipe pipe, igt_output_t *output, bool color_fb)
+static void prepare_pipe(data_t *data, enum pipe pipe, igt_output_t *output,
+ bool color_fb, bool count_events)
{
- int i;
+ int i, events = 0;
struct udev_monitor *mon = igt_watch_uevents();
drmModeModeInfo *mode = igt_output_get_mode(output);
bool event_detected = false;
@@ -248,24 +250,34 @@ static void prepare_pipe(data_t *data, enum pipe pipe, igt_output_t *output, boo
igt_flush_uevents(mon);
for (i = 1; i <= FLIP_COUNT; i++) {
flip_fb(data, pipe, output, &data->fb[i % fb_count]);
+ if (count_events)
+ igt_wait_for_vblank(data->drm_fd, data->display.pipes[pipe].crtc_offset);
/* Check for histogram event on every flip and break the loop if detected. */
if (igt_global_histogram_event_detected(mon, 0)) {
- event_detected = true;
- break;
+ if (count_events)
+ events++;
+ else {
+ event_detected = true;
+ break;
+ }
}
}
igt_cleanup_uevents(mon);
- igt_assert_f(event_detected, "Histogram event not generated.\n");
+ if (count_events) {
+ igt_info("Number of histogram events received = %d\n", events);
+ igt_assert_f(events, "Histogram event not generated.\n");
+ } else
+ igt_assert_f(event_detected, "Histogram event not generated.\n");
}
static void run_global_histogram_pipeline(data_t *data, enum pipe pipe, igt_output_t *output,
- bool color_fb, test_t test_pixel_factor)
+ bool color_fb, test_t test_pixel_factor, bool count_events)
{
drmModePropertyBlobRes *global_hist_blob = NULL;
- prepare_pipe(data, pipe, output, color_fb);
+ prepare_pipe(data, pipe, output, color_fb, count_events);
read_global_histogram(data, pipe, &global_hist_blob);
@@ -277,7 +289,8 @@ static void run_global_histogram_pipeline(data_t *data, enum pipe pipe, igt_outp
}
static void run_tests_for_global_histogram(data_t *data, bool color_fb,
- test_t test_pixel_factor)
+ test_t test_pixel_factor,
+ bool count_events)
{
enum pipe pipe;
igt_output_t *output;
@@ -294,7 +307,7 @@ static void run_tests_for_global_histogram(data_t *data, bool color_fb,
continue;
igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output))
- run_global_histogram_pipeline(data, pipe, output, color_fb, test_pixel_factor);
+ run_global_histogram_pipeline(data, pipe, output, color_fb, test_pixel_factor, count_events);
}
}
}
@@ -302,7 +315,7 @@ static void run_tests_for_global_histogram(data_t *data, bool color_fb,
static void run_algo_test(data_t *data, bool color_fb)
{
#ifdef HAVE_LIBGHE
- run_tests_for_global_histogram(data, color_fb, algo_image_enhancement_factor);
+ run_tests_for_global_histogram(data, color_fb, algo_image_enhancement_factor, false);
#else
igt_skip("Histogram algorithm library not found.\n");
#endif
@@ -320,15 +333,20 @@ igt_main
igt_require(data.display.is_atomic);
}
+ igt_describe("Test to enable histogram, flip color fbs, count histogram "
+ "event.");
+ igt_subtest_with_dynamic("global-color-event")
+ run_tests_for_global_histogram(&data, true, NULL, true);
+
igt_describe("Test to enable histogram, flip monochrome fbs, wait for histogram "
"event and then read the histogram data.");
igt_subtest_with_dynamic("global-basic")
- run_tests_for_global_histogram(&data, false, NULL);
+ run_tests_for_global_histogram(&data, false, NULL, false);
igt_describe("Test to enable histogram, flip color fbs, wait for histogram event "
"and then read the histogram data.");
igt_subtest_with_dynamic("global-color")
- run_tests_for_global_histogram(&data, true, NULL);
+ run_tests_for_global_histogram(&data, true, NULL, false);
igt_describe("Test to enable histogram, flip monochrome fbs, wait for histogram "
"event and then read the histogram data and enhance pixels by multiplying "
--
2.25.1
next reply other threads:[~2024-12-11 15:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 15:14 Mohammed Thasleem [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-12-11 15:34 [PATCH i-g-t] tests/kms_histogram: Add test to count the number of histogram events Mohammed Thasleem
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=20241211151424.97387-1-mohammed.thasleem@intel.com \
--to=mohammed.thasleem@intel.com \
--cc=arun.r.murthy@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox