Commit 542110f2 authored by Lucas De Marchi's avatar Lucas De Marchi

drm/i915: Invert if/else ladder for stolen init

Continue converting the driver to the convention of last version first,
extending it to the future platforms. Now, any GRAPHICS_VER >= 11 will
be handled by the first branch.
Reviewed-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220908-if-ladder-v2-3-7a7b15545c93@intel.com
Link: https://patchwork.freedesktop.org/patch/msgid/20220912-copy-engine-v1-1-ef92fd81758d@intel.com
parent 1416b547
...@@ -428,48 +428,29 @@ static int i915_gem_init_stolen(struct intel_memory_region *mem) ...@@ -428,48 +428,29 @@ static int i915_gem_init_stolen(struct intel_memory_region *mem)
reserved_base = stolen_top; reserved_base = stolen_top;
reserved_size = 0; reserved_size = 0;
switch (GRAPHICS_VER(i915)) { if (GRAPHICS_VER(i915) >= 11) {
case 2: icl_get_stolen_reserved(i915, uncore,
case 3:
break;
case 4:
if (!IS_G4X(i915))
break;
fallthrough;
case 5:
g4x_get_stolen_reserved(i915, uncore,
&reserved_base, &reserved_size); &reserved_base, &reserved_size);
break; } else if (GRAPHICS_VER(i915) >= 8) {
case 6:
gen6_get_stolen_reserved(i915, uncore,
&reserved_base, &reserved_size);
break;
case 7:
if (IS_VALLEYVIEW(i915))
vlv_get_stolen_reserved(i915, uncore,
&reserved_base, &reserved_size);
else
gen7_get_stolen_reserved(i915, uncore,
&reserved_base, &reserved_size);
break;
case 8:
case 9:
if (IS_LP(i915)) if (IS_LP(i915))
chv_get_stolen_reserved(i915, uncore, chv_get_stolen_reserved(i915, uncore,
&reserved_base, &reserved_size); &reserved_base, &reserved_size);
else else
bdw_get_stolen_reserved(i915, uncore, bdw_get_stolen_reserved(i915, uncore,
&reserved_base, &reserved_size); &reserved_base, &reserved_size);
break; } else if (GRAPHICS_VER(i915) >= 7) {
default: if (IS_VALLEYVIEW(i915))
MISSING_CASE(GRAPHICS_VER(i915)); vlv_get_stolen_reserved(i915, uncore,
fallthrough; &reserved_base, &reserved_size);
case 11: else
case 12: gen7_get_stolen_reserved(i915, uncore,
icl_get_stolen_reserved(i915, uncore, &reserved_base, &reserved_size);
&reserved_base, } else if (GRAPHICS_VER(i915) >= 6) {
&reserved_size); gen6_get_stolen_reserved(i915, uncore,
break; &reserved_base, &reserved_size);
} else if (GRAPHICS_VER(i915) >= 5 || IS_G4X(i915)) {
g4x_get_stolen_reserved(i915, uncore,
&reserved_base, &reserved_size);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment