[PATCH 2/5] drm/syncobj: add sync obj wait interface. (v2)

Christian König deathsimple at vodafone.de
Fri May 12 08:57:19 UTC 2017


Am 12.05.2017 um 10:49 schrieb Chris Wilson:
> On Fri, May 12, 2017 at 10:34:54AM +1000, Dave Airlie wrote:
>> +static int drm_syncobj_wait_all_fences(struct drm_device *dev,
>> +				       struct drm_file *file_private,
>> +				       struct drm_syncobj_wait *wait,
>> +				       uint32_t *handles)
>> +{
>> +	uint32_t i;
>> +	int ret = 0;
>> +	unsigned long timeout = nsecs_to_jiffies(wait->timeout_ns);
>> +
>> +	for (i = 0; i < wait->count_handles; i++) {
>> +		struct dma_fence *fence;
>> +
>> +		ret = drm_syncobj_fence_get(file_private, handles[i],
>> +					    &fence);
>> +		if (ret)
>> +			return ret;
>> +
>> +		if (!fence)
>> +			continue;
>> +
>> +		ret = dma_fence_wait_timeout(fence, true, timeout);
> Doesn't handle -EINTR yet with timeout. If having a drmIoctl() that
> can't be tricked into turning a short waiting into an indefinite one is a
> goal.

Yeah, Daniel summarized that once nicely by noting that timeouts should 
be absolute not relative.

Christian.

> -Chris
>



More information about the amd-gfx mailing list