Skip to content

Commit

Permalink
drm/i915/execlists: Request the kernel context be pinned high
Browse files Browse the repository at this point in the history
PIN_HIGH is an expensive operation (in comparison to allocating from the
hole stack) unsuitable for frequent use (such as switching between
contexts). However, the kernel context should be pinned just once for
the lifetime of the driver, and here it is appropriate to keep it out of
the mappable range (in order to maximise mappable space for users).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161218153724.8439-6-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Dec 18, 2016
1 parent 70ffe99 commit 2947e40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/i915/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ static int execlists_context_pin(struct intel_engine_cs *engine,
struct i915_gem_context *ctx)
{
struct intel_context *ce = &ctx->engine[engine->id];
unsigned int flags;
void *vaddr;
int ret;

Expand All @@ -781,8 +782,11 @@ static int execlists_context_pin(struct intel_engine_cs *engine,
goto err;
}

ret = i915_vma_pin(ce->state, 0, GEN8_LR_CONTEXT_ALIGN,
PIN_OFFSET_BIAS | GUC_WOPCM_TOP | PIN_GLOBAL);
flags = PIN_OFFSET_BIAS | GUC_WOPCM_TOP | PIN_GLOBAL;
if (ctx == ctx->i915->kernel_context)
flags |= PIN_HIGH;

ret = i915_vma_pin(ce->state, 0, GEN8_LR_CONTEXT_ALIGN, flags);
if (ret)
goto err;

Expand Down

0 comments on commit 2947e40

Please sign in to comment.