From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by gabe.freedesktop.org (Postfix) with ESMTPS id D8D8310E221 for ; Thu, 15 Sep 2022 19:16:42 +0000 (UTC) Received: by mail-ed1-x533.google.com with SMTP id z13so14406891edb.13 for ; Thu, 15 Sep 2022 12:16:42 -0700 (PDT) Message-ID: <104f2005-e3a0-983b-eb27-c14ce0395642@gmail.com> Date: Thu, 15 Sep 2022 22:16:34 +0300 MIME-Version: 1.0 Content-Language: en-US To: Rob Clark References: <20220914225800.3850-1-quic_jesszhan@quicinc.com> From: Juha-Pekka Heikkila In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [igt-dev] [PATCH i-g-t v1] tests/kms_cursor_crc: Wait extra vblank List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: juhapekka.heikkila@gmail.com Cc: igt-dev@lists.freedesktop.org, petri.latvala@intel.com Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On 15.9.2022 21.39, Rob Clark wrote: > On Thu, Sep 15, 2022 at 11:02 AM Juha-Pekka Heikkila > wrote: >> >> Hi Jessica, >> >> On 15.9.2022 1.58, Jessica Zhang wrote: >>> Wait an extra vblank for legacy cursor ioctl to finish. >>> >>> Extra vblank wait is needed for both HW and SW test as the legacy cursor >>> ioctl is called in both cases. >>> >>> Based on Rob's patch [1] and, similarly, fixes flaky results on MSM. >>> >>> Signed-off-by: Jessica Zhang >>> >>> [1] https://patchwork.freedesktop.org/series/105999/ >>> --- >>> tests/kms_cursor_crc.c | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c >>> index 53f18f4f1add..272dcb7fa0a4 100644 >>> --- a/tests/kms_cursor_crc.c >>> +++ b/tests/kms_cursor_crc.c >>> @@ -202,8 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test, >>> igt_display_commit(display); >>> >>> /* Extra vblank wait is because nonblocking cursor ioctl */ >>> - igt_wait_for_vblank(data->drm_fd, >>> - display->pipes[data->pipe].crtc_offset); >>> + igt_wait_for_vblank_count(data->drm_fd, >>> + display->pipes[data->pipe].crtc_offset, 2); >> >> It will take more than one frame on your target device for non blocking >> cursor commit to settle? This cannot be right, even if this somehow was >> the case you are breaking this test for everyone else. > > It is possible, depending on timing, kthread scheduling, etc, for a > legacy cursor to end up getting applied to the next frame. I assume there's not many heavy tasks running on test machines. Let's not forget we're talking about non blocking commit, what you above listed could cause is you'd accidentally actually get that extra frame for cursor to settle. > > How is this breaking the test for anyone else? When testing non blocking commit it is that frame where we know changes should be present which is interesting. Otherwise we can wait even full five frames just to be on safe side to let cursor show up. /Juha-Pekka >>> >>> igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc); >>> >>> @@ -243,8 +243,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test, >>> igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]); >>> >>> igt_display_commit(display); >>> - igt_wait_for_vblank(data->drm_fd, >>> - display->pipes[data->pipe].crtc_offset); >>> + igt_wait_for_vblank_count(data->drm_fd, >>> + display->pipes[data->pipe].crtc_offset, 2); >> >> This change make even less sense to me than above. There's nothing >> cursor plane related on this part of test. You are saying flipping >> normal framebuffers on non cursor plane take also more than one frame on >> your target device? It sound like vblank counting is somehow broken on >> your target device if these changes together fix something. >> >> /Juha-Pekka >> >>> >>> igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc); >>> igt_assert_crc_equal(&crc, hwcrc); >>