drm/i915: Fix watermark calculations for gen12+ CCS+CC modifier
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 3 Oct 2022 11:15:41 +0000 (14:15 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:35 +0000 (12:34 +0200)
commit 070a2855900de17b1e11a0dc35af9794e80f1a28 upstream.

Take the gen12+ CCS+CC modifier into account when calculating the
watermarks. Othwerwise we'll calculate the watermarks thinking this
Y-tiled modifier is linear.

The rc_surface part is actually a nop since that is not used
for any glk+ platform.

Cc: stable@vger.kernel.org
Fixes: d1e2775e9b96 ("drm/i915/tgl: Add Clear Color support for TGL Render Decompression")
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221003111544.8007-4-ville.syrjala@linux.intel.com
(cherry picked from commit a627455bbe50a111475d7a42beb58fa64bd96c83)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/intel_pm.c

index 59bd37880d38dd91b72466e2a0bfaffc1dd263b8..614cb84f2ceecb40db68c540fa13eeb57b64f75e 100644 (file)
@@ -5404,12 +5404,14 @@ skl_compute_wm_params(const struct intel_crtc_state *crtc_state,
                      modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
                      modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
                      modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS ||
-                     modifier == I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS;
+                     modifier == I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS ||
+                     modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC;
        wp->x_tiled = modifier == I915_FORMAT_MOD_X_TILED;
        wp->rc_surface = modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
                         modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
                         modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS ||
-                        modifier == I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS;
+                        modifier == I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS ||
+                        modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC;
        wp->is_planar = intel_format_info_is_yuv_semiplanar(format, modifier);
 
        wp->width = width;