summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorMaarten Lankhorst2015-06-15 12:33:38 +0200
committerDaniel Vetter2015-06-22 14:17:55 +0200
commitb359283a035e44a6c760244e14af86cf1f62ef67 (patch)
treefa643d0d0e2f668eaaf203585b5b78f52a5b22db /drivers/gpu/drm/i915/intel_display.c
parentdrm/i915: Update DRIVER_DATE to 20150619 (diff)
downloadkernel-qcow2-linux-b359283a035e44a6c760244e14af86cf1f62ef67.tar.gz
kernel-qcow2-linux-b359283a035e44a6c760244e14af86cf1f62ef67.tar.xz
kernel-qcow2-linux-b359283a035e44a6c760244e14af86cf1f62ef67.zip
drm/i915: Use crtc state in intel_modeset_pipe_config
Grabbing crtc state from atomic state is a lot more involved, and make sure connectors are added before calling this function. Move check_digital_port_conflicts to intel_modeset_checks, it's only useful to check it on a modeset. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Tested-by(IVB): Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 98bb15ac4c66..a483a65f0757 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12056,10 +12056,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
static int
intel_modeset_pipe_config(struct drm_crtc *crtc,
- struct drm_atomic_state *state)
+ struct intel_crtc_state *pipe_config)
{
- struct drm_crtc_state *crtc_state;
- struct intel_crtc_state *pipe_config;
+ struct drm_atomic_state *state = pipe_config->base.state;
struct intel_encoder *encoder;
struct drm_connector *connector;
struct drm_connector_state *connector_state;
@@ -12072,26 +12071,6 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
return -EINVAL;
}
- if (!check_digital_port_conflicts(state)) {
- DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
- return -EINVAL;
- }
-
- crtc_state = drm_atomic_get_existing_crtc_state(state, crtc);
- if (WARN_ON(!crtc_state))
- return -EINVAL;
-
- pipe_config = to_intel_crtc_state(crtc_state);
-
- /*
- * XXX: Add all connectors to make the crtc state match the encoders.
- */
- if (!needs_modeset(&pipe_config->base)) {
- ret = drm_atomic_add_affected_connectors(state, crtc);
- if (ret)
- return ret;
- }
-
clear_intel_crtc_state(pipe_config);
pipe_config->cpu_transcoder =
@@ -12919,6 +12898,11 @@ static int intel_modeset_checks(struct drm_atomic_state *state)
struct drm_device *dev = state->dev;
int ret;
+ if (!check_digital_port_conflicts(state)) {
+ DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
+ return -EINVAL;
+ }
+
/*
* See if the config requires any additional preparation, e.g.
* to adjust global state with pipes off. We need to do this
@@ -12965,7 +12949,14 @@ intel_modeset_compute_config(struct drm_atomic_state *state)
if (!crtc_state->enable)
continue;
- ret = intel_modeset_pipe_config(crtc, state);
+ if (!needs_modeset(crtc_state)) {
+ ret = drm_atomic_add_affected_connectors(state, crtc);
+ if (ret)
+ return ret;
+ }
+
+ ret = intel_modeset_pipe_config(crtc,
+ to_intel_crtc_state(crtc_state));
if (ret)
return ret;