From d5cabf73489fe165562adea765ed7f53fd264e53 Mon Sep 17 00:00:00 2001 From: Anton Kindestam Date: Sat, 7 Dec 2019 18:23:42 +0100 Subject: drm: avoid division by 0 in drm_pflip_cb with bad drivers Seems like some drivers only increment msc every other page flip when running in interlaced mode (I'm looking at you nouveau). I.e. it seems to be incremented at the frame rate, rather than the field rate. Obviously we can't work with this, so shame the driver and bail. On intel this isn't an issue, as msc is incremented at field rate there. This means presentation feedback won't work correctly in interlaced modes with those drivers, but who in their right mind uses an interlaced mode these days, anyway? --- video/out/drm_common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'video/out/drm_common.h') diff --git a/video/out/drm_common.h b/video/out/drm_common.h index 6ddd0994e3..aa08312ad2 100644 --- a/video/out/drm_common.h +++ b/video/out/drm_common.h @@ -66,6 +66,7 @@ struct drm_pflip_cb_closure { struct drm_vsync_tuple *vsync; // vsync tuple of the latest page flip. drm_pflip_cb updates this struct vo_vsync_info *vsync_info; // where the drm_pflip_cb routine writes its output bool *waiting_for_flip; // drm_pflip_cb writes false here before returning + struct mp_log *log; // Needed to print error messages that shame bad drivers }; bool vt_switcher_init(struct vt_switcher *s, struct mp_log *log); -- cgit v1.2.3