diff options
author | Joonas Lahtinen <joonas.lahtinen@linux.intel.com> | 2017-04-28 03:53:36 -0400 |
---|---|---|
committer | Joonas Lahtinen <joonas.lahtinen@linux.intel.com> | 2017-04-28 05:11:59 -0400 |
commit | 63ffbcdadcf2b5dde2cd6db6715fc94e77cd43b6 (patch) | |
tree | fdb59ad7c9664bf324f71fbb053535de891e22e1 /drivers/gpu/drm/i915/intel_ringbuffer.c | |
parent | a3662830e1e120e9950072a48d75a61ed921ad4a (diff) |
drm/i915: Sanitize engine context sizes
Pre-calculate engine context size based on engine class and device
generation and store it in the engine instance.
v2:
- Squash and get rid of hw_context_size (Chris)
v3:
- Move after MMIO init for probing on Gen7 and 8 (Chris)
- Retained rounding (Tvrtko)
v4:
- Rebase for deferred legacy context allocation
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Oscar Mateo <oscar.mateo@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: intel-gvt-dev@lists.freedesktop.org
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 61f612454ce7..29b5afac7856 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -1444,7 +1444,7 @@ alloc_context_vma(struct intel_engine_cs *engine) | |||
1444 | struct drm_i915_gem_object *obj; | 1444 | struct drm_i915_gem_object *obj; |
1445 | struct i915_vma *vma; | 1445 | struct i915_vma *vma; |
1446 | 1446 | ||
1447 | obj = i915_gem_object_create(i915, i915->hw_context_size); | 1447 | obj = i915_gem_object_create(i915, engine->context_size); |
1448 | if (IS_ERR(obj)) | 1448 | if (IS_ERR(obj)) |
1449 | return ERR_CAST(obj); | 1449 | return ERR_CAST(obj); |
1450 | 1450 | ||
@@ -1487,7 +1487,7 @@ static int intel_ring_context_pin(struct intel_engine_cs *engine, | |||
1487 | return 0; | 1487 | return 0; |
1488 | GEM_BUG_ON(!ce->pin_count); /* no overflow please! */ | 1488 | GEM_BUG_ON(!ce->pin_count); /* no overflow please! */ |
1489 | 1489 | ||
1490 | if (engine->id == RCS && !ce->state && engine->i915->hw_context_size) { | 1490 | if (!ce->state && engine->context_size) { |
1491 | struct i915_vma *vma; | 1491 | struct i915_vma *vma; |
1492 | 1492 | ||
1493 | vma = alloc_context_vma(engine); | 1493 | vma = alloc_context_vma(engine); |