[PATCH xf86-video-amdgpu] Call present_event_notify directly if target_msc <= crtc_msc (v2)

Jammy Zhou Jammy.Zhou at amd.com
Wed Oct 28 22:34:57 PDT 2015


Do present immediately in this case.

v2: fix the overflow

Change-Id: I25b9212169ccbf572b88c033dc09c0ac5cfa4812
Signed-off-by: Jammy Zhou <Jammy.Zhou at amd.com>
---
 src/amdgpu_present.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index 5e5ed72..b9cc1c7 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -160,6 +160,16 @@ amdgpu_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc)
 	struct amdgpu_drm_queue_entry *queue;
 	drmVBlank vbl;
 	int ret;
+	uint64_t crtc_ust, crtc_msc;
+
+	ret = amdgpu_present_get_ust_msc(crtc, &crtc_ust, &crtc_msc);
+	if (ret != Success)
+		return ret;
+
+	if (crtc_msc >= msc) {
+		present_event_notify(event_id, crtc_ust, crtc_msc);
+		return Success;
+	}
 
 	event = calloc(sizeof(struct amdgpu_present_vblank_event), 1);
 	if (!event)
-- 
1.9.1



More information about the xorg-driver-ati mailing list