From: "Modem, Bhanuprakash" <bhanuprakash.modem@intel.com>
To: Nidhi Gupta <nidhi1.gupta@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: Reduce the execution time on simulation
Date: Tue, 28 Mar 2023 17:11:44 +0530 [thread overview]
Message-ID: <98d4c936-908a-e411-2c84-434948ebca9b@intel.com> (raw)
In-Reply-To: <20230302224356.28771-1-nidhi1.gupta@intel.com>
On Fri-03-03-2023 04:13 am, Nidhi Gupta wrote:
> As the test execution is taking more time on simulation, limit the
> execution to two (first & last) pipes. This optimization is for
> simulation and hardware.
>
> This patch will also provide an option (command line flag '-e') to
> execute on all pipes.
>
> Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> ---
> tests/kms_cursor_crc.c | 60 +++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 59 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index 0b5aac30..a69c0444 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -83,6 +83,11 @@ typedef struct {
> cursorarea oldcursorarea[MAXCURSORBUFFER];
> } data_t;
>
> +static bool extended;
> +static enum pipe active_pipes[IGT_MAX_PIPES];
> +static uint32_t last_pipe;
> +
> +
> #define TEST_DPMS (1<<0)
> #define TEST_SUSPEND (1<<1)
>
> @@ -700,6 +705,17 @@ static void test_rapid_movement(data_t *data)
> igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
> }
>
> +static bool execution_constraint(enum pipe pipe)
> +{
> + if (!extended &&
> + pipe != active_pipes[0] &&
> + pipe != active_pipes[last_pipe])
> + return true;
> +
> + return false;
> +}
> +
> +
> static void run_size_tests(data_t *data, int w, int h)
> {
> enum pipe pipe;
> @@ -750,6 +766,9 @@ static void run_size_tests(data_t *data, int w, int h)
> }
>
> for_each_pipe_with_single_output(&data->display, pipe, data->output) {
> + if (execution_constraint(pipe))
> + continue;
> +
> data->pipe = pipe;
>
> if (require_cursor_size(data, w, h)) {
> @@ -783,6 +802,9 @@ static void run_tests_on_pipe(data_t *data)
> "correctly.");
> igt_subtest_with_dynamic("cursor-size-change") {
> for_each_pipe_with_single_output(&data->display, pipe, data->output) {
> + if (execution_constraint(pipe))
> + continue;
> +
> data->pipe = pipe;
>
> igt_dynamic_f("pipe-%s-%s",
> @@ -797,6 +819,9 @@ static void run_tests_on_pipe(data_t *data)
> "plane, i.e., alpha channel equal to 1.0.");
> igt_subtest_with_dynamic("cursor-alpha-opaque") {
> for_each_pipe_with_single_output(&data->display, pipe, data->output) {
> + if (execution_constraint(pipe))
> + continue;
> +
> data->pipe = pipe;
>
> igt_dynamic_f("pipe-%s-%s",
> @@ -811,6 +836,9 @@ static void run_tests_on_pipe(data_t *data)
> "plane, i.e., alpha channel equal to 0.0.");
> igt_subtest_with_dynamic("cursor-alpha-transparent") {
> for_each_pipe_with_single_output(&data->display, pipe, data->output) {
> + if (execution_constraint(pipe))
> + continue;
> +
> data->pipe = pipe;
>
> igt_dynamic_f("pipe-%s-%s",
> @@ -828,6 +856,9 @@ static void run_tests_on_pipe(data_t *data)
> igt_describe("Check random placement of a cursor with DPMS.");
> igt_subtest_with_dynamic("cursor-dpms") {
> for_each_pipe_with_single_output(&data->display, pipe, data->output) {
> + if (execution_constraint(pipe))
> + continue;
> +
> data->pipe = pipe;
> data->flags = TEST_DPMS;
>
> @@ -843,6 +874,9 @@ static void run_tests_on_pipe(data_t *data)
> igt_describe("Check random placement of a cursor with suspend.");
> igt_subtest_with_dynamic("cursor-suspend") {
> for_each_pipe_with_single_output(&data->display, pipe, data->output) {
> + if (execution_constraint(pipe))
> + continue;
> +
> data->pipe = pipe;
> data->flags = TEST_SUSPEND;
>
> @@ -881,16 +915,40 @@ static void run_tests_on_pipe(data_t *data)
>
> static data_t data;
>
> -igt_main
> +static int opt_handler(int opt, int opt_index, void *_data)
> +{
> + switch (opt) {
> + case 'e':
> + extended = true;
> + break;
> + default:
> + return IGT_OPT_HANDLER_ERROR;
> + }
> +
> + return IGT_OPT_HANDLER_SUCCESS;
> +}
> +
> +const char *help_str =
> + " -e \tExtended tests.\n";
> +
> +igt_main_args("e", NULL, help_str, opt_handler, NULL)
> {
> uint64_t cursor_width = 64, cursor_height = 64;
> int ret;
>
> igt_fixture {
> + enum pipe pipe;
> +
> + last_pipe = 0;
> +
> data.drm_fd = drm_open_driver_master(DRIVER_ANY);
>
> igt_display_require(&data.display, data.drm_fd);
> igt_display_require_output(&data.display);
> + /* Get active pipes. */
> + for_each_pipe(&data.display, pipe)
> + active_pipes[last_pipe++] = pipe;
> + last_pipe--;
>
> ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width);
> igt_assert(ret == 0 || errno == EINVAL);
prev parent reply other threads:[~2023-03-28 11:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 22:43 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: Reduce the execution time on simulation Nidhi Gupta
2023-03-03 4:50 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-03-06 16:47 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-03-28 11:41 ` Modem, Bhanuprakash [this message]
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=98d4c936-908a-e411-2c84-434948ebca9b@intel.com \
--to=bhanuprakash.modem@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=nidhi1.gupta@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