summaryrefslogtreecommitdiffstats
path: root/video/out/drm_common.h
diff options
context:
space:
mode:
authorAnton Kindestam <antonki@kth.se>2019-07-29 19:32:29 +0200
committerJan Ekström <jeebjp@gmail.com>2019-09-28 14:10:01 +0300
commit9538fb5a7af951e220f26c87c80aaaa2a5cfbc67 (patch)
tree36a1c191a061a18ddfad7fe1926ad6de4993ee34 /video/out/drm_common.h
parent77980c8184cdc62f964fd85fc6cbd3d79019ce7a (diff)
downloadmpv-9538fb5a7af951e220f26c87c80aaaa2a5cfbc67.tar.bz2
mpv-9538fb5a7af951e220f26c87c80aaaa2a5cfbc67.tar.xz
drm: refactor page_flipped callback
Avoid duplicating the same callback function in both context_drm_egl and vo_drm.
Diffstat (limited to 'video/out/drm_common.h')
-rw-r--r--video/out/drm_common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/video/out/drm_common.h b/video/out/drm_common.h
index ba4fceba45..6ddd0994e3 100644
--- a/video/out/drm_common.h
+++ b/video/out/drm_common.h
@@ -61,6 +61,13 @@ struct drm_vsync_tuple {
unsigned int sbc;
};
+struct drm_pflip_cb_closure {
+ struct drm_vsync_tuple *frame_vsync; // vsync tuple when the frame that just flipped was queued
+ 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
+};
+
bool vt_switcher_init(struct vt_switcher *s, struct mp_log *log);
void vt_switcher_destroy(struct vt_switcher *s);
void vt_switcher_poll(struct vt_switcher *s, int timeout_ms);
@@ -78,4 +85,8 @@ struct kms *kms_create(struct mp_log *log, const char *connector_spec,
void kms_destroy(struct kms *kms);
double kms_get_display_fps(const struct kms *kms);
+// DRM Page Flip callback
+void drm_pflip_cb(int fd, unsigned int msc, unsigned int sec,
+ unsigned int usec, void *data);
+
#endif