Skip to content

Commit e6001c9

Browse files
committed
drm/i915: Move dbuf_state->active_pipes into skl_wm_get_hw_state()
Move the dbuf_state readout parts into skl_wm_get_hw_state() so that the details are better hidden from sight. This will stop updating this on pre-skl, but that's what we want since the dbuf state is only used on skl+. 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-18-ville.syrjala@linux.intel.com
1 parent 14968c2 commit e6001c9

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

drivers/gpu/drm/i915/display/intel_modeset_setup.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -693,16 +693,13 @@ static void readout_plane_state(struct drm_i915_private *i915)
693693
static void intel_modeset_readout_hw_state(struct drm_i915_private *i915)
694694
{
695695
struct intel_display *display = &i915->display;
696-
struct intel_dbuf_state *dbuf_state =
697-
to_intel_dbuf_state(i915->display.dbuf.obj.state);
698696
struct intel_pmdemand_state *pmdemand_state =
699697
to_intel_pmdemand_state(i915->display.pmdemand.obj.state);
700698
enum pipe pipe;
701699
struct intel_crtc *crtc;
702700
struct intel_encoder *encoder;
703701
struct intel_connector *connector;
704702
struct drm_connector_list_iter conn_iter;
705-
u8 active_pipes = 0;
706703

707704
for_each_intel_crtc(&i915->drm, crtc) {
708705
struct intel_crtc_state *crtc_state =
@@ -719,17 +716,12 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915)
719716
crtc->base.enabled = crtc_state->hw.enable;
720717
crtc->active = crtc_state->hw.active;
721718

722-
if (crtc_state->hw.active)
723-
active_pipes |= BIT(crtc->pipe);
724-
725719
drm_dbg_kms(&i915->drm,
726720
"[CRTC:%d:%s] hw state readout: %s\n",
727721
crtc->base.base.id, crtc->base.name,
728722
str_enabled_disabled(crtc_state->hw.active));
729723
}
730724

731-
dbuf_state->active_pipes = active_pipes;
732-
733725
readout_plane_state(i915);
734726

735727
for_each_intel_encoder(&i915->drm, encoder) {

drivers/gpu/drm/i915/display/skl_watermark.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3157,6 +3157,7 @@ static void skl_wm_get_hw_state(struct drm_i915_private *i915)
31573157
dbuf_state->joined_mbus = intel_de_read(display, MBUS_CTL) & MBUS_JOIN;
31583158

31593159
dbuf_state->mdclk_cdclk_ratio = intel_mdclk_cdclk_ratio(display, &display->cdclk.hw);
3160+
dbuf_state->active_pipes = 0;
31603161

31613162
for_each_intel_crtc(display->drm, crtc) {
31623163
struct intel_crtc_state *crtc_state =
@@ -3168,8 +3169,10 @@ static void skl_wm_get_hw_state(struct drm_i915_private *i915)
31683169

31693170
memset(&crtc_state->wm.skl.optimal, 0,
31703171
sizeof(crtc_state->wm.skl.optimal));
3171-
if (crtc_state->hw.active)
3172+
if (crtc_state->hw.active) {
31723173
skl_pipe_wm_get_hw_state(crtc, &crtc_state->wm.skl.optimal);
3174+
dbuf_state->active_pipes |= BIT(pipe);
3175+
}
31733176
crtc_state->wm.skl.raw = crtc_state->wm.skl.optimal;
31743177

31753178
memset(&dbuf_state->ddb[pipe], 0, sizeof(dbuf_state->ddb[pipe]));

0 commit comments

Comments
 (0)