]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/wm: Extract skl_ddb_entry_verify()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 24 Mar 2026 13:48:40 +0000 (15:48 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 9 Apr 2026 15:07:21 +0000 (18:07 +0300)
Extract the DDB entry verification to a helper function.
We'll have another caller soon.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260324134843.2364-7-ville.syrjala@linux.intel.com
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
drivers/gpu/drm/i915/display/skl_watermark.c

index 3e323e434bfb016579bdd68e8f2c594d157396aa..17faf090a1540bc3c9618c698e848c6eb6bb2e28 100644 (file)
@@ -3934,6 +3934,23 @@ static void skl_wm_level_verify(struct intel_plane *plane,
                hw_wm_level->enable, hw_wm_level->blocks, hw_wm_level->lines);
 }
 
+static void skl_ddb_entry_verify(struct intel_plane *plane,
+                                const char *ddb_name,
+                                const struct skl_ddb_entry *hw_ddb_entry,
+                                const struct skl_ddb_entry *sw_ddb_entry)
+{
+       struct intel_display *display = to_intel_display(plane);
+
+       if (skl_ddb_entry_equal(hw_ddb_entry, sw_ddb_entry))
+               return;
+
+       drm_err(display->drm,
+               "[PLANE:%d:%s] mismatch in %s (expected (%u,%u), found (%u,%u))\n",
+               plane->base.base.id, plane->base.name, ddb_name,
+               sw_ddb_entry->start, sw_ddb_entry->end,
+               hw_ddb_entry->start, hw_ddb_entry->end);
+}
+
 void intel_wm_state_verify(struct intel_atomic_state *state,
                           struct intel_crtc *crtc)
 {
@@ -3977,7 +3994,6 @@ void intel_wm_state_verify(struct intel_atomic_state *state,
                        &hw->wm.planes[plane->id];
                const struct skl_plane_wm *sw_plane_wm =
                        &sw_wm->planes[plane->id];
-               const struct skl_ddb_entry *hw_ddb_entry, *sw_ddb_entry;
 
                for (level = 0; level < display->wm.num_levels; level++) {
                        char wm_name[16];
@@ -4003,17 +4019,9 @@ void intel_wm_state_verify(struct intel_atomic_state *state,
                                            &sw_plane_wm->sagv.trans_wm);
                }
 
-               /* DDB */
-               hw_ddb_entry = &hw->ddb[plane->id];
-               sw_ddb_entry = &new_crtc_state->wm.skl.plane_ddb[plane->id];
-
-               if (!skl_ddb_entry_equal(hw_ddb_entry, sw_ddb_entry)) {
-                       drm_err(display->drm,
-                               "[PLANE:%d:%s] mismatch in DDB (expected (%u,%u), found (%u,%u))\n",
-                               plane->base.base.id, plane->base.name,
-                               sw_ddb_entry->start, sw_ddb_entry->end,
-                               hw_ddb_entry->start, hw_ddb_entry->end);
-               }
+               skl_ddb_entry_verify(plane, "DDB",
+                                    &hw->ddb[plane->id],
+                                    &new_crtc_state->wm.skl.plane_ddb[plane->id]);
        }
 
        kfree(hw);