Pass fb_id into drmmode_page_flip_target_absolute/relative

drmmode->fb_id isn't what we need in the TearFree case. Fixes TearFree
freezing with

(WW) RADEON(0): flip queue failed in radeon_scanout_flip: No such file or directory

in the log file.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98834
Fixes: 1106b2f773 ("Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when available")
This commit is contained in:
Michel Dänzer
2016-11-24 18:45:22 +09:00
committed by Michel Dänzer
parent 13c6bc5e38
commit 5fea5ef2f0
3 changed files with 25 additions and 19 deletions

View File

@@ -2314,21 +2314,21 @@ static Bool drmmode_probe_page_flip_target(drmmode_ptr drmmode)
}
static int
drmmode_page_flip(drmmode_crtc_private_ptr drmmode_crtc, uint32_t flags,
uintptr_t drm_queue_seq)
drmmode_page_flip(drmmode_crtc_private_ptr drmmode_crtc, int fb_id,
uint32_t flags, uintptr_t drm_queue_seq)
{
drmmode_ptr drmmode = drmmode_crtc->drmmode;
flags |= DRM_MODE_PAGE_FLIP_EVENT;
return drmModePageFlip(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
drmmode->fb_id, flags, (void*)drm_queue_seq);
fb_id, flags, (void*)drm_queue_seq);
}
int
drmmode_page_flip_target_absolute(RADEONEntPtr pRADEONEnt,
drmmode_crtc_private_ptr drmmode_crtc,
uint32_t flags, uintptr_t drm_queue_seq,
uint32_t target_msc)
int fb_id, uint32_t flags,
uintptr_t drm_queue_seq, uint32_t target_msc)
{
#ifdef DRM_MODE_PAGE_FLIP_TARGET
if (pRADEONEnt->has_page_flip_target) {
@@ -2337,19 +2337,19 @@ drmmode_page_flip_target_absolute(RADEONEntPtr pRADEONEnt,
flags |= DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE;
return drmModePageFlipTarget(drmmode->fd,
drmmode_crtc->mode_crtc->crtc_id,
drmmode->fb_id, flags,
(void*)drm_queue_seq, target_msc);
fb_id, flags, (void*)drm_queue_seq,
target_msc);
}
#endif
return drmmode_page_flip(drmmode_crtc, flags, drm_queue_seq);
return drmmode_page_flip(drmmode_crtc, fb_id, flags, drm_queue_seq);
}
int
drmmode_page_flip_target_relative(RADEONEntPtr pRADEONEnt,
drmmode_crtc_private_ptr drmmode_crtc,
uint32_t flags, uintptr_t drm_queue_seq,
uint32_t target_msc)
int fb_id, uint32_t flags,
uintptr_t drm_queue_seq, uint32_t target_msc)
{
#ifdef DRM_MODE_PAGE_FLIP_TARGET
if (pRADEONEnt->has_page_flip_target) {
@@ -2358,12 +2358,12 @@ drmmode_page_flip_target_relative(RADEONEntPtr pRADEONEnt,
flags |= DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_PAGE_FLIP_TARGET_RELATIVE;
return drmModePageFlipTarget(drmmode->fd,
drmmode_crtc->mode_crtc->crtc_id,
drmmode->fb_id, flags,
(void*)drm_queue_seq, target_msc);
fb_id, flags, (void*)drm_queue_seq,
target_msc);
}
#endif
return drmmode_page_flip(drmmode_crtc, flags, drm_queue_seq);
return drmmode_page_flip(drmmode_crtc, fb_id, flags, drm_queue_seq);
}
Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
@@ -2868,6 +2868,7 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
if (drmmode_crtc->hw_id == ref_crtc_hw_id) {
if (drmmode_page_flip_target_absolute(pRADEONEnt,
drmmode_crtc,
drmmode->fb_id,
flip_flags,
drm_queue_seq,
target_msc) != 0)
@@ -2875,6 +2876,7 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
} else {
if (drmmode_page_flip_target_relative(pRADEONEnt,
drmmode_crtc,
drmmode->fb_id,
flip_flags,
drm_queue_seq, 0) != 0)
goto flip_error;

View File

@@ -135,11 +135,13 @@ enum drmmode_flip_sync {
extern int drmmode_page_flip_target_absolute(RADEONEntPtr pRADEONEnt,
drmmode_crtc_private_ptr drmmode_crtc,
uint32_t flags, uintptr_t drm_queue_seq,
int fb_id, uint32_t flags,
uintptr_t drm_queue_seq,
uint32_t target_msc);
extern int drmmode_page_flip_target_relative(RADEONEntPtr pRADEONEnt,
drmmode_crtc_private_ptr drmmode_crtc,
uint32_t flags, uintptr_t drm_queue_seq,
int fb_id, uint32_t flags,
uintptr_t drm_queue_seq,
uint32_t target_msc);
extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp);
extern void drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode);

View File

@@ -794,8 +794,9 @@ radeon_prime_scanout_flip(PixmapDirtyUpdatePtr ent)
return;
}
if (drmmode_page_flip_target_relative(pRADEONEnt, drmmode_crtc, 0,
drm_queue_seq, 0) != 0) {
if (drmmode_page_flip_target_relative(pRADEONEnt, drmmode_crtc,
drmmode_crtc->scanout[scanout_id].fb_id,
0, drm_queue_seq, 0) != 0) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s\n",
__func__, strerror(errno));
return;
@@ -1069,8 +1070,9 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info,
return;
}
if (drmmode_page_flip_target_relative(pRADEONEnt, drmmode_crtc, 0,
drm_queue_seq, 0) != 0) {
if (drmmode_page_flip_target_relative(pRADEONEnt, drmmode_crtc,
drmmode_crtc->scanout[scanout_id].fb_id,
0, drm_queue_seq, 0) != 0) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s\n",
__func__, strerror(errno));
return;