[Intel-gfx] [PATCH 2/3] drm/i915/selftests: Wrap a timer into a i915_sw_fence

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu Oct 12 09:20:21 UTC 2017


On 12/10/2017 09:33, Chris Wilson wrote:
> Quoting Chris Wilson (2017-10-11 15:06:06)
>> +void timed_fence_init(struct timed_fence *tf, long expires)
>> +{
>> +       i915_sw_fence_init(&tf->fence, timer_fence_notify);
>> +
>> +       setup_timer_on_stack(&tf->timer, timed_fence_wake, (unsigned long)tf);
>> +       mod_timer(&tf->timer, expires);
>> +}
>> +
>> +void timed_fence_fini(struct timed_fence *tf)
>> +{
>> +       if (del_timer_sync(&tf->timer))
>> +               i915_sw_fence_complete(&tf->fence);
> 
> Needs the paired destroy_timer_on_stack(&tf->fence);

I would probably have missed this, not a fan of this on_stack API in the 
first place.

Anyway, with that:

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the Intel-gfx mailing list