Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Petri Latvala <adrinael@adrinael.net>,
	Arkadiusz Hiler <arek@hiler.eu>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Alex Hung <alex.hung@amd.com>,
	igt-dev@lists.freedesktop.org,
	Esha Bharadwaj <quic_ebharadw@quicinc.com>
Subject: Re: [PATCH i-g-t v4 4/4] tests/kms_writeback: Add dump for valid clone mode
Date: Mon, 14 Oct 2024 15:32:01 +0300	[thread overview]
Message-ID: <5a63e1df-4068-4abf-906f-5f530badfdb0@gmail.com> (raw)
In-Reply-To: <45d3888c-b4cb-4f73-9e70-f4e86b5998ef@quicinc.com>

Hi Abhinav,

on Intel i915 and Xe drivers writeback is not implemented and I don't 
know if anyone is working on it. In those ways no need to care about 
Intel drivers.

/Juha-Pekka

On 26.9.2024 0.55, Abhinav Kumar wrote:
> Hi IGT maintainers
> 
> I have given some comments below so that we can skip the test if no 
> valid clones of WB output are found  but at a top level, I wanted to get 
> your feedback that if we validate every clone of WB output with it in a 
> pair-wise fashion, thats something which works for all vendors?
> 
> This will not test the case where lets say WB, output A, output B are 
> all clones of each other and we want to do a 3-way clone mode as it will 
> only test,
> 
> 1) WB with output A
> 2) WB with output B
> 
> But atleast it validates all of WB's clones one pair at a time.
> 
> So wanted to know if we can make this a generic test-case of 
> kms_writeback OR we need to protect this with some cmdline option.
> 
> Thanks
> 
> Abhinav
> On 9/25/2024 1:37 PM, Jessica Zhang wrote:
>> From: Esha Bharadwaj <quic_ebharadw@quicinc.com>
>>
>> Move the regular writeback dump into its own subtest and add a subtest to
>> dump pairs of cloned non-writeback and writeback encoders
>>
>> Signed-off-by: Esha Bharadwaj <quic_ebharadw@quicinc.com>
>> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
>> ---
>>   tests/kms_writeback.c | 86 +++++++++++++++++++++++++++++++++++++++++ 
>> +++++++---
>>   1 file changed, 82 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c
>> index 4155961a0..cdbb9e436 100644
>> --- a/tests/kms_writeback.c
>> +++ b/tests/kms_writeback.c
>> @@ -47,6 +47,13 @@
>>   #include "sw_sync.h"
>>   /**
>> + * SUBTEST: dump-writeback
>> + * Description: Dump a non-cloned writeback buffer
>> + *
>> + * SUBTEST: dump-valid-clones
>> + * Description: Dump all valid clone pairs of writeback and non- 
>> writeback
>> + *              connectors
>> + *
>>    * SUBTEST: writeback-check-output-XRGB2101010
>>    * Description: Check XRGB2101010 writeback output with CRC validation
>>    *
>> @@ -450,7 +457,7 @@ static void do_single_commit(igt_output_t *output, 
>> igt_plane_t *plane, igt_fb_t
>>   }
>>   static void commit_and_dump_fb(igt_display_t *display, igt_output_t 
>> *output, igt_plane_t *plane,
>> -                    igt_fb_t *input_fb, drmModeModeInfo *mode)
>> +                   igt_fb_t *input_fb, drmModeModeInfo *mode, char 
>> *suffix)
>>   {
>>       cairo_surface_t *fb_surface_out;
>>       char filepath_out[PATH_MAX];
>> @@ -471,7 +478,8 @@ static void commit_and_dump_fb(igt_display_t 
>> *display, igt_output_t *output, igt
>>       do_single_commit(output, plane, input_fb, &output_fb);
>>       fb_surface_out = igt_get_cairo_surface(display->drm_fd, 
>> &output_fb);
>> -    snprintf(filepath_out, PATH_MAX, "%s/%s.png", path_name, file_name);
>> +    snprintf(filepath_out, PATH_MAX, "%s/%s-%s.png", path_name, 
>> file_name, suffix);
>> +
>>       status = cairo_surface_write_to_png(fb_surface_out, filepath_out);
>>       igt_assert_eq(status, CAIRO_STATUS_SUCCESS);
>>       cairo_surface_destroy(fb_surface_out);
>> @@ -555,6 +563,7 @@ igt_main_args("b:c:f:dl", long_options, help_str, 
>> opt_handler, NULL)
>>       drmModeModeInfo mode;
>>       unsigned int fb_id;
>>       int ret;
>> +    char dump_suffix[PATH_MAX];
>>       memset(&display, 0, sizeof(display));
>> @@ -603,9 +612,78 @@ igt_main_args("b:c:f:dl", long_options, help_str, 
>> opt_handler, NULL)
>>           if (data.list_modes)
>>               list_writeback_modes(&display);
>> -        if (data.dump_check)
>> -            commit_and_dump_fb(&display, output, plane, &input_fb, 
>> &mode);
>>       }
>> +
>> +    /*
>> +     * When dump_check is high, the following subtests will be run.
>> +     * These tests will be skipped if list_modes flag is high.
>> +     */
>> +    igt_describe("Dump a non-cloned writeback buffer");
>> +    igt_subtest("dump-writeback") {
>> +        igt_skip_on(!data.dump_check || data.list_modes);
>> +        snprintf(dump_suffix, PATH_MAX, "encoder%d", output->id);
>> +        commit_and_dump_fb(&display, output, plane, &input_fb, &mode, 
>> dump_suffix);
>> +    }
>> +
>> +    igt_describe("Dump valid clone pairs of writeback and non- 
>> writeback connectors");
>> +    igt_subtest("dump-valid-clones") {
>> +        igt_output_t *nonwb_output;
>> +        enum pipe curr_pipe;
>> +        drmModeModeInfo *nonwb_mode;
>> +        igt_fb_t clone_fb;
>> +
>> +        /*
>> +         * Drop the dump flag check once calling writeback_sequence() is
>> +         * supported
>> +         */
>> +        igt_skip_on(!data.dump_check || data.list_modes);
>> +        igt_skip_on_f(!(data.supported_colors & XRGB8888), 
>> "DRM_FORMAT_XRGB8888 is unsupported\n");
>> +        igt_require(fb_id > 0);
>> +        for_each_output(&display, nonwb_output) {
>> +            if ((nonwb_output->config.connector->connector_type == 
>> DRM_MODE_CONNECTOR_WRITEBACK)
>> +                    || igt_output_clone_valid(display.drm_fd, output, 
>> nonwb_output))
>> +                continue;
>> +
>> +            /* Set up non-writeback cloned output */
>> +            curr_pipe = output->pending_pipe;
>> +            nonwb_mode = igt_output_get_mode(nonwb_output);
>> +
>> +            igt_output_set_pipe(nonwb_output, curr_pipe);
>> +            igt_output_override_mode(output, nonwb_mode);
>> +
>> +            fb_id = igt_create_fb(display.drm_fd, nonwb_mode->hdisplay,
>> +                      nonwb_mode->vdisplay,
>> +                      DRM_FORMAT_XRGB8888,
>> +                      DRM_FORMAT_MOD_LINEAR,
>> +                      &clone_fb);
>> +            igt_assert(fb_id >= 0);
>> +
>> +            /*
>> +             * Currently, only dump the resulting frame. This is
>> +             * because the igt_fb_get_fnv1a_crc() is unable to
>> +             * calculate CRCs for non-32 bit aligned resolutions.
>> +             *
>> +             * Once there is a workaround for this issue, this can
>> +             * be changed to:
>> +             *    if (dump_check flag set)
>> +             *        commit_and_dump_fb()
>> +             *    else
>> +             *        writeback_sequence()
>> +             */
> 
> With https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/ 
> commit/27ba1f4756f12a3694dce6d456aed947f22a8e34 merged, this comment is 
> no longer true.
> 
> We should drop the dump_check restriction for clones test.
> 
> We should also skip this test if there were no possible_clones found for 
> the WB output.
> 


  reply	other threads:[~2024-10-14 12:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 20:37 [PATCH i-g-t v4 0/4] tests/kms_writeback: Add clone mode subtest Jessica Zhang
2024-09-25 20:37 ` [PATCH i-g-t v4 1/4] tests/kms_writeback: clear writeback properties in teardown path Jessica Zhang
2024-09-25 20:46   ` Abhinav Kumar
2024-10-14 13:52     ` Kamil Konieczny
2024-10-14 19:05       ` Abhinav Kumar
2024-09-25 20:37 ` [PATCH i-g-t v4 2/4] lib/igt_kms: Add helper to get encoder index Jessica Zhang
2024-09-25 21:10   ` Abhinav Kumar
2024-09-25 20:37 ` [PATCH i-g-t v4 3/4] lib/igt_kms: loosen duplicate check in igt_display_refresh Jessica Zhang
2024-09-25 21:00   ` Abhinav Kumar
2024-09-25 20:37 ` [PATCH i-g-t v4 4/4] tests/kms_writeback: Add dump for valid clone mode Jessica Zhang
2024-09-25 21:55   ` Abhinav Kumar
2024-10-14 12:32     ` Juha-Pekka Heikkila [this message]
2024-09-26  9:20 ` ✗ Fi.CI.BAT: failure for tests/kms_writeback: Add clone mode subtest (rev4) Patchwork
2024-09-26  9:39 ` ✗ CI.xeBAT: " Patchwork
2024-09-27  0:56 ` ✗ CI.xeFULL: " 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=5a63e1df-4068-4abf-906f-5f530badfdb0@gmail.com \
    --to=juhapekka.heikkila@gmail.com \
    --cc=adrinael@adrinael.net \
    --cc=alex.hung@amd.com \
    --cc=arek@hiler.eu \
    --cc=ashutosh.dixit@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_ebharadw@quicinc.com \
    --cc=quic_jesszhan@quicinc.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