Commit 1ec96860 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Extract intel_bw_crtc_disable_noatomic()



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: default avatarVinod Govindapillai <vinod.govindapillai@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250306163420.3961-9-ville.syrjala@linux.intel.com
parent d34b59d5
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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)
{
+2 −0
Original line number Diff line number Diff line
@@ -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__ */
+1 −5
Original line number Diff line number Diff line
@@ -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);
}