drm/i915: Move cdclk and pll setup to intel_modeset_compute_config(), v2.

It makes more sense there, since these are computation steps that can
fail.

Changes since v1:
- Rename __intel_set_mode_checks to intel_modeset_checks (Matt Roper)
- Move intel_modeset_checks to before check_planes, so it won't
  have to be moved later.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
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>
This commit is contained in:
Ander Conselvan de Oliveira 2015-06-01 12:50:02 +02:00 committed by Jani Nikula
parent 5ac1c4bcf0
commit c347a6768d
1 changed files with 35 additions and 39 deletions

View File

@ -12758,38 +12758,7 @@ static void update_scanline_offset(struct intel_crtc *crtc)
crtc->scanline_offset = 1;
}
static int
intel_modeset_compute_config(struct drm_atomic_state *state)
{
struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state;
int ret, i;
ret = drm_atomic_helper_check_modeset(state->dev, state);
if (ret)
return ret;
for_each_crtc_in_state(state, crtc, crtc_state, i) {
if (!crtc_state->enable &&
WARN_ON(crtc_state->active))
crtc_state->active = false;
if (!crtc_state->enable)
continue;
ret = intel_modeset_pipe_config(crtc, state);
if (ret)
return ret;
intel_dump_pipe_config(to_intel_crtc(crtc),
to_intel_crtc_state(crtc_state),
"[modeset]");
}
return drm_atomic_helper_check_planes(state->dev, state);
}
static int __intel_set_mode_setup_plls(struct drm_atomic_state *state)
static int intel_modeset_setup_plls(struct drm_atomic_state *state)
{
struct drm_device *dev = state->dev;
struct drm_i915_private *dev_priv = to_i915(dev);
@ -12839,7 +12808,7 @@ static int __intel_set_mode_setup_plls(struct drm_atomic_state *state)
}
/* Code that should eventually be part of atomic_check() */
static int __intel_set_mode_checks(struct drm_atomic_state *state)
static int intel_modeset_checks(struct drm_atomic_state *state)
{
struct drm_device *dev = state->dev;
int ret;
@ -12861,11 +12830,42 @@ static int __intel_set_mode_checks(struct drm_atomic_state *state)
return ret;
}
ret = __intel_set_mode_setup_plls(state);
return intel_modeset_setup_plls(state);
}
static int
intel_modeset_compute_config(struct drm_atomic_state *state)
{
struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state;
int ret, i;
ret = drm_atomic_helper_check_modeset(state->dev, state);
if (ret)
return ret;
return 0;
for_each_crtc_in_state(state, crtc, crtc_state, i) {
if (!crtc_state->enable &&
WARN_ON(crtc_state->active))
crtc_state->active = false;
if (!crtc_state->enable)
continue;
ret = intel_modeset_pipe_config(crtc, state);
if (ret)
return ret;
intel_dump_pipe_config(to_intel_crtc(crtc),
to_intel_crtc_state(crtc_state),
"[modeset]");
}
ret = intel_modeset_checks(state);
if (ret)
return ret;
return drm_atomic_helper_check_planes(state->dev, state);
}
static int __intel_set_mode(struct drm_atomic_state *state)
@ -12877,10 +12877,6 @@ static int __intel_set_mode(struct drm_atomic_state *state)
int ret = 0;
int i;
ret = __intel_set_mode_checks(state);
if (ret < 0)
return ret;
ret = drm_atomic_helper_prepare_planes(dev, state);
if (ret)
return ret;