Skip to content

Commit

Permalink
drm/i915: Move dbuf_state->active_pipes into skl_wm_get_hw_state()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ville Syrjälä committed Mar 7, 2025
1 parent 14968c2 commit e6001c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 0 additions & 8 deletions drivers/gpu/drm/i915/display/intel_modeset_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,16 +693,13 @@ static void readout_plane_state(struct drm_i915_private *i915)
static void intel_modeset_readout_hw_state(struct drm_i915_private *i915)
{
struct intel_display *display = &i915->display;
struct intel_dbuf_state *dbuf_state =
to_intel_dbuf_state(i915->display.dbuf.obj.state);
struct intel_pmdemand_state *pmdemand_state =
to_intel_pmdemand_state(i915->display.pmdemand.obj.state);
enum pipe pipe;
struct intel_crtc *crtc;
struct intel_encoder *encoder;
struct intel_connector *connector;
struct drm_connector_list_iter conn_iter;
u8 active_pipes = 0;

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

if (crtc_state->hw.active)
active_pipes |= BIT(crtc->pipe);

drm_dbg_kms(&i915->drm,
"[CRTC:%d:%s] hw state readout: %s\n",
crtc->base.base.id, crtc->base.name,
str_enabled_disabled(crtc_state->hw.active));
}

dbuf_state->active_pipes = active_pipes;

readout_plane_state(i915);

for_each_intel_encoder(&i915->drm, encoder) {
Expand Down
5 changes: 4 additions & 1 deletion drivers/gpu/drm/i915/display/skl_watermark.c
Original file line number Diff line number Diff line change
Expand Up @@ -3157,6 +3157,7 @@ static void skl_wm_get_hw_state(struct drm_i915_private *i915)
dbuf_state->joined_mbus = intel_de_read(display, MBUS_CTL) & MBUS_JOIN;

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

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

memset(&crtc_state->wm.skl.optimal, 0,
sizeof(crtc_state->wm.skl.optimal));
if (crtc_state->hw.active)
if (crtc_state->hw.active) {
skl_pipe_wm_get_hw_state(crtc, &crtc_state->wm.skl.optimal);
dbuf_state->active_pipes |= BIT(pipe);
}
crtc_state->wm.skl.raw = crtc_state->wm.skl.optimal;

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

0 comments on commit e6001c9

Please sign in to comment.