drm/i915: switch num_scalers/num_sprites to consider DISPLAY_VER
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 28 Jul 2021 21:59:43 +0000 (14:59 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 30 Jul 2021 17:19:47 +0000 (10:19 -0700)
The numbers of scalers and sprites depend on the display version, so use
it instead of GRAPHICS_VER. We were mixing both, which let me confused
while removing CNL and GRAPHICS_VER == 10.

v2 (Rodrigo): Switch IS_GEMINILAKE to DISPLAY_VER == 10
v3 (Lucas): Change check to DISPLAY_VER >= 9, to cover the GLK's num_scalers,
otherwise it remains set to 0.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210728215946.1573015-23-lucas.demarchi@intel.com
drivers/gpu/drm/i915/intel_device_info.c

index 99b51c2..b674d03 100644 (file)
@@ -267,10 +267,10 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
        if (IS_ADLS_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A2))
                for_each_pipe(dev_priv, pipe)
                        runtime->num_scalers[pipe] = 0;
-       else if (GRAPHICS_VER(dev_priv) >= 10) {
+       else if (DISPLAY_VER(dev_priv) >= 11) {
                for_each_pipe(dev_priv, pipe)
                        runtime->num_scalers[pipe] = 2;
-       } else if (GRAPHICS_VER(dev_priv) == 9) {
+       } else if (DISPLAY_VER(dev_priv) >= 9) {
                runtime->num_scalers[PIPE_A] = 2;
                runtime->num_scalers[PIPE_B] = 2;
                runtime->num_scalers[PIPE_C] = 1;
@@ -281,10 +281,10 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
        if (DISPLAY_VER(dev_priv) >= 13 || HAS_D12_PLANE_MINIMIZATION(dev_priv))
                for_each_pipe(dev_priv, pipe)
                        runtime->num_sprites[pipe] = 4;
-       else if (GRAPHICS_VER(dev_priv) >= 11)
+       else if (DISPLAY_VER(dev_priv) >= 11)
                for_each_pipe(dev_priv, pipe)
                        runtime->num_sprites[pipe] = 6;
-       else if (GRAPHICS_VER(dev_priv) == 10 || IS_GEMINILAKE(dev_priv))
+       else if (DISPLAY_VER(dev_priv) == 10)
                for_each_pipe(dev_priv, pipe)
                        runtime->num_sprites[pipe] = 3;
        else if (IS_BROXTON(dev_priv)) {
@@ -303,7 +303,7 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
        } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
                for_each_pipe(dev_priv, pipe)
                        runtime->num_sprites[pipe] = 2;
-       } else if (GRAPHICS_VER(dev_priv) >= 5 || IS_G4X(dev_priv)) {
+       } else if (DISPLAY_VER(dev_priv) >= 5 || IS_G4X(dev_priv)) {
                for_each_pipe(dev_priv, pipe)
                        runtime->num_sprites[pipe] = 1;
        }