summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2015-06-01 12:49:53 +0200
committerJani Nikula <jani.nikula@intel.com>2015-06-12 13:19:32 +0300
commit85a96e7a4213de094acc63fd433dcf766e91c782 (patch)
tree165b42cd63f04a67f448530c6f8835c8b9e29a0d /drivers/gpu
parent53d9f4e99de001374eb06195609cc0451f31a318 (diff)
drm/i915: Make sure all planes and connectors are added on modeset.
Add missing calls to drm_atomic_add_affected_*. This is needed to convert to atomic planes. When converting to atomic all planes are needed on modeset. For good measure make sure all connectors are added too. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4648fa5ab55a..2b5b829a98ad 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5959,7 +5959,7 @@ static int valleyview_modeset_global_pipes(struct drm_atomic_state *state)
struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state;
int max_pixclk = intel_mode_max_pixclk(state->dev, state);
- int cdclk, i;
+ int cdclk, ret = 0;
if (max_pixclk < 0)
return max_pixclk;
@@ -5974,20 +5974,25 @@ static int valleyview_modeset_global_pipes(struct drm_atomic_state *state)
/* add all active pipes to the state */
for_each_crtc(state->dev, crtc) {
- if (!crtc->state->active)
- continue;
-
crtc_state = drm_atomic_get_crtc_state(state, crtc);
if (IS_ERR(crtc_state))
return PTR_ERR(crtc_state);
- }
- /* disable/enable all currently active pipes while we change cdclk */
- for_each_crtc_in_state(state, crtc, crtc_state, i)
- if (crtc_state->active)
- crtc_state->mode_changed = true;
+ if (!crtc_state->active || needs_modeset(crtc_state))
+ continue;
- return 0;
+ crtc_state->mode_changed = true;
+
+ ret = drm_atomic_add_affected_connectors(state, crtc);
+ if (ret)
+ break;
+
+ ret = drm_atomic_add_affected_planes(state, crtc);
+ if (ret)
+ break;
+ }
+
+ return ret;
}
static void vlv_program_pfi_credits(struct drm_i915_private *dev_priv)
@@ -12185,8 +12190,10 @@ encoder_retry:
/* Check if we need to force a modeset */
if (pipe_config->has_audio !=
- to_intel_crtc_state(crtc->state)->has_audio)
+ to_intel_crtc_state(crtc->state)->has_audio) {
pipe_config->base.mode_changed = true;
+ ret = drm_atomic_add_affected_planes(state, crtc);
+ }
/*
* Note we have an issue here with infoframes: current code
@@ -12194,8 +12201,6 @@ encoder_retry:
* requirements. So here we should be checking for any
* required changes and forcing a mode set.
*/
-
- return 0;
fail:
return ret;
}