summaryrefslogtreecommitdiff
path: root/src/amdgpu_kms.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-11-22 16:30:59 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2016-11-22 16:30:59 +0900
commitf9ba1e8fd48cd967a09c4e083b277505d08d3849 (patch)
tree787266fee2af8a23af34e46717d65a6d21b86b41 /src/amdgpu_kms.c
parente8aa4e7ea59f00d5527654b7181a05aab8c78928 (diff)
Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when available
(Ported from radeon commits 1106b2f773ad0611c729b27f4c192a26b43ef1e7 and 5fea5ef2f07eee4a0f94baab427010b936f1d4b4) v2: * Squash in radeon fix for TearFree regression * Remove preprocessor guards for compatibility with libdrm < 2.4.72 (Emil Velikov) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/amdgpu_kms.c')
-rw-r--r--src/amdgpu_kms.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 319b572..cadd928 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -701,9 +701,9 @@ amdgpu_prime_scanout_flip(PixmapDirtyUpdatePtr ent)
return;
}
- if (drmModePageFlip(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id,
- drmmode_crtc->scanout[scanout_id].fb_id,
- DRM_MODE_PAGE_FLIP_EVENT, (void*)drm_queue_seq)) {
+ if (drmmode_page_flip_target_relative(pAMDGPUEnt, 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;
@@ -949,8 +949,8 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info,
xf86CrtcPtr xf86_crtc)
{
drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
- ScrnInfoPtr scrn;
- AMDGPUEntPtr pAMDGPUEnt;
+ ScrnInfoPtr scrn = xf86_crtc->scrn;
+ AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
uintptr_t drm_queue_seq;
unsigned scanout_id;
@@ -961,7 +961,6 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info,
if (!amdgpu_scanout_do_update(xf86_crtc, scanout_id))
return;
- scrn = xf86_crtc->scrn;
drm_queue_seq = amdgpu_drm_queue_alloc(xf86_crtc,
AMDGPU_DRM_QUEUE_CLIENT_DEFAULT,
AMDGPU_DRM_QUEUE_ID_DEFAULT,
@@ -973,10 +972,9 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info,
return;
}
- pAMDGPUEnt = AMDGPUEntPriv(scrn);
- if (drmModePageFlip(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id,
- drmmode_crtc->scanout[scanout_id].fb_id,
- DRM_MODE_PAGE_FLIP_EVENT, (void*)drm_queue_seq)) {
+ if (drmmode_page_flip_target_relative(pAMDGPUEnt, 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;