diff options
author | Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> | 2017-04-11 03:11:12 -0700 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-04-11 19:44:04 +0100 |
commit | ddfb570c205446fc6dcfaff1efb5c0e5ca1b30d7 (patch) | |
tree | d7ee0535b7be4bd120d44b414cc790f612fe8d56 /drivers/gpu/drm/i915/intel_lrc.c | |
parent | 5f9be05432cb4c323967f6d71ce0ecc024a775c7 (diff) | |
download | op-kernel-dev-ddfb570c205446fc6dcfaff1efb5c0e5ca1b30d7.zip op-kernel-dev-ddfb570c205446fc6dcfaff1efb5c0e5ca1b30d7.tar.gz |
drm/i915: Use the engine class to get the context size
Technically speaking, the context size is per engine class, not per
instance.
v2: Add MISSING_CASE (Tvrtko)
v3: Rebased
v4: Restore the interface back to hiding the class lookup (Chris)
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1491905472-16189-1-git-send-email-oscar.mateo@intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lrc.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 0dc1cc4..711125a 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -1923,21 +1923,30 @@ populate_lr_context(struct i915_gem_context *ctx, */ uint32_t intel_lr_context_size(struct intel_engine_cs *engine) { - int ret = 0; + struct drm_i915_private *dev_priv = engine->i915; + int ret; - WARN_ON(INTEL_GEN(engine->i915) < 8); + WARN_ON(INTEL_GEN(dev_priv) < 8); - switch (engine->id) { - case RCS: - if (INTEL_GEN(engine->i915) >= 9) + switch (engine->class) { + case RENDER_CLASS: + switch (INTEL_GEN(dev_priv)) { + default: + MISSING_CASE(INTEL_GEN(dev_priv)); + case 9: ret = GEN9_LR_CONTEXT_RENDER_SIZE; - else + break; + case 8: ret = GEN8_LR_CONTEXT_RENDER_SIZE; + break; + } break; - case VCS: - case BCS: - case VECS: - case VCS2: + + default: + MISSING_CASE(engine->class); + case VIDEO_DECODE_CLASS: + case VIDEO_ENHANCEMENT_CLASS: + case COPY_ENGINE_CLASS: ret = GEN8_LR_CONTEXT_OTHER_SIZE; break; } |