From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E42C10E080 for ; Fri, 13 Oct 2023 03:27:33 +0000 (UTC) Message-ID: Date: Fri, 13 Oct 2023 08:57:19 +0530 Content-Language: en-US To: Swati Sharma , References: <20231011133114.68627-1-swati2.sharma@intel.com> <20231011133114.68627-4-swati2.sharma@intel.com> From: Karthik B S In-Reply-To: <20231011133114.68627-4-swati2.sharma@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Subject: Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_vblank: restrict to 2 pipes and add capability to run on all pipes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: Hi, On 10/11/2023 7:01 PM, Swati Sharma wrote: > Restrict execution to 2 pipes but add capability to executed > on all pipes. The subject line looks little contradicting to me. We could just mention 'restrict execution to 2 pipes' on subject line and elaborate in the commit message? With this updated, Reviewed-by: Karthik B S > > Signed-off-by: Swati Sharma > --- > tests/kms_vblank.c | 39 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > > diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c > index 4edd3f6bc..593da691e 100644 > --- a/tests/kms_vblank.c > +++ b/tests/kms_vblank.c > @@ -150,6 +150,10 @@ typedef struct { > #define RPM 0x80 > } data_t; > > +static bool all_pipes; > +static enum pipe active_pipes[IGT_MAX_PIPES]; > +static uint32_t last_pipe; > + > static double elapsed(const struct timespec *start, > const struct timespec *end, > int loop) > @@ -546,6 +550,10 @@ static void run_subtests(data_t *data) > if (!pipe_output_combo_valid(&data->display, data->pipe, data->output)) > continue; > > + if (!all_pipes && data->pipe != active_pipes[0] && > + data->pipe != active_pipes[last_pipe]) > + continue; > + > igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) { > data->flags = m->flags | NOHANG; > run_test(data, f->func); > @@ -566,6 +574,10 @@ static void run_subtests(data_t *data) > if (!pipe_output_combo_valid(&data->display, data->pipe, data->output)) > continue; > > + if (!all_pipes && data->pipe != active_pipes[0] && > + data->pipe != active_pipes[last_pipe]) > + continue; > + > igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) { > data->flags = m->flags; > run_test(data, f->func); > @@ -622,7 +634,23 @@ static void invalid_subtest(data_t *data, int fd) > cleanup_crtc(data, fd, output); > } > > -igt_main > +static int opt_handler(int opt, int opt_index, void *data) > +{ > + switch (opt) { > + case 'e': > + all_pipes = true; > + break; > + default: > + return IGT_OPT_HANDLER_ERROR; > + } > + > + return IGT_OPT_HANDLER_SUCCESS; > +} > + > +const char *help_str = > + " -e \tRun on all pipes. (By default subtests will run on two pipes)\n"; > + > +igt_main_args("e", NULL, help_str, opt_handler, NULL) > { > int fd; > data_t data; > @@ -632,6 +660,11 @@ igt_main > kmstest_set_vt_graphics_mode(); > igt_display_require(&data.display, fd); > igt_display_require_output(&data.display); > + > + /* Get active pipes. */ > + for_each_pipe(&data.display, data.pipe) > + active_pipes[last_pipe++] = data.pipe; > + last_pipe--; > } > > igt_describe("Negative test for vblank request."); > @@ -652,6 +685,10 @@ igt_main > if (!pipe_output_combo_valid(&data.display, data.pipe, data.output)) > continue; > > + if (!all_pipes && data.pipe != active_pipes[0] && > + data.pipe != active_pipes[last_pipe]) > + continue; > + > igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name) > crtc_id_subtest(&data, fd); > }