drm/i915: Include "ignore lines" in skl+ wm state
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 13 Feb 2019 16:54:23 +0000 (18:54 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 14 Feb 2019 19:30:30 +0000 (21:30 +0200)
We'll need to poke at the "ignore lines" bit in the skl+
watermark registers for a w/a. Include that bit in the wm
state.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190213165424.22904-2-ville.syrjala@linux.intel.com
Reviewed-by: Clint Taylor <Clinton.A.Taylor@intel.com>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_pm.c

index 17fe942eaafa0ab57626676c4da5a4573b7324f1..5c8d0489a1cd968a16bee6fa1506575dfa478898 100644 (file)
@@ -1126,6 +1126,7 @@ struct skl_wm_level {
        u16 plane_res_b;
        u8 plane_res_l;
        bool plane_en;
+       bool ignore_lines;
 };
 
 /* Stores plane specific WM parameters */
index 2ee810d466addc7f4c60c5af3c2e613457aa0eda..a5a47369cbd521bfde8188cc56e2cfa0e088e009 100644 (file)
@@ -6032,6 +6032,7 @@ enum {
 #define _CUR_WM_TRANS_A_0      0x70168
 #define _CUR_WM_TRANS_B_0      0x71168
 #define   PLANE_WM_EN          (1 << 31)
+#define   PLANE_WM_IGNORE_LINES        (1 << 30)
 #define   PLANE_WM_LINES_SHIFT 14
 #define   PLANE_WM_LINES_MASK  0x1f
 #define   PLANE_WM_BLOCKS_MASK 0x7ff /* skl+: 10 bits, icl+ 11 bits */
index 7745ce20a6cdef06257fe7668c359d0ea25dbdf1..9485645a41b05fdd3d8e3d6f13a8f8d392898f93 100644 (file)
@@ -5053,11 +5053,12 @@ static void skl_write_wm_level(struct drm_i915_private *dev_priv,
 {
        u32 val = 0;
 
-       if (level->plane_en) {
+       if (level->plane_en)
                val |= PLANE_WM_EN;
-               val |= level->plane_res_b;
-               val |= level->plane_res_l << PLANE_WM_LINES_SHIFT;
-       }
+       if (level->ignore_lines)
+               val |= PLANE_WM_IGNORE_LINES;
+       val |= level->plane_res_b;
+       val |= level->plane_res_l << PLANE_WM_LINES_SHIFT;
 
        I915_WRITE_FW(reg, val);
 }
@@ -5123,6 +5124,7 @@ bool skl_wm_level_equals(const struct skl_wm_level *l1,
                         const struct skl_wm_level *l2)
 {
        return l1->plane_en == l2->plane_en &&
+               l1->ignore_lines == l2->ignore_lines &&
                l1->plane_res_l == l2->plane_res_l &&
                l1->plane_res_b == l2->plane_res_b;
 }
@@ -5331,19 +5333,28 @@ skl_print_wm_changes(struct intel_atomic_state *state)
                                      enast(new_wm->wm[6].plane_en), enast(new_wm->wm[7].plane_en),
                                      enast(new_wm->trans_wm.plane_en));
 
-                       DRM_DEBUG_KMS("[PLANE:%d:%s]   lines %4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d"
-                                     " -> %4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d\n",
+                       DRM_DEBUG_KMS("[PLANE:%d:%s]   lines %c%3d,%c%3d,%c%3d,%c%3d,%c%3d,%c%3d,%c%3d,%c%3d,%c%3d"
+                                     " -> %c%3d,%c%3d,%c%3d,%c%3d,%c%3d,%c%3d,%c%3d,%c%3d,%c%3d\n",
                                      plane->base.base.id, plane->base.name,
-                                     old_wm->wm[0].plane_res_l, old_wm->wm[1].plane_res_l,
-                                     old_wm->wm[2].plane_res_l, old_wm->wm[3].plane_res_l,
-                                     old_wm->wm[4].plane_res_l, old_wm->wm[5].plane_res_l,
-                                     old_wm->wm[6].plane_res_l, old_wm->wm[7].plane_res_l,
-                                     old_wm->trans_wm.plane_res_l,
-                                     new_wm->wm[0].plane_res_l, new_wm->wm[1].plane_res_l,
-                                     new_wm->wm[2].plane_res_l, new_wm->wm[3].plane_res_l,
-                                     new_wm->wm[4].plane_res_l, new_wm->wm[5].plane_res_l,
-                                     new_wm->wm[6].plane_res_l, new_wm->wm[7].plane_res_l,
-                                     new_wm->trans_wm.plane_res_l);
+                                     enast(old_wm->wm[0].ignore_lines), old_wm->wm[0].plane_res_l,
+                                     enast(old_wm->wm[1].ignore_lines), old_wm->wm[1].plane_res_l,
+                                     enast(old_wm->wm[2].ignore_lines), old_wm->wm[2].plane_res_l,
+                                     enast(old_wm->wm[3].ignore_lines), old_wm->wm[3].plane_res_l,
+                                     enast(old_wm->wm[4].ignore_lines), old_wm->wm[4].plane_res_l,
+                                     enast(old_wm->wm[5].ignore_lines), old_wm->wm[5].plane_res_l,
+                                     enast(old_wm->wm[6].ignore_lines), old_wm->wm[6].plane_res_l,
+                                     enast(old_wm->wm[7].ignore_lines), old_wm->wm[7].plane_res_l,
+                                     enast(old_wm->trans_wm.ignore_lines), old_wm->trans_wm.plane_res_l,
+
+                                     enast(new_wm->wm[0].ignore_lines), new_wm->wm[0].plane_res_l,
+                                     enast(new_wm->wm[1].ignore_lines), new_wm->wm[1].plane_res_l,
+                                     enast(new_wm->wm[2].ignore_lines), new_wm->wm[2].plane_res_l,
+                                     enast(new_wm->wm[3].ignore_lines), new_wm->wm[3].plane_res_l,
+                                     enast(new_wm->wm[4].ignore_lines), new_wm->wm[4].plane_res_l,
+                                     enast(new_wm->wm[5].ignore_lines), new_wm->wm[5].plane_res_l,
+                                     enast(new_wm->wm[6].ignore_lines), new_wm->wm[6].plane_res_l,
+                                     enast(new_wm->wm[7].ignore_lines), new_wm->wm[7].plane_res_l,
+                                     enast(new_wm->trans_wm.ignore_lines), new_wm->trans_wm.plane_res_l);
 
                        DRM_DEBUG_KMS("[PLANE:%d:%s]  blocks %4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d"
                                      " -> %4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d,%4d\n",
@@ -5686,6 +5697,7 @@ static inline void skl_wm_level_from_reg_val(u32 val,
                                             struct skl_wm_level *level)
 {
        level->plane_en = val & PLANE_WM_EN;
+       level->ignore_lines = val & PLANE_WM_IGNORE_LINES;
        level->plane_res_b = val & PLANE_WM_BLOCKS_MASK;
        level->plane_res_l = (val >> PLANE_WM_LINES_SHIFT) &
                PLANE_WM_LINES_MASK;