aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorJoonas Lahtinen <[email protected]>2017-04-28 07:53:36 +0000
committerJoonas Lahtinen <[email protected]>2017-04-28 09:11:59 +0000
commit63ffbcdadcf2b5dde2cd6db6715fc94e77cd43b6 (patch)
treefdb59ad7c9664bf324f71fbb053535de891e22e1 /drivers/gpu/drm/i915/intel_ringbuffer.c
parentdrm/i915/guc: Fix sleep under spinlock during reset (diff)
downloadkernel-63ffbcdadcf2b5dde2cd6db6715fc94e77cd43b6.tar.gz
kernel-63ffbcdadcf2b5dde2cd6db6715fc94e77cd43b6.zip
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 <[email protected]> Cc: Paulo Zanoni <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: Oscar Mateo <[email protected]> Cc: Zhenyu Wang <[email protected]> Cc: [email protected] Acked-by: Tvrtko Ursulin <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Reviewed-by: Chris Wilson <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c4
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)
struct drm_i915_gem_object *obj;
struct i915_vma *vma;
- obj = i915_gem_object_create(i915, i915->hw_context_size);
+ obj = i915_gem_object_create(i915, engine->context_size);
if (IS_ERR(obj))
return ERR_CAST(obj);
@@ -1487,7 +1487,7 @@ static int intel_ring_context_pin(struct intel_engine_cs *engine,
return 0;
GEM_BUG_ON(!ce->pin_count); /* no overflow please! */
- if (engine->id == RCS && !ce->state && engine->i915->hw_context_size) {
+ if (!ce->state && engine->context_size) {
struct i915_vma *vma;
vma = alloc_context_vma(engine);