[Intel-gfx] [PATCH v2 10/27] drm/i915: Do not run most checks when there's no modeset.
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Thu Jun 4 05:47:40 PDT 2015
The only reason to check anything without modeset was for fastboot
audio_changed/infoframe_changed changes.
Now that's handled during hw readout parameters shouldn't change
any more when all things stay identical.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5ce78fec2575..967398cc03cb 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12651,13 +12651,18 @@ intel_modeset_compute_config(struct drm_atomic_state *state)
struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state;
int ret, i;
+ bool any_ms = false;
ret = drm_atomic_helper_check_modeset(state->dev, state);
if (ret)
return ret;
for_each_crtc_in_state(state, crtc, crtc_state, i) {
- if (!needs_modeset(crtc_state) || !crtc_state->enable)
+ if (!needs_modeset(crtc_state))
+ continue;
+
+ any_ms = true;
+ if (!crtc_state->enable)
continue;
ret = intel_modeset_pipe_config(crtc,
@@ -12670,9 +12675,12 @@ intel_modeset_compute_config(struct drm_atomic_state *state)
"[modeset]");
}
- ret = intel_modeset_checks(state);
- if (ret)
- return ret;
+ if (any_ms) {
+ ret = intel_modeset_checks(state);
+
+ if (ret)
+ return ret;
+ }
return drm_atomic_helper_check_planes(state->dev, state);
}
@@ -12685,6 +12693,7 @@ static int __intel_set_mode(struct drm_atomic_state *state)
struct drm_crtc_state *crtc_state;
int ret = 0;
int i;
+ bool any_ms = false;
ret = drm_atomic_helper_prepare_planes(dev, state);
if (ret)
@@ -12693,7 +12702,11 @@ static int __intel_set_mode(struct drm_atomic_state *state)
drm_atomic_helper_swap_state(dev, state);
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;
intel_crtc_disable_planes(crtc);
@@ -12706,8 +12719,8 @@ static int __intel_set_mode(struct drm_atomic_state *state)
/* The state has been swaped above, so state actually contains the
* old state now. */
-
- modeset_update_crtc_power_domains(state, false);
+ if (any_ms)
+ modeset_update_crtc_power_domains(state, false);
/* Now enable the clocks, plane, pipe, and connectors that we set up. */
for_each_crtc_in_state(state, crtc, crtc_state, i) {
--
2.1.0
More information about the Intel-gfx
mailing list