drm/i915: Use connector atomic state in encoders.
Subsystems (2)
cover drm/i915: Use connector atomic state in encoders.
This is required for supporting nonblocking modeset and atomic connector properties. Connector properties will need the connector state to be passed or it will not work as intended.
Nonblocking modesets need to iterate over the atomic state, instead of relying on the legacy state fixed up by atomic.
Maarten Lankhorst (15):
drm/i915: handle DP_MST correctly in bxt_get_dpll drm/i915: Pass atomic state to crtc enable/disable functions drm/i915: Remove unused mode_set hook from encoder drm/i915: Walk over encoders in crtc enable/disable using atomic
state.
drm/i915: Pass crtc_state and connector_state to encoder functions drm/i915: Make encoder->compute_config take the connector state drm/i915: Remove unused loop from intel_dp_mst_compute_config drm/i915: Convert intel_crt to use atomic state drm/i915: Convert intel_dvo to use atomic state drm/i915: Convert intel_dsi to use atomic state drm/i915: Convert intel_sdvo to use atomic state drm/i915: Convert intel_lvds to use atomic state drm/i915: Convert intel_dp_mst to use atomic state drm/i915: Convert intel_dp to use atomic state drm/i915: Use more atomic state in intel_color.c
drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/intel_color.c | 24 +-- drivers/gpu/drm/i915/intel_crt.c | 33 ++-- drivers/gpu/drm/i915/intel_ddi.c | 42 +++-- drivers/gpu/drm/i915/intel_display.c | 304 +++++++++++++++++++++++----------- drivers/gpu/drm/i915/intel_dp.c | 174 ++++++++++--------- drivers/gpu/drm/i915/intel_dp_mst.c | 91 ++++------ drivers/gpu/drm/i915/intel_dpll_mgr.c | 10 +- drivers/gpu/drm/i915/intel_drv.h | 44 +++-- drivers/gpu/drm/i915/intel_dsi.c | 41 +++-- drivers/gpu/drm/i915/intel_dvo.c | 27 +-- drivers/gpu/drm/i915/intel_hdmi.c | 75 ++++++--- drivers/gpu/drm/i915/intel_lvds.c | 54 +++--- drivers/gpu/drm/i915/intel_sdvo.c | 52 +++--- drivers/gpu/drm/i915/intel_tv.c | 15 +- 15 files changed, 615 insertions(+), 377 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/15 drm/i915: handle DP_MST correctly in bxt_get_dpll
No idea if it supports it, but this is the minimum required from get_dpll.
--- drivers/gpu/drm/i915/intel_dpll_mgr.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dpll_mgr.c +8 -2
@@ -1535,7 +1535,8 @@ bxt_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, vco = best_clock.vco; }else if (encoder->type ==INTEL_OUTPUT_DP || - encoder->type ==INTEL_OUTPUT_EDP ) { + encoder->type ==INTEL_OUTPUT_EDP || + encoder->type ==INTEL_OUTPUT_DP_MST ) {int i; clk_div = bxt_dp_clk_val[0 ];
@@ -1611,7 +1612,12 @@ bxt_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, crtc_state->dpll_hw_state.pcsdw12 =LANESTAGGER_STRAP_OVRD | lanestagger; - intel_dig_port =enc_to_dig_port (&encoder->base); +if (encoder->type ==INTEL_OUTPUT_DP_MST ) { +struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base); + + intel_dig_port = intel_mst->primary; + }else + intel_dig_port =enc_to_dig_port (&encoder->base);/* 1:1 mapping between ports and PLLs */ i = (enum intel_dpll_id ) intel_dig_port->port;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/15] drm/i915: handle DP_MST correctly in bxt_get_dpll
Quoted 12 lines · Maarten Lankhorst
No idea if it supports it, but this is the minimum required from
get_dpll.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_dpll_mgr.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_dpll_mgr.c +0
-0
drivers/gpu/drm/i915/intel_dpll_mgr.c bxt_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, · line 1539
Quoted 6 lines
drivers/gpu/drm/i915/intel_dpll_mgr.c +2
-1@@ -1535,7 +1535,8 @@ bxt_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, vco = best_clock.vco; }else if (encoder->type ==INTEL_OUTPUT_DP || - encoder->type ==INTEL_OUTPUT_EDP ) { + encoder->type ==INTEL_OUTPUT_EDP || + encoder->type ==INTEL_OUTPUT_DP_MST ) {
drm_encoder_type_is_DP? Maybe as a follow-up patch, this is
Quoted 4 lines
drivers/gpu/drm/i915/intel_dpll_mgr.c +0
-0int i; clk_div = bxt_dp_clk_val[0 ];
drivers/gpu/drm/i915/intel_dpll_mgr.c bxt_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, · line 1620
Quoted 10 lines
drivers/gpu/drm/i915/intel_dpll_mgr.c +6
-1@@ -1611,7 +1612,12 @@ bxt_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, crtc_state->dpll_hw_state.pcsdw12 =LANESTAGGER_STRAP_OVRD | lanestagger; - intel_dig_port =enc_to_dig_port (&encoder->base); +if (encoder->type ==INTEL_OUTPUT_DP_MST ) { +struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base); + + intel_dig_port = intel_mst->primary; + }else + intel_dig_port =enc_to_dig_port (&encoder->base);
I think we need a "give me the real encoder not the fake one" helper for dp connectors. I thought I've seen one of those fly by. -Daniel
Quoted 10 lines
drivers/gpu/drm/i915/intel_dpll_mgr.c +0
-0/* 1:1 mapping between ports and PLLs */ i = (enum intel_dpll_id ) intel_dig_port->port;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/15 drm/i915: Pass atomic state to crtc enable/disable functions
In reply to Maarten LankhorstThis is required for supporting nonblocking modesets. Iterating over the connector list will no longer be allowed when we don't hold connection_mutex, so we have to use the atomic state.
Fix disable_noatomic by populating the minimal state required to disable a connector.
--- drivers/gpu/drm/i915/i915_drv.h | 6 ++-- drivers/gpu/drm/i915/intel_display.c | 56 ++++++++++++++++++++++++------------ 2 files changed, 42 insertions(+), 20 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +4 -2
@@ -628,8 +628,10 @@ struct drm_i915_display_funcs { struct intel_initial_plane_config *);int (*crtc_compute_clock)(struct intel_crtc *crtc,struct intel_crtc_state *crtc_state); -void (*crtc_enable)(struct drm_crtc *crtc); -void (*crtc_disable)(struct drm_crtc *crtc); +void (*crtc_enable)(struct intel_crtc_state *pipe_config, +struct drm_atomic_state *old_state); +void (*crtc_disable)(struct intel_crtc_state *old_crtc_state, +struct drm_atomic_state *old_state);void (*audio_codec_enable)(struct drm_connector *connector,struct intel_encoder *encoder,const struct drm_display_mode *adjusted_mode);
drivers/gpu/drm/i915/intel_display.c +38 -18
148 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/15] drm/i915: Pass atomic state to crtc enable/disable functions
Quoted 156 lines · Maarten Lankhorst
This is required for supporting nonblocking modesets. Iterating over the connector list will no longer be allowed when we don't hold
connection_mutex, so we have to use the atomic state.Fix
disable_noatomicby populating the minimal state required to disable a connector.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/i915_drv.h | 6 ++-- drivers/gpu/drm/i915/intel_display.c | 56 ++++++++++++++++++++++++------------ 2 files changed, 42 insertions(+), 20 deletions(-)drivers/gpu/drm/i915/i915_drv.h +4
-2@@ -628,8 +628,10 @@ struct drm_i915_display_funcs { struct intel_initial_plane_config *);int (*crtc_compute_clock)(struct intel_crtc *crtc,struct intel_crtc_state *crtc_state); -void (*crtc_enable)(struct drm_crtc *crtc); -void (*crtc_disable)(struct drm_crtc *crtc); +void (*crtc_enable)(struct intel_crtc_state *pipe_config, +struct drm_atomic_state *old_state); +void (*crtc_disable)(struct intel_crtc_state *old_crtc_state, +struct drm_atomic_state *old_state);void (*audio_codec_enable)(struct drm_connector *connector,struct intel_encoder *encoder,const struct drm_display_mode *adjusted_mode);drivers/gpu/drm/i915/intel_display.c +24
-15@@ -4694,15 +4694,15 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc, unsigned plane_maskintel_frontbuffer_flip (to_i915 (dev),INTEL_FRONTBUFFER_ALL_MASK (pipe)); } -static void ironlake_crtc_enable (struct drm_crtc *crtc) +static void ironlake_crtc_enable (struct intel_crtc_state *pipe_config, +struct drm_atomic_state *old_state) { +struct drm_crtc *crtc = pipe_config->base.crtc;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_encoder *encoder;int pipe = intel_crtc->pipe; -struct intel_crtc_state *pipe_config = -to_intel_crtc_state (crtc->state);if (WARN_ON (intel_crtc->active))return ;@@ -4791,16 +4791,16 @@ static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)return HAS_IPS (crtc->base.dev) && crtc->pipe ==PIPE_A ; } -static void haswell_crtc_enable (struct drm_crtc *crtc) +static void haswell_crtc_enable (struct intel_crtc_state *pipe_config, +struct drm_atomic_state *old_state) { +struct drm_crtc *crtc = pipe_config->base.crtc;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_encoder *encoder;int pipe = intel_crtc->pipe, hsw_workaround_pipe;enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder; -struct intel_crtc_state *pipe_config = -to_intel_crtc_state (crtc->state);if (WARN_ON (intel_crtc->active))return ;@@ -4930,8 +4930,10 @@ static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force) } } -static void ironlake_crtc_disable (struct drm_crtc *crtc) +static void ironlake_crtc_disable (struct intel_crtc_state *old_crtc_state, +struct drm_atomic_state *old_state) { +struct drm_crtc *crtc = old_crtc_state->base.crtc;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);@@ -4993,8 +4995,10 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)intel_set_pch_fifo_underrun_reporting (dev_priv, pipe, true); } -static void haswell_crtc_disable (struct drm_crtc *crtc) +static void haswell_crtc_disable (struct intel_crtc_state *old_crtc_state, +struct drm_atomic_state *old_state) { +struct drm_crtc *crtc = old_crtc_state->base.crtc;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);@@ -6098,14 +6102,14 @@ static void valleyview_modeset_commit_cdclk(struct drm_atomic_state *old_state)intel_display_power_put (dev_priv,POWER_DOMAIN_PIPE_A ); } -static void valleyview_crtc_enable (struct drm_crtc *crtc) +static void valleyview_crtc_enable (struct intel_crtc_state *pipe_config, +struct drm_atomic_state *old_state) { +struct drm_crtc *crtc = pipe_config->base.crtc;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_encoder *encoder; -struct intel_crtc_state *pipe_config = -to_intel_crtc_state (crtc->state);int pipe = intel_crtc->pipe;if (WARN_ON (intel_crtc->active))@@ -6169,14 +6173,14 @@ static void i9xx_set_pll_dividers(struct intel_crtc *crtc)I915_WRITE (FP1 (crtc->pipe), crtc->config->dpll_hw_state.fp1); } -static void i9xx_crtc_enable (struct drm_crtc *crtc) +static void i9xx_crtc_enable (struct intel_crtc_state *pipe_config, +struct drm_atomic_state *old_state) { +struct drm_crtc *crtc = pipe_config->base.crtc;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_encoder *encoder; -struct intel_crtc_state *pipe_config = -to_intel_crtc_state (crtc->state);enum pipe pipe = intel_crtc->pipe;if (WARN_ON (intel_crtc->active))@@ -6232,8 +6236,10 @@ static void i9xx_pfit_disable(struct intel_crtc *crtc)I915_WRITE (PFIT_CONTROL ,0 ); } -static void i9xx_crtc_disable (struct drm_crtc *crtc) +static void i9xx_crtc_disable (struct intel_crtc_state *old_crtc_state, +struct drm_atomic_state *old_state) { +struct drm_crtc *crtc = old_crtc_state->base.crtc;struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);@@ -6285,6 +6291,9 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc)struct drm_i915_private *dev_priv =to_i915 (crtc->dev);enum intel_display_power_domain domain;unsigned long domains; +struct drm_atomic_state *state; +struct intel_crtc_state *crtc_state; +int ret;if (!intel_crtc->active)return ;
drivers/gpu/drm/i915/intel_display.c static void intel_crtc_disable_noatomic(struct drm_crtc *crtc) · line 6311
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +2
-1@@ -6298,7 +6307,18 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc)to_intel_plane_state (crtc->primary->state)->visible = false; } - dev_priv->display.crtc_disable (crtc); + state =drm_atomic_state_alloc (crtc->dev); + state->acquire_ctx = crtc->dev->mode_config.acquire_ctx;
Ugh, really not nice to not pass the acquire_ctx explicitly around here. Anyway, this is
Quoted 38 lines
drivers/gpu/drm/i915/intel_display.c +12
-2+ +/* Everything's already locked, -EDEADLK can't happen. */ + crtc_state =intel_atomic_get_crtc_state (state, intel_crtc); + ret =drm_atomic_add_affected_connectors (state, crtc); + +WARN_ON (IS_ERR (crtc_state) || ret); + + dev_priv->display.crtc_disable (crtc_state, state); + +drm_atomic_state_free (state);DRM_DEBUG_KMS ("[CRTC:%d:%s] hw state adjusted, was enabled, now disabled\n" , crtc->base.id, crtc->name);@@ -13669,7 +13689,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)if (old_crtc_state->active) {intel_crtc_disable_planes (crtc, old_crtc_state->plane_mask); - dev_priv->display.crtc_disable (crtc); + dev_priv->display.crtc_disable (to_intel_crtc_state (old_crtc_state), state); intel_crtc->active = false;intel_fbc_disable (intel_crtc);intel_disable_shared_dpll (intel_crtc);@@ -13710,7 +13730,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)if (modeset && crtc->state->active) {update_scanline_offset (to_intel_crtc (crtc)); - dev_priv->display.crtc_enable (crtc); + dev_priv->display.crtc_enable (pipe_config, state); }/* Complete events for now disable pipes here. */ Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/15 drm/i915: Remove unused mode_set hook from encoder
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/intel_drv.h | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/intel_drv.h +0 -1
@@ -198,7 +198,6 @@ struct intel_encoder {void (*pre_pll_enable)(struct intel_encoder *);void (*pre_enable)(struct intel_encoder *);void (*enable)(struct intel_encoder *); -void (*mode_set)(struct intel_encoder *intel_encoder);void (*disable)(struct intel_encoder *);void (*post_disable)(struct intel_encoder *);void (*post_pll_disable)(struct intel_encoder *);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 03/15] drm/i915: Remove unused mode_set hook from encoder
Quoted 1 line · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 23 lines
--- drivers/gpu/drm/i915/intel_drv.h | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/i915/intel_drv.h +0
-1@@ -198,7 +198,6 @@ struct intel_encoder {void (*pre_pll_enable)(struct intel_encoder *);void (*pre_enable)(struct intel_encoder *);void (*enable)(struct intel_encoder *); -void (*mode_set)(struct intel_encoder *intel_encoder);void (*disable)(struct intel_encoder *);void (*post_disable)(struct intel_encoder *);void (*post_pll_disable)(struct intel_encoder *);Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/15 drm/i915: Walk over encoders in crtc enable/disable using atomic state.
In reply to Maarten LankhorstThis cleans up another possible use of the connector list, encoder->crtc is legacy state and should not be used.
With the atomic state as argument it's easy to find the encoder from the connector it belongs to.
intel_opregion_notify_encoder is a noop for !HAS_DDI, so it's harmless to unconditionally include it in encoder enable/disable.
--- drivers/gpu/drm/i915/intel_display.c | 190 ++++++++++++++++++++++++----------- 1 file changed, 134 insertions(+), 56 deletions(-)
drivers/gpu/drm/i915/intel_display.c +134 -56
@@ -4694,6 +4694,123 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc, unsigned plane_maskintel_frontbuffer_flip (to_i915 (dev),INTEL_FRONTBUFFER_ALL_MASK (pipe)); } +static void intel_encoders_pre_pll_enable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct drm_connector_state *conn_state = conn->state; +struct intel_encoder *encoder = +to_intel_encoder (conn_state->best_encoder); + +if (conn_state->crtc != crtc) +continue ; + +if (encoder->pre_pll_enable) + encoder->pre_pll_enable (encoder); + } +} + +static void intel_encoders_pre_enable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct drm_connector_state *conn_state = conn->state; +struct intel_encoder *encoder = +to_intel_encoder (conn_state->best_encoder); + +if (conn_state->crtc != crtc) +continue ; + +if (encoder->pre_enable) + encoder->pre_enable (encoder); + } +} + +static void intel_encoders_enable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct drm_connector_state *conn_state = conn->state; +struct intel_encoder *encoder = +to_intel_encoder (conn_state->best_encoder); + +if (conn_state->crtc != crtc) +continue ; + + encoder->enable (encoder); +intel_opregion_notify_encoder (encoder, true); + } +} + +static void intel_encoders_disable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct intel_encoder *encoder = +to_intel_encoder (old_conn_state->best_encoder); + +if (old_conn_state->crtc != crtc) +continue ; + +intel_opregion_notify_encoder (encoder, false); + encoder->disable (encoder); + } +} + +static void intel_encoders_post_disable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct intel_encoder *encoder = +to_intel_encoder (old_conn_state->best_encoder); + +if (old_conn_state->crtc != crtc) +continue ; + +if (encoder->post_disable) + encoder->post_disable (encoder); + } +} + +static void intel_encoders_post_pll_disable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct intel_encoder *encoder = +to_intel_encoder (old_conn_state->best_encoder); + +if (old_conn_state->crtc != crtc) +continue ; + +if (encoder->post_pll_disable) + encoder->post_pll_disable (encoder); + } +} +static void ironlake_crtc_enable (struct intel_crtc_state *pipe_config,struct drm_atomic_state *old_state) {
@@ -4701,7 +4818,6 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe;if (WARN_ON (intel_crtc->active))
@@ -4740,9 +4856,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config, intel_crtc->active = true; -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_enable) - encoder->pre_enable (encoder); +intel_encoders_pre_enable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) {/* Note: FDI PLL enabling _must_ be done before we enable the
@@ -4772,8 +4886,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->enable (encoder); +intel_encoders_enable (crtc, old_state);if (HAS_PCH_CPT (dev))cpt_verify_modeset (dev, intel_crtc->pipe);
@@ -4798,7 +4911,6 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe, hsw_workaround_pipe;enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;
@@ -4809,9 +4921,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,intel_set_pch_fifo_underrun_reporting (dev_priv,TRANSCODER_A , false); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_pll_enable) - encoder->pre_pll_enable (encoder); +intel_encoders_pre_pll_enable (crtc, old_state);if (intel_crtc->config->shared_dpll)intel_enable_shared_dpll (intel_crtc);
@@ -4849,10 +4959,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,else intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -for_each_encoder_on_crtc (dev, crtc, encoder) { -if (encoder->pre_enable) - encoder->pre_enable (encoder); - } +intel_encoders_pre_enable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) dev_priv->display.fdi_link_train (crtc);
@@ -4893,10 +5000,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) { - encoder->enable (encoder); -intel_opregion_notify_encoder (encoder, true); - } +intel_encoders_enable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) {intel_wait_for_vblank (dev, pipe);
@@ -4937,7 +5041,6 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe;/*
@@ -4950,8 +5053,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,intel_set_pch_fifo_underrun_reporting (dev_priv, pipe, false); } -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->disable (encoder); +intel_encoders_disable (crtc, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);
@@ -4963,9 +5065,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,if (intel_crtc->config->has_pch_encoder)ironlake_fdi_disable (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->post_disable) - encoder->post_disable (encoder); +intel_encoders_post_disable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) {ironlake_disable_pch_transcoder (dev_priv, pipe);
@@ -5002,17 +5102,13 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;if (intel_crtc->config->has_pch_encoder)intel_set_pch_fifo_underrun_reporting (dev_priv,TRANSCODER_A , false); -for_each_encoder_on_crtc (dev, crtc, encoder) { -intel_opregion_notify_encoder (encoder, false); - encoder->disable (encoder); - } +intel_encoders_disable (crtc, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);
@@ -5035,9 +5131,7 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,if (!transcoder_is_dsi (cpu_transcoder))intel_ddi_disable_pipe_clock (intel_crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->post_disable) - encoder->post_disable (encoder); +intel_encoders_post_disable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) {lpt_disable_pch_transcoder (dev_priv);
@@ -6109,7 +6203,6 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe;if (WARN_ON (intel_crtc->active))
@@ -6134,9 +6227,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_pll_enable) - encoder->pre_pll_enable (encoder); +intel_encoders_pre_pll_enable (crtc, old_state);if (IS_CHERRYVIEW (dev)) {chv_prepare_pll (intel_crtc, intel_crtc->config);
@@ -6146,9 +6237,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,vlv_enable_pll (intel_crtc, intel_crtc->config); } -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_enable) - encoder->pre_enable (encoder); +intel_encoders_pre_enable (crtc, old_state);i9xx_pfit_enable (intel_crtc);
@@ -6160,8 +6249,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->enable (encoder); +intel_encoders_enable (crtc, old_state); }static void i9xx_set_pll_dividers (struct intel_crtc *crtc)
@@ -6180,7 +6268,6 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;enum pipe pipe = intel_crtc->pipe;if (WARN_ON (intel_crtc->active))
@@ -6201,9 +6288,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,if (!IS_GEN2 (dev))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_enable) - encoder->pre_enable (encoder); +intel_encoders_pre_enable (crtc, old_state);i9xx_enable_pll (intel_crtc);
@@ -6217,8 +6302,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->enable (encoder); +intel_encoders_enable (crtc, old_state); }static void i9xx_pfit_disable (struct intel_crtc *crtc)
@@ -6243,7 +6327,6 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe;/*
@@ -6253,8 +6336,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,if (IS_GEN2 (dev))intel_wait_for_vblank (dev, pipe); -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->disable (encoder); +intel_encoders_disable (crtc, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);
@@ -6263,9 +6345,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_pfit_disable (intel_crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->post_disable) - encoder->post_disable (encoder); +intel_encoders_post_disable (crtc, old_state);if (!intel_crtc_has_type (intel_crtc->config,INTEL_OUTPUT_DSI )) {if (IS_CHERRYVIEW (dev))
@@ -6276,9 +6356,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_disable_pll (intel_crtc); } -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->post_pll_disable) - encoder->post_pll_disable (encoder); +intel_encoders_post_pll_disable (crtc, old_state);if (!IS_GEN2 (dev))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, false);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 04/15] drm/i915: Walk over encoders in crtc enable/disable using atomic state.
Quoted 10 lines · Maarten Lankhorst
This cleans up another possible use of the connector list,
encoder->crtcis legacy state and should not be used.With the atomic state as argument it's easy to find the encoder from the connector it belongs to.
intel_opregion_notify_encoderis a noop for !HAS_DDI, so it's harmless to unconditionally include it in encoder enable/disable.Signed-off-by Maarten Lankhorst <[email protected]>
Dunno why I missed that one, sorry.
Quoted 379 lines
--- drivers/gpu/drm/i915/intel_display.c | 190 ++++++++++++++++++++++++----------- 1 file changed, 134 insertions(+), 56 deletions(-)drivers/gpu/drm/i915/intel_display.c +134
-56@@ -4694,6 +4694,123 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc, unsigned plane_maskintel_frontbuffer_flip (to_i915 (dev),INTEL_FRONTBUFFER_ALL_MASK (pipe)); } +static void intel_encoders_pre_pll_enable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct drm_connector_state *conn_state = conn->state; +struct intel_encoder *encoder = +to_intel_encoder (conn_state->best_encoder); + +if (conn_state->crtc != crtc) +continue ; + +if (encoder->pre_pll_enable) + encoder->pre_pll_enable (encoder); + } +} + +static void intel_encoders_pre_enable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct drm_connector_state *conn_state = conn->state; +struct intel_encoder *encoder = +to_intel_encoder (conn_state->best_encoder); + +if (conn_state->crtc != crtc) +continue ; + +if (encoder->pre_enable) + encoder->pre_enable (encoder); + } +} + +static void intel_encoders_enable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct drm_connector_state *conn_state = conn->state; +struct intel_encoder *encoder = +to_intel_encoder (conn_state->best_encoder); + +if (conn_state->crtc != crtc) +continue ; + + encoder->enable (encoder); +intel_opregion_notify_encoder (encoder, true); + } +} + +static void intel_encoders_disable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct intel_encoder *encoder = +to_intel_encoder (old_conn_state->best_encoder); + +if (old_conn_state->crtc != crtc) +continue ; + +intel_opregion_notify_encoder (encoder, false); + encoder->disable (encoder); + } +} + +static void intel_encoders_post_disable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct intel_encoder *encoder = +to_intel_encoder (old_conn_state->best_encoder); + +if (old_conn_state->crtc != crtc) +continue ; + +if (encoder->post_disable) + encoder->post_disable (encoder); + } +} + +static void intel_encoders_post_pll_disable (struct drm_crtc *crtc, +struct drm_atomic_state *old_state) +{ +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; + +for_each_connector_in_state (old_state, conn, old_conn_state, i) { +struct intel_encoder *encoder = +to_intel_encoder (old_conn_state->best_encoder); + +if (old_conn_state->crtc != crtc) +continue ; + +if (encoder->post_pll_disable) + encoder->post_pll_disable (encoder); + } +} +static void ironlake_crtc_enable (struct intel_crtc_state *pipe_config,struct drm_atomic_state *old_state) {@@ -4701,7 +4818,6 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe;if (WARN_ON (intel_crtc->active))@@ -4740,9 +4856,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config, intel_crtc->active = true; -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_enable) - encoder->pre_enable (encoder); +intel_encoders_pre_enable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) {/* Note: FDI PLL enabling _must_ be done before we enable the @@ -4772,8 +4886,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->enable (encoder); +intel_encoders_enable (crtc, old_state);if (HAS_PCH_CPT (dev))cpt_verify_modeset (dev, intel_crtc->pipe);@@ -4798,7 +4911,6 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe, hsw_workaround_pipe;enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;@@ -4809,9 +4921,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,intel_set_pch_fifo_underrun_reporting (dev_priv,TRANSCODER_A , false); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_pll_enable) - encoder->pre_pll_enable (encoder); +intel_encoders_pre_pll_enable (crtc, old_state);if (intel_crtc->config->shared_dpll)intel_enable_shared_dpll (intel_crtc);@@ -4849,10 +4959,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,else intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -for_each_encoder_on_crtc (dev, crtc, encoder) { -if (encoder->pre_enable) - encoder->pre_enable (encoder); - } +intel_encoders_pre_enable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) dev_priv->display.fdi_link_train (crtc);@@ -4893,10 +5000,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) { - encoder->enable (encoder); -intel_opregion_notify_encoder (encoder, true); - } +intel_encoders_enable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) {intel_wait_for_vblank (dev, pipe);@@ -4937,7 +5041,6 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe;/* @@ -4950,8 +5053,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,intel_set_pch_fifo_underrun_reporting (dev_priv, pipe, false); } -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->disable (encoder); +intel_encoders_disable (crtc, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);@@ -4963,9 +5065,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,if (intel_crtc->config->has_pch_encoder)ironlake_fdi_disable (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->post_disable) - encoder->post_disable (encoder); +intel_encoders_post_disable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) {ironlake_disable_pch_transcoder (dev_priv, pipe);@@ -5002,17 +5102,13 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;if (intel_crtc->config->has_pch_encoder)intel_set_pch_fifo_underrun_reporting (dev_priv,TRANSCODER_A , false); -for_each_encoder_on_crtc (dev, crtc, encoder) { -intel_opregion_notify_encoder (encoder, false); - encoder->disable (encoder); - } +intel_encoders_disable (crtc, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);@@ -5035,9 +5131,7 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,if (!transcoder_is_dsi (cpu_transcoder))intel_ddi_disable_pipe_clock (intel_crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->post_disable) - encoder->post_disable (encoder); +intel_encoders_post_disable (crtc, old_state);if (intel_crtc->config->has_pch_encoder) {lpt_disable_pch_transcoder (dev_priv);@@ -6109,7 +6203,6 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe;if (WARN_ON (intel_crtc->active))@@ -6134,9 +6227,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_pll_enable) - encoder->pre_pll_enable (encoder); +intel_encoders_pre_pll_enable (crtc, old_state);if (IS_CHERRYVIEW (dev)) {chv_prepare_pll (intel_crtc, intel_crtc->config);@@ -6146,9 +6237,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,vlv_enable_pll (intel_crtc, intel_crtc->config); } -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_enable) - encoder->pre_enable (encoder); +intel_encoders_pre_enable (crtc, old_state);i9xx_pfit_enable (intel_crtc);@@ -6160,8 +6249,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->enable (encoder); +intel_encoders_enable (crtc, old_state); }static void i9xx_set_pll_dividers (struct intel_crtc *crtc)@@ -6180,7 +6268,6 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;enum pipe pipe = intel_crtc->pipe;if (WARN_ON (intel_crtc->active))@@ -6201,9 +6288,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,if (!IS_GEN2 (dev))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->pre_enable) - encoder->pre_enable (encoder); +intel_encoders_pre_enable (crtc, old_state);i9xx_enable_pll (intel_crtc);@@ -6217,8 +6302,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->enable (encoder); +intel_encoders_enable (crtc, old_state); }static void i9xx_pfit_disable (struct intel_crtc *crtc)@@ -6243,7 +6327,6 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_encoder *encoder;int pipe = intel_crtc->pipe;/* @@ -6253,8 +6336,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,if (IS_GEN2 (dev))intel_wait_for_vblank (dev, pipe); -for_each_encoder_on_crtc (dev, crtc, encoder) - encoder->disable (encoder); +intel_encoders_disable (crtc, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);@@ -6263,9 +6345,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_pfit_disable (intel_crtc); -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->post_disable) - encoder->post_disable (encoder); +intel_encoders_post_disable (crtc, old_state);if (!intel_crtc_has_type (intel_crtc->config,INTEL_OUTPUT_DSI )) {if (IS_CHERRYVIEW (dev))@@ -6276,9 +6356,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_disable_pll (intel_crtc); } -for_each_encoder_on_crtc (dev, crtc, encoder) -if (encoder->post_pll_disable) - encoder->post_pll_disable (encoder); +intel_encoders_post_pll_disable (crtc, old_state);if (!IS_GEN2 (dev))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, false);Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/15 drm/i915: Pass crtc_state and connector_state to encoder functions
In reply to Maarten LankhorstThis is mostly code churn, with exception of a few places:
- intel_display.c has changes in intel_sanitize_encoder
- intel_ddi.c has intel_ddi_fdi_disable calling intel_ddi_post_disable, and required a function change. Also affects intel_display.c
- intel_dp_mst.c passes a NULL crtc_state and conn_state to intel_ddi_post_disable for shutting down the real encoder.
No other functional changes are done, diff stat is already huge. Each encoder type will need to be fixed to use the atomic states separately.
--- drivers/gpu/drm/i915/intel_crt.c | 18 +++++-- drivers/gpu/drm/i915/intel_ddi.c | 31 +++++++---- drivers/gpu/drm/i915/intel_display.c | 102 ++++++++++++++++++++--------------- drivers/gpu/drm/i915/intel_dp.c | 48 ++++++++++++----- drivers/gpu/drm/i915/intel_dp_mst.c | 20 +++++-- drivers/gpu/drm/i915/intel_drv.h | 28 +++++++--- drivers/gpu/drm/i915/intel_dsi.c | 16 ++++-- drivers/gpu/drm/i915/intel_dvo.c | 12 +++-- drivers/gpu/drm/i915/intel_hdmi.c | 72 ++++++++++++++++++------- drivers/gpu/drm/i915/intel_lvds.c | 29 +++++++--- drivers/gpu/drm/i915/intel_sdvo.c | 22 +++++--- drivers/gpu/drm/i915/intel_tv.c | 12 +++-- 12 files changed, 284 insertions(+), 126 deletions(-)
drivers/gpu/drm/i915/intel_crt.c +13 -5
@@ -193,21 +193,29 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode)I915_WRITE (crt->adpa_reg, adpa); } -static void intel_disable_crt (struct intel_encoder *encoder) +static void intel_disable_crt (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {intel_crt_set_dpms (encoder,DRM_MODE_DPMS_OFF ); } -static void pch_disable_crt (struct intel_encoder *encoder) +static void pch_disable_crt (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { } -static void pch_post_disable_crt (struct intel_encoder *encoder) +static void pch_post_disable_crt (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { -intel_disable_crt (encoder); +intel_disable_crt (encoder, old_crtc_state, old_conn_state); } -static void intel_enable_crt (struct intel_encoder *encoder) +static void intel_enable_crt (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {intel_crt_set_dpms (encoder,DRM_MODE_DPMS_ON ); }
drivers/gpu/drm/i915/intel_ddi.c +22 -9
@@ -1611,7 +1611,9 @@ void intel_ddi_clk_select(struct intel_encoder *encoder, } } -static void intel_ddi_pre_enable (struct intel_encoder *intel_encoder) +static void intel_ddi_pre_enable (struct intel_encoder *intel_encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_encoder *encoder = &intel_encoder->base;struct drm_i915_private *dev_priv =to_i915 (encoder->dev);
@@ -1663,7 +1665,9 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder) } } -static void intel_ddi_post_disable (struct intel_encoder *intel_encoder) +static void intel_ddi_post_disable (struct intel_encoder *intel_encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_encoder *encoder = &intel_encoder->base;struct drm_device *dev = encoder->dev;
@@ -1673,6 +1677,8 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)uint32_t val;bool wait = false; +/* old_crtc_state and old_conn_state are NULL when called from DP_MST */ + val =I915_READ (DDI_BUF_CTL (port));if (val &DDI_BUF_CTL_ENABLE ) { val &= ~DDI_BUF_CTL_ENABLE ;
@@ -1708,7 +1714,9 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder) } } -static void intel_enable_ddi (struct intel_encoder *intel_encoder) +static void intel_enable_ddi (struct intel_encoder *intel_encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_encoder *encoder = &intel_encoder->base;struct drm_crtc *crtc = encoder->crtc;
@@ -1746,7 +1754,9 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder) } } -static void intel_disable_ddi (struct intel_encoder *intel_encoder) +static void intel_disable_ddi (struct intel_encoder *intel_encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_encoder *encoder = &intel_encoder->base;struct drm_crtc *crtc = encoder->crtc;
@@ -2052,7 +2062,9 @@ bxt_ddi_phy_calc_lane_lat_optim_mask(struct intel_encoder *encoder, } } -static void bxt_ddi_pre_pll_enable (struct intel_encoder *encoder) +static void bxt_ddi_pre_pll_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_digital_port *dport =enc_to_dig_port (&encoder->base);struct drm_i915_private *dev_priv =to_i915 (dport->base.base.dev);
@@ -2141,10 +2153,11 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)udelay (600 ); } -void intel_ddi_fdi_disable (struct drm_crtc *crtc) +void intel_ddi_fdi_disable (struct intel_encoder *intel_encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc->dev); -struct intel_encoder *intel_encoder =intel_ddi_get_crtc_encoder (crtc); +struct drm_i915_private *dev_priv =to_i915 (intel_encoder->base.dev);uint32_t val;/*
@@ -2157,7 +2170,7 @@ void intel_ddi_fdi_disable(struct drm_crtc *crtc) val &= ~FDI_RX_ENABLE ;I915_WRITE (FDI_RX_CTL (PIPE_A ), val); -intel_ddi_post_disable (intel_encoder); +intel_ddi_post_disable (intel_encoder, old_crtc_state, old_conn_state); val =I915_READ (FDI_RX_MISC (PIPE_A )); val &= ~(FDI_RX_PWRDN_LANE1_MASK |FDI_RX_PWRDN_LANE0_MASK );
drivers/gpu/drm/i915/intel_display.c +58 -44
305 lines not on this page · raw message
drivers/gpu/drm/i915/intel_dp.c +36 -12
120 lines not on this page · raw message
drivers/gpu/drm/i915/intel_dp_mst.c +15 -5
@@ -92,7 +92,9 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, } -static void intel_mst_disable_dp (struct intel_encoder *encoder) +static void intel_mst_disable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;
@@ -109,7 +111,9 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder) } } -static void intel_mst_post_disable_dp (struct intel_encoder *encoder) +static void intel_mst_post_disable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;
@@ -128,12 +132,16 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder) intel_mst->connector =NULL ;if (intel_dp->active_mst_links ==0 ) { - intel_dig_port->base.post_disable (&intel_dig_port->base); + intel_dig_port->base.post_disable (&intel_dig_port->base, + old_crtc_state,NULL ); +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF ); } } -static void intel_mst_pre_enable_dp (struct intel_encoder *encoder) +static void intel_mst_pre_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;
@@ -200,7 +208,9 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) ret =drm_dp_update_payload_part1 (&intel_dp->mst_mgr); } -static void intel_mst_enable_dp (struct intel_encoder *encoder) +static void intel_mst_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;
drivers/gpu/drm/i915/intel_drv.h +21 -7
@@ -195,12 +195,24 @@ struct intel_encoder {void (*hot_plug)(struct intel_encoder *);bool (*compute_config)(struct intel_encoder *,struct intel_crtc_state *); -void (*pre_pll_enable)(struct intel_encoder *); -void (*pre_enable)(struct intel_encoder *); -void (*enable)(struct intel_encoder *); -void (*disable)(struct intel_encoder *); -void (*post_disable)(struct intel_encoder *); -void (*post_pll_disable)(struct intel_encoder *); +void (*pre_pll_enable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*pre_enable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*enable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*disable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*post_disable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*post_pll_disable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *);/* Read out the current hw state of this connector, returning true if * the encoder is active. If the encoder is enabled it also set the pipe * it is connected to in the pipe parameter. */
@@ -1122,7 +1134,9 @@ bool intel_ddi_pll_select(struct intel_crtc *crtc,void intel_ddi_set_pipe_settings (struct drm_crtc *crtc);void intel_ddi_prepare_link_retrain (struct intel_dp *intel_dp);bool intel_ddi_connector_get_hw_state (struct intel_connector *intel_connector); -void intel_ddi_fdi_disable (struct drm_crtc *crtc); +void intel_ddi_fdi_disable (struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *);void intel_ddi_get_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config); struct intel_encoder *
drivers/gpu/drm/i915/intel_dsi.c +12 -4
@@ -535,7 +535,9 @@ static void intel_dsi_enable(struct intel_encoder *encoder)static void intel_dsi_prepare (struct intel_encoder *intel_encoder); -static void intel_dsi_pre_enable (struct intel_encoder *encoder) +static void intel_dsi_pre_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -582,7 +584,9 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)intel_dsi_enable (encoder); } -static void intel_dsi_enable_nop (struct intel_encoder *encoder) +static void intel_dsi_enable_nop (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {DRM_DEBUG_KMS ("\n" );
@@ -592,7 +596,9 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)*/ } -static void intel_dsi_pre_disable (struct intel_encoder *encoder) +static void intel_dsi_pre_disable (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port;
@@ -694,7 +700,9 @@ static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)intel_disable_dsi_pll (encoder); } -static void intel_dsi_post_disable (struct intel_encoder *encoder) +static void intel_dsi_post_disable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);
drivers/gpu/drm/i915/intel_dvo.c +9 -3
@@ -174,7 +174,9 @@ static void intel_dvo_get_config(struct intel_encoder *encoder, pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; } -static void intel_disable_dvo (struct intel_encoder *encoder) +static void intel_disable_dvo (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dvo *intel_dvo =enc_to_dvo (encoder);
@@ -186,7 +188,9 @@ static void intel_disable_dvo(struct intel_encoder *encoder)I915_READ (dvo_reg); } -static void intel_enable_dvo (struct intel_encoder *encoder) +static void intel_enable_dvo (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dvo *intel_dvo =enc_to_dvo (encoder);
@@ -253,7 +257,9 @@ static bool intel_dvo_compute_config(struct intel_encoder *encoder,return true; } -static void intel_dvo_pre_enable (struct intel_encoder *encoder) +static void intel_dvo_pre_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
drivers/gpu/drm/i915/intel_hdmi.c +52 -20
175 lines not on this page · raw message
drivers/gpu/drm/i915/intel_lvds.c +21 -8
@@ -136,7 +136,9 @@ static void intel_lvds_get_config(struct intel_encoder *encoder, pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; } -static void intel_pre_enable_lvds (struct intel_encoder *encoder) +static void intel_pre_enable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base);struct drm_device *dev = encoder->base.dev;
@@ -210,7 +212,9 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder)/** * Sets the power state for the panel. */ -static void intel_enable_lvds (struct intel_encoder *encoder) +static void intel_enable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base);
@@ -237,7 +241,9 @@ static void intel_enable_lvds(struct intel_encoder *encoder)intel_panel_enable_backlight (intel_connector); } -static void intel_disable_lvds (struct intel_encoder *encoder) +static void intel_disable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_device *dev = encoder->base.dev;struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base);
@@ -260,7 +266,10 @@ static void intel_disable_lvds(struct intel_encoder *encoder)POSTING_READ (lvds_encoder->reg); } -static void gmch_disable_lvds (struct intel_encoder *encoder) +static void gmch_disable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) + {struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); struct intel_connector *intel_connector =
@@ -268,10 +277,12 @@ static void gmch_disable_lvds(struct intel_encoder *encoder)intel_panel_disable_backlight (intel_connector); -intel_disable_lvds (encoder); +intel_disable_lvds (encoder, old_crtc_state, old_conn_state); } -static void pch_disable_lvds (struct intel_encoder *encoder) +static void pch_disable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); struct intel_connector *intel_connector =
@@ -280,9 +291,11 @@ static void pch_disable_lvds(struct intel_encoder *encoder)intel_panel_disable_backlight (intel_connector); } -static void pch_post_disable_lvds (struct intel_encoder *encoder) +static void pch_post_disable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { -intel_disable_lvds (encoder); +intel_disable_lvds (encoder, old_crtc_state, old_conn_state); } static enum drm_mode_status
drivers/gpu/drm/i915/intel_sdvo.c +16 -6
@@ -1192,7 +1192,9 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder,return true; } -static void intel_sdvo_pre_enable (struct intel_encoder *intel_encoder) +static void intel_sdvo_pre_enable (struct intel_encoder *intel_encoder, +struct intel_crtc_state *crtc_state, +struct drm_connector_state *conn_state) {struct drm_device *dev = intel_encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -1434,7 +1436,9 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, pipe_config->pixel_multiplier, encoder_pixel_multiplier); } -static void intel_disable_sdvo (struct intel_encoder *encoder) +static void intel_disable_sdvo (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_sdvo *intel_sdvo =to_sdvo (encoder);
@@ -1477,16 +1481,22 @@ static void intel_disable_sdvo(struct intel_encoder *encoder) } } -static void pch_disable_sdvo (struct intel_encoder *encoder) +static void pch_disable_sdvo (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { } -static void pch_post_disable_sdvo (struct intel_encoder *encoder) +static void pch_post_disable_sdvo (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { -intel_disable_sdvo (encoder); +intel_disable_sdvo (encoder, old_crtc_state, old_conn_state); } -static void intel_enable_sdvo (struct intel_encoder *encoder) +static void intel_enable_sdvo (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
drivers/gpu/drm/i915/intel_tv.c +9 -3
@@ -838,7 +838,9 @@ intel_tv_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) }static void -intel_enable_tv (struct intel_encoder *encoder) +intel_enable_tv (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -851,7 +853,9 @@ intel_enable_tv(struct intel_encoder *encoder) }static void -intel_disable_tv (struct intel_encoder *encoder) +intel_disable_tv (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -1010,7 +1014,9 @@ static void set_color_conversion(struct drm_i915_private *dev_priv, color_conversion->av); } -static void intel_tv_pre_enable (struct intel_encoder *encoder) +static void intel_tv_pre_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/15] drm/i915: Pass crtc_state and connector_state to encoder functions
Quoted 6 lines · Maarten Lankhorst
This is mostly code churn, with exception of a few places:
-intel_display.chas changes inintel_sanitize_encoder
-intel_ddi.chasintel_ddi_fdi_disablecallingintel_ddi_post_disable, and required a function change. Also affectsintel_display.c
-intel_dp_mst.cpasses a NULLcrtc_stateandconn_statetointel_ddi_post_disablefor shutting down the real encoder.
I didn't find this NULL callsite. Outdated commit message?
Quoted 22 lines
No other functional changes are done, diff stat is already huge. Each encoder type will need to be fixed to use the atomic states separately.
Signed-off-by Maarten Lankhorst <[email protected]>drivers/gpu/drm/i915/intel_display.c +6
-2@@ -5131,12 +5137,26 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,if (!transcoder_is_dsi (cpu_transcoder))intel_ddi_disable_pipe_clock (intel_crtc); -intel_encoders_post_disable (crtc, old_state); +intel_encoders_post_disable (crtc, old_crtc_state, old_state);if (intel_crtc->config->has_pch_encoder) { +struct drm_connector_state *old_conn_state; +struct drm_connector *conn; +int i; +lpt_disable_pch_transcoder (dev_priv);lpt_disable_iclkip (dev_priv); -intel_ddi_fdi_disable (crtc); +
drivers/gpu/drm/i915/intel_display.c static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state, · line 5159
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+for_each_connector_in_state (old_state, conn, old_conn_state, i) +if (old_conn_state->crtc == crtc) { +struct intel_encoder *encoder = +to_intel_encoder (old_conn_state->best_encoder); + +intel_ddi_fdi_disable (encoder, + old_crtc_state, + old_conn_state); +break ; + }
This is pretty much the reasone why I think the hsw+ fdi code should be part of the lpt+crt encoder driver, and _not_ in the shared crtc logic. I've sent around patches a few times to make this happen, but they all got shot down because that makes it unlike the ilk-ivb modeset code.
Imo it's time to finally do this, at least for this one here. Needs to be a prep patch.
Quoted 79 lines
drivers/gpu/drm/i915/intel_display.c +8
-8intel_set_pch_fifo_underrun_reporting (dev_priv,TRANSCODER_A , true);@@ -6227,7 +6247,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -intel_encoders_pre_pll_enable (crtc, old_state); +intel_encoders_pre_pll_enable (crtc, pipe_config, old_state);if (IS_CHERRYVIEW (dev)) {chv_prepare_pll (intel_crtc, intel_crtc->config);@@ -6237,7 +6257,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,vlv_enable_pll (intel_crtc, intel_crtc->config); } -intel_encoders_pre_enable (crtc, old_state); +intel_encoders_pre_enable (crtc, pipe_config, old_state);i9xx_pfit_enable (intel_crtc);@@ -6249,7 +6269,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -intel_encoders_enable (crtc, old_state); +intel_encoders_enable (crtc, pipe_config, old_state); }static void i9xx_set_pll_dividers (struct intel_crtc *crtc)@@ -6288,7 +6308,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,if (!IS_GEN2 (dev))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -intel_encoders_pre_enable (crtc, old_state); +intel_encoders_pre_enable (crtc, pipe_config, old_state);i9xx_enable_pll (intel_crtc);@@ -6302,7 +6322,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);drm_crtc_vblank_on (crtc); -intel_encoders_enable (crtc, old_state); +intel_encoders_enable (crtc, pipe_config, old_state); }static void i9xx_pfit_disable (struct intel_crtc *crtc)@@ -6336,7 +6356,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,if (IS_GEN2 (dev))intel_wait_for_vblank (dev, pipe); -intel_encoders_disable (crtc, old_state); +intel_encoders_disable (crtc, old_crtc_state, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);@@ -6345,7 +6365,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_pfit_disable (intel_crtc); -intel_encoders_post_disable (crtc, old_state); +intel_encoders_post_disable (crtc, old_crtc_state, old_state);if (!intel_crtc_has_type (intel_crtc->config,INTEL_OUTPUT_DSI )) {if (IS_CHERRYVIEW (dev))@@ -6356,7 +6376,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_disable_pll (intel_crtc); } -intel_encoders_post_pll_disable (crtc, old_state); +intel_encoders_post_pll_disable (crtc, old_crtc_state, old_state);if (!IS_GEN2 (dev))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, false);@@ -15858,17 +15878,6 @@ static bool intel_crtc_has_encoders(struct intel_crtc *crtc)return false; }
drivers/gpu/drm/i915/intel_display.c static bool intel_crtc_has_encoders(struct intel_crtc *crtc) · line 15870
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0
-10-static bool intel_encoder_has_connectors (struct intel_encoder *encoder) -{ -struct drm_device *dev = encoder->base.dev; -struct intel_connector *connector; - -for_each_connector_on_encoder (dev, &encoder->base, connector) -return true; - -return false; -}
Imo rename this to static intel_connector *intel_encoder_find_connector and then the below code changes becomes a lot more readable.
Otherwise lgtm.
-Daniel
Quoted 743 lines
drivers/gpu/drm/i915/intel_display.c +14
-10-static void intel_sanitize_crtc (struct intel_crtc *crtc) {struct drm_device *dev = crtc->base.dev;@@ -15955,6 +15964,7 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) {struct intel_connector *connector;struct drm_device *dev = encoder->base.dev; +bool found_connector = false;/* We need to check both for a crtc link (meaning that the * encoder is active and trying to read from a pipe) and the @@ -15962,7 +15972,12 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)bool has_active_crtc = encoder->base.crtc &&to_intel_crtc (encoder->base.crtc)->active; -if (intel_encoder_has_connectors (encoder) && !has_active_crtc) { +for_each_connector_on_encoder (dev, &encoder->base, connector) { + found_connector = true; +break ; + } + +if (found_connector && !has_active_crtc) {DRM_DEBUG_KMS ("[ENCODER:%d:%s] has active connectors but no active pipe!\n" , encoder->base.base.id, encoder->base.name);@@ -15971,12 +15986,14 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)* fallout from our resume register restoring. Disable * the encoder manually again. */ if (encoder->base.crtc) { +struct drm_crtc_state *crtc_state = encoder->base.crtc->state; +DRM_DEBUG_KMS ("[ENCODER:%d:%s] manually disabled\n" , encoder->base.base.id, encoder->base.name); - encoder->disable (encoder); + encoder->disable (encoder,to_intel_crtc_state (crtc_state), connector->base.state);if (encoder->post_disable) - encoder->post_disable (encoder); + encoder->post_disable (encoder,to_intel_crtc_state (crtc_state), connector->base.state); } encoder->base.crtc =NULL ;@@ -15984,12 +16001,9 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)* a bug in one of the get_hw_state functions. Or someplace else * in our code, like the register restore mess on resume. Clamp * things to off as a safer default. */ -for_each_intel_connector (dev, connector) { -if (connector->encoder != encoder) -continue ; - connector->base.dpms =DRM_MODE_DPMS_OFF ; - connector->base.encoder =NULL ; - } + + connector->base.dpms =DRM_MODE_DPMS_OFF ; + connector->base.encoder =NULL ; }/* Enabled encoders without active connectors will be fixed in * the crtc fixup. */ drivers/gpu/drm/i915/intel_dp.c +36
-12@@ -2479,7 +2479,9 @@ static void intel_dp_get_config(struct intel_encoder *encoder, } } -static void intel_disable_dp (struct intel_encoder *encoder) +static void intel_disable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);struct drm_device *dev = encoder->base.dev;@@ -2503,7 +2505,9 @@ static void intel_disable_dp(struct intel_encoder *encoder)intel_dp_link_down (intel_dp); } -static void ilk_post_disable_dp (struct intel_encoder *encoder) +static void ilk_post_disable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);enum port port =dp_to_dig_port (intel_dp)->port;@@ -2515,14 +2519,18 @@ static void ilk_post_disable_dp(struct intel_encoder *encoder)ironlake_edp_pll_off (intel_dp); } -static void vlv_post_disable_dp (struct intel_encoder *encoder) +static void vlv_post_disable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);intel_dp_link_down (intel_dp); } -static void chv_post_disable_dp (struct intel_encoder *encoder) +static void chv_post_disable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);struct drm_device *dev = encoder->base.dev;@@ -2696,7 +2704,9 @@ static void intel_enable_dp(struct intel_encoder *encoder) } } -static void g4x_enable_dp (struct intel_encoder *encoder) +static void g4x_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);@@ -2704,7 +2714,9 @@ static void g4x_enable_dp(struct intel_encoder *encoder)intel_edp_backlight_on (intel_dp); } -static void vlv_enable_dp (struct intel_encoder *encoder) +static void vlv_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);@@ -2712,7 +2724,9 @@ static void vlv_enable_dp(struct intel_encoder *encoder)intel_psr_enable (intel_dp); } -static void g4x_pre_enable_dp (struct intel_encoder *encoder) +static void g4x_pre_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);enum port port =dp_to_dig_port (intel_dp)->port;@@ -2827,21 +2841,27 @@ static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp)intel_dp_init_panel_power_sequencer_registers (dev, intel_dp); } -static void vlv_pre_enable_dp (struct intel_encoder *encoder) +static void vlv_pre_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {vlv_phy_pre_encoder_enable (encoder);intel_enable_dp (encoder); } -static void vlv_dp_pre_pll_enable (struct intel_encoder *encoder) +static void vlv_dp_pre_pll_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {intel_dp_prepare (encoder);vlv_phy_pre_pll_enable (encoder); } -static void chv_pre_enable_dp (struct intel_encoder *encoder) +static void chv_pre_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {chv_phy_pre_encoder_enable (encoder);@@ -2851,14 +2871,18 @@ static void chv_pre_enable_dp(struct intel_encoder *encoder)chv_phy_release_cl2_override (encoder); } -static void chv_dp_pre_pll_enable (struct intel_encoder *encoder) +static void chv_dp_pre_pll_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {intel_dp_prepare (encoder);chv_phy_pre_pll_enable (encoder); } -static void chv_dp_post_pll_disable (struct intel_encoder *encoder) +static void chv_dp_post_pll_disable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {chv_phy_post_pll_disable (encoder); }drivers/gpu/drm/i915/intel_dp_mst.c +15
-5@@ -92,7 +92,9 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, } -static void intel_mst_disable_dp (struct intel_encoder *encoder) +static void intel_mst_disable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;@@ -109,7 +111,9 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder) } } -static void intel_mst_post_disable_dp (struct intel_encoder *encoder) +static void intel_mst_post_disable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;@@ -128,12 +132,16 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder) intel_mst->connector =NULL ;if (intel_dp->active_mst_links ==0 ) { - intel_dig_port->base.post_disable (&intel_dig_port->base); + intel_dig_port->base.post_disable (&intel_dig_port->base, + old_crtc_state,NULL ); +intel_dp_sink_dpms (intel_dp,DRM_MODE_DPMS_OFF ); } } -static void intel_mst_pre_enable_dp (struct intel_encoder *encoder) +static void intel_mst_pre_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;@@ -200,7 +208,9 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder) ret =drm_dp_update_payload_part1 (&intel_dp->mst_mgr); } -static void intel_mst_enable_dp (struct intel_encoder *encoder) +static void intel_mst_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;drivers/gpu/drm/i915/intel_drv.h +21
-7@@ -195,12 +195,24 @@ struct intel_encoder {void (*hot_plug)(struct intel_encoder *);bool (*compute_config)(struct intel_encoder *,struct intel_crtc_state *); -void (*pre_pll_enable)(struct intel_encoder *); -void (*pre_enable)(struct intel_encoder *); -void (*enable)(struct intel_encoder *); -void (*disable)(struct intel_encoder *); -void (*post_disable)(struct intel_encoder *); -void (*post_pll_disable)(struct intel_encoder *); +void (*pre_pll_enable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*pre_enable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*enable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*disable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*post_disable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *); +void (*post_pll_disable)(struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *);/* Read out the current hw state of this connector, returning true if * the encoder is active. If the encoder is enabled it also set the pipe * it is connected to in the pipe parameter. */ @@ -1122,7 +1134,9 @@ bool intel_ddi_pll_select(struct intel_crtc *crtc,void intel_ddi_set_pipe_settings (struct drm_crtc *crtc);void intel_ddi_prepare_link_retrain (struct intel_dp *intel_dp);bool intel_ddi_connector_get_hw_state (struct intel_connector *intel_connector); -void intel_ddi_fdi_disable (struct drm_crtc *crtc); +void intel_ddi_fdi_disable (struct intel_encoder *, +struct intel_crtc_state *, +struct drm_connector_state *);void intel_ddi_get_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config); struct intel_encoder *drivers/gpu/drm/i915/intel_dsi.c +12
-4@@ -535,7 +535,9 @@ static void intel_dsi_enable(struct intel_encoder *encoder)static void intel_dsi_prepare (struct intel_encoder *intel_encoder); -static void intel_dsi_pre_enable (struct intel_encoder *encoder) +static void intel_dsi_pre_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -582,7 +584,9 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)intel_dsi_enable (encoder); } -static void intel_dsi_enable_nop (struct intel_encoder *encoder) +static void intel_dsi_enable_nop (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {DRM_DEBUG_KMS ("\n" );@@ -592,7 +596,9 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)*/ } -static void intel_dsi_pre_disable (struct intel_encoder *encoder) +static void intel_dsi_pre_disable (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);enum port port;@@ -694,7 +700,9 @@ static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)intel_disable_dsi_pll (encoder); } -static void intel_dsi_post_disable (struct intel_encoder *encoder) +static void intel_dsi_post_disable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);drivers/gpu/drm/i915/intel_dvo.c +9
-3@@ -174,7 +174,9 @@ static void intel_dvo_get_config(struct intel_encoder *encoder, pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; } -static void intel_disable_dvo (struct intel_encoder *encoder) +static void intel_disable_dvo (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dvo *intel_dvo =enc_to_dvo (encoder);@@ -186,7 +188,9 @@ static void intel_disable_dvo(struct intel_encoder *encoder)I915_READ (dvo_reg); } -static void intel_enable_dvo (struct intel_encoder *encoder) +static void intel_enable_dvo (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dvo *intel_dvo =enc_to_dvo (encoder);@@ -253,7 +257,9 @@ static bool intel_dvo_compute_config(struct intel_encoder *encoder,return true; } -static void intel_dvo_pre_enable (struct intel_encoder *encoder) +static void intel_dvo_pre_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);drivers/gpu/drm/i915/intel_hdmi.c +52
-20@@ -985,7 +985,9 @@ static void intel_enable_hdmi_audio(struct intel_encoder *encoder)intel_audio_codec_enable (encoder); } -static void g4x_enable_hdmi (struct intel_encoder *encoder) +static void g4x_enable_hdmi (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -1006,7 +1008,9 @@ static void g4x_enable_hdmi(struct intel_encoder *encoder)intel_enable_hdmi_audio (encoder); } -static void ibx_enable_hdmi (struct intel_encoder *encoder) +static void ibx_enable_hdmi (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -1055,7 +1059,9 @@ static void ibx_enable_hdmi(struct intel_encoder *encoder)intel_enable_hdmi_audio (encoder); } -static void cpt_enable_hdmi (struct intel_encoder *encoder) +static void cpt_enable_hdmi (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -1108,11 +1114,15 @@ static void cpt_enable_hdmi(struct intel_encoder *encoder)intel_enable_hdmi_audio (encoder); } -static void vlv_enable_hdmi (struct intel_encoder *encoder) +static void vlv_enable_hdmi (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) { } -static void intel_disable_hdmi (struct intel_encoder *encoder) +static void intel_disable_hdmi (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -1164,17 +1174,21 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)intel_dp_dual_mode_set_tmds_output (intel_hdmi, false); } -static void g4x_disable_hdmi (struct intel_encoder *encoder) +static void g4x_disable_hdmi (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc);if (crtc->config->has_audio)intel_audio_codec_disable (encoder); -intel_disable_hdmi (encoder); +intel_disable_hdmi (encoder, old_crtc_state, old_conn_state); } -static void pch_disable_hdmi (struct intel_encoder *encoder) +static void pch_disable_hdmi (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc);@@ -1182,9 +1196,11 @@ static void pch_disable_hdmi(struct intel_encoder *encoder)intel_audio_codec_disable (encoder); } -static void pch_post_disable_hdmi (struct intel_encoder *encoder) +static void pch_post_disable_hdmi (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { -intel_disable_hdmi (encoder); +intel_disable_hdmi (encoder, old_crtc_state, old_conn_state); }static int intel_hdmi_source_max_tmds_clock (struct drm_i915_private *dev_priv)@@ -1638,7 +1654,9 @@ done:return 0 ; } -static void intel_hdmi_pre_enable (struct intel_encoder *encoder) +static void intel_hdmi_pre_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base);struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc);@@ -1651,7 +1669,9 @@ static void intel_hdmi_pre_enable(struct intel_encoder *encoder) adjusted_mode); } -static void vlv_hdmi_pre_enable (struct intel_encoder *encoder) +static void vlv_hdmi_pre_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_digital_port *dport =enc_to_dig_port (&encoder->base);struct intel_hdmi *intel_hdmi = &dport->hdmi;@@ -1671,37 +1691,47 @@ static void vlv_hdmi_pre_enable(struct intel_encoder *encoder) intel_crtc->config->has_hdmi_sink, adjusted_mode); -g4x_enable_hdmi (encoder); +g4x_enable_hdmi (encoder, pipe_config, conn_state);vlv_wait_port_ready (dev_priv, dport,0x0 ); } -static void vlv_hdmi_pre_pll_enable (struct intel_encoder *encoder) +static void vlv_hdmi_pre_pll_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {intel_hdmi_prepare (encoder);vlv_phy_pre_pll_enable (encoder); } -static void chv_hdmi_pre_pll_enable (struct intel_encoder *encoder) +static void chv_hdmi_pre_pll_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {intel_hdmi_prepare (encoder);chv_phy_pre_pll_enable (encoder); } -static void chv_hdmi_post_pll_disable (struct intel_encoder *encoder) +static void chv_hdmi_post_pll_disable (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {chv_phy_post_pll_disable (encoder); } -static void vlv_hdmi_post_disable (struct intel_encoder *encoder) +static void vlv_hdmi_post_disable (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {/* Reset lanes to avoid HDMI flicker (VLV w/a) */ vlv_phy_reset_lanes (encoder); } -static void chv_hdmi_post_disable (struct intel_encoder *encoder) +static void chv_hdmi_post_disable (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -1714,7 +1744,9 @@ static void chv_hdmi_post_disable(struct intel_encoder *encoder)mutex_unlock (&dev_priv->sb_lock); } -static void chv_hdmi_pre_enable (struct intel_encoder *encoder) +static void chv_hdmi_pre_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_digital_port *dport =enc_to_dig_port (&encoder->base);struct intel_hdmi *intel_hdmi = &dport->hdmi;@@ -1734,7 +1766,7 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder) intel_crtc->config->has_hdmi_sink, adjusted_mode); -g4x_enable_hdmi (encoder); +g4x_enable_hdmi (encoder, pipe_config, conn_state);vlv_wait_port_ready (dev_priv, dport,0x0 );drivers/gpu/drm/i915/intel_lvds.c +21
-8@@ -136,7 +136,9 @@ static void intel_lvds_get_config(struct intel_encoder *encoder, pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; } -static void intel_pre_enable_lvds (struct intel_encoder *encoder) +static void intel_pre_enable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base);struct drm_device *dev = encoder->base.dev;@@ -210,7 +212,9 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder)/** * Sets the power state for the panel. */ -static void intel_enable_lvds (struct intel_encoder *encoder) +static void intel_enable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base);@@ -237,7 +241,9 @@ static void intel_enable_lvds(struct intel_encoder *encoder)intel_panel_enable_backlight (intel_connector); } -static void intel_disable_lvds (struct intel_encoder *encoder) +static void intel_disable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_device *dev = encoder->base.dev;struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base);@@ -260,7 +266,10 @@ static void intel_disable_lvds(struct intel_encoder *encoder)POSTING_READ (lvds_encoder->reg); } -static void gmch_disable_lvds (struct intel_encoder *encoder) +static void gmch_disable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) + {struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); struct intel_connector *intel_connector =@@ -268,10 +277,12 @@ static void gmch_disable_lvds(struct intel_encoder *encoder)intel_panel_disable_backlight (intel_connector); -intel_disable_lvds (encoder); +intel_disable_lvds (encoder, old_crtc_state, old_conn_state); } -static void pch_disable_lvds (struct intel_encoder *encoder) +static void pch_disable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); struct intel_connector *intel_connector =@@ -280,9 +291,11 @@ static void pch_disable_lvds(struct intel_encoder *encoder)intel_panel_disable_backlight (intel_connector); } -static void pch_post_disable_lvds (struct intel_encoder *encoder) +static void pch_post_disable_lvds (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { -intel_disable_lvds (encoder); +intel_disable_lvds (encoder, old_crtc_state, old_conn_state); } static enum drm_mode_statusdrivers/gpu/drm/i915/intel_sdvo.c +16
-6@@ -1192,7 +1192,9 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder,return true; } -static void intel_sdvo_pre_enable (struct intel_encoder *intel_encoder) +static void intel_sdvo_pre_enable (struct intel_encoder *intel_encoder, +struct intel_crtc_state *crtc_state, +struct drm_connector_state *conn_state) {struct drm_device *dev = intel_encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -1434,7 +1436,9 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, pipe_config->pixel_multiplier, encoder_pixel_multiplier); } -static void intel_disable_sdvo (struct intel_encoder *encoder) +static void intel_disable_sdvo (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_sdvo *intel_sdvo =to_sdvo (encoder);@@ -1477,16 +1481,22 @@ static void intel_disable_sdvo(struct intel_encoder *encoder) } } -static void pch_disable_sdvo (struct intel_encoder *encoder) +static void pch_disable_sdvo (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { } -static void pch_post_disable_sdvo (struct intel_encoder *encoder) +static void pch_post_disable_sdvo (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) { -intel_disable_sdvo (encoder); +intel_disable_sdvo (encoder, old_crtc_state, old_conn_state); } -static void intel_enable_sdvo (struct intel_encoder *encoder) +static void intel_enable_sdvo (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);drivers/gpu/drm/i915/intel_tv.c +9
-3@@ -838,7 +838,9 @@ intel_tv_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) }static void -intel_enable_tv (struct intel_encoder *encoder) +intel_enable_tv (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -851,7 +853,9 @@ intel_enable_tv(struct intel_encoder *encoder) }static void -intel_disable_tv (struct intel_encoder *encoder) +intel_disable_tv (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -1010,7 +1014,9 @@ static void set_color_conversion(struct drm_i915_private *dev_priv, color_conversion->av); } -static void intel_tv_pre_enable (struct intel_encoder *encoder) +static void intel_tv_pre_enable (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/15] drm/i915: Pass crtc_state and connector_state to encoder functions
Op 18-08-16 om 15:30 schreef Daniel Vetter:
Quoted 8 lines · Maarten Lankhorst
Quoted 6 lines
This is mostly code churn, with exception of a few places:
-intel_display.chas changes inintel_sanitize_encoder
-intel_ddi.chasintel_ddi_fdi_disablecallingintel_ddi_post_disable, and required a function change. Also affectsintel_display.c
-intel_dp_mst.cpasses a NULLcrtc_stateandconn_statetointel_ddi_post_disablefor shutting down the real encoder.I didn't find this NULL callsite. Outdated commit message?
intel_dp_mst.c:
+ intel_dig_port->base.post_disable(&intel_dig_port->base,
+ old_crtc_state, NULL);
Though it seems I accidentally pass old_crtc_state, that one should be NULL too.
R-B with that fixed?
And did you review 4/15? I don't see it in my inbox.
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/15] drm/i915: Pass crtc_state and connector_state to encoder functions
Quoted 14 lines · Maarten Lankhorst
Op 18-08-16 om 15:30 schreef Daniel Vetter:
Quoted 8 lines · Maarten Lankhorst
Quoted 6 lines
This is mostly code churn, with exception of a few places:
-intel_display.chas changes inintel_sanitize_encoder
-intel_ddi.chasintel_ddi_fdi_disablecallingintel_ddi_post_disable, and required a function change. Also affectsintel_display.c
-intel_dp_mst.cpasses a NULLcrtc_stateandconn_statetointel_ddi_post_disablefor shutting down the real encoder.I didn't find this NULL callsite. Outdated commit message?
intel_dp_mst.c:drivers/gpu/drm/i915/intel_dp_mst.c +2
-0+ intel_dig_port->base.post_disable (&intel_dig_port->base, + old_crtc_state,NULL );
Quoted 1 line
Though it seems I accidentally pass
old_crtc_state, that one should be NULL too.
Indeed I somehow missed that one. Still, why do we need to pass NULL there? We should be able to wire up the state passing completely.
Quoted 1 line
R-B with that fixed?
There's 2 more review comments from me.
Quoted 1 line
And did you review 4/15? I don't see it in my inbox.
Sorry, must have missed it. Now with r-b.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/15] drm/i915: Pass crtc_state and connector_state to encoder functions
Op 22-08-16 om 16:32 schreef Daniel Vetter:
Quoted 10 lines · Maarten Lankhorst
Quoted 9 lines
Op 18-08-16 om 15:30 schreef Daniel Vetter:
Quoted 8 lines · Maarten Lankhorst
Quoted 6 lines
This is mostly code churn, with exception of a few places:
-intel_display.chas changes inintel_sanitize_encoder
-intel_ddi.chasintel_ddi_fdi_disablecallingintel_ddi_post_disable, and required a function change. Also affectsintel_display.c
-intel_dp_mst.cpasses a NULLcrtc_stateandconn_statetointel_ddi_post_disablefor shutting down the real encoder.I didn't find this NULL callsite. Outdated commit message?
Quoted 8 lines
Quoted 6 lines
intel_dp_mst.c:drivers/gpu/drm/i915/intel_dp_mst.c +2
-0+ intel_dig_port->base.post_disable (&intel_dig_port->base, + old_crtc_state,NULL );Though it seems I accidentally pass
old_crtc_state, that one should be NULL too.Indeed I somehow missed that one. Still, why do we need to pass NULL there? We should be able to wire up the state passing completely.
In MST mode we have to do some enabling of the port regardless of crtc/MST connector.
If we would pass conn_state, then conn_state->connector != intel_dig_port->connector and conn_state->best_encoder != to_intel_encoder(intel_dig_port). Why even bother passing conn_state at that point?
We also shouldn't pass crtc_state, because in that case the disabling sequence may potentially be different depending on which crtc is disabled last. Nice source of bugs. :)
~Maarten
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/15] drm/i915: Pass crtc_state and connector_state to encoder functions
Quoted 21 lines · Maarten Lankhorst
Op 22-08-16 om 16:32 schreef Daniel Vetter:
Quoted 10 lines · Maarten Lankhorst
Quoted 9 lines
Op 18-08-16 om 15:30 schreef Daniel Vetter:
Quoted 8 lines · Maarten Lankhorst
Quoted 6 lines
This is mostly code churn, with exception of a few places:
-intel_display.chas changes inintel_sanitize_encoder
-intel_ddi.chasintel_ddi_fdi_disablecallingintel_ddi_post_disable, and required a function change. Also affectsintel_display.c
-intel_dp_mst.cpasses a NULLcrtc_stateandconn_statetointel_ddi_post_disablefor shutting down the real encoder.I didn't find this NULL callsite. Outdated commit message?
Quoted 8 lines
Quoted 6 lines
intel_dp_mst.c:drivers/gpu/drm/i915/intel_dp_mst.c +2
-0+ intel_dig_port->base.post_disable (&intel_dig_port->base, + old_crtc_state,NULL );Though it seems I accidentally pass
old_crtc_state, that one should be NULL too.Indeed I somehow missed that one. Still, why do we need to pass NULL there? We should be able to wire up the state passing completely.
In MST mode we have to do some enabling of the port regardless of crtc/MST connector.
Quoted 8 lines
If we would pass
conn_state, thenconn_state->connector!=intel_dig_port->connectorandconn_state->best_encoder!=to_intel_encoder(intel_dig_port). Why even bother passingconn_stateat that point?We also shouldn't pass
crtc_state, because in that case the disabling sequence may potentially be different depending on which crtc is disabled last. Nice source of bugs. :)
Ok, makes sense. Otoh I think we should just make sure that dp port relevant parts of the crtc all match between all the mst streams.
But yeah passing the connector state doesn't make sense I guess. -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/15] drm/i915: Pass crtc_state and connector_state to encoder functions
In reply to Daniel VetterQuoted 15 lines · Daniel Vetter
Quoted 14 lines · Maarten Lankhorst
Op 18-08-16 om 15:30 schreef Daniel Vetter:
Quoted 8 lines · Maarten Lankhorst
Quoted 6 lines
This is mostly code churn, with exception of a few places:
-intel_display.chas changes inintel_sanitize_encoder
-intel_ddi.chasintel_ddi_fdi_disablecallingintel_ddi_post_disable, and required a function change. Also affectsintel_display.c
-intel_dp_mst.cpasses a NULLcrtc_stateandconn_statetointel_ddi_post_disablefor shutting down the real encoder.I didn't find this NULL callsite. Outdated commit message?
intel_dp_mst.c:drivers/gpu/drm/i915/intel_dp_mst.c +2
-0+ intel_dig_port->base.post_disable (&intel_dig_port->base, + old_crtc_state,NULL );
Quoted 8 lines
Quoted 1 line
Though it seems I accidentally pass
old_crtc_state, that one should be NULL too.Indeed I somehow missed that one. Still, why do we need to pass NULL there? We should be able to wire up the state passing completely.
Quoted 1 line
R-B with that fixed?
There's 2 more review comments from me.
In case it wasn't clear: No r-b from me without addressing those two issues. Not happy at all that you went ahead and pushed it anyway. -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/15 drm/i915: Make encoder->compute_config take the connector state
In reply to Maarten LankhorstSome places iterate over connector_state to find the right connector, pass it along as argument.
--- drivers/gpu/drm/i915/intel_crt.c | 3 ++- drivers/gpu/drm/i915/intel_ddi.c | 7 ++++--- drivers/gpu/drm/i915/intel_display.c | 2 +- drivers/gpu/drm/i915/intel_dp.c | 3 ++- drivers/gpu/drm/i915/intel_dp_mst.c | 4 ++-- drivers/gpu/drm/i915/intel_drv.h | 9 ++++++--- drivers/gpu/drm/i915/intel_dsi.c | 3 ++- drivers/gpu/drm/i915/intel_dvo.c | 3 ++- drivers/gpu/drm/i915/intel_hdmi.c | 3 ++- drivers/gpu/drm/i915/intel_lvds.c | 3 ++- drivers/gpu/drm/i915/intel_sdvo.c | 3 ++- drivers/gpu/drm/i915/intel_tv.c | 3 ++- 12 files changed, 29 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/intel_crt.c +2 -1
@@ -261,7 +261,8 @@ intel_crt_mode_valid(struct drm_connector *connector, }static bool intel_crt_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;
drivers/gpu/drm/i915/intel_ddi.c +4 -3
@@ -2285,7 +2285,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder, }static bool intel_ddi_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);int type = encoder->type;
@@ -2298,9 +2299,9 @@ static bool intel_ddi_compute_config(struct intel_encoder *encoder, pipe_config->cpu_transcoder =TRANSCODER_EDP ;if (type ==INTEL_OUTPUT_HDMI ) - ret =intel_hdmi_compute_config (encoder, pipe_config); + ret =intel_hdmi_compute_config (encoder, pipe_config, conn_state);else - ret =intel_dp_compute_config (encoder, pipe_config); + ret =intel_dp_compute_config (encoder, pipe_config, conn_state);if (IS_BROXTON (dev_priv) && ret) pipe_config->lane_lat_optim_mask =
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -12589,7 +12589,7 @@ encoder_retry: encoder =to_intel_encoder (connector_state->best_encoder); -if (!(encoder->compute_config (encoder, pipe_config))) { +if (!(encoder->compute_config (encoder, pipe_config, connector_state))) {DRM_DEBUG_KMS ("Encoder config failure\n" ); goto fail; }
drivers/gpu/drm/i915/intel_dp.c +2 -1
@@ -1470,7 +1470,8 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,bool intel_dp_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);
drivers/gpu/drm/i915/intel_dp_mst.c +2 -2
@@ -31,7 +31,8 @@#include <drm/drm_edid.h> static bool intel_dp_mst_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;
@@ -54,7 +55,6 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder,*/ lane_count =drm_dp_max_lane_count (intel_dp->dpcd); - pipe_config->lane_count = lane_count; pipe_config->pipe_bpp =24 ;
drivers/gpu/drm/i915/intel_drv.h +6 -3
@@ -194,7 +194,8 @@ struct intel_encoder {unsigned int cloneable;void (*hot_plug)(struct intel_encoder *);bool (*compute_config)(struct intel_encoder *, -struct intel_crtc_state *); +struct intel_crtc_state *, +struct drm_connector_state *);void (*pre_pll_enable)(struct intel_encoder *,struct intel_crtc_state *,struct drm_connector_state *);
@@ -1367,7 +1368,8 @@ void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);void intel_dp_encoder_destroy (struct drm_encoder *encoder);int intel_dp_sink_crc (struct intel_dp *intel_dp,u8 *crc);bool intel_dp_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config); +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state);bool intel_dp_is_edp (struct drm_device *dev,enum port port);enum irqreturn intel_dp_hpd_pulse (struct intel_digital_port *intel_dig_port,bool long_hpd);
@@ -1492,7 +1494,8 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, struct intel_connector *intel_connector);struct intel_hdmi *enc_to_intel_hdmi (struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config); +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state);void intel_dp_dual_mode_set_tmds_output (struct intel_hdmi *hdmi,bool enable);
drivers/gpu/drm/i915/intel_dsi.c +2 -1
@@ -312,7 +312,8 @@ static inline bool is_cmd_mode(struct intel_dsi *intel_dsi) }static bool intel_dsi_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
drivers/gpu/drm/i915/intel_dvo.c +2 -1
@@ -239,7 +239,8 @@ intel_dvo_mode_valid(struct drm_connector *connector, }static bool intel_dvo_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dvo *intel_dvo =enc_to_dvo (encoder); const struct drm_display_mode *fixed_mode =
drivers/gpu/drm/i915/intel_hdmi.c +2 -1
@@ -1301,7 +1301,8 @@ static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state) }bool intel_hdmi_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base);struct drm_device *dev = encoder->base.dev;
drivers/gpu/drm/i915/intel_lvds.c +2 -1
@@ -317,7 +317,8 @@ intel_lvds_mode_valid(struct drm_connector *connector, }static bool intel_lvds_compute_config (struct intel_encoder *intel_encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = intel_encoder->base.dev; struct intel_lvds_encoder *lvds_encoder =
drivers/gpu/drm/i915/intel_sdvo.c +2 -1
@@ -1125,7 +1125,8 @@ static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_state *pipe_config) }static bool intel_sdvo_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_sdvo *intel_sdvo =to_sdvo (encoder);struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
drivers/gpu/drm/i915/intel_tv.c +2 -1
@@ -912,7 +912,8 @@ intel_tv_get_config(struct intel_encoder *encoder,static bool intel_tv_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_tv *intel_tv =enc_to_tv (encoder);const struct tv_mode *tv_mode =intel_tv_mode_find (intel_tv);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 06/15] drm/i915: Make encoder->compute_config take the connector state
Quoted 4 lines · Maarten Lankhorst
Some places iterate over
connector_stateto find the right connector, pass it along as argument.Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 229 lines
--- drivers/gpu/drm/i915/intel_crt.c | 3 ++- drivers/gpu/drm/i915/intel_ddi.c | 7 ++++--- drivers/gpu/drm/i915/intel_display.c | 2 +- drivers/gpu/drm/i915/intel_dp.c | 3 ++- drivers/gpu/drm/i915/intel_dp_mst.c | 4 ++-- drivers/gpu/drm/i915/intel_drv.h | 9 ++++++--- drivers/gpu/drm/i915/intel_dsi.c | 3 ++- drivers/gpu/drm/i915/intel_dvo.c | 3 ++- drivers/gpu/drm/i915/intel_hdmi.c | 3 ++- drivers/gpu/drm/i915/intel_lvds.c | 3 ++- drivers/gpu/drm/i915/intel_sdvo.c | 3 ++- drivers/gpu/drm/i915/intel_tv.c | 3 ++- 12 files changed, 29 insertions(+), 17 deletions(-)drivers/gpu/drm/i915/intel_crt.c +2
-1@@ -261,7 +261,8 @@ intel_crt_mode_valid(struct drm_connector *connector, }static bool intel_crt_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;drivers/gpu/drm/i915/intel_ddi.c +4
-3@@ -2285,7 +2285,8 @@ void intel_ddi_get_config(struct intel_encoder *encoder, }static bool intel_ddi_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);int type = encoder->type;@@ -2298,9 +2299,9 @@ static bool intel_ddi_compute_config(struct intel_encoder *encoder, pipe_config->cpu_transcoder =TRANSCODER_EDP ;if (type ==INTEL_OUTPUT_HDMI ) - ret =intel_hdmi_compute_config (encoder, pipe_config); + ret =intel_hdmi_compute_config (encoder, pipe_config, conn_state);else - ret =intel_dp_compute_config (encoder, pipe_config); + ret =intel_dp_compute_config (encoder, pipe_config, conn_state);if (IS_BROXTON (dev_priv) && ret) pipe_config->lane_lat_optim_mask =drivers/gpu/drm/i915/intel_display.c +1
-1@@ -12589,7 +12589,7 @@ encoder_retry: encoder =to_intel_encoder (connector_state->best_encoder); -if (!(encoder->compute_config (encoder, pipe_config))) { +if (!(encoder->compute_config (encoder, pipe_config, connector_state))) {DRM_DEBUG_KMS ("Encoder config failure\n" ); goto fail; }drivers/gpu/drm/i915/intel_dp.c +2
-1@@ -1470,7 +1470,8 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,bool intel_dp_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);drivers/gpu/drm/i915/intel_dp_mst.c +2
-2@@ -31,7 +31,8 @@#include <drm/drm_edid.h> static bool intel_dp_mst_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;@@ -54,7 +55,6 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder,*/ lane_count =drm_dp_max_lane_count (intel_dp->dpcd); - pipe_config->lane_count = lane_count; pipe_config->pipe_bpp =24 ;drivers/gpu/drm/i915/intel_drv.h +6
-3@@ -194,7 +194,8 @@ struct intel_encoder {unsigned int cloneable;void (*hot_plug)(struct intel_encoder *);bool (*compute_config)(struct intel_encoder *, -struct intel_crtc_state *); +struct intel_crtc_state *, +struct drm_connector_state *);void (*pre_pll_enable)(struct intel_encoder *,struct intel_crtc_state *,struct drm_connector_state *);@@ -1367,7 +1368,8 @@ void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);void intel_dp_encoder_destroy (struct drm_encoder *encoder);int intel_dp_sink_crc (struct intel_dp *intel_dp,u8 *crc);bool intel_dp_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config); +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state);bool intel_dp_is_edp (struct drm_device *dev,enum port port);enum irqreturn intel_dp_hpd_pulse (struct intel_digital_port *intel_dig_port,bool long_hpd);@@ -1492,7 +1494,8 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, struct intel_connector *intel_connector);struct intel_hdmi *enc_to_intel_hdmi (struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config); +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state);void intel_dp_dual_mode_set_tmds_output (struct intel_hdmi *hdmi,bool enable);drivers/gpu/drm/i915/intel_dsi.c +2
-1@@ -312,7 +312,8 @@ static inline bool is_cmd_mode(struct intel_dsi *intel_dsi) }static bool intel_dsi_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,drivers/gpu/drm/i915/intel_dvo.c +2
-1@@ -239,7 +239,8 @@ intel_dvo_mode_valid(struct drm_connector *connector, }static bool intel_dvo_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_dvo *intel_dvo =enc_to_dvo (encoder); const struct drm_display_mode *fixed_mode =drivers/gpu/drm/i915/intel_hdmi.c +2
-1@@ -1301,7 +1301,8 @@ static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state) }bool intel_hdmi_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base);struct drm_device *dev = encoder->base.dev;drivers/gpu/drm/i915/intel_lvds.c +2
-1@@ -317,7 +317,8 @@ intel_lvds_mode_valid(struct drm_connector *connector, }static bool intel_lvds_compute_config (struct intel_encoder *intel_encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct drm_device *dev = intel_encoder->base.dev; struct intel_lvds_encoder *lvds_encoder =drivers/gpu/drm/i915/intel_sdvo.c +2
-1@@ -1125,7 +1125,8 @@ static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_state *pipe_config) }static bool intel_sdvo_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_sdvo *intel_sdvo =to_sdvo (encoder);struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;drivers/gpu/drm/i915/intel_tv.c +2
-1@@ -912,7 +912,8 @@ intel_tv_get_config(struct intel_encoder *encoder,static bool intel_tv_compute_config (struct intel_encoder *encoder, -struct intel_crtc_state *pipe_config) +struct intel_crtc_state *pipe_config, +struct drm_connector_state *conn_state) {struct intel_tv *intel_tv =enc_to_tv (encoder);const struct tv_mode *tv_mode =intel_tv_mode_find (intel_tv);Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/15 drm/i915: Remove unused loop from intel_dp_mst_compute_config
In reply to Maarten Lankhorstconn_state is passed as argument now, if anything required conn_state they can get it without having to look it up.
--- drivers/gpu/drm/i915/intel_dp_mst.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_dp_mst.c +1 -18
@@ -38,12 +38,9 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder,struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp;struct drm_atomic_state *state; -int bpp, i; +int bpp;int lane_count, slots;const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; -struct drm_connector *drm_connector; -struct intel_connector *connector, *found =NULL ; -struct drm_connector_state *connector_state;int mst_pbn; pipe_config->dp_encoder_is_mst = true;
@@ -62,20 +59,6 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, state = pipe_config->base.state; -for_each_connector_in_state (state, drm_connector, connector_state, i) { - connector =to_intel_connector (drm_connector); - -if (connector_state->best_encoder == &encoder->base) { - found = connector; -break ; - } - } - -if (!found) { -DRM_ERROR ("can't find connector\n" ); -return false; - } - mst_pbn =drm_dp_calc_pbn_mode (adjusted_mode->crtc_clock, bpp); pipe_config->pbn = mst_pbn;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/15] drm/i915: Remove unused loop from intel_dp_mst_compute_config
Quoted 2 lines · Maarten Lankhorst
conn_stateis passed as argument now, if anything requiredconn_statethey can get it without having to look it up.
Commit message seems off, this has been dead code before. It seems to be duct-tape from before we had a proper intel_mst_best_encoder. -Daniel
Quoted 52 lines
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_dp_mst.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)drivers/gpu/drm/i915/intel_dp_mst.c +1
-18@@ -38,12 +38,9 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder,struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp;struct drm_atomic_state *state; -int bpp, i; +int bpp;int lane_count, slots;const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; -struct drm_connector *drm_connector; -struct intel_connector *connector, *found =NULL ; -struct drm_connector_state *connector_state;int mst_pbn; pipe_config->dp_encoder_is_mst = true;@@ -62,20 +59,6 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, state = pipe_config->base.state; -for_each_connector_in_state (state, drm_connector, connector_state, i) { - connector =to_intel_connector (drm_connector); - -if (connector_state->best_encoder == &encoder->base) { - found = connector; -break ; - } - } - -if (!found) { -DRM_ERROR ("can't find connector\n" ); -return false; - } - mst_pbn =drm_dp_calc_pbn_mode (adjusted_mode->crtc_clock, bpp); pipe_config->pbn = mst_pbn;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/15] drm/i915: Remove unused loop from intel_dp_mst_compute_config
Op 18-08-16 om 15:34 schreef Daniel Vetter:
Quoted 5 lines · Maarten Lankhorst
Quoted 2 lines
conn_stateis passed as argument now, if anything requiredconn_statethey can get it without having to look it up.Commit message seems off, this has been dead code before. It seems to be duct-tape from before we had a proper
intel_mst_best_encoder.
What about this?
Now that conn_state is passed in as argument to compute_config, it's guaranteed that there is a connector for the argument. The code that looks for the connector is now dead, and completely unused. Delete it.
~Maarten
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 07/15] drm/i915: Remove unused loop from intel_dp_mst_compute_config
Quoted 11 lines · Maarten Lankhorst
Op 18-08-16 om 15:34 schreef Daniel Vetter:
Quoted 5 lines · Maarten Lankhorst
Quoted 2 lines
conn_stateis passed as argument now, if anything requiredconn_statethey can get it without having to look it up.Commit message seems off, this has been dead code before. It seems to be duct-tape from before we had a proper
intel_mst_best_encoder.What about this?
Now that
conn_stateis passed in as argument tocompute_config, it's guaranteed that there is a connector for the argument. The code that looks for the connector is now dead, and completely unused. Delete it.
Sounds good. Reviewed-by: Daniel Vetter <[email protected]> with that.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/15 drm/i915: Convert intel_crt to use atomic state
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/intel_crt.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_crt.c +7 -5
@@ -143,13 +143,15 @@ static void hsw_crt_get_config(struct intel_encoder *encoder,/* Note: The caller is required to filter out dpms modes not supported by the * platform. */ -static void intel_crt_set_dpms (struct intel_encoder *encoder,int mode) +static void intel_crt_set_dpms (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state, +int mode) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crt *crt =intel_encoder_to_crt (encoder); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode;u32 adpa;if (INTEL_INFO (dev)->gen >=5 )
@@ -197,7 +199,7 @@ static void intel_disable_crt(struct intel_encoder *encoder,struct intel_crtc_state *old_crtc_state, struct drm_connector_state *old_conn_state) { -intel_crt_set_dpms (encoder ,DRM_MODE_DPMS_OFF ); +intel_crt_set_dpms (encoder ,old_crtc_state ,DRM_MODE_DPMS_OFF ); } static void pch_disable_crt(struct intel_encoder *encoder,
@@ -217,7 +219,7 @@ static void intel_enable_crt(struct intel_encoder *encoder,struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { -intel_crt_set_dpms (encoder ,DRM_MODE_DPMS_ON ); +intel_crt_set_dpms (encoder ,pipe_config ,DRM_MODE_DPMS_ON ); } static enum drm_mode_status
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 08/15] drm/i915: Convert intel_crt to use atomic state
Quoted 1 line · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 52 lines
--- drivers/gpu/drm/i915/intel_crt.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_crt.c +7
-5@@ -143,13 +143,15 @@ static void hsw_crt_get_config(struct intel_encoder *encoder,/* Note: The caller is required to filter out dpms modes not supported by the * platform. */ -static void intel_crt_set_dpms (struct intel_encoder *encoder,int mode) +static void intel_crt_set_dpms (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state, +int mode) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crt *crt =intel_encoder_to_crt (encoder); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode;u32 adpa;if (INTEL_INFO (dev)->gen >=5 )@@ -197,7 +199,7 @@ static void intel_disable_crt(struct intel_encoder *encoder,struct intel_crtc_state *old_crtc_state, struct drm_connector_state *old_conn_state) { -intel_crt_set_dpms (encoder ,DRM_MODE_DPMS_OFF ); +intel_crt_set_dpms (encoder ,old_crtc_state ,DRM_MODE_DPMS_OFF ); } static void pch_disable_crt(struct intel_encoder *encoder,@@ -217,7 +219,7 @@ static void intel_enable_crt(struct intel_encoder *encoder,struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { -intel_crt_set_dpms (encoder ,DRM_MODE_DPMS_ON ); +intel_crt_set_dpms (encoder ,pipe_config ,DRM_MODE_DPMS_ON ); } static enum drm_mode_statusSignature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/15 drm/i915: Convert intel_dvo to use atomic state
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/intel_dvo.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_dvo.c +5 -7
@@ -194,13 +194,12 @@ static void intel_enable_dvo(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dvo *intel_dvo =enc_to_dvo (encoder); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc);i915_reg_t dvo_reg = intel_dvo->dev.dvo_reg;u32 temp =I915_READ (dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &crtc->config->base.mode, - &crtc->config->base.adjusted_mode); + &pipe_config->base.mode, + &pipe_config->base.adjusted_mode);I915_WRITE (dvo_reg, temp |DVO_ENABLE );I915_READ (dvo_reg);
@@ -262,10 +261,9 @@ static void intel_dvo_pre_enable(struct intel_encoder *encoder,struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;struct intel_dvo *intel_dvo =enc_to_dvo (encoder);int pipe = crtc->pipe;u32 dvo_val;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 09/15] drm/i915: Convert intel_dvo to use atomic state
Quoted 1 line · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 45 lines
--- drivers/gpu/drm/i915/intel_dvo.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)drivers/gpu/drm/i915/intel_dvo.c +5
-7@@ -194,13 +194,12 @@ static void intel_enable_dvo(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dvo *intel_dvo =enc_to_dvo (encoder); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc);i915_reg_t dvo_reg = intel_dvo->dev.dvo_reg;u32 temp =I915_READ (dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &crtc->config->base.mode, - &crtc->config->base.adjusted_mode); + &pipe_config->base.mode, + &pipe_config->base.adjusted_mode);I915_WRITE (dvo_reg, temp |DVO_ENABLE );I915_READ (dvo_reg);@@ -262,10 +261,9 @@ static void intel_dvo_pre_enable(struct intel_encoder *encoder,struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;struct intel_dvo *intel_dvo =enc_to_dvo (encoder);int pipe = crtc->pipe;u32 dvo_val;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/15 drm/i915: Convert intel_dsi to use atomic state
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/intel_dsi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/intel_dsi.c +11 -11
@@ -534,16 +534,15 @@ static void intel_dsi_enable(struct intel_encoder *encoder)intel_panel_enable_backlight (intel_dsi->attached_connector); } -static void intel_dsi_prepare (struct intel_encoder *intel_encoder); +static void intel_dsi_prepare (struct intel_encoder *intel_encoder, +struct intel_crtc_state *pipe_config);static void intel_dsi_pre_enable (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state) { -struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc);enum port port;DRM_DEBUG_KMS ("\n" );
@@ -553,9 +552,9 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder,* lock. It needs to be fully powered down to fix it. */ intel_disable_dsi_pll (encoder); -intel_enable_dsi_pll (encoder, crtc->config); +intel_enable_dsi_pll (encoder, pipe_config); -intel_dsi_prepare (encoder); +intel_dsi_prepare (encoder, pipe_config);/* Panel Enable over CRC PMIC */ if (intel_dsi->gpio_panel)
@@ -829,7 +828,7 @@ static void bxt_dsi_get_pipe_config(struct intel_encoder *encoder, crtc_hblank_start_sw, crtc_hblank_end_sw; intel_crtc =to_intel_crtc (encoder->base.crtc); - adjusted_mode_sw = &intel_crtc->config->base.adjusted_mode; + adjusted_mode_sw = &pipe_config->base.adjusted_mode;/* * Atleast one port is active as encoder->get_config called only if
@@ -1113,14 +1112,15 @@ static u32 pixel_format_to_reg(enum mipi_dsi_pixel_format fmt) } } -static void intel_dsi_prepare (struct intel_encoder *intel_encoder) +static void intel_dsi_prepare (struct intel_encoder *intel_encoder, +struct intel_crtc_state *pipe_config) {struct drm_encoder *encoder = &intel_encoder->base;struct drm_device *dev = encoder->dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *intel_crtc =to_intel_crtc (encoder->crtc); +struct intel_crtc *intel_crtc =to_intel_crtc (pipe_config->base.crtc);struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); -const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode; +const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;enum port port;unsigned int bpp =mipi_dsi_pixel_format_to_bpp (intel_dsi->pixel_format);u32 val, tmp;
@@ -1357,7 +1357,7 @@ static int intel_dsi_set_property(struct drm_connector *connector, intel_connector->panel.fitting_mode = val; } - crtc =intel_attached_encoder (connector)->base.crtc; + crtc = connector->state->crtc;if (crtc && crtc->state->enable) {/* * If the CRTC is enabled, the display will be changed
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 10/15] drm/i915: Convert intel_dsi to use atomic state
Quoted 42 lines · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_dsi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)drivers/gpu/drm/i915/intel_dsi.c +5
-6@@ -534,16 +534,15 @@ static void intel_dsi_enable(struct intel_encoder *encoder)intel_panel_enable_backlight (intel_dsi->attached_connector); } -static void intel_dsi_prepare (struct intel_encoder *intel_encoder); +static void intel_dsi_prepare (struct intel_encoder *intel_encoder, +struct intel_crtc_state *pipe_config);static void intel_dsi_pre_enable (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state) { -struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc);enum port port;DRM_DEBUG_KMS ("\n" );@@ -553,9 +552,9 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder,* lock. It needs to be fully powered down to fix it. */ intel_disable_dsi_pll (encoder); -intel_enable_dsi_pll (encoder, crtc->config); +intel_enable_dsi_pll (encoder, pipe_config); -intel_dsi_prepare (encoder); +intel_dsi_prepare (encoder, pipe_config);/* Panel Enable over CRC PMIC */ if (intel_dsi->gpio_panel)
drivers/gpu/drm/i915/intel_dsi.c static void bxt_dsi_get_pipe_config(struct intel_encoder *encoder, · line 831
Quoted 5 lines
drivers/gpu/drm/i915/intel_dsi.c +1
-1@@ -829,7 +828,7 @@ static void bxt_dsi_get_pipe_config(struct intel_encoder *encoder, crtc_hblank_start_sw, crtc_hblank_end_sw; intel_crtc =to_intel_crtc (encoder->base.crtc); - adjusted_mode_sw = &intel_crtc->config->base.adjusted_mode; + adjusted_mode_sw = &pipe_config->base.adjusted_mode;
I think this will break bxt dsi state readout. It looks like it's still broken :( I totally missed the review there I think, it should do this rounding in compute_config, to guarantee that get_pipe_config matches.
I suggest you just put a FIXME onto this one and drop this hunk from your patch.
With that addressed:
Quoted 38 lines
drivers/gpu/drm/i915/intel_dsi.c +5
-4/* * Atleast one port is active as encoder->get_config called only if @@ -1113,14 +1112,15 @@ static u32 pixel_format_to_reg(enum mipi_dsi_pixel_format fmt) } } -static void intel_dsi_prepare (struct intel_encoder *intel_encoder) +static void intel_dsi_prepare (struct intel_encoder *intel_encoder, +struct intel_crtc_state *pipe_config) {struct drm_encoder *encoder = &intel_encoder->base;struct drm_device *dev = encoder->dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *intel_crtc =to_intel_crtc (encoder->crtc); +struct intel_crtc *intel_crtc =to_intel_crtc (pipe_config->base.crtc);struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); -const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode; +const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;enum port port;unsigned int bpp =mipi_dsi_pixel_format_to_bpp (intel_dsi->pixel_format);u32 val, tmp;@@ -1357,7 +1357,7 @@ static int intel_dsi_set_property(struct drm_connector *connector, intel_connector->panel.fitting_mode = val; } - crtc =intel_attached_encoder (connector)->base.crtc; + crtc = connector->state->crtc;if (crtc && crtc->state->enable) {/* * If the CRTC is enabled, the display will be changed Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/15 drm/i915: Convert intel_sdvo to use atomic state
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/intel_sdvo.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/intel_sdvo.c +11 -16
@@ -1003,24 +1003,22 @@ static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo, }static bool intel_sdvo_set_avi_infoframe (struct intel_sdvo *intel_sdvo, -const struct drm_display_mode *adjusted_mode) +struct intel_crtc_state *pipe_config) {uint8_t sdvo_data[HDMI_INFOFRAME_SIZE (AVI )]; -struct drm_crtc *crtc = intel_sdvo->base.base.crtc; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc);union hdmi_infoframe frame;int ret;ssize_t len; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - adjusted_mode); + &pipe_config->base.adjusted_mode);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return false; }if (intel_sdvo->rgb_quant_range_selectable) { -if (intel_crtc->config->limited_color_range) +if (pipe_config->limited_color_range) frame.avi.quantization_range =HDMI_QUANTIZATION_RANGE_LIMITED ;else
@@ -1199,18 +1197,15 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder, {struct drm_device *dev = intel_encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *crtc =to_intel_crtc (intel_encoder->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; -struct drm_display_mode *mode = &crtc->config->base.mode; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct drm_display_mode *mode = &crtc_state->base.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;struct intel_sdvo_dtd input_dtd, output_dtd;int rate; -if (!mode) -return ; -/* First, set the input mapping for the first input to our controlled * output. This is only correct if we're a single-input device, in * which case the first input is the output from the appropriate SDVO
@@ -1243,11 +1238,11 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,if (!intel_sdvo_set_target_input (intel_sdvo))return ; -if (crtc->config->has_hdmi_sink) { +if (crtc_state->has_hdmi_sink) {intel_sdvo_set_encode (intel_sdvo,SDVO_ENCODE_HDMI );intel_sdvo_set_colorimetry (intel_sdvo,SDVO_COLORIMETRY_RGB256 ); -intel_sdvo_set_avi_infoframe (intel_sdvo, adjusted_mode); +intel_sdvo_set_avi_infoframe (intel_sdvo, crtc_state); }else intel_sdvo_set_encode (intel_sdvo,SDVO_ENCODE_DVI );
@@ -1263,7 +1258,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,DRM_INFO ("Setting input timings on %s failed\n" ,SDVO_NAME (intel_sdvo)); -switch (crtc->config->pixel_multiplier) { +switch (crtc_state->pixel_multiplier) {default :WARN (1 ,"unknown pixel multiplier specified\n" );case 1 : rate =SDVO_CLOCK_RATE_MULT_1X ;break ;
@@ -1278,7 +1273,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,/* The real mode polarity is set by the SDVO commands, using * struct intel_sdvo_dtd. */ sdvox =SDVO_VSYNC_ACTIVE_HIGH |SDVO_HSYNC_ACTIVE_HIGH ; -if (!HAS_PCH_SPLIT (dev) && crtc->config->limited_color_range) +if (!HAS_PCH_SPLIT (dev) && crtc_state->limited_color_range) sdvox |=HDMI_COLOR_RANGE_16_235 ;if (INTEL_INFO (dev)->gen <5 ) sdvox |=SDVO_BORDER_ENABLE ;
@@ -1304,7 +1299,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder, }else if (IS_I945G (dev) ||IS_I945GM (dev) ||IS_G33 (dev)) {/* done in crtc_mode_set as it lives inside the dpll register */ }else { - sdvox |= (crtc->config->pixel_multiplier -1 ) + sdvox |= (crtc_state->pixel_multiplier -1 ) <<SDVO_PORT_MULTIPLY_SHIFT ; }
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 11/15] drm/i915: Convert intel_sdvo to use atomic state
Quoted 1 line · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 106 lines
--- drivers/gpu/drm/i915/intel_sdvo.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-)drivers/gpu/drm/i915/intel_sdvo.c +11
-16@@ -1003,24 +1003,22 @@ static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo, }static bool intel_sdvo_set_avi_infoframe (struct intel_sdvo *intel_sdvo, -const struct drm_display_mode *adjusted_mode) +struct intel_crtc_state *pipe_config) {uint8_t sdvo_data[HDMI_INFOFRAME_SIZE (AVI )]; -struct drm_crtc *crtc = intel_sdvo->base.base.crtc; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc);union hdmi_infoframe frame;int ret;ssize_t len; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - adjusted_mode); + &pipe_config->base.adjusted_mode);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return false; }if (intel_sdvo->rgb_quant_range_selectable) { -if (intel_crtc->config->limited_color_range) +if (pipe_config->limited_color_range) frame.avi.quantization_range =HDMI_QUANTIZATION_RANGE_LIMITED ;else @@ -1199,18 +1197,15 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder, {struct drm_device *dev = intel_encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *crtc =to_intel_crtc (intel_encoder->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; -struct drm_display_mode *mode = &crtc->config->base.mode; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct drm_display_mode *mode = &crtc_state->base.mode;struct intel_sdvo *intel_sdvo =to_sdvo (intel_encoder);u32 sdvox;struct intel_sdvo_in_out_map in_out;struct intel_sdvo_dtd input_dtd, output_dtd;int rate; -if (!mode) -return ; -/* First, set the input mapping for the first input to our controlled * output. This is only correct if we're a single-input device, in * which case the first input is the output from the appropriate SDVO @@ -1243,11 +1238,11 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,if (!intel_sdvo_set_target_input (intel_sdvo))return ; -if (crtc->config->has_hdmi_sink) { +if (crtc_state->has_hdmi_sink) {intel_sdvo_set_encode (intel_sdvo,SDVO_ENCODE_HDMI );intel_sdvo_set_colorimetry (intel_sdvo,SDVO_COLORIMETRY_RGB256 ); -intel_sdvo_set_avi_infoframe (intel_sdvo, adjusted_mode); +intel_sdvo_set_avi_infoframe (intel_sdvo, crtc_state); }else intel_sdvo_set_encode (intel_sdvo,SDVO_ENCODE_DVI );@@ -1263,7 +1258,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,DRM_INFO ("Setting input timings on %s failed\n" ,SDVO_NAME (intel_sdvo)); -switch (crtc->config->pixel_multiplier) { +switch (crtc_state->pixel_multiplier) {default :WARN (1 ,"unknown pixel multiplier specified\n" );case 1 : rate =SDVO_CLOCK_RATE_MULT_1X ;break ;@@ -1278,7 +1273,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,/* The real mode polarity is set by the SDVO commands, using * struct intel_sdvo_dtd. */ sdvox =SDVO_VSYNC_ACTIVE_HIGH |SDVO_HSYNC_ACTIVE_HIGH ; -if (!HAS_PCH_SPLIT (dev) && crtc->config->limited_color_range) +if (!HAS_PCH_SPLIT (dev) && crtc_state->limited_color_range) sdvox |=HDMI_COLOR_RANGE_16_235 ;if (INTEL_INFO (dev)->gen <5 ) sdvox |=SDVO_BORDER_ENABLE ;@@ -1304,7 +1299,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder, }else if (IS_I945G (dev) ||IS_I945GM (dev) ||IS_G33 (dev)) {/* done in crtc_mode_set as it lives inside the dpll register */ }else { - sdvox |= (crtc->config->pixel_multiplier -1 ) + sdvox |= (crtc_state->pixel_multiplier -1 ) <<SDVO_PORT_MULTIPLY_SHIFT ; }Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 12/15 drm/i915: Convert intel_lvds to use atomic state
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/intel_lvds.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +10 -12
@@ -141,17 +141,16 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder, struct drm_connector_state *conn_state) {struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); -struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;int pipe = crtc->pipe;u32 temp; -if (HAS_PCH_SPLIT (dev)) { +if (HAS_PCH_SPLIT (dev_priv)) {assert_fdi_rx_pll_disabled (dev_priv, pipe);assert_shared_dpll_disabled (dev_priv, - crtc->config->shared_dpll); + pipe_config->shared_dpll); }else {assert_pll_disabled (dev_priv, pipe); }
@@ -159,7 +158,7 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder, temp =I915_READ (lvds_encoder->reg); temp |=LVDS_PORT_EN |LVDS_A0A2_CLKA_POWER_UP ; -if (HAS_PCH_CPT (dev)) { +if (HAS_PCH_CPT (dev_priv)) { temp &= ~PORT_TRANS_SEL_MASK ; temp |=PORT_TRANS_SEL_CPT (pipe); }else {
@@ -172,7 +171,7 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder,/* set the corresponsding LVDS_BORDER bit */ temp &= ~LVDS_BORDER_ENABLE ; - temp |= crtc->config->gmch_pfit.lvds_border_bits; + temp |= pipe_config->gmch_pfit.lvds_border_bits;/* Set the B0-B3 data pairs corresponding to whether we're going to * set the DPLLs for dual-channel mode or not. */
@@ -195,7 +194,7 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder,if (IS_GEN4 (dev_priv)) {/* Bspec wording suggests that LVDS port dithering only exists * for 18bpp panels. */ -if (crtc->config->dither && crtc->config->pipe_bpp ==18 ) +if (pipe_config->dither && pipe_config->pipe_bpp ==18 ) temp |=LVDS_ENABLE_DITHER ;else temp &= ~LVDS_ENABLE_DITHER ;
@@ -245,12 +244,11 @@ static void intel_disable_lvds(struct intel_encoder *encoder,struct intel_crtc_state *old_crtc_state, struct drm_connector_state *old_conn_state) { - struct drm_device *dev = encoder->base.dev; struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);i915_reg_t ctl_reg, stat_reg; -if (HAS_PCH_SPLIT (dev)) { +if (HAS_PCH_SPLIT (dev_priv)) { ctl_reg =PCH_PP_CONTROL ; stat_reg =PCH_PP_STATUS ; }else {
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 12/15] drm/i915: Convert intel_lvds to use atomic state
Quoted 1 line · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 80 lines
--- drivers/gpu/drm/i915/intel_lvds.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)drivers/gpu/drm/i915/intel_lvds.c +10
-12@@ -141,17 +141,16 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder, struct drm_connector_state *conn_state) {struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); -struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;int pipe = crtc->pipe;u32 temp; -if (HAS_PCH_SPLIT (dev)) { +if (HAS_PCH_SPLIT (dev_priv)) {assert_fdi_rx_pll_disabled (dev_priv, pipe);assert_shared_dpll_disabled (dev_priv, - crtc->config->shared_dpll); + pipe_config->shared_dpll); }else {assert_pll_disabled (dev_priv, pipe); }@@ -159,7 +158,7 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder, temp =I915_READ (lvds_encoder->reg); temp |=LVDS_PORT_EN |LVDS_A0A2_CLKA_POWER_UP ; -if (HAS_PCH_CPT (dev)) { +if (HAS_PCH_CPT (dev_priv)) { temp &= ~PORT_TRANS_SEL_MASK ; temp |=PORT_TRANS_SEL_CPT (pipe); }else {@@ -172,7 +171,7 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder,/* set the corresponsding LVDS_BORDER bit */ temp &= ~LVDS_BORDER_ENABLE ; - temp |= crtc->config->gmch_pfit.lvds_border_bits; + temp |= pipe_config->gmch_pfit.lvds_border_bits;/* Set the B0-B3 data pairs corresponding to whether we're going to * set the DPLLs for dual-channel mode or not. */ @@ -195,7 +194,7 @@ static void intel_pre_enable_lvds(struct intel_encoder *encoder,if (IS_GEN4 (dev_priv)) {/* Bspec wording suggests that LVDS port dithering only exists * for 18bpp panels. */ -if (crtc->config->dither && crtc->config->pipe_bpp ==18 ) +if (pipe_config->dither && pipe_config->pipe_bpp ==18 ) temp |=LVDS_ENABLE_DITHER ;else temp &= ~LVDS_ENABLE_DITHER ;@@ -245,12 +244,11 @@ static void intel_disable_lvds(struct intel_encoder *encoder,struct intel_crtc_state *old_crtc_state, struct drm_connector_state *old_conn_state) { - struct drm_device *dev = encoder->base.dev; struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);i915_reg_t ctl_reg, stat_reg; -if (HAS_PCH_SPLIT (dev)) { +if (HAS_PCH_SPLIT (dev_priv)) { ctl_reg =PCH_PP_CONTROL ; stat_reg =PCH_PP_STATUS ; }else {Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 13/15 drm/i915: Convert intel_dp_mst to use atomic state
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/intel_dp_mst.c | 48 ++++++++++++++----------------------- 1 file changed, 18 insertions(+), 30 deletions(-)
drivers/gpu/drm/i915/intel_dp_mst.c +18 -30
@@ -82,11 +82,13 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder,struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; +struct intel_connector *connector = +to_intel_connector (old_conn_state->connector);int ret;DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); -drm_dp_mst_reset_vcpi_slots (&intel_dp->mst_mgr, intel_mst->connector->port); +drm_dp_mst_reset_vcpi_slots (&intel_dp->mst_mgr, connector->port); ret =drm_dp_update_payload_part1 (&intel_dp->mst_mgr);if (ret) {
@@ -101,6 +103,8 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; +struct intel_connector *connector = +to_intel_connector (old_conn_state->connector);DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links);
@@ -109,7 +113,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,/* and this can also fail */ drm_dp_update_payload_part2 (&intel_dp->mst_mgr); -drm_dp_mst_deallocate_vcpi (&intel_dp->mst_mgr, intel_mst->connector->port); +drm_dp_mst_deallocate_vcpi (&intel_dp->mst_mgr, connector->port); intel_dp->active_mst_links--;
@@ -129,43 +133,29 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; -struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum port port = intel_dig_port->port; +struct intel_connector *connector = +to_intel_connector (conn_state->connector);int ret;uint32_t temp; -struct intel_connector *found =NULL , *connector;int slots; -struct drm_crtc *crtc = encoder->base.crtc; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); - -for_each_intel_connector (dev, connector) { -if (connector->base.state->best_encoder == &encoder->base) { - found = connector; -break ; - } - } - -if (!found) { -DRM_ERROR ("can't find connector\n" ); -return ; - }/* MST encoders are bound to a crtc, not to a connector, * force the mapping here for get_hw_state. */ - found->encoder = encoder; + connector->encoder = encoder;DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); - intel_mst->connector = found; + intel_mst->connector = connector;if (intel_dp->active_mst_links ==0 ) { -intel_ddi_clk_select (&intel_dig_port->base, intel_crtc->config); +intel_ddi_clk_select (&intel_dig_port->base, pipe_config);intel_prepare_dp_ddi_buffers (&intel_dig_port->base); -intel_dp_set_link_params (intel_dp, intel_crtc->config); +intel_dp_set_link_params (intel_dp, pipe_config);intel_ddi_init_dp_buf_reg (&intel_dig_port->base);
@@ -176,8 +166,8 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder, } ret =drm_dp_mst_allocate_vcpi (&intel_dp->mst_mgr, - intel_mst->connector->port, - intel_crtc->config->pbn, &slots); + connector->port, + pipe_config->pbn, &slots);if (ret == false) {DRM_ERROR ("failed to allocate vcpi\n" );return ;
@@ -198,8 +188,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder,struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; -struct drm_device *dev = intel_dig_port->base.base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum port port = intel_dig_port->port;int ret;
@@ -232,9 +221,8 @@ static void intel_dp_mst_enc_get_config(struct intel_encoder *encoder, {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary; -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); -struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;u32 temp, flags =0 ;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 13/15] drm/i915: Convert intel_dp_mst to use atomic state
Quoted 71 lines · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_dp_mst.c | 48 ++++++++++++++----------------------- 1 file changed, 18 insertions(+), 30 deletions(-)drivers/gpu/drm/i915/intel_dp_mst.c +9
-19@@ -82,11 +82,13 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder,struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; +struct intel_connector *connector = +to_intel_connector (old_conn_state->connector);int ret;DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); -drm_dp_mst_reset_vcpi_slots (&intel_dp->mst_mgr, intel_mst->connector->port); +drm_dp_mst_reset_vcpi_slots (&intel_dp->mst_mgr, connector->port); ret =drm_dp_update_payload_part1 (&intel_dp->mst_mgr);if (ret) {@@ -101,6 +103,8 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; +struct intel_connector *connector = +to_intel_connector (old_conn_state->connector);DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links);@@ -109,7 +113,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,/* and this can also fail */ drm_dp_update_payload_part2 (&intel_dp->mst_mgr); -drm_dp_mst_deallocate_vcpi (&intel_dp->mst_mgr, intel_mst->connector->port); +drm_dp_mst_deallocate_vcpi (&intel_dp->mst_mgr, connector->port); intel_dp->active_mst_links--;@@ -129,43 +133,29 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; -struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum port port = intel_dig_port->port; +struct intel_connector *connector = +to_intel_connector (conn_state->connector);int ret;uint32_t temp; -struct intel_connector *found =NULL , *connector;int slots; -struct drm_crtc *crtc = encoder->base.crtc; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); - -for_each_intel_connector (dev, connector) { -if (connector->base.state->best_encoder == &encoder->base) { - found = connector; -break ; - } - } - -if (!found) { -DRM_ERROR ("can't find connector\n" ); -return ; - }
drivers/gpu/drm/i915/intel_dp_mst.c static void intel_mst_pre_enable_dp(struct intel_encoder *encoder, · line 151
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp_mst.c +2
-2/* MST encoders are bound to a crtc, not to a connector, * force the mapping here for get_hw_state. */ - found->encoder = encoder; + connector->encoder = encoder;DRM_DEBUG_KMS ("%d\n" , intel_dp->active_mst_links); - intel_mst->connector = found; + intel_mst->connector = connector;
The intel_mst->connector link is also only needed for get_hw_state. Would be good to move them together. Same with the clearing in post_disable, which is also missing the clearing of intel_connector->encoder. Follow-up patch perhaps.
With that bikeshed addressed:
Quoted 52 lines
drivers/gpu/drm/i915/intel_dp_mst.c +7
-9if (intel_dp->active_mst_links ==0 ) { -intel_ddi_clk_select (&intel_dig_port->base, intel_crtc->config); +intel_ddi_clk_select (&intel_dig_port->base, pipe_config);intel_prepare_dp_ddi_buffers (&intel_dig_port->base); -intel_dp_set_link_params (intel_dp, intel_crtc->config); +intel_dp_set_link_params (intel_dp, pipe_config);intel_ddi_init_dp_buf_reg (&intel_dig_port->base);@@ -176,8 +166,8 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder, } ret =drm_dp_mst_allocate_vcpi (&intel_dp->mst_mgr, - intel_mst->connector->port, - intel_crtc->config->pbn, &slots); + connector->port, + pipe_config->pbn, &slots);if (ret == false) {DRM_ERROR ("failed to allocate vcpi\n" );return ;@@ -198,8 +188,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder,struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary;struct intel_dp *intel_dp = &intel_dig_port->dp; -struct drm_device *dev = intel_dig_port->base.base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum port port = intel_dig_port->port;int ret;@@ -232,9 +221,8 @@ static void intel_dp_mst_enc_get_config(struct intel_encoder *encoder, {struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_digital_port *intel_dig_port = intel_mst->primary; -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); -struct drm_device *dev = encoder->base.dev; -struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;u32 temp, flags =0 ;Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 14/15 drm/i915: Convert intel_dp to use atomic state
In reply to Maarten LankhorstSlightly less straightforward. Some of the drrs calls are done from workers or from intel_ddi.c, pass along crtc_state when we can, or crtc->config when we can't.
--- drivers/gpu/drm/i915/intel_ddi.c | 4 +- drivers/gpu/drm/i915/intel_dp.c | 123 ++++++++++++++++++--------------------- drivers/gpu/drm/i915/intel_drv.h | 6 +- 3 files changed, 64 insertions(+), 69 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +2 -2
@@ -1745,7 +1745,7 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder,intel_edp_backlight_on (intel_dp);intel_psr_enable (intel_dp); -intel_edp_drrs_enable (intel_dp); +intel_edp_drrs_enable (intel_dp, pipe_config); }if (intel_crtc->config->has_audio) {
@@ -1773,7 +1773,7 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder,if (type ==INTEL_OUTPUT_EDP ) {struct intel_dp *intel_dp =enc_to_intel_dp (encoder); -intel_edp_drrs_disable (intel_dp); +intel_edp_drrs_disable (intel_dp, old_crtc_state);intel_psr_disable (intel_dp);intel_edp_backlight_off (intel_dp); }
drivers/gpu/drm/i915/intel_dp.c +58 -65
341 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +4 -2
@@ -1387,8 +1387,10 @@ void intel_dp_hot_plug(struct intel_encoder *intel_encoder);void intel_power_sequencer_reset (struct drm_i915_private *dev_priv);uint32_t intel_dp_pack_aux (const uint8_t *src,int src_bytes);void intel_plane_destroy (struct drm_plane *plane); -void intel_edp_drrs_enable (struct intel_dp *intel_dp); -void intel_edp_drrs_disable (struct intel_dp *intel_dp); +void intel_edp_drrs_enable (struct intel_dp *intel_dp, +struct intel_crtc_state *crtc_state); +void intel_edp_drrs_disable (struct intel_dp *intel_dp, +struct intel_crtc_state *crtc_state);void intel_edp_drrs_invalidate (struct drm_i915_private *dev_priv,unsigned int frontbuffer_bits); void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 14/15] drm/i915: Convert intel_dp to use atomic state
Quoted 5 lines · Maarten Lankhorst
Slightly less straightforward. Some of the drrs calls are done from workers or from
intel_ddi.c, pass alongcrtc_statewhen we can, orcrtc->configwhen we can't.Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 424 lines
--- drivers/gpu/drm/i915/intel_ddi.c | 4 +- drivers/gpu/drm/i915/intel_dp.c | 123 ++++++++++++++++++--------------------- drivers/gpu/drm/i915/intel_drv.h | 6 +- 3 files changed, 64 insertions(+), 69 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +2
-2@@ -1745,7 +1745,7 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder,intel_edp_backlight_on (intel_dp);intel_psr_enable (intel_dp); -intel_edp_drrs_enable (intel_dp); +intel_edp_drrs_enable (intel_dp, pipe_config); }if (intel_crtc->config->has_audio) {@@ -1773,7 +1773,7 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder,if (type ==INTEL_OUTPUT_EDP ) {struct intel_dp *intel_dp =enc_to_intel_dp (encoder); -intel_edp_drrs_disable (intel_dp); +intel_edp_drrs_disable (intel_dp, old_crtc_state);intel_psr_disable (intel_dp);intel_edp_backlight_off (intel_dp); }drivers/gpu/drm/i915/intel_dp.c +58
-65@@ -1655,16 +1655,17 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp, intel_dp->link_mst =intel_crtc_has_type (pipe_config,INTEL_OUTPUT_DP_MST ); } -static void intel_dp_prepare (struct intel_encoder *encoder) +static void intel_dp_prepare (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);enum port port =dp_to_dig_port (intel_dp)->port;struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; +const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; -intel_dp_set_link_params (intel_dp, crtc->config); +intel_dp_set_link_params (intel_dp, pipe_config);/* * There are four kinds of DP registers: @@ -1690,7 +1691,7 @@ static void intel_dp_prepare(struct intel_encoder *encoder)/* Handle DP bits in common between all three register formats */ intel_dp->DP |=DP_VOLTAGE_0_4 |DP_PRE_EMPHASIS_0 ; - intel_dp->DP |=DP_PORT_WIDTH (crtc->config->lane_count); + intel_dp->DP |=DP_PORT_WIDTH (pipe_config->lane_count);/* Split out the IBX/CPU vs CPT settings */ @@ -1718,7 +1719,7 @@ static void intel_dp_prepare(struct intel_encoder *encoder)I915_WRITE (TRANS_DP_CTL (crtc->pipe), trans_dp); }else {if (!HAS_PCH_SPLIT (dev) && !IS_VALLEYVIEW (dev) && - !IS_CHERRYVIEW (dev) && crtc->config->limited_color_range) + !IS_CHERRYVIEW (dev) && pipe_config->limited_color_range) intel_dp->DP |=DP_COLOR_RANGE_16_235 ;if (adjusted_mode->flags &DRM_MODE_FLAG_PHSYNC )@@ -2256,10 +2257,10 @@ static void assert_edp_pll(struct drm_i915_private *dev_priv, bool state)#define assert_edp_pll_enabled (d) assert_edp_pll((d), true)#define assert_edp_pll_disabled (d) assert_edp_pll((d), false) -static void ironlake_edp_pll_on (struct intel_dp *intel_dp) +static void ironlake_edp_pll_on (struct intel_dp *intel_dp, +struct intel_crtc_state *pipe_config) { -struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp); -struct intel_crtc *crtc =to_intel_crtc (intel_dig_port->base.base.crtc); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);assert_pipe_disabled (dev_priv, crtc->pipe);@@ -2267,11 +2268,11 @@ static void ironlake_edp_pll_on(struct intel_dp *intel_dp)assert_edp_pll_disabled (dev_priv);DRM_DEBUG_KMS ("enabling eDP PLL for clock %d\n" , - crtc->config->port_clock); + pipe_config->port_clock); intel_dp->DP &= ~DP_PLL_FREQ_MASK ; -if (crtc->config->port_clock ==162000 ) +if (pipe_config->port_clock ==162000 ) intel_dp->DP |=DP_PLL_FREQ_162MHZ ;else intel_dp->DP |=DP_PLL_FREQ_270MHZ ;@@ -2485,13 +2486,12 @@ static void intel_disable_dp(struct intel_encoder *encoder, struct drm_connector_state *old_conn_state) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base); -struct drm_device *dev = encoder->base.dev; -struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -if (crtc->config->has_audio) +if (old_crtc_state->has_audio)intel_audio_codec_disable (encoder); -if (HAS_PSR (dev) && !HAS_DDI (dev)) +if (HAS_PSR (dev_priv) && !HAS_DDI (dev_priv))intel_psr_disable (intel_dp);/* Make sure the panel is off before trying to change the mode. But also @@ -2502,7 +2502,7 @@ static void intel_disable_dp(struct intel_encoder *encoder,intel_edp_panel_off (intel_dp);/* disable the port before the pipe on g4x */ -if (INTEL_INFO (dev)->gen <5 ) +if (INTEL_GEN (dev_priv) <5 )intel_dp_link_down (intel_dp); }@@ -2631,12 +2631,11 @@ _intel_dp_set_link_train(struct intel_dp *intel_dp, } } -static void intel_dp_enable_port (struct intel_dp *intel_dp) +static void intel_dp_enable_port (struct intel_dp *intel_dp, +struct intel_crtc_state *old_crtc_state) {struct drm_device *dev =intel_dp_to_dev (intel_dp);struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *crtc = -to_intel_crtc (dp_to_dig_port (intel_dp)->base.base.crtc);/* enable with pattern 1 (as per spec) */ _intel_dp_set_link_train(intel_dp, &intel_dp->DP,@@ -2652,14 +2651,15 @@ static void intel_dp_enable_port(struct intel_dp *intel_dp)* fail when the power sequencer is freshly used for this port. */ intel_dp->DP |=DP_PORT_EN ; -if (crtc->config->has_audio) +if (old_crtc_state->has_audio) intel_dp->DP |=DP_AUDIO_OUTPUT_ENABLE ;I915_WRITE (intel_dp->output_reg, intel_dp->DP);POSTING_READ (intel_dp->output_reg); } -static void intel_enable_dp (struct intel_encoder *encoder) +static void intel_enable_dp (struct intel_encoder *encoder, +struct intel_crtc_state *pipe_config) {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);struct drm_device *dev = encoder->base.dev;@@ -2676,7 +2676,7 @@ static void intel_enable_dp(struct intel_encoder *encoder)if (IS_VALLEYVIEW (dev) ||IS_CHERRYVIEW (dev))vlv_init_panel_power_sequencer (intel_dp); -intel_dp_enable_port (intel_dp); +intel_dp_enable_port (intel_dp, pipe_config);edp_panel_vdd_on (intel_dp);edp_panel_on (intel_dp);@@ -2688,7 +2688,7 @@ static void intel_enable_dp(struct intel_encoder *encoder)unsigned int lane_mask =0x0 ;if (IS_CHERRYVIEW (dev)) - lane_mask =intel_dp_unused_lane_mask (crtc->config->lane_count); + lane_mask =intel_dp_unused_lane_mask (pipe_config->lane_count);vlv_wait_port_ready (dev_priv,dp_to_dig_port (intel_dp), lane_mask);@@ -2698,7 +2698,7 @@ static void intel_enable_dp(struct intel_encoder *encoder)intel_dp_start_link_train (intel_dp);intel_dp_stop_link_train (intel_dp); -if (crtc->config->has_audio) { +if (pipe_config->has_audio) {DRM_DEBUG_DRIVER ("Enabling DP audio on pipe %c\n" ,pipe_name (pipe));intel_audio_codec_enable (encoder);@@ -2711,7 +2711,7 @@ static void g4x_enable_dp(struct intel_encoder *encoder, {struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base); -intel_enable_dp (encoder); +intel_enable_dp (encoder, pipe_config);intel_edp_backlight_on (intel_dp); }@@ -2732,11 +2732,11 @@ static void g4x_pre_enable_dp(struct intel_encoder *encoder,struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);enum port port =dp_to_dig_port (intel_dp)->port; -intel_dp_prepare (encoder); +intel_dp_prepare (encoder, pipe_config);/* Only ilk+ has port A */ if (port ==PORT_A ) -ironlake_edp_pll_on (intel_dp); +ironlake_edp_pll_on (intel_dp, pipe_config); }static void vlv_detach_power_sequencer (struct intel_dp *intel_dp)@@ -2848,14 +2848,14 @@ static void vlv_pre_enable_dp(struct intel_encoder *encoder, {vlv_phy_pre_encoder_enable (encoder); -intel_enable_dp (encoder); +intel_enable_dp (encoder, pipe_config); }static void vlv_dp_pre_pll_enable (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state) { -intel_dp_prepare (encoder); +intel_dp_prepare (encoder, pipe_config);vlv_phy_pre_pll_enable (encoder); }@@ -2866,7 +2866,7 @@ static void chv_pre_enable_dp(struct intel_encoder *encoder, {chv_phy_pre_encoder_enable (encoder); -intel_enable_dp (encoder); +intel_enable_dp (encoder, pipe_config);/* Second common lane will stay alive on its own now */ chv_phy_release_cl2_override (encoder);@@ -2876,7 +2876,7 @@ static void chv_dp_pre_pll_enable(struct intel_encoder *encoder,struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { -intel_dp_prepare (encoder ); +intel_dp_prepare (encoder ,pipe_config );chv_phy_pre_pll_enable (encoder); }@@ -5057,14 +5057,14 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev,* * The caller of this function needs to take a lock on dev_priv->drrs. */ -static void intel_dp_set_drrs_state (struct drm_device *dev,int refresh_rate) +static void intel_dp_set_drrs_state (struct drm_i915_private *dev_priv, +struct intel_crtc_state *crtc_state, +int refresh_rate) { -struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_encoder *encoder;struct intel_digital_port *dig_port =NULL ;struct intel_dp *intel_dp = dev_priv->drrs.dp; -struct intel_crtc_state *config =NULL ; -struct intel_crtc *intel_crtc =NULL ; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc_state->base.crtc);enum drrs_refresh_rate_type index =DRRS_HIGH_RR ;if (refresh_rate <=0 ) {@@ -5091,8 +5091,6 @@ static void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate)return ; } - config = intel_crtc->config; -if (dev_priv->drrs.type <SEAMLESS_DRRS_SUPPORT ) {DRM_DEBUG_KMS ("Only Seamless DRRS supported.\n" );return ;@@ -5108,12 +5106,12 @@ static void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate)return ; } -if (!intel_crtc->active) { +if (!crtc_state->base.active) {DRM_DEBUG_KMS ("eDP encoder disabled. CRTC not Active\n" );return ; } -if (INTEL_INFO (dev)->gen >=8 && !IS_CHERRYVIEW (dev)) { +if (INTEL_GEN (dev_priv) >=8 && !IS_CHERRYVIEW (dev_priv)) {switch (index) {case DRRS_HIGH_RR :intel_dp_set_m_n (intel_crtc,M1_N1 );@@ -5125,18 +5123,18 @@ static void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate)default :DRM_ERROR ("Unsupported refreshrate type\n" ); } - }else if (INTEL_INFO (dev)->gen >6 ) { -i915_reg_t reg =PIPECONF (intel_crtc->config->cpu_transcoder); + }else if (INTEL_GEN (dev_priv) >6 ) { +i915_reg_t reg =PIPECONF (crtc_state->cpu_transcoder);u32 val; val =I915_READ (reg);if (index >DRRS_HIGH_RR ) { -if (IS_VALLEYVIEW (dev) ||IS_CHERRYVIEW (dev)) +if (IS_VALLEYVIEW (dev_priv) ||IS_CHERRYVIEW (dev_priv)) val |=PIPECONF_EDP_RR_MODE_SWITCH_VLV ;else val |=PIPECONF_EDP_RR_MODE_SWITCH ; }else { -if (IS_VALLEYVIEW (dev) ||IS_CHERRYVIEW (dev)) +if (IS_VALLEYVIEW (dev_priv) ||IS_CHERRYVIEW (dev_priv)) val &= ~PIPECONF_EDP_RR_MODE_SWITCH_VLV ;else val &= ~PIPECONF_EDP_RR_MODE_SWITCH ;@@ -5155,15 +5153,13 @@ static void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate)* * Initializes frontbuffer_bits and drrs.dp */ -void intel_edp_drrs_enable (struct intel_dp *intel_dp) +void intel_edp_drrs_enable (struct intel_dp *intel_dp, +struct intel_crtc_state *crtc_state) {struct drm_device *dev =intel_dp_to_dev (intel_dp);struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct drm_crtc *crtc = dig_port->base.base.crtc; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -if (!intel_crtc->config->has_drrs) { +if (!crtc_state->has_drrs) {DRM_DEBUG_KMS ("Panel doesn't support DRRS\n" );return ; }@@ -5187,15 +5183,13 @@ unlock:* @intel_dp: DP struct * */ -void intel_edp_drrs_disable (struct intel_dp *intel_dp) +void intel_edp_drrs_disable (struct intel_dp *intel_dp, +struct intel_crtc_state *old_crtc_state) {struct drm_device *dev =intel_dp_to_dev (intel_dp);struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp); -struct drm_crtc *crtc = dig_port->base.base.crtc; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -if (!intel_crtc->config->has_drrs) +if (!old_crtc_state->has_drrs)return ;mutex_lock (&dev_priv->drrs.mutex);@@ -5205,9 +5199,8 @@ void intel_edp_drrs_disable(struct intel_dp *intel_dp) }if (dev_priv->drrs.refresh_rate_type ==DRRS_LOW_RR ) -intel_dp_set_drrs_state (&dev_priv->drm, - intel_dp->attached_connector->panel. - fixed_mode->vrefresh); +intel_dp_set_drrs_state (dev_priv, old_crtc_state, + intel_dp->attached_connector->panel.fixed_mode->vrefresh); dev_priv->drrs.dp =NULL ;mutex_unlock (&dev_priv->drrs.mutex);@@ -5236,10 +5229,12 @@ static void intel_edp_drrs_downclock_work(struct work_struct *work)if (dev_priv->drrs.busy_frontbuffer_bits) goto unlock; -if (dev_priv->drrs.refresh_rate_type !=DRRS_LOW_RR ) -intel_dp_set_drrs_state (&dev_priv->drm, - intel_dp->attached_connector->panel. - downclock_mode->vrefresh); +if (dev_priv->drrs.refresh_rate_type !=DRRS_LOW_RR ) { +struct drm_crtc *crtc =dp_to_dig_port (intel_dp)->base.base.crtc; + +intel_dp_set_drrs_state (dev_priv,to_intel_crtc (crtc)->config, + intel_dp->attached_connector->panel.downclock_mode->vrefresh); + } unlock:mutex_unlock (&dev_priv->drrs.mutex);@@ -5280,9 +5275,8 @@ void intel_edp_drrs_invalidate(struct drm_i915_private *dev_priv,/* invalidate means busy screen hence upclock */ if (frontbuffer_bits && dev_priv->drrs.refresh_rate_type ==DRRS_LOW_RR ) -intel_dp_set_drrs_state (&dev_priv->drm, - dev_priv->drrs.dp->attached_connector->panel. - fixed_mode->vrefresh); +intel_dp_set_drrs_state (dev_priv,to_intel_crtc (crtc)->config, + dev_priv->drrs.dp->attached_connector->panel.fixed_mode->vrefresh);mutex_unlock (&dev_priv->drrs.mutex); }@@ -5324,9 +5318,8 @@ void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,/* flush means busy screen hence upclock */ if (frontbuffer_bits && dev_priv->drrs.refresh_rate_type ==DRRS_LOW_RR ) -intel_dp_set_drrs_state (&dev_priv->drm, - dev_priv->drrs.dp->attached_connector->panel. - fixed_mode->vrefresh); +intel_dp_set_drrs_state (dev_priv,to_intel_crtc (crtc)->config, + dev_priv->drrs.dp->attached_connector->panel.fixed_mode->vrefresh);/* * flush also means no more activity hence schedule downclock, if all drivers/gpu/drm/i915/intel_drv.h +4
-2@@ -1387,8 +1387,10 @@ void intel_dp_hot_plug(struct intel_encoder *intel_encoder);void intel_power_sequencer_reset (struct drm_i915_private *dev_priv);uint32_t intel_dp_pack_aux (const uint8_t *src,int src_bytes);void intel_plane_destroy (struct drm_plane *plane); -void intel_edp_drrs_enable (struct intel_dp *intel_dp); -void intel_edp_drrs_disable (struct intel_dp *intel_dp); +void intel_edp_drrs_enable (struct intel_dp *intel_dp, +struct intel_crtc_state *crtc_state); +void intel_edp_drrs_disable (struct intel_dp *intel_dp, +struct intel_crtc_state *crtc_state);void intel_edp_drrs_invalidate (struct drm_i915_private *dev_priv,unsigned int frontbuffer_bits); void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 15/15 drm/i915: Use more atomic state in intel_color.c
In reply to Maarten Lankhorstcrtc_state is already passed around, use it instead of crtc->config.
--- drivers/gpu/drm/i915/intel_color.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_color.c +14 -10
@@ -100,13 +100,14 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)struct intel_crtc *intel_crtc =to_intel_crtc (crtc);int i, pipe = intel_crtc->pipe;uint16_t coeffs[9 ] = {0 , }; +struct intel_crtc_state *intel_crtc_state =to_intel_crtc_state (crtc_state);if (crtc_state->ctm) {struct drm_color_ctm *ctm = (struct drm_color_ctm *)crtc_state->ctm->data;uint64_t input[9 ] = {0 , }; -if (intel_crtc->config->limited_color_range) { +if (intel_crtc_state->limited_color_range) {ctm_mult_by_limited (input, ctm->matrix); }else {for (i =0 ; i <ARRAY_SIZE (input); i++)
@@ -158,7 +159,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)* into consideration. */ for (i =0 ; i <3 ; i++) { -if (intel_crtc->config->limited_color_range) +if (intel_crtc_state->limited_color_range) coeffs[i *3 + i] =I9XX_CSC_COEFF_LIMITED_RANGE ;else
@@ -182,7 +183,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)if (INTEL_INFO (dev)->gen >6 ) {uint16_t postoff =0 ; -if (intel_crtc->config->limited_color_range) +if (intel_crtc_state->limited_color_range) postoff = (16 * (1 <<12 ) /255 ) &0x1fff ;I915_WRITE (PIPE_CSC_POSTOFF_HI (pipe), postoff);
@@ -193,7 +194,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state) }else {uint32_t mode =CSC_MODE_YUV_TO_RGB ; -if (intel_crtc->config->limited_color_range) +if (intel_crtc_state->limited_color_range) mode |=CSC_BLACK_SCREEN_OFFSET ;I915_WRITE (PIPE_CSC_MODE (pipe), mode);
@@ -263,7 +264,8 @@ void intel_color_set_csc(struct drm_crtc_state *crtc_state)/* Loads the legacy palette/gamma unit for the CRTC. */ static void i9xx_load_luts_internal (struct drm_crtc *crtc, -struct drm_property_blob *blob) +struct drm_property_blob *blob, +struct intel_crtc_state *crtc_state) {struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);
@@ -272,7 +274,7 @@ static void i9xx_load_luts_internal(struct drm_crtc *crtc,int i;if (HAS_GMCH_DISPLAY (dev)) { -if (intel_crtc_has_type (intel_crtc->config,INTEL_OUTPUT_DSI )) +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_DSI ))assert_dsi_pll_enabled (dev_priv);else assert_pll_enabled (dev_priv, pipe);
@@ -305,7 +307,8 @@ static void i9xx_load_luts_internal(struct drm_crtc *crtc,static void i9xx_load_luts (struct drm_crtc_state *crtc_state) { -i9xx_load_luts_internal (crtc_state->crtc, crtc_state->gamma_lut); +i9xx_load_luts_internal (crtc_state->crtc, crtc_state->gamma_lut, +to_intel_crtc_state (crtc_state)); }/* Loads the legacy palette/gamma unit for the CRTC on Haswell. */
@@ -323,7 +326,7 @@ static void haswell_load_luts(struct drm_crtc_state *crtc_state)* Workaround : Do not read or write the pipe palette/gamma data while * GAMMA_MODE is configured for split gamma and IPS_CTL has IPS enabled. */ -if (IS_HASWELL (dev) && intel_crtc->config->ips_enabled && +if (IS_HASWELL (dev) && intel_crtc_state->ips_enabled && (intel_crtc_state->gamma_mode ==GAMMA_MODE_MODE_SPLIT )) {hsw_disable_ips (intel_crtc); reenable_ips = true;
@@ -436,7 +439,8 @@ static void cherryview_load_luts(struct drm_crtc_state *state)/* Turn off degamma/gamma on CGM block. */ I915_WRITE (CGM_PIPE_MODE (pipe), (state->ctm ?CGM_PIPE_MODE_CSC :0 )); -i9xx_load_luts_internal (crtc, state->gamma_lut); +i9xx_load_luts_internal (crtc, state->gamma_lut, +to_intel_crtc_state (state));return ; }
@@ -479,7 +483,7 @@ static void cherryview_load_luts(struct drm_crtc_state *state)* Also program a linear LUT in the legacy block (behind the * CGM block). */ -i9xx_load_luts_internal (crtc,NULL ); +i9xx_load_luts_internal (crtc,NULL ,to_intel_crtc_state (state)); }void intel_color_load_luts (struct drm_crtc_state *crtc_state)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 15/15] drm/i915: Use more atomic state in intel_color.c
Quoted 3 lines · Maarten Lankhorst
crtc_stateis already passed around, use it instead ofcrtc->config.Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 115 lines
--- drivers/gpu/drm/i915/intel_color.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)drivers/gpu/drm/i915/intel_color.c +14
-10@@ -100,13 +100,14 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)struct intel_crtc *intel_crtc =to_intel_crtc (crtc);int i, pipe = intel_crtc->pipe;uint16_t coeffs[9 ] = {0 , }; +struct intel_crtc_state *intel_crtc_state =to_intel_crtc_state (crtc_state);if (crtc_state->ctm) {struct drm_color_ctm *ctm = (struct drm_color_ctm *)crtc_state->ctm->data;uint64_t input[9 ] = {0 , }; -if (intel_crtc->config->limited_color_range) { +if (intel_crtc_state->limited_color_range) {ctm_mult_by_limited (input, ctm->matrix); }else {for (i =0 ; i <ARRAY_SIZE (input); i++)@@ -158,7 +159,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)* into consideration. */ for (i =0 ; i <3 ; i++) { -if (intel_crtc->config->limited_color_range) +if (intel_crtc_state->limited_color_range) coeffs[i *3 + i] =I9XX_CSC_COEFF_LIMITED_RANGE ;else @@ -182,7 +183,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)if (INTEL_INFO (dev)->gen >6 ) {uint16_t postoff =0 ; -if (intel_crtc->config->limited_color_range) +if (intel_crtc_state->limited_color_range) postoff = (16 * (1 <<12 ) /255 ) &0x1fff ;I915_WRITE (PIPE_CSC_POSTOFF_HI (pipe), postoff);@@ -193,7 +194,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state) }else {uint32_t mode =CSC_MODE_YUV_TO_RGB ; -if (intel_crtc->config->limited_color_range) +if (intel_crtc_state->limited_color_range) mode |=CSC_BLACK_SCREEN_OFFSET ;I915_WRITE (PIPE_CSC_MODE (pipe), mode);@@ -263,7 +264,8 @@ void intel_color_set_csc(struct drm_crtc_state *crtc_state)/* Loads the legacy palette/gamma unit for the CRTC. */ static void i9xx_load_luts_internal (struct drm_crtc *crtc, -struct drm_property_blob *blob) +struct drm_property_blob *blob, +struct intel_crtc_state *crtc_state) {struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev);@@ -272,7 +274,7 @@ static void i9xx_load_luts_internal(struct drm_crtc *crtc,int i;if (HAS_GMCH_DISPLAY (dev)) { -if (intel_crtc_has_type (intel_crtc->config,INTEL_OUTPUT_DSI )) +if (intel_crtc_has_type (crtc_state,INTEL_OUTPUT_DSI ))assert_dsi_pll_enabled (dev_priv);else assert_pll_enabled (dev_priv, pipe);@@ -305,7 +307,8 @@ static void i9xx_load_luts_internal(struct drm_crtc *crtc,static void i9xx_load_luts (struct drm_crtc_state *crtc_state) { -i9xx_load_luts_internal (crtc_state->crtc, crtc_state->gamma_lut); +i9xx_load_luts_internal (crtc_state->crtc, crtc_state->gamma_lut, +to_intel_crtc_state (crtc_state)); }/* Loads the legacy palette/gamma unit for the CRTC on Haswell. */ @@ -323,7 +326,7 @@ static void haswell_load_luts(struct drm_crtc_state *crtc_state)* Workaround : Do not read or write the pipe palette/gamma data while * GAMMA_MODE is configured for split gamma and IPS_CTL has IPS enabled. */ -if (IS_HASWELL (dev) && intel_crtc->config->ips_enabled && +if (IS_HASWELL (dev) && intel_crtc_state->ips_enabled && (intel_crtc_state->gamma_mode ==GAMMA_MODE_MODE_SPLIT )) {hsw_disable_ips (intel_crtc); reenable_ips = true;@@ -436,7 +439,8 @@ static void cherryview_load_luts(struct drm_crtc_state *state)/* Turn off degamma/gamma on CGM block. */ I915_WRITE (CGM_PIPE_MODE (pipe), (state->ctm ?CGM_PIPE_MODE_CSC :0 )); -i9xx_load_luts_internal (crtc, state->gamma_lut); +i9xx_load_luts_internal (crtc, state->gamma_lut, +to_intel_crtc_state (state));return ; }@@ -479,7 +483,7 @@ static void cherryview_load_luts(struct drm_crtc_state *state)* Also program a linear LUT in the legacy block (behind the * CGM block). */ -i9xx_load_luts_internal (crtc,NULL ); +i9xx_load_luts_internal (crtc,NULL ,to_intel_crtc_state (state)); }void intel_color_load_luts (struct drm_crtc_state *crtc_state)Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Ro.CI.BAT: failure for drm/i915: Use connector atomic state in encoders.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/i915: Use connector atomic state in encoders.
URL : https://patchwork.freedesktop.org/series/10853/
State : failure
== Summary ==
Applying: drm/i915: handle DP_MST correctly in bxt_get_dpll
Applying: drm/i915: Pass atomic state to crtc enable/disable functions Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_drv.h
M drivers/gpu/drm/i915/intel_display.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/intel_display.c
Auto-merging drivers/gpu/drm/i915/i915_drv.h
Applying: drm/i915: Remove unused mode_set hook from encoder
Applying: drm/i915: Walk over encoders in crtc enable/disable using atomic state.
Applying: drm/i915: Pass crtc_state and connector_state to encoder functions
fatal: sha1 information is lacking or useless (drivers/gpu/drm/i915/intel_display.c).
error: could not build fake ancestor
Patch failed at 0005 drm/i915: Pass crtc_state and connector_state to encoder functions The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Ro.CI.BAT: failure for drm/i915: Use connector atomic state in encoders.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/i915: Use connector atomic state in encoders.
URL : https://patchwork.freedesktop.org/series/10853/
State : failure
== Summary ==
Applying: drm/i915: handle DP_MST correctly in bxt_get_dpll
Applying: drm/i915: Pass atomic state to crtc enable/disable functions Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_drv.h
M drivers/gpu/drm/i915/intel_display.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/intel_display.c
Auto-merging drivers/gpu/drm/i915/i915_drv.h
Applying: drm/i915: Remove unused mode_set hook from encoder
Applying: drm/i915: Walk over encoders in crtc enable/disable using atomic state.
Applying: drm/i915: Pass crtc_state and connector_state to encoder functions
fatal: sha1 information is lacking or useless (drivers/gpu/drm/i915/intel_display.c).
error: could not build fake ancestor
Patch failed at 0005 drm/i915: Pass crtc_state and connector_state to encoder functions The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Maarten Lankhorst
This is required for supporting nonblocking modeset and atomic connector properties. Connector properties will need the connector state to be passed or it will not work as intended.
Nonblocking modesets need to iterate over the atomic state, instead of relying on the legacy state fixed up by atomic.
Hm, intel_ddi.c seems entirely unhandled here. And how far along killing intel_crtc->active are we now?
-Daniel
Quoted 43 lines
Maarten Lankhorst (15):
drm/i915: handleDP_MSTcorrectly inbxt_get_dplldrm/i915: Pass atomic state to crtc enable/disable functions drm/i915: Remove unusedmode_sethook from encoder drm/i915: Walk over encoders in crtc enable/disable using atomic
state.
drm/i915: Passcrtc_stateandconnector_stateto encoder functions drm/i915: Makeencoder->compute_configtake the connector state drm/i915: Remove unused loop fromintel_dp_mst_compute_configdrm/i915: Convertintel_crtto use atomic state drm/i915: Convertintel_dvoto use atomic state drm/i915: Convertintel_dsito use atomic state drm/i915: Convertintel_sdvoto use atomic state drm/i915: Convertintel_lvdsto use atomic state drm/i915: Convertintel_dp_mstto use atomic state drm/i915: Convertintel_dpto use atomic state drm/i915: Use more atomic state inintel_color.cdrivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/intel_color.c | 24 +-- drivers/gpu/drm/i915/intel_crt.c | 33 ++-- drivers/gpu/drm/i915/intel_ddi.c | 42 +++-- drivers/gpu/drm/i915/intel_display.c | 304 +++++++++++++++++++++++----------- drivers/gpu/drm/i915/intel_dp.c | 174 ++++++++++--------- drivers/gpu/drm/i915/intel_dp_mst.c | 91 ++++------ drivers/gpu/drm/i915/intel_dpll_mgr.c | 10 +- drivers/gpu/drm/i915/intel_drv.h | 44 +++-- drivers/gpu/drm/i915/intel_dsi.c | 41 +++-- drivers/gpu/drm/i915/intel_dvo.c | 27 +-- drivers/gpu/drm/i915/intel_hdmi.c | 75 ++++++--- drivers/gpu/drm/i915/intel_lvds.c | 54 +++--- drivers/gpu/drm/i915/intel_sdvo.c | 52 +++--- drivers/gpu/drm/i915/intel_tv.c | 15 +- 15 files changed, 615 insertions(+), 377 deletions(-)Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Op 18-08-16 om 16:04 schreef Daniel Vetter:
Quoted 9 lines · Maarten Lankhorst
Quoted 6 lines
This is required for supporting nonblocking modeset and atomic connector properties. Connector properties will need the connector state to be passed or it will not work as intended.
Nonblocking modesets need to iterate over the atomic state, instead of relying on the legacy state fixed up by atomic.
Hm,
intel_ddi.cseems entirely unhandled here. And how far along killingintel_crtc->activeare we now?
intel_ddi is a bit harder, but should definitely still be done. It conflicts a bit with Ville's OUTPUT_UNKNOWN -> OUTPUT_DDI work, so I left that file alone.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx