[Intel-gfx] [PATCH 01/18] drm/i915: Support asynchronous waits on struct fence from i915_gem_request
Joonas Lahtinen
joonas.lahtinen at linux.intel.com
Wed Sep 14 07:37:18 UTC 2016
On ke, 2016-09-14 at 07:52 +0100, Chris Wilson wrote:
> +int
> +i915_gem_request_await_fence(struct drm_i915_gem_request *req,
> + struct fence *fence)
> +{
> + struct fence_array *array;
> + int ret;
> + int i;
> +
> + if (test_bit(FENCE_FLAG_SIGNALED_BIT, &fence->flags))
> + return 0;
> +
> + if (fence_is_i915(fence))
> + return i915_gem_request_await_request(req, to_request(fence));
> +
> + if (!fence_is_array(fence)) {
> + ret = i915_sw_fence_await_dma_fence(&req->submit,
> + fence, 10*HZ,
Magic 10*HZ, give it a define it is not temporary.
> + GFP_KERNEL);
> + return ret < 0 ? ret : 0;
> + }
> +
> + array = to_fence_array(fence);
> + for (i = 0; i < array->num_fences; i++) {
> + struct fence *child = array->fences[i];
> +
> + if (fence_is_i915(child))
> + ret = i915_gem_request_await_request(req,
> + to_request(child));
> + else
> + ret = i915_sw_fence_await_dma_fence(&req->submit,
> + child, 10*HZ,
> + GFP_KERNEL);
This chunk repeats from above, make it a small
__i915_gem_request_await_fence function.
> + if (ret < 0)
> + return ret;
How about the failure case when we're half bound, no need to tear down?
No uses in this patch so hard to evaluate.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
More information about the Intel-gfx
mailing list