We probably shouldn't print out WOPCM size on platforms that don't have GuC. We also want to make sure we don't hit any asserts if user explicitly sets enable_guc != 0 on non-guc platforms. Signed-off-by: Michał Winiarski <michal.winiarski@xxxxxxxxx> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: Jackie Li <yaodong.li@xxxxxxxxx> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx> --- drivers/gpu/drm/i915/intel_wopcm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_wopcm.c b/drivers/gpu/drm/i915/intel_wopcm.c index be8fca80aeca..828800ca119c 100644 --- a/drivers/gpu/drm/i915/intel_wopcm.c +++ b/drivers/gpu/drm/i915/intel_wopcm.c @@ -69,6 +69,9 @@ */ void intel_wopcm_init_early(struct intel_wopcm *wopcm) { + if (!HAS_GUC(wopcm_to_i915(wopcm))) + return; + wopcm->size = GEN9_WOPCM_SIZE; DRM_DEBUG_DRIVER("WOPCM size: %uKiB\n", wopcm->size / 1024); @@ -285,8 +288,12 @@ static int wopcm_guc_region_init(struct intel_wopcm *wopcm) */ int intel_wopcm_init(struct intel_wopcm *wopcm) { + struct drm_i915_private *dev_priv = wopcm_to_i915(wopcm); int err; + if (!HAS_GUC(dev_priv) || !USES_GUC(dev_priv)) + return 0; + GEM_BUG_ON(!wopcm->size); err = wopcm_guc_region_init(wopcm); @@ -319,10 +326,9 @@ void intel_wopcm_init_hw(struct intel_wopcm *wopcm) { struct drm_i915_private *dev_priv = wopcm_to_i915(wopcm); - if (!USES_GUC(dev_priv)) + if (!HAS_GUC(dev_priv) || !USES_GUC(dev_priv)) return; - GEM_BUG_ON(!HAS_GUC(dev_priv)); GEM_BUG_ON(!wopcm->guc.size); GEM_BUG_ON(!wopcm->guc.base); -- 2.14.3 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx