Commit 61333b60 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Daniel Vetter

drm/i915: Do not run most checks when there's no modeset.

All the checks in intel_modeset_checks are only useful when a modeset
occurs, because there is nothing to update otherwise.

Same for power/cdclk changes, if there is no modeset they are noops.

Unfortunately intel_modeset_pipe_config still gets called without
modeset, because atomic hw readout isn't done yet.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Tested-by(IVB): Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent ac21b225
...@@ -13169,18 +13169,18 @@ intel_modeset_compute_config(struct drm_atomic_state *state) ...@@ -13169,18 +13169,18 @@ intel_modeset_compute_config(struct drm_atomic_state *state)
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state; struct drm_crtc_state *crtc_state;
int ret, i; int ret, i;
bool any_ms = false;
ret = drm_atomic_helper_check_modeset(state->dev, state); ret = drm_atomic_helper_check_modeset(state->dev, state);
if (ret) if (ret)
return ret; return ret;
for_each_crtc_in_state(state, crtc, crtc_state, i) { for_each_crtc_in_state(state, crtc, crtc_state, i) {
if (!crtc_state->enable && if (!crtc_state->enable) {
WARN_ON(crtc_state->active)) if (needs_modeset(crtc_state))
crtc_state->active = false; any_ms = true;
if (!crtc_state->enable)
continue; continue;
}
if (!needs_modeset(crtc_state)) { if (!needs_modeset(crtc_state)) {
ret = drm_atomic_add_affected_connectors(state, crtc); ret = drm_atomic_add_affected_connectors(state, crtc);
...@@ -13193,14 +13193,20 @@ intel_modeset_compute_config(struct drm_atomic_state *state) ...@@ -13193,14 +13193,20 @@ intel_modeset_compute_config(struct drm_atomic_state *state)
if (ret) if (ret)
return ret; return ret;
if (needs_modeset(crtc_state))
any_ms = true;
intel_dump_pipe_config(to_intel_crtc(crtc), intel_dump_pipe_config(to_intel_crtc(crtc),
to_intel_crtc_state(crtc_state), to_intel_crtc_state(crtc_state),
"[modeset]"); "[modeset]");
} }
ret = intel_modeset_checks(state); if (any_ms) {
if (ret) ret = intel_modeset_checks(state);
return ret;
if (ret)
return ret;
}
return drm_atomic_helper_check_planes(state->dev, state); return drm_atomic_helper_check_planes(state->dev, state);
} }
...@@ -13213,6 +13219,7 @@ static int __intel_set_mode(struct drm_atomic_state *state) ...@@ -13213,6 +13219,7 @@ static int __intel_set_mode(struct drm_atomic_state *state)
struct drm_crtc_state *crtc_state; struct drm_crtc_state *crtc_state;
int ret = 0; int ret = 0;
int i; int i;
bool any_ms = false;
ret = drm_atomic_helper_prepare_planes(dev, state); ret = drm_atomic_helper_prepare_planes(dev, state);
if (ret) if (ret)
...@@ -13221,7 +13228,11 @@ static int __intel_set_mode(struct drm_atomic_state *state) ...@@ -13221,7 +13228,11 @@ static int __intel_set_mode(struct drm_atomic_state *state)
drm_atomic_helper_swap_state(dev, state); drm_atomic_helper_swap_state(dev, state);
for_each_crtc_in_state(state, crtc, crtc_state, i) { for_each_crtc_in_state(state, crtc, crtc_state, i) {
if (!needs_modeset(crtc->state) || !crtc_state->active) if (!needs_modeset(crtc->state))
continue;
any_ms = true;
if (!crtc_state->active)
continue; continue;
intel_crtc_disable_planes(crtc); intel_crtc_disable_planes(crtc);
...@@ -13234,8 +13245,8 @@ static int __intel_set_mode(struct drm_atomic_state *state) ...@@ -13234,8 +13245,8 @@ static int __intel_set_mode(struct drm_atomic_state *state)
/* The state has been swaped above, so state actually contains the /* The state has been swaped above, so state actually contains the
* old state now. */ * old state now. */
if (any_ms)
modeset_update_crtc_power_domains(state); modeset_update_crtc_power_domains(state);
/* Now enable the clocks, plane, pipe, and connectors that we set up. */ /* Now enable the clocks, plane, pipe, and connectors that we set up. */
for_each_crtc_in_state(state, crtc, crtc_state, i) { for_each_crtc_in_state(state, crtc, crtc_state, i) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment