From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_gem_stolen.c | 36 ++++++++++---------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index 0afd50cf71de..4a9f545f0c4e 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -356,34 +356,26 @@ int i915_gem_init_stolen(struct drm_i915_private *dev_priv) reserved_base = 0; reserved_size = 0; - switch (INTEL_GEN(dev_priv)) { - case 2: - case 3: - break; - case 4: - if (!IS_G4X(dev_priv)) - break; - /* fall through */ - case 5: - g4x_get_stolen_reserved(dev_priv, - &reserved_base, &reserved_size); - break; - case 6: - gen6_get_stolen_reserved(dev_priv, - &reserved_base, &reserved_size); - break; - case 7: - gen7_get_stolen_reserved(dev_priv, - &reserved_base, &reserved_size); - break; - default: + if (IS_GEN(dev_priv, 8, GEN_FOREVER)) { if (IS_LP(dev_priv)) chv_get_stolen_reserved(dev_priv, &reserved_base, &reserved_size); else bdw_get_stolen_reserved(dev_priv, &reserved_base, &reserved_size); - break; + + } else if (IS_GEN(dev_priv, 7, GEN_FOREVER)) { + gen7_get_stolen_reserved(dev_priv, + &reserved_base, &reserved_size); + } else if (IS_GEN(dev_priv, 6, GEN_FOREVER)) { + gen6_get_stolen_reserved(dev_priv, + &reserved_base, &reserved_size); + } else if (IS_GEN(dev_priv, 5, GEN_FOREVER)) { + g4x_get_stolen_reserved(dev_priv, + &reserved_base, &reserved_size); + } else if (IS_GEN(dev_priv, 4, GEN_FOREVER) && IS_G4X(dev_priv)) { + g4x_get_stolen_reserved(dev_priv, + &reserved_base, &reserved_size); } /* It is possible for the reserved base to be zero, but the register -- 2.27.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx