Skip to content

Commit

Permalink
drm/i915: Extract hsw_ips_get_config()
Browse files Browse the repository at this point in the history
Pull the IPS state readout into hsw_ips.c.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220209113526.7595-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
  • Loading branch information
Ville Syrjälä committed Feb 9, 2022
1 parent f3b603d commit 28f5f88
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
20 changes: 20 additions & 0 deletions drivers/gpu/drm/i915/display/hsw_ips.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,23 @@ int hsw_ips_compute_config(struct intel_atomic_state *state,

return 0;
}

void hsw_ips_get_config(struct intel_crtc_state *crtc_state)
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
struct drm_i915_private *i915 = to_i915(crtc->base.dev);

if (!hsw_crtc_supports_ips(crtc))
return;

if (IS_HASWELL(i915)) {
crtc_state->ips_enabled = intel_de_read(i915, IPS_CTL) & IPS_ENABLE;
} else {
/*
* We cannot readout IPS state on broadwell, set to
* true so we can set it to a defined state on first
* commit.
*/
crtc_state->ips_enabled = true;
}
}
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/display/hsw_ips.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ bool hsw_crtc_supports_ips(struct intel_crtc *crtc);
bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state);
int hsw_ips_compute_config(struct intel_atomic_state *state,
struct intel_crtc *crtc);
void hsw_ips_get_config(struct intel_crtc_state *crtc_state);

#endif /* __HSW_IPS_H__ */
14 changes: 1 addition & 13 deletions drivers/gpu/drm/i915/display/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -4191,19 +4191,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,
ilk_get_pfit_config(pipe_config);
}

if (hsw_crtc_supports_ips(crtc)) {
if (IS_HASWELL(dev_priv))
pipe_config->ips_enabled = intel_de_read(dev_priv,
IPS_CTL) & IPS_ENABLE;
else {
/*
* We cannot readout IPS state on broadwell, set to
* true so we can set it to a defined state on first
* commit.
*/
pipe_config->ips_enabled = true;
}
}
hsw_ips_get_config(pipe_config);

if (pipe_config->cpu_transcoder != TRANSCODER_EDP &&
!transcoder_is_dsi(pipe_config->cpu_transcoder)) {
Expand Down

0 comments on commit 28f5f88

Please sign in to comment.