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

Michel Dänzer michel at daenzer.net
Mon Nov 2 01:44:25 PST 2015


On 29.10.2015 14:34, Jammy Zhou wrote:
> 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;
> +	}

If crtc_msc >= msc, the DRM_IOCTL_WAIT_VBLANK ioctl should generate the
userspace event immediately, so I'm not sure anymore why this patch
would make any difference. Can you provide more details about what
exactly happens with and without this patch?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-driver-ati mailing list