drm/i915: Match code to comment and enforce ppgtt for execlists

Our execlist dispatch code requires a ppGTT so make sure we enforce that
option in intel_sanitize_enable_ppgtt(). The comment already tries to
explain that execlists requires ppgtt, but was written when gen8 may
have also taken the legacy path; so rewrite the code to match the
comment by using HAS_EXECLISTS() feature instead of the gen.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180922141804.21183-1-chris@chris-wilson.co.uk
This commit is contained in:
Chris Wilson 2018-09-22 15:18:03 +01:00
parent 570b16b559
commit 4a3d3f6785
2 changed files with 5 additions and 4 deletions

View File

@ -152,10 +152,10 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
} }
/* /*
* We don't allow disabling PPGTT for gen9+ as it's a requirement for * We don't allow disabling PPGTT for gen8+ as it's a requirement for
* execlists, the sole mechanism available to submit work. * execlists, the sole mechanism available to submit work.
*/ */
if (enable_ppgtt == 0 && INTEL_GEN(dev_priv) < 9) if (enable_ppgtt == 0 && !HAS_EXECLISTS(dev_priv))
return 0; return 0;
if (enable_ppgtt == 1) if (enable_ppgtt == 1)

View File

@ -430,7 +430,7 @@ static u64 execlists_update_context(struct i915_request *rq)
* PML4 is allocated during ppgtt init, so this is not needed * PML4 is allocated during ppgtt init, so this is not needed
* in 48-bit mode. * in 48-bit mode.
*/ */
if (ppgtt && !i915_vm_is_48bit(&ppgtt->vm)) if (!i915_vm_is_48bit(&ppgtt->vm))
execlists_update_context_pdps(ppgtt, reg_state); execlists_update_context_pdps(ppgtt, reg_state);
return ce->lrc_desc; return ce->lrc_desc;
@ -1376,6 +1376,7 @@ execlists_context_pin(struct intel_engine_cs *engine,
struct intel_context *ce = to_intel_context(ctx, engine); struct intel_context *ce = to_intel_context(ctx, engine);
lockdep_assert_held(&ctx->i915->drm.struct_mutex); lockdep_assert_held(&ctx->i915->drm.struct_mutex);
GEM_BUG_ON(!(ctx->ppgtt ?: ctx->i915->mm.aliasing_ppgtt));
if (likely(ce->pin_count++)) if (likely(ce->pin_count++))
return ce; return ce;
@ -2705,7 +2706,7 @@ static void execlists_init_reg_state(u32 *regs,
CTX_REG(regs, CTX_PDP0_UDW, GEN8_RING_PDP_UDW(engine, 0), 0); CTX_REG(regs, CTX_PDP0_UDW, GEN8_RING_PDP_UDW(engine, 0), 0);
CTX_REG(regs, CTX_PDP0_LDW, GEN8_RING_PDP_LDW(engine, 0), 0); CTX_REG(regs, CTX_PDP0_LDW, GEN8_RING_PDP_LDW(engine, 0), 0);
if (ppgtt && i915_vm_is_48bit(&ppgtt->vm)) { if (i915_vm_is_48bit(&ppgtt->vm)) {
/* 64b PPGTT (48bit canonical) /* 64b PPGTT (48bit canonical)
* PDP0_DESCRIPTOR contains the base address to PML4 and * PDP0_DESCRIPTOR contains the base address to PML4 and
* other PDP Descriptors are ignored. * other PDP Descriptors are ignored.