[Intel-gfx] [PATCH v2] drm/i915: Remove local timeline var from submit/unsubmit
Chris Wilson
chris at chris-wilson.co.uk
Thu Mar 22 13:01:01 UTC 2018
Quoting Chris Wilson (2018-03-22 12:55:52)
> Both request_submit and request_unsubmit deal with transferring the
> request from the client's timeline onto the execution timeline and back
> again. As both functions deal with a pair of timeline's, using a
> shorthand for just one of them is slightly confusing, especially as the
> different functions use the shorthand for the alternate timeline.
> Instead, use the full version of each timeline so it should be easier to
> keep track of the transfer between the request/client and the engine.
>
> v2: Refactor the common lock+list_move
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_request.c | 29 ++++++++++++++---------------
> 1 file changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 2325886d1d55..cc4f01ea2a03 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -492,10 +492,19 @@ static u32 timeline_get_seqno(struct intel_timeline *tl)
> return ++tl->seqno;
> }
>
> +static void move_to_timeline(struct i915_request *request,
> + struct intel_timeline *timeline)
> +{
> + GEM_BUG_ON(request->timeline == request->engine->timeline);
lockdep_assert_held(&request->engine->timeline->lock);
for clarity.
> +
> + spin_lock(&request->timeline->lock);
> + list_move_tail(&request->link, &timeline->requests);
> + spin_unlock(&request->timeline->lock);
> +}
More information about the Intel-gfx
mailing list