]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915: Extract intel_bw_crtc_disable_noatomic()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 6 Mar 2025 16:34:10 +0000 (18:34 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 7 Mar 2025 17:02:35 +0000 (19:02 +0200)
Hoist the bw stuff into a separate function from
intel_crtc_disable_noatomic_complete() so that the details
are better hidden inside intel_bw.c.

We can also skip the whole thing on pre-skl since the dbuf state
isn't actually used on those platforms.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250306163420.3961-9-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_bw.c
drivers/gpu/drm/i915/display/intel_bw.h
drivers/gpu/drm/i915/display/intel_modeset_setup.c

index 23edc81741dee8d49fa57fdb580ac48a816097a5..417d2d527ae437466fe03f6115b502ca483fccdb 100644 (file)
@@ -1422,6 +1422,20 @@ int intel_bw_atomic_check(struct intel_atomic_state *state)
        return 0;
 }
 
+void intel_bw_crtc_disable_noatomic(struct intel_crtc *crtc)
+{
+       struct intel_display *display = to_intel_display(crtc);
+       struct intel_bw_state *bw_state =
+               to_intel_bw_state(display->bw.obj.state);
+       enum pipe pipe = crtc->pipe;
+
+       if (DISPLAY_VER(display) < 9)
+               return;
+
+       bw_state->data_rate[pipe] = 0;
+       bw_state->num_active_planes[pipe] = 0;
+}
+
 static struct intel_global_state *
 intel_bw_duplicate_state(struct intel_global_obj *obj)
 {
index 161813cca473368ab017515a3251c2cb6a20baf5..bd94dde207eec92c5607ac1eb7913ac48a96edb3 100644 (file)
@@ -14,6 +14,7 @@
 
 struct drm_i915_private;
 struct intel_atomic_state;
+struct intel_crtc;
 struct intel_crtc_state;
 
 struct intel_dbuf_bw {
@@ -81,5 +82,6 @@ int intel_bw_calc_min_cdclk(struct intel_atomic_state *state,
                            bool *need_cdclk_calc);
 int intel_bw_min_cdclk(struct drm_i915_private *i915,
                       const struct intel_bw_state *bw_state);
+void intel_bw_crtc_disable_noatomic(struct intel_crtc *crtc);
 
 #endif /* __INTEL_BW_H__ */
index 10a2421f7c50a3571e7c61052edd609979d7ac9f..e9b0533526f608954a1f0a9c8eb8454d96994044 100644 (file)
@@ -156,8 +156,6 @@ static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc)
 {
        struct intel_display *display = to_intel_display(crtc);
        struct drm_i915_private *i915 = to_i915(crtc->base.dev);
-       struct intel_bw_state *bw_state =
-               to_intel_bw_state(i915->display.bw.obj.state);
        struct intel_pmdemand_state *pmdemand_state =
                to_intel_pmdemand_state(i915->display.pmdemand.obj.state);
        struct intel_crtc_state *crtc_state =
@@ -177,9 +175,7 @@ static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc)
 
        intel_cdclk_crtc_disable_noatomic(crtc);
        skl_wm_crtc_disable_noatomic(crtc);
-
-       bw_state->data_rate[pipe] = 0;
-       bw_state->num_active_planes[pipe] = 0;
+       intel_bw_crtc_disable_noatomic(crtc);
 
        intel_pmdemand_update_port_clock(display, pmdemand_state, pipe, 0);
 }