[Intel-gfx] [PATCH 7/8] drm/i915/guc: Don't touch WOPCM if we're not using GuC
Michał Winiarski
michal.winiarski at intel.com
Fri Mar 23 12:34:10 UTC 2018
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 at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Jackie Li <yaodong.li at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
---
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
More information about the Intel-gfx
mailing list