Skip to content

Commit

Permalink
drm/i915: Make active_pipes check skl specific
Browse files Browse the repository at this point in the history
Seems that only skl needs to have SAGV turned off
for multipipe scenarios, so lets do it this way.

If anything blows up - we can always revert this patch.

v2: Changed if condition to look better (Ville).

Signed-off-by: Stanislav Lisovskiy <[email protected]>
[vsyrjala: wrapped long line to appease checkpatch]
Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
StanFox1984 authored and vsyrjala committed May 13, 2020
1 parent 1d0a6c8 commit d8d5afe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 9 additions & 5 deletions drivers/gpu/drm/i915/intel_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3777,7 +3777,7 @@ void intel_sagv_pre_plane_update(struct intel_atomic_state *state)
if (!new_bw_state)
return;

if (!intel_can_enable_sagv(new_bw_state))
if (!intel_can_enable_sagv(dev_priv, new_bw_state))
intel_disable_sagv(dev_priv);
}

Expand All @@ -3800,7 +3800,7 @@ void intel_sagv_post_plane_update(struct intel_atomic_state *state)
if (!new_bw_state)
return;

if (intel_can_enable_sagv(new_bw_state))
if (intel_can_enable_sagv(dev_priv, new_bw_state))
intel_enable_sagv(dev_priv);
}

Expand Down Expand Up @@ -3858,16 +3858,19 @@ static bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state
return skl_crtc_can_enable_sagv(crtc_state);
}

bool intel_can_enable_sagv(const struct intel_bw_state *bw_state)
bool intel_can_enable_sagv(struct drm_i915_private *dev_priv,
const struct intel_bw_state *bw_state)
{
if (bw_state->active_pipes && !is_power_of_2(bw_state->active_pipes))
if (INTEL_GEN(dev_priv) < 11 &&
bw_state->active_pipes && !is_power_of_2(bw_state->active_pipes))
return false;

return bw_state->pipe_sagv_reject == 0;
}

static int intel_compute_sagv_mask(struct intel_atomic_state *state)
{
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
int ret;
struct intel_crtc *crtc;
const struct intel_crtc_state *new_crtc_state;
Expand Down Expand Up @@ -3901,7 +3904,8 @@ static int intel_compute_sagv_mask(struct intel_atomic_state *state)
return ret;
}

if (intel_can_enable_sagv(new_bw_state) != intel_can_enable_sagv(old_bw_state)) {
if (intel_can_enable_sagv(dev_priv, new_bw_state) !=
intel_can_enable_sagv(dev_priv, old_bw_state)) {
ret = intel_atomic_serialize_global_state(&new_bw_state->base);
if (ret)
return ret;
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/intel_pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void skl_pipe_wm_get_hw_state(struct intel_crtc *crtc,
struct skl_pipe_wm *out);
void g4x_wm_sanitize(struct drm_i915_private *dev_priv);
void vlv_wm_sanitize(struct drm_i915_private *dev_priv);
bool intel_can_enable_sagv(const struct intel_bw_state *bw_state);
bool intel_can_enable_sagv(struct drm_i915_private *dev_priv,
const struct intel_bw_state *bw_state);
int intel_enable_sagv(struct drm_i915_private *dev_priv);
int intel_disable_sagv(struct drm_i915_private *dev_priv);
void intel_sagv_pre_plane_update(struct intel_atomic_state *state);
Expand Down

0 comments on commit d8d5afe

Please sign in to comment.