diff options
Diffstat (limited to 'src/amdgpu_present.c')
-rw-r--r-- | src/amdgpu_present.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c index 7769e1f..b6792f3 100644 --- a/src/amdgpu_present.c +++ b/src/amdgpu_present.c @@ -55,16 +55,6 @@ struct amdgpu_present_vblank_event { Bool unflip; }; -static uint32_t crtc_select(int crtc_id) -{ - if (crtc_id > 1) - return crtc_id << DRM_VBLANK_HIGH_CRTC_SHIFT; - else if (crtc_id > 0) - return DRM_VBLANK_SECONDARY; - else - return 0; -} - static RRCrtcPtr amdgpu_present_get_crtc(WindowPtr window) { @@ -155,13 +145,8 @@ amdgpu_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) { xf86CrtcPtr xf86_crtc = crtc->devPrivate; ScreenPtr screen = crtc->pScreen; - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); - int crtc_id = drmmode_get_crtc_id(xf86_crtc); struct amdgpu_present_vblank_event *event; uintptr_t drm_queue_seq; - drmVBlank vbl; - int ret; event = calloc(sizeof(struct amdgpu_present_vblank_event), 1); if (!event) @@ -177,12 +162,10 @@ amdgpu_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) return BadAlloc; } - vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | crtc_select(crtc_id); - vbl.request.sequence = msc; - vbl.request.signal = drm_queue_seq; for (;;) { - ret = drmWaitVBlank(pAMDGPUEnt->fd, &vbl); - if (!ret) + if (drmmode_wait_vblank(xf86_crtc, + DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT, msc, + drm_queue_seq, NULL, NULL)) break; if (errno != EBUSY || !amdgpu_present_flush_drm_events(screen)) { amdgpu_drm_abort_entry(drm_queue_seq); |