[PATCH 3/3] present: Handle DPMS off in radeon_present_get_ust_msc

Michel Dänzer michel at daenzer.net
Wed Jul 8 02:25:42 PDT 2015


From: Michel Dänzer <michel.daenzer at amd.com>

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.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_present.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/radeon_present.c b/src/radeon_present.c
index 49acb23..bd4d8f2 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);
 }
 
 /*
-- 
2.1.4



More information about the xorg-driver-ati mailing list