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

Michel Dänzer michel at daenzer.net
Tue Nov 3 19:22:30 PST 2015


On 03.11.2015 15:43, Zhou, Jammy wrote:
>> If crtc_msc >= msc, the DRM_IOCTL_WAIT_VBLANK ioctl should generate the userspace event immediately
> Yes, that works. But the round trip of the vblank handling makes the performance worse.

Any chance you could share specific numbers? Otherwise, it's hard for me
to imagine how this could make a significant difference.


> -----Original Message-----
> From: Michel Dänzer [mailto:michel at daenzer.net] 
> Sent: Monday, November 02, 2015 5:44 PM
> To: Zhou, Jammy
> Cc: xorg-driver-ati at lists.x.org
> Subject: Re: [PATCH xf86-video-amdgpu] Call present_event_notify directly if target_msc <= crtc_msc (v2)
> 
> 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