Skip to content

Commit

Permalink
drm/i915/execlists: Prevent merging requests with conflicting flags
Browse files Browse the repository at this point in the history
We set out-of-bound parameters inside the i915_requests.flags field,
such as disabling preemption or marking the end-of-context. We should
not coalesce consecutive requests if they have differing instructions
as we only inspect the last active request in a context. Thus if we
allow a later request to be merged into the same execution context, it
will mask any of the earlier flags.

References: 2a98f4e ("drm/i915: add infrastructure to hold off preemption on a request")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191011190325.10979-9-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Oct 12, 2019
1 parent a5efcde commit d8ad5f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/i915/gt/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,9 @@ static bool can_merge_rq(const struct i915_request *prev,
if (i915_request_completed(next))
return true;

if (unlikely(prev->flags ^ next->flags) & I915_REQUEST_NOPREEMPT)
return false;

if (!can_merge_ctx(prev->hw_context, next->hw_context))
return false;

Expand Down

0 comments on commit d8ad5f5

Please sign in to comment.