From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: Petri Latvala <petri.latvala@intel.com>,
Nidhi Gupta <nidhi1.gupta@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] tests/i915/kms_draw_crc.c: Convert tests to dynamic
Date: Fri, 17 Jun 2022 11:23:29 +0300 [thread overview]
Message-ID: <c61193a8-a321-7342-e8cb-e54e37a38af5@gmail.com> (raw)
In-Reply-To: <Yqw3XKQlSVy74dP2@platvala-desk.ger.corp.intel.com>
On 17.6.2022 11.12, Petri Latvala wrote:
> On Fri, Jun 17, 2022 at 03:26:53AM +0530, Nidhi Gupta wrote:
>> Convert the existing subtests to dynamic subtests at pipe level.
>>
>> Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
>> ---
>> tests/i915/kms_draw_crc.c | 26 ++++++++++++++++++++------
>> 1 file changed, 20 insertions(+), 6 deletions(-)
>>
>> diff --git a/tests/i915/kms_draw_crc.c b/tests/i915/kms_draw_crc.c
>> index 33fefed4..04cae0aa 100644
>> --- a/tests/i915/kms_draw_crc.c
>> +++ b/tests/i915/kms_draw_crc.c
>> @@ -40,6 +40,7 @@ drmModeResPtr drm_res;
>> drmModeConnectorPtr drm_connectors[MAX_CONNECTORS];
>> struct buf_ops *bops;
>> igt_pipe_crc_t *pipe_crc;
>> +igt_display_t display;
>>
>> static const uint32_t formats[] = {
>> DRM_FORMAT_XRGB8888,
>> @@ -265,6 +266,7 @@ static void setup_environment(void)
>> drm_fd = drm_open_driver_master(DRIVER_INTEL);
>> igt_require(drm_fd >= 0);
>>
>> + igt_display_require(&display, drm_fd);
>> drm_res = drmModeGetResources(drm_fd);
>> igt_require(drm_res);
>> igt_assert(drm_res->count_connectors <= MAX_CONNECTORS);
>> @@ -331,6 +333,8 @@ igt_main
>> {
>> enum igt_draw_method method;
>> int format_idx, modifier_idx;
>> + igt_output_t *output;
>> + enum pipe pipe;
>>
>> igt_fixture
>> setup_environment();
>> @@ -340,18 +344,28 @@ igt_main
>> for (modifier_idx = 0; modifier_idx < ARRAY_SIZE(modifiers); modifier_idx++) {
>> igt_describe("This subtest verfies igt_draw library works "
>> "with different modifiers, DRM_FORMATS, DRAW_METHODS.");
>> - igt_subtest_f("draw-method-%s-%s-%s",
>> + igt_subtest_with_dynamic_f("draw-method-%s-%s-%s",
>> format_str(format_idx),
>> igt_draw_get_method_name(method),
>> - modifier_str(modifier_idx))
>> - draw_method_subtest(method, format_idx,
>> - modifiers[modifier_idx]);
>> + modifier_str(modifier_idx)) {
>> + for_each_pipe_with_valid_output(&display, pipe, output) {
>> + igt_dynamic_f("%s-pipe-%s", igt_output_name(output), kmstest_pipe_name(pipe)) {
>> + draw_method_subtest(method, format_idx,
>> + modifiers[modifier_idx]);
>> + }
>
> There's an easy thumb rule to follow: If you're looping over all
> output/pipe combinations, and you're not even passing the output and
> pipe to the test, you're just repeating the same operation n times.
Added to Petri's comment, when test description says lets try if
igt_draw library actually works there's not much point testing different
pipes/connectors since igt_draw library doesn't depend on those.
>
>
>> + }
>> + }
>> } } }
>>
>> igt_describe("This subtest verifies CRC after filling fb with x-tiling "
>> "or none.");
>> - igt_subtest("fill-fb")
>> - fill_fb_subtest();
>> + igt_subtest_with_dynamic("fill-fb") {
>> + for_each_pipe_with_valid_output(&display, pipe, output) {
>> + igt_dynamic_f("%s-pipe-%s", igt_output_name(output), kmstest_pipe_name(pipe)) {
>> + fill_fb_subtest();
>> + }
>
> Same here.
>
>
>
next prev parent reply other threads:[~2022-06-17 8:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-16 21:56 [igt-dev] [PATCH i-g-t 0/2] tests/i915/kms_draw_crc.c: Test Cleanup Nidhi Gupta
2022-06-16 21:56 ` [igt-dev] [PATCH i-g-t 1/2] tests/i915/kms_draw_crc.c: Convert tests to dynamic Nidhi Gupta
2022-06-17 8:12 ` Petri Latvala
2022-06-17 8:23 ` Juha-Pekka Heikkila [this message]
2022-07-19 13:27 ` Modem, Bhanuprakash
2022-06-16 21:56 ` [igt-dev] [PATCH i-g-t 2/2] tests/i915/kms_draw_crc.c: Test Cleanup Nidhi Gupta
2022-07-15 8:48 ` Modem, Bhanuprakash
2022-06-16 22:45 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-06-17 8:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=c61193a8-a321-7342-e8cb-e54e37a38af5@gmail.com \
--to=juhapekka.heikkila@gmail.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=nidhi1.gupta@intel.com \
--cc=petri.latvala@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.