Commit 56273062 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Switch intel_crtc_disable_noatomic() to intel_ types

It's hard to see what is going on when the function mixes drm_
and intel_ types. Switch to intel_ types.

v2: Deal with another use of 'intel_crtc' being introduced
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191105171447.22111-2-ville.syrjala@linux.intel.comReviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent f49108d0
...@@ -7203,84 +7203,84 @@ static void i9xx_crtc_disable(struct intel_atomic_state *state, ...@@ -7203,84 +7203,84 @@ static void i9xx_crtc_disable(struct intel_atomic_state *state,
i830_enable_pipe(dev_priv, pipe); i830_enable_pipe(dev_priv, pipe);
} }
static void intel_crtc_disable_noatomic(struct drm_crtc *crtc, static void intel_crtc_disable_noatomic(struct intel_crtc *crtc,
struct drm_modeset_acquire_ctx *ctx) struct drm_modeset_acquire_ctx *ctx)
{ {
struct intel_encoder *encoder; struct intel_encoder *encoder;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
struct drm_i915_private *dev_priv = to_i915(crtc->dev);
struct intel_bw_state *bw_state = struct intel_bw_state *bw_state =
to_intel_bw_state(dev_priv->bw_obj.state); to_intel_bw_state(dev_priv->bw_obj.state);
struct intel_crtc_state *crtc_state = struct intel_crtc_state *crtc_state =
to_intel_crtc_state(crtc->state); to_intel_crtc_state(crtc->base.state);
enum intel_display_power_domain domain; enum intel_display_power_domain domain;
struct intel_plane *plane; struct intel_plane *plane;
u64 domains;
struct drm_atomic_state *state; struct drm_atomic_state *state;
struct intel_crtc_state *temp_crtc_state; struct intel_crtc_state *temp_crtc_state;
enum pipe pipe = crtc->pipe;
u64 domains;
int ret; int ret;
if (!intel_crtc->active) if (!crtc_state->hw.active)
return; return;
for_each_intel_plane_on_crtc(&dev_priv->drm, intel_crtc, plane) { for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
const struct intel_plane_state *plane_state = const struct intel_plane_state *plane_state =
to_intel_plane_state(plane->base.state); to_intel_plane_state(plane->base.state);
if (plane_state->uapi.visible) if (plane_state->uapi.visible)
intel_plane_disable_noatomic(intel_crtc, plane); intel_plane_disable_noatomic(crtc, plane);
} }
state = drm_atomic_state_alloc(crtc->dev); state = drm_atomic_state_alloc(&dev_priv->drm);
if (!state) { if (!state) {
DRM_DEBUG_KMS("failed to disable [CRTC:%d:%s], out of memory", DRM_DEBUG_KMS("failed to disable [CRTC:%d:%s], out of memory",
crtc->base.id, crtc->name); crtc->base.base.id, crtc->base.name);
return; return;
} }
state->acquire_ctx = ctx; state->acquire_ctx = ctx;
/* Everything's already locked, -EDEADLK can't happen. */ /* Everything's already locked, -EDEADLK can't happen. */
temp_crtc_state = intel_atomic_get_crtc_state(state, intel_crtc); temp_crtc_state = intel_atomic_get_crtc_state(state, crtc);
ret = drm_atomic_add_affected_connectors(state, crtc); ret = drm_atomic_add_affected_connectors(state, &crtc->base);
WARN_ON(IS_ERR(temp_crtc_state) || ret); WARN_ON(IS_ERR(temp_crtc_state) || ret);
dev_priv->display.crtc_disable(to_intel_atomic_state(state), dev_priv->display.crtc_disable(to_intel_atomic_state(state), crtc);
intel_crtc);
drm_atomic_state_put(state); drm_atomic_state_put(state);
DRM_DEBUG_KMS("[CRTC:%d:%s] hw state adjusted, was enabled, now disabled\n", DRM_DEBUG_KMS("[CRTC:%d:%s] hw state adjusted, was enabled, now disabled\n",
crtc->base.id, crtc->name); crtc->base.base.id, crtc->base.name);
WARN_ON(drm_atomic_set_mode_for_crtc(crtc->state, NULL) < 0); crtc->active = false;
crtc->state->active = false; crtc->base.enabled = false;
intel_crtc->active = false;
crtc->enabled = false; WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, NULL) < 0);
crtc->state->connector_mask = 0; crtc_state->uapi.active = false;
crtc->state->encoder_mask = 0; crtc_state->uapi.connector_mask = 0;
crtc_state->uapi.encoder_mask = 0;
intel_crtc_free_hw_state(crtc_state); intel_crtc_free_hw_state(crtc_state);
memset(&crtc_state->hw, 0, sizeof(crtc_state->hw)); memset(&crtc_state->hw, 0, sizeof(crtc_state->hw));
for_each_encoder_on_crtc(crtc->dev, crtc, encoder) for_each_encoder_on_crtc(&dev_priv->drm, &crtc->base, encoder)
encoder->base.crtc = NULL; encoder->base.crtc = NULL;
intel_fbc_disable(intel_crtc); intel_fbc_disable(crtc);
intel_update_watermarks(intel_crtc); intel_update_watermarks(crtc);
intel_disable_shared_dpll(to_intel_crtc_state(crtc->state)); intel_disable_shared_dpll(crtc_state);
domains = intel_crtc->enabled_power_domains; domains = crtc->enabled_power_domains;
for_each_power_domain(domain, domains) for_each_power_domain(domain, domains)
intel_display_power_put_unchecked(dev_priv, domain); intel_display_power_put_unchecked(dev_priv, domain);
intel_crtc->enabled_power_domains = 0; crtc->enabled_power_domains = 0;
dev_priv->active_pipes &= ~BIT(intel_crtc->pipe); dev_priv->active_pipes &= ~BIT(pipe);
dev_priv->min_cdclk[intel_crtc->pipe] = 0; dev_priv->min_cdclk[pipe] = 0;
dev_priv->min_voltage_level[intel_crtc->pipe] = 0; dev_priv->min_voltage_level[pipe] = 0;
bw_state->data_rate[intel_crtc->pipe] = 0; bw_state->data_rate[pipe] = 0;
bw_state->num_active_planes[intel_crtc->pipe] = 0; bw_state->num_active_planes[pipe] = 0;
} }
/* /*
...@@ -17319,7 +17319,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc, ...@@ -17319,7 +17319,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc,
/* Adjust the state of the output pipe according to whether we /* Adjust the state of the output pipe according to whether we
* have active connectors/encoders. */ * have active connectors/encoders. */
if (crtc_state->hw.active && !intel_crtc_has_encoders(crtc)) if (crtc_state->hw.active && !intel_crtc_has_encoders(crtc))
intel_crtc_disable_noatomic(&crtc->base, ctx); intel_crtc_disable_noatomic(crtc, ctx);
if (crtc_state->hw.active || HAS_GMCH(dev_priv)) { if (crtc_state->hw.active || HAS_GMCH(dev_priv)) {
/* /*
......
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