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

Chris Wilson chris at chris-wilson.co.uk
Thu Oct 12 08:33:11 UTC 2017


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);
-Chris


More information about the Intel-gfx mailing list