lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211202151200.3125685-1-markyacoub@chromium.org>
Date:   Thu,  2 Dec 2021 10:11:55 -0500
From:   Mark Yacoub <markyacoub@...omium.org>
To:     dri-devel@...ts.freedesktop.org
Cc:     seanpaul@...omium.org, chunkuang.hu@...nel.org,
        p.zabel@...gutronix.de, matthias.bgg@...il.com,
        jason-jh.lin@...iatek.com, tzungbi@...gle.com,
        Mark Yacoub <markyacoub@...gle.com>,
        Mark Yacoub <markyacoub@...omium.org>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>, linux-kernel@...r.kernel.org
Subject: [PATCH] drm: send vblank event with the attached sequence rather than current

From: Mark Yacoub <markyacoub@...gle.com>

[Why]
drm_handle_vblank_events loops over vblank_event_list to send any event
that is current or has passed.
More than 1 event could be pending with past sequence time that need to
be send. This can be a side effect of drivers without hardware vblank
counter and they depend on the difference in the timestamps and the
frame/field duration calculated in drm_update_vblank_count. This can
lead to 1 vblirq being ignored due to very small diff, resulting in a
subsequent vblank with 2 pending vblank events to be sent, each with a
unique sequence expected by user space.

[How]
Send each pending vblank event with the sequence it's waiting on instead
of assigning the current sequence to all of them.

Fixes igt@..._flip "Unexpected frame sequence"
Tested on Jacuzzi (MT8183)

Signed-off-by: Mark Yacoub <markyacoub@...omium.org>
---
 drivers/gpu/drm/drm_vblank.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 3417e1ac79185..47da8056abc14 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1902,7 +1902,7 @@ static void drm_handle_vblank_events(struct drm_device *dev, unsigned int pipe)
 
 		list_del(&e->base.link);
 		drm_vblank_put(dev, pipe);
-		send_vblank_event(dev, e, seq, now);
+		send_vblank_event(dev, e, e->sequence, now);
 	}
 
 	if (crtc && crtc->funcs->get_vblank_timestamp)
-- 
2.34.0.rc2.393.gf8c9666880-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ