diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2017-08-01 17:29:16 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2017-08-03 17:11:30 +0900 |
commit | 4441c7c6dde2d71bd44c3031c5679ee3186ea8f9 (patch) | |
tree | 4bc912ce361c932180f106119f7d6fa028469153 /src/drmmode_display.h | |
parent | 3e08409344a2fd504429522507592f98555bec05 (diff) |
Add drmmode_crtc_can_flip helper
To reduce code duplication between DRI2 and Present. No functional
change intended yet.
(Ported from radeon commit 9bc3eef74452d924f9101c024f66ad9b14c404c8)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/drmmode_display.h')
-rw-r--r-- | src/drmmode_display.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/drmmode_display.h b/src/drmmode_display.h index 309ec67..677f796 100644 --- a/src/drmmode_display.h +++ b/src/drmmode_display.h @@ -132,6 +132,17 @@ enum drmmode_flip_sync { }; +/* Can the page flip ioctl be used for this CRTC? */ +static inline Bool +drmmode_crtc_can_flip(xf86CrtcPtr crtc) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + return crtc->enabled && + drmmode_crtc->pending_dpms_mode == DPMSModeOn; +} + + static inline void drmmode_fb_reference_loc(int drm_fd, struct drmmode_fb **old, struct drmmode_fb *new, const char *caller, unsigned line) |