patch for libtdm-drm
diff --git a/src/tdm_drm_display.c b/src/tdm_drm_display.c
index 76c6424..0dc7302 100644
--- a/src/tdm_drm_display.c
+++ b/src/tdm_drm_display.c
@@ -85,8 +85,10 @@ _tdm_drm_display_get_cur_msc(int fd, int pipe, uint *msc)
drmVBlank vbl;
vbl.request.type = DRM_VBLANK_RELATIVE;
- if (pipe > 0)
+ if (pipe == 1)
vbl.request.type |= DRM_VBLANK_SECONDARY;
+ else if (pipe > 1)
+ vbl.request.type |= pipe << DRM_VBLANK_HIGH_CRTC_SHIFT;
vbl.request.sequence = 0;
if (drmWaitVBlank(fd, &vbl)) {
@@ -106,8 +108,10 @@ _tdm_drm_display_wait_vblank(int fd, int pipe, uint *target_msc, void *data)
drmVBlank vbl;
vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT;
- if (pipe > 0)
+ if (pipe == 1)
vbl.request.type |= DRM_VBLANK_SECONDARY;
+ else if (pipe > 1)
+ vbl.request.type |= pipe << DRM_VBLANK_HIGH_CRTC_SHIFT;
vbl.request.sequence = *target_msc;
vbl.request.signal = (unsigned long)(uintptr_t)data;