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)) {
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;
if (drmWaitVBlank(fd, &vbl)) {
- *target_msc = 0;
TDM_ERR("wait vblank failed: %m");
+ *target_msc = 0;
return TDM_ERROR_OPERATION_FAILED;
}