All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: Karthik B S <karthik.b.s@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: avoid recalculating refecence crcs
Date: Fri, 8 Jan 2021 13:23:40 +0200	[thread overview]
Message-ID: <2ad8ed6d-0690-be51-7e5b-8bcd98c37040@gmail.com> (raw)
In-Reply-To: <78ecef46-df05-cf03-5d02-81b401f05d6e@intel.com>

Thanks for R-b, pushed this as well as optimization patch for kms_plane 
scaling.

/Juha-Pekka

On 8.1.2021 6.23, Karthik B S wrote:
> On 1/7/2021 9:21 PM, Juha-Pekka Heikkila wrote:
>> Get those reference crcs only once since they stay the same.
>>
>> v2: Need to make exception for HSW, there crcs seem to vary across
>> rendering pipes.
> 
> Since it is an optimization, this exception should be fine.
> 
> Reviewed-by: Karthik B S <karthik.b.s@intel.com>
> 
>>
>> This reduces generic rotation tests execution time on my ICL from 26s 
>> to 14s
>>
>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
>> ---
>>   tests/kms_rotation_crc.c | 88 ++++++++++++++++++++++++----------------
>>   1 file changed, 52 insertions(+), 36 deletions(-)
>>
>> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
>> index ffcc2cc2e..be27103fa 100644
>> --- a/tests/kms_rotation_crc.c
>> +++ b/tests/kms_rotation_crc.c
>> @@ -49,6 +49,14 @@ struct p_point{
>>       float_t y;
>>   };
>> +enum rectangle_type {
>> +    rectangle,
>> +    square,
>> +    portrait,
>> +    landscape,
>> +    num_rectangle_types /* must be last */
>> +};
>> +
>>   typedef struct {
>>       int gfx_fd;
>>       igt_display_t display;
>> @@ -70,6 +78,12 @@ typedef struct {
>>       bool use_native_resolution;
>>       bool extended;
>> +
>> +    struct crc_rect_tag {
>> +        bool valid;
>> +        igt_crc_t ref_crc;
>> +        igt_crc_t flip_crc;
>> +    } crc_rect[num_rectangle_types];
>>   } data_t;
>>   typedef struct {
>> @@ -190,14 +204,6 @@ static void prepare_crtc(data_t *data, 
>> igt_output_t *output, enum pipe pipe,
>>           igt_pipe_crc_start(data->pipe_crc);
>>   }
>> -enum rectangle_type {
>> -    rectangle,
>> -    square,
>> -    portrait,
>> -    landscape,
>> -    num_rectangle_types /* must be last */
>> -};
>> -
>>   static void prepare_fbs(data_t *data, igt_output_t *output,
>>               igt_plane_t *plane, enum rectangle_type rect, uint32_t 
>> format)
>>   {
>> @@ -267,42 +273,49 @@ static void prepare_fbs(data_t *data, 
>> igt_output_t *output,
>>       igt_require(igt_display_has_format_mod(display, pixel_format, 
>> tiling));
>>       /*
>> -     * Create a reference software rotated flip framebuffer.
>> +     * HSW will need to have those CRCs calculated each time, it
>> +     * seems to behave different from other platforms.
>>        */
>> -    igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format, tiling,
>> -              &data->fb_flip);
>> -    paint_squares(data, data->rotation, &data->fb_flip,
>> -              flip_opacity);
>> -    igt_plane_set_fb(plane, &data->fb_flip);
>> -    if (plane->type != DRM_PLANE_TYPE_CURSOR)
>> -        igt_plane_set_position(plane, data->pos_x, data->pos_y);
>> -    igt_display_commit2(display, COMMIT_ATOMIC);
>> +    if (!data->crc_rect[rect].valid || IS_HASWELL(data->devid)) {
>> +        /*
>> +        * Create a reference software rotated flip framebuffer.
>> +        */
>> +        igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format, tiling,
>> +            &data->fb_flip);
>> +        paint_squares(data, data->rotation, &data->fb_flip,
>> +            flip_opacity);
>> +        igt_plane_set_fb(plane, &data->fb_flip);
>> +        if (plane->type != DRM_PLANE_TYPE_CURSOR)
>> +            igt_plane_set_position(plane, data->pos_x, data->pos_y);
>> +        igt_display_commit2(display, COMMIT_ATOMIC);
>> -    igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
>> &data->flip_crc);
>> +        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
>> &data->crc_rect[rect].flip_crc);
>> +        igt_remove_fb(data->gfx_fd, &data->fb_flip);
>> +
>> +        /*
>> +        * Create a reference CRC for a software-rotated fb.
>> +        */
>> +        igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format,
>> +            data->override_tiling ?: LOCAL_DRM_FORMAT_MOD_NONE, 
>> &data->fb_reference);
>> +        paint_squares(data, data->rotation, &data->fb_reference, 1.0);
>> +
>> +        igt_plane_set_fb(plane, &data->fb_reference);
>> +        if (plane->type != DRM_PLANE_TYPE_CURSOR)
>> +            igt_plane_set_position(plane, data->pos_x, data->pos_y);
>> +        igt_display_commit2(display, COMMIT_ATOMIC);
>> +
>> +        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
>> &data->crc_rect[rect].ref_crc);
>> +        data->crc_rect[rect].valid = true;
>> +    }
>>       /*
>>         * Prepare the non-rotated flip fb.
>>         */
>> -    igt_remove_fb(data->gfx_fd, &data->fb_flip);
>>       igt_create_fb(data->gfx_fd, w, h, pixel_format, tiling,
>>                 &data->fb_flip);
>>       paint_squares(data, IGT_ROTATION_0, &data->fb_flip,
>>                 flip_opacity);
>> -    /*
>> -     * Create a reference CRC for a software-rotated fb.
>> -     */
>> -    igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format,
>> -              data->override_tiling ?: LOCAL_DRM_FORMAT_MOD_NONE, 
>> &data->fb_reference);
>> -    paint_squares(data, data->rotation, &data->fb_reference, 1.0);
>> -
>> -    igt_plane_set_fb(plane, &data->fb_reference);
>> -    if (plane->type != DRM_PLANE_TYPE_CURSOR)
>> -        igt_plane_set_position(plane, data->pos_x, data->pos_y);
>> -    igt_display_commit2(display, COMMIT_ATOMIC);
>> -
>> -    igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
>> &data->ref_crc);
>> -
>>       /*
>>        * Prepare the plane with an non-rotated fb let the hw rotate it.
>>        */
>> @@ -341,7 +354,7 @@ static void test_single_case(data_t *data, enum 
>> pipe pipe,
>>       /* Check CRC */
>>       igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
>> &crc_output);
>> -    igt_assert_crc_equal(&data->ref_crc, &crc_output);
>> +    igt_assert_crc_equal(&data->crc_rect[rect].ref_crc, &crc_output);
>>       /*
>>        * If flips are requested flip to a different fb and
>> @@ -364,8 +377,7 @@ static void test_single_case(data_t *data, enum 
>> pipe pipe,
>>           }
>>           kmstest_wait_for_pageflip(data->gfx_fd);
>>           igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
>> &crc_output);
>> -        igt_assert_crc_equal(&data->flip_crc,
>> -                     &crc_output);
>> +        igt_assert_crc_equal(&data->crc_rect[rect].flip_crc, 
>> &crc_output);
>>       }
>>   }
>> @@ -396,6 +408,10 @@ static void test_plane_rotation(data_t *data, int 
>> plane_type, bool test_bad_form
>>       igt_display_t *display = &data->display;
>>       igt_output_t *output;
>>       enum pipe pipe;
>> +    int c;
>> +
>> +    for (c = 0; c < num_rectangle_types; c++)
>> +        data->crc_rect[c].valid = false;
>>       if (plane_type == DRM_PLANE_TYPE_CURSOR)
>>           igt_require(display->has_cursor_plane);
> 
> 

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-01-08 11:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 15:51 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: avoid recalculating refecence crcs Juha-Pekka Heikkila
2021-01-07 15:51 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Juha-Pekka Heikkila
2021-01-07 16:40 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_rotation_crc: avoid recalculating refecence crcs Patchwork
2021-01-07 20:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-01-08  4:23 ` [igt-dev] [PATCH i-g-t 1/2] " Karthik B S
2021-01-08 11:23   ` Juha-Pekka Heikkila [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-05  8:25 Juha-Pekka Heikkila
2021-01-06  4:40 ` Karthik B S

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=2ad8ed6d-0690-be51-7e5b-8bcd98c37040@gmail.com \
    --to=juhapekka.heikkila@gmail.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@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.