diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2015-05-28 11:24:42 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2015-07-09 10:24:35 +0900 |
commit | 95f5d09e3667ded027ae648c97eb4737d8bf67c5 (patch) | |
tree | 0818e011bd779d67441586d3fc8d1ad9e03350a0 | |
parent | 211862b777d0be251a4662f5dd24f2d400544c09 (diff) |
present: Handle DPMS off in radeon_present_get_ust_msc
The DRM_IOCTL_WAIT_VBLANK ioctl may return an error during DPMS off,
which would trigger an error message in drmmode_crtc_get_ust_msc.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/radeon_present.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/radeon_present.c b/src/radeon_present.c index 49acb233..bd4d8f28 100644 --- a/src/radeon_present.c +++ b/src/radeon_present.c @@ -87,7 +87,13 @@ radeon_present_get_crtc(WindowPtr window) static int radeon_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc) { - return drmmode_crtc_get_ust_msc(crtc->devPrivate, ust, msc); + xf86CrtcPtr xf86_crtc = crtc->devPrivate; + drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; + + if (drmmode_crtc->dpms_mode != DPMSModeOn) + return BadAlloc; + + return drmmode_crtc_get_ust_msc(xf86_crtc, ust, msc); } /* |