summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-03-03 16:30:27 +0900
committerMichel Dänzer <michel@daenzer.net>2017-03-07 16:53:27 +0900
commit88725b68cad92418c9bb03cb7f20526ce238d64e (patch)
treee7f4814be730ba8447607f386b25ceac696b09ab /src
parentb31489c086b4bc50c824e85fa26d97c0f43afb20 (diff)
present: Use async flip for unflip if possible
In that case, unflip operations should finish faster in general. (Ported from radeon commit 0a4eb0e12f0c9c653cf4cea6fd62e1a507eb261c) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_present.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index 4048f98..d381e15 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -48,6 +48,8 @@
#include "present.h"
+static present_screen_info_rec amdgpu_present_screen_info;
+
struct amdgpu_present_vblank_event {
uint64_t event_id;
Bool unflip;
@@ -351,6 +353,9 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
struct amdgpu_present_vblank_event *event;
PixmapPtr pixmap = screen->GetScreenPixmap(screen);
+ enum drmmode_flip_sync flip_sync =
+ (amdgpu_present_screen_info.capabilities & PresentCapabilityAsync) ?
+ FLIP_ASYNC : FLIP_VSYNC;
int old_fb_id;
int i;
@@ -369,7 +374,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
amdgpu_glamor_flush(scrn);
if (amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, pixmap,
event_id, event, -1, amdgpu_present_flip_event,
- amdgpu_present_flip_abort, FLIP_VSYNC, 0))
+ amdgpu_present_flip_abort, flip_sync, 0))
return;
modeset: