Split hw and drm state.
Subsystems (3)
cover Split hw and drm state.
Fourth try, with load detect fixed.
Maarten Lankhorst (9):
drm/i915: Pass intel_crtc_state to needs_modeset() drm/i915: Convert most of atomic commit to take more intel state drm/i915: Convert hw state verifier to take more intel state drm/i915: Use intel_crtc_state in sanitize_watermarks() too drm/i915: Pass intel state to plane functions as well drm/i915: Use intel state as much as possible in wm code drm/i915: Prepare to split crtc state in uapi and hw state drm/i915: Handle a few more cases for hw/sw split drm/i915: Complete sw/hw split
drivers/gpu/drm/i915/display/icl_dsi.c | 18 +- drivers/gpu/drm/i915/display/intel_atomic.c | 32 +- drivers/gpu/drm/i915/display/intel_atomic.h | 1 + .../gpu/drm/i915/display/intel_atomic_plane.c | 45 +- .../gpu/drm/i915/display/intel_atomic_plane.h | 5 +- drivers/gpu/drm/i915/display/intel_audio.c | 14 +- drivers/gpu/drm/i915/display/intel_bw.c | 4 +- drivers/gpu/drm/i915/display/intel_cdclk.c | 8 +- drivers/gpu/drm/i915/display/intel_color.c | 150 +-- drivers/gpu/drm/i915/display/intel_crt.c | 24 +- drivers/gpu/drm/i915/display/intel_ddi.c | 28 +- drivers/gpu/drm/i915/display/intel_display.c | 1188 ++++++++--------- drivers/gpu/drm/i915/display/intel_dp.c | 42 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 8 +- drivers/gpu/drm/i915/display/intel_dpio_phy.c | 14 +- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 36 +- drivers/gpu/drm/i915/display/intel_dvo.c | 14 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 62 +- drivers/gpu/drm/i915/display/intel_lspcon.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 12 +- drivers/gpu/drm/i915/display/intel_panel.c | 14 +- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 6 +- drivers/gpu/drm/i915/display/intel_psr.c | 14 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 22 +- drivers/gpu/drm/i915/display/intel_sprite.c | 25 +- drivers/gpu/drm/i915/display/intel_tv.c | 8 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 10 +- drivers/gpu/drm/i915/display/vlv_dsi.c | 20 +- drivers/gpu/drm/i915/i915_debugfs.c | 14 +- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/intel_drv.h | 30 +- drivers/gpu/drm/i915/intel_pm.c | 282 ++-- drivers/gpu/drm/i915/intel_pm.h | 4 +- 34 files changed, 1102 insertions(+), 1064 deletions(-)
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/9 drm/i915: Pass intel_crtc_state to needs_modeset()
--- drivers/gpu/drm/i915/display/intel_display.c | 68 ++++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +34 -34
@@ -515,9 +515,9 @@ icl_wa_scalerclkgating(struct drm_i915_private *dev_priv, enum pipe pipe, }static bool -needs_modeset (const struct drm_crtc_state *state) +needs_modeset (const struct intel_crtc_state *state) { -return drm_atomic_crtc_needs_modeset (state); +return drm_atomic_crtc_needs_modeset (&state->base); }/*
@@ -5796,7 +5796,7 @@ static bool hsw_pre_update_disable_ips(const struct intel_crtc_state *old_crtc_sif (!old_crtc_state->ips_enabled)return false; -if (needs_modeset (&new_crtc_state->base)) +if (needs_modeset (new_crtc_state))return true;/*
@@ -5823,7 +5823,7 @@ static bool hsw_post_update_enable_ips(const struct intel_crtc_state *old_crtc_sif (!new_crtc_state->ips_enabled)return false; -if (needs_modeset (&new_crtc_state->base)) +if (needs_modeset (new_crtc_state))return true;/*
@@ -5900,7 +5900,7 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)intel_fbc_post_update (crtc);if (new_primary_state->visible && - (needs_modeset (&pipe_config->base) || + (needs_modeset (pipe_config) || !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config); }
@@ -5924,7 +5924,7 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct drm_plane *primary = crtc->base.primary;struct drm_plane_state *old_primary_state =drm_atomic_get_old_plane_state (old_state, primary); -bool modeset =needs_modeset (&pipe_config->base); +bool modeset =needs_modeset (pipe_config);struct intel_atomic_state *old_intel_state =to_intel_atomic_state (old_state);
@@ -5984,7 +5984,7 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,* If we're doing a modeset, we're done. No need to do any pre-vblank * watermark programming here. */ -if (needs_modeset (&pipe_config->base)) +if (needs_modeset (pipe_config))return ;/*
@@ -11339,7 +11339,7 @@ int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_statstruct intel_plane *plane =to_intel_plane (plane_state->plane);struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev); -bool mode_changed =needs_modeset (crtc_state); +bool mode_changed =needs_modeset (pipe_config);bool was_crtc_enabled = old_crtc_state->base.active;bool is_crtc_enabled = crtc_state->active;bool turn_off, turn_on, visible, was_visible;
@@ -11608,7 +11608,7 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,struct intel_crtc_state *pipe_config =to_intel_crtc_state (crtc_state);int ret; -bool mode_changed =needs_modeset (crtc_state); +bool mode_changed =needs_modeset (pipe_config);if (INTEL_GEN (dev_priv) <5 && !IS_G4X (dev_priv) && mode_changed && !crtc_state->active)
@@ -13088,7 +13088,7 @@ intel_modeset_verify_crtc(struct drm_crtc *crtc, struct drm_crtc_state *old_state, struct drm_crtc_state *new_state) { -if (!needs_modeset (new_state) && +if (!needs_modeset (to_intel_crtc_state (new_state)) && !to_intel_crtc_state (new_state)->update_pipe)return ;
@@ -13180,7 +13180,7 @@ static void intel_modeset_clear_plls(struct intel_atomic_state *state)struct intel_shared_dpll *old_dpll = old_crtc_state->shared_dpll; -if (!needs_modeset (&new_crtc_state->base)) +if (!needs_modeset (new_crtc_state))continue ; new_crtc_state->shared_dpll =NULL ;
@@ -13210,7 +13210,7 @@ static int haswell_mode_set_planes_workaround(struct intel_atomic_state *state)/* look at all crtc's that are going to be enabled in during modeset */ for_each_new_intel_crtc_in_state (state, crtc, crtc_state, i) {if (!crtc_state->base.active || - !needs_modeset (&crtc_state->base)) + !needs_modeset (crtc_state))continue ;if (first_crtc_state) {
@@ -13235,7 +13235,7 @@ static int haswell_mode_set_planes_workaround(struct intel_atomic_state *state) crtc_state->hsw_workaround_pipe =INVALID_PIPE ;if (!crtc_state->base.active || -needs_modeset (&crtc_state->base)) +needs_modeset (crtc_state))continue ;/* 2 or more enabled crtcs means no need for w/a */
@@ -13285,7 +13285,7 @@ static int intel_modeset_all_pipes(struct drm_atomic_state *state)if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (!crtc_state->active ||needs_modeset (crtc_state)) +if (!crtc_state->active ||needs_modeset (to_intel_crtc_state (crtc_state)))continue ; crtc_state->mode_changed = true;
@@ -13362,12 +13362,12 @@ static int intel_modeset_checks(struct intel_atomic_state *state) }if (is_power_of_2 (state->active_crtcs)) { -struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct intel_crtc *crtc; +struct intel_crtc_state *crtc_state; pipe =ilog2 (state->active_crtcs); - crtc = &intel_get_crtc_for_pipe (dev_priv, pipe)->base; - crtc_state =drm_atomic_get_new_crtc_state (&state->base, crtc); + crtc =intel_get_crtc_for_pipe (dev_priv, pipe); + crtc_state =intel_atomic_get_new_crtc_state (state, crtc);if (crtc_state &&needs_modeset (crtc_state)) pipe =INVALID_PIPE ; }else {
@@ -13478,7 +13478,7 @@ static int intel_atomic_check(struct drm_device *dev,for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -if (!needs_modeset (&new_crtc_state->base)) +if (!needs_modeset (new_crtc_state))continue ;if (!new_crtc_state->base.enable) {
@@ -13492,7 +13492,7 @@ static int intel_atomic_check(struct drm_device *dev,intel_crtc_check_fastset (old_crtc_state, new_crtc_state); -if (needs_modeset (&new_crtc_state->base)) +if (needs_modeset (new_crtc_state)) any_ms = true; }
@@ -13527,12 +13527,12 @@ static int intel_atomic_check(struct drm_device *dev,for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -if (!needs_modeset (&new_crtc_state->base) && +if (!needs_modeset (new_crtc_state) && !new_crtc_state->update_pipe)continue ;intel_dump_pipe_config (new_crtc_state, state, -needs_modeset (&new_crtc_state->base) ? +needs_modeset (new_crtc_state) ?"[modeset]" :"[fastset]" ); }
@@ -13579,7 +13579,7 @@ static void intel_update_crtc(struct drm_crtc *crtc,struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_crtc_state *pipe_config =to_intel_crtc_state (new_crtc_state); -bool modeset =needs_modeset (new_crtc_state); +bool modeset =needs_modeset (pipe_config);struct intel_plane_state *new_plane_state =intel_atomic_get_new_plane_state (to_intel_atomic_state (state),to_intel_plane (crtc->primary));
@@ -13788,15 +13788,15 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state) new_intel_crtc_state =to_intel_crtc_state (new_crtc_state); intel_crtc =to_intel_crtc (crtc); -if (needs_modeset (new_crtc_state) || -to_intel_crtc_state (new_crtc_state)->update_pipe) { +if (needs_modeset (new_intel_crtc_state) || + new_intel_crtc_state->update_pipe) { put_domains[intel_crtc->pipe] =modeset_get_crtc_power_domains (crtc, new_intel_crtc_state); } -if (!needs_modeset (new_crtc_state)) +if (!needs_modeset (new_intel_crtc_state))continue ;intel_pre_plane_update (old_intel_crtc_state, new_intel_crtc_state);
@@ -13855,7 +13855,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)/* Complete the events for pipes that have now been disabled */ for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { -bool modeset =needs_modeset (new_crtc_state); +bool modeset =needs_modeset (to_intel_crtc_state (new_crtc_state));/* Complete events for now disable pipes here. */ if (modeset && !new_crtc_state->active && new_crtc_state->event) {
@@ -13891,7 +13891,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state) new_intel_crtc_state =to_intel_crtc_state (new_crtc_state);if (new_crtc_state->active && - !needs_modeset (new_crtc_state) && + !needs_modeset (to_intel_crtc_state (new_crtc_state)) && (new_intel_crtc_state->base.color_mgmt_changed || new_intel_crtc_state->update_pipe))intel_color_load_luts (new_intel_crtc_state);
@@ -14250,9 +14250,9 @@ intel_prepare_plane_fb(struct drm_plane *plane,int ret;if (old_obj) { -struct drm_crtc_state *crtc_state = -drm_atomic_get_new_crtc_state (new_state->state, - plane->state->crtc); +struct intel_crtc_state *crtc_state = +intel_atomic_get_new_crtc_state (intel_state, +to_intel_crtc (plane->state->crtc));/* Big Hammer, we also need to ensure that any pending * MI_WAIT_FOR_EVENT inside a user batch buffer on the
@@ -14413,7 +14413,7 @@ static void intel_begin_crtc_commit(struct intel_atomic_state *state,intel_atomic_get_old_crtc_state (state, crtc);struct intel_crtc_state *new_crtc_state =intel_atomic_get_new_crtc_state (state, crtc); -bool modeset =needs_modeset (&new_crtc_state->base); +bool modeset =needs_modeset (new_crtc_state);/* Perform vblank evasion around commit operation */ intel_pipe_update_start (new_crtc_state);
@@ -14466,7 +14466,7 @@ static void intel_finish_crtc_commit(struct intel_atomic_state *state,intel_pipe_update_end (new_crtc_state);if (new_crtc_state->update_pipe && - !needs_modeset (&new_crtc_state->base) && + !needs_modeset (new_crtc_state) && old_crtc_state->base.mode.private_flags &I915_MODE_FLAG_INHERITED )intel_crtc_arm_fifo_underrun (crtc, new_crtc_state); }
@@ -14580,7 +14580,7 @@ intel_legacy_cursor_update(struct drm_plane *plane,* When crtc is inactive or there is a modeset pending, * wait for it to complete in the slowpath */ -if (!crtc_state->base.active ||needs_modeset (&crtc_state->base) || +if (!crtc_state->base.active ||needs_modeset (crtc_state) || crtc_state->update_pipe) goto slow;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/9] drm/i915: Pass intel_crtc_state to needs_modeset()
On Thu, Jun 20, 2019 at 11:46:05PM +0200, Maarten Lankhorst wrote:
Commit msg missing from some of these.
Apart from that:
Quoted 272 lines
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 68 ++++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +34
-34@@ -515,9 +515,9 @@ icl_wa_scalerclkgating(struct drm_i915_private *dev_priv, enum pipe pipe, }static bool -needs_modeset (const struct drm_crtc_state *state) +needs_modeset (const struct intel_crtc_state *state) { -return drm_atomic_crtc_needs_modeset (state); +return drm_atomic_crtc_needs_modeset (&state->base); }/* @@ -5796,7 +5796,7 @@ static bool hsw_pre_update_disable_ips(const struct intel_crtc_state *old_crtc_sif (!old_crtc_state->ips_enabled)return false; -if (needs_modeset (&new_crtc_state->base)) +if (needs_modeset (new_crtc_state))return true;/* @@ -5823,7 +5823,7 @@ static bool hsw_post_update_enable_ips(const struct intel_crtc_state *old_crtc_sif (!new_crtc_state->ips_enabled)return false; -if (needs_modeset (&new_crtc_state->base)) +if (needs_modeset (new_crtc_state))return true;/* @@ -5900,7 +5900,7 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)intel_fbc_post_update (crtc);if (new_primary_state->visible && - (needs_modeset (&pipe_config->base) || + (needs_modeset (pipe_config) || !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config); }@@ -5924,7 +5924,7 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct drm_plane *primary = crtc->base.primary;struct drm_plane_state *old_primary_state =drm_atomic_get_old_plane_state (old_state, primary); -bool modeset =needs_modeset (&pipe_config->base); +bool modeset =needs_modeset (pipe_config);struct intel_atomic_state *old_intel_state =to_intel_atomic_state (old_state);@@ -5984,7 +5984,7 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,* If we're doing a modeset, we're done. No need to do any pre-vblank * watermark programming here. */ -if (needs_modeset (&pipe_config->base)) +if (needs_modeset (pipe_config))return ;/* @@ -11339,7 +11339,7 @@ int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_statstruct intel_plane *plane =to_intel_plane (plane_state->plane);struct drm_device *dev = crtc->dev;struct drm_i915_private *dev_priv =to_i915 (dev); -bool mode_changed =needs_modeset (crtc_state); +bool mode_changed =needs_modeset (pipe_config);bool was_crtc_enabled = old_crtc_state->base.active;bool is_crtc_enabled = crtc_state->active;bool turn_off, turn_on, visible, was_visible;@@ -11608,7 +11608,7 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,struct intel_crtc_state *pipe_config =to_intel_crtc_state (crtc_state);int ret; -bool mode_changed =needs_modeset (crtc_state); +bool mode_changed =needs_modeset (pipe_config);if (INTEL_GEN (dev_priv) <5 && !IS_G4X (dev_priv) && mode_changed && !crtc_state->active)@@ -13088,7 +13088,7 @@ intel_modeset_verify_crtc(struct drm_crtc *crtc, struct drm_crtc_state *old_state, struct drm_crtc_state *new_state) { -if (!needs_modeset (new_state) && +if (!needs_modeset (to_intel_crtc_state (new_state)) && !to_intel_crtc_state (new_state)->update_pipe)return ;@@ -13180,7 +13180,7 @@ static void intel_modeset_clear_plls(struct intel_atomic_state *state)struct intel_shared_dpll *old_dpll = old_crtc_state->shared_dpll; -if (!needs_modeset (&new_crtc_state->base)) +if (!needs_modeset (new_crtc_state))continue ; new_crtc_state->shared_dpll =NULL ;@@ -13210,7 +13210,7 @@ static int haswell_mode_set_planes_workaround(struct intel_atomic_state *state)/* look at all crtc's that are going to be enabled in during modeset */ for_each_new_intel_crtc_in_state (state, crtc, crtc_state, i) {if (!crtc_state->base.active || - !needs_modeset (&crtc_state->base)) + !needs_modeset (crtc_state))continue ;if (first_crtc_state) {@@ -13235,7 +13235,7 @@ static int haswell_mode_set_planes_workaround(struct intel_atomic_state *state) crtc_state->hsw_workaround_pipe =INVALID_PIPE ;if (!crtc_state->base.active || -needs_modeset (&crtc_state->base)) +needs_modeset (crtc_state))continue ;/* 2 or more enabled crtcs means no need for w/a */ @@ -13285,7 +13285,7 @@ static int intel_modeset_all_pipes(struct drm_atomic_state *state)if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (!crtc_state->active ||needs_modeset (crtc_state)) +if (!crtc_state->active ||needs_modeset (to_intel_crtc_state (crtc_state)))continue ; crtc_state->mode_changed = true;@@ -13362,12 +13362,12 @@ static int intel_modeset_checks(struct intel_atomic_state *state) }if (is_power_of_2 (state->active_crtcs)) { -struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct intel_crtc *crtc; +struct intel_crtc_state *crtc_state; pipe =ilog2 (state->active_crtcs); - crtc = &intel_get_crtc_for_pipe (dev_priv, pipe)->base; - crtc_state =drm_atomic_get_new_crtc_state (&state->base, crtc); + crtc =intel_get_crtc_for_pipe (dev_priv, pipe); + crtc_state =intel_atomic_get_new_crtc_state (state, crtc);if (crtc_state &&needs_modeset (crtc_state)) pipe =INVALID_PIPE ; }else {@@ -13478,7 +13478,7 @@ static int intel_atomic_check(struct drm_device *dev,for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -if (!needs_modeset (&new_crtc_state->base)) +if (!needs_modeset (new_crtc_state))continue ;if (!new_crtc_state->base.enable) {@@ -13492,7 +13492,7 @@ static int intel_atomic_check(struct drm_device *dev,intel_crtc_check_fastset (old_crtc_state, new_crtc_state); -if (needs_modeset (&new_crtc_state->base)) +if (needs_modeset (new_crtc_state)) any_ms = true; }@@ -13527,12 +13527,12 @@ static int intel_atomic_check(struct drm_device *dev,for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -if (!needs_modeset (&new_crtc_state->base) && +if (!needs_modeset (new_crtc_state) && !new_crtc_state->update_pipe)continue ;intel_dump_pipe_config (new_crtc_state, state, -needs_modeset (&new_crtc_state->base) ? +needs_modeset (new_crtc_state) ?"[modeset]" :"[fastset]" ); }@@ -13579,7 +13579,7 @@ static void intel_update_crtc(struct drm_crtc *crtc,struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_crtc_state *pipe_config =to_intel_crtc_state (new_crtc_state); -bool modeset =needs_modeset (new_crtc_state); +bool modeset =needs_modeset (pipe_config);struct intel_plane_state *new_plane_state =intel_atomic_get_new_plane_state (to_intel_atomic_state (state),to_intel_plane (crtc->primary));@@ -13788,15 +13788,15 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state) new_intel_crtc_state =to_intel_crtc_state (new_crtc_state); intel_crtc =to_intel_crtc (crtc); -if (needs_modeset (new_crtc_state) || -to_intel_crtc_state (new_crtc_state)->update_pipe) { +if (needs_modeset (new_intel_crtc_state) || + new_intel_crtc_state->update_pipe) { put_domains[intel_crtc->pipe] =modeset_get_crtc_power_domains (crtc, new_intel_crtc_state); } -if (!needs_modeset (new_crtc_state)) +if (!needs_modeset (new_intel_crtc_state))continue ;intel_pre_plane_update (old_intel_crtc_state, new_intel_crtc_state);@@ -13855,7 +13855,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)/* Complete the events for pipes that have now been disabled */ for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { -bool modeset =needs_modeset (new_crtc_state); +bool modeset =needs_modeset (to_intel_crtc_state (new_crtc_state));/* Complete events for now disable pipes here. */ if (modeset && !new_crtc_state->active && new_crtc_state->event) {@@ -13891,7 +13891,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state) new_intel_crtc_state =to_intel_crtc_state (new_crtc_state);if (new_crtc_state->active && - !needs_modeset (new_crtc_state) && + !needs_modeset (to_intel_crtc_state (new_crtc_state)) && (new_intel_crtc_state->base.color_mgmt_changed || new_intel_crtc_state->update_pipe))intel_color_load_luts (new_intel_crtc_state);@@ -14250,9 +14250,9 @@ intel_prepare_plane_fb(struct drm_plane *plane,int ret;if (old_obj) { -struct drm_crtc_state *crtc_state = -drm_atomic_get_new_crtc_state (new_state->state, - plane->state->crtc); +struct intel_crtc_state *crtc_state = +intel_atomic_get_new_crtc_state (intel_state, +to_intel_crtc (plane->state->crtc));/* Big Hammer, we also need to ensure that any pending * MI_WAIT_FOR_EVENT inside a user batch buffer on the @@ -14413,7 +14413,7 @@ static void intel_begin_crtc_commit(struct intel_atomic_state *state,intel_atomic_get_old_crtc_state (state, crtc);struct intel_crtc_state *new_crtc_state =intel_atomic_get_new_crtc_state (state, crtc); -bool modeset =needs_modeset (&new_crtc_state->base); +bool modeset =needs_modeset (new_crtc_state);/* Perform vblank evasion around commit operation */ intel_pipe_update_start (new_crtc_state);@@ -14466,7 +14466,7 @@ static void intel_finish_crtc_commit(struct intel_atomic_state *state,intel_pipe_update_end (new_crtc_state);if (new_crtc_state->update_pipe && - !needs_modeset (&new_crtc_state->base) && + !needs_modeset (new_crtc_state) && old_crtc_state->base.mode.private_flags &I915_MODE_FLAG_INHERITED )intel_crtc_arm_fifo_underrun (crtc, new_crtc_state); }@@ -14580,7 +14580,7 @@ intel_legacy_cursor_update(struct drm_plane *plane,* When crtc is inactive or there is a modeset pending, * wait for it to complete in the slowpath */ -if (!crtc_state->base.active ||needs_modeset (&crtc_state->base) || +if (!crtc_state->base.active ||needs_modeset (crtc_state) || crtc_state->update_pipe) goto slow;Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/9 drm/i915: Convert most of atomic commit to take more intel state
In reply to Maarten LankhorstInstead of passing along drm_crtc_state and drm_atomic_state, pass along more intel_atomic_state and intel_crtc_state. This will make the code more readable by not casting between drm state and intel state all the time.
--- drivers/gpu/drm/i915/display/intel_display.c | 403 +++++++++---------- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/intel_pm.c | 11 +- drivers/gpu/drm/i915/intel_pm.h | 4 +- 4 files changed, 196 insertions(+), 228 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +186 -217
@@ -6036,19 +6036,19 @@ static void intel_crtc_disable_planes(struct intel_atomic_state *state,intel_frontbuffer_flip (dev_priv, fb_bits); } -static void intel_encoders_pre_pll_enable (struct drm_crtc *crtc, +static void intel_encoders_pre_pll_enable (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *conn_state;struct drm_connector *conn;int i; -for_each_new_connector_in_state (old_state, conn, conn_state, i) { +for_each_new_connector_in_state (&old_state->base, conn, conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (conn_state->best_encoder); -if (conn_state->crtc != crtc) +if (conn_state->crtc != &crtc->base)continue ;if (encoder->pre_pll_enable)
@@ -6056,19 +6056,19 @@ static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc, } } -static void intel_encoders_pre_enable (struct drm_crtc *crtc, +static void intel_encoders_pre_enable (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *conn_state;struct drm_connector *conn;int i; -for_each_new_connector_in_state (old_state, conn, conn_state, i) { +for_each_new_connector_in_state (&old_state->base, conn, conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (conn_state->best_encoder); -if (conn_state->crtc != crtc) +if (conn_state->crtc != &crtc->base)continue ;if (encoder->pre_enable)
@@ -6076,19 +6076,19 @@ static void intel_encoders_pre_enable(struct drm_crtc *crtc, } } -static void intel_encoders_enable (struct drm_crtc *crtc, +static void intel_encoders_enable (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *conn_state;struct drm_connector *conn;int i; -for_each_new_connector_in_state (old_state, conn, conn_state, i) { +for_each_new_connector_in_state (&old_state->base, conn, conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (conn_state->best_encoder); -if (conn_state->crtc != crtc) +if (conn_state->crtc != &crtc->base)continue ;if (encoder->enable)
@@ -6097,19 +6097,19 @@ static void intel_encoders_enable(struct drm_crtc *crtc, } } -static void intel_encoders_disable (struct drm_crtc *crtc, +static void intel_encoders_disable (struct intel_crtc *crtc,struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *old_conn_state;struct drm_connector *conn;int i; -for_each_old_connector_in_state (old_state, conn, old_conn_state, i) { +for_each_old_connector_in_state (&old_state->base, conn, old_conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (old_conn_state->best_encoder); -if (old_conn_state->crtc != crtc) +if (old_conn_state->crtc != &crtc->base)continue ;intel_opregion_notify_encoder (encoder, false);
@@ -6118,19 +6118,19 @@ static void intel_encoders_disable(struct drm_crtc *crtc, } } -static void intel_encoders_post_disable (struct drm_crtc *crtc, +static void intel_encoders_post_disable (struct intel_crtc *crtc,struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *old_conn_state;struct drm_connector *conn;int i; -for_each_old_connector_in_state (old_state, conn, old_conn_state, i) { +for_each_old_connector_in_state (&old_state->base, conn, old_conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (old_conn_state->best_encoder); -if (old_conn_state->crtc != crtc) +if (old_conn_state->crtc != &crtc->base)continue ;if (encoder->post_disable)
@@ -6138,19 +6138,19 @@ static void intel_encoders_post_disable(struct drm_crtc *crtc, } } -static void intel_encoders_post_pll_disable (struct drm_crtc *crtc, +static void intel_encoders_post_pll_disable (struct intel_crtc *crtc,struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *old_conn_state;struct drm_connector *conn;int i; -for_each_old_connector_in_state (old_state, conn, old_conn_state, i) { +for_each_old_connector_in_state (&old_state->base, conn, old_conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (old_conn_state->best_encoder); -if (old_conn_state->crtc != crtc) +if (old_conn_state->crtc != &crtc->base)continue ;if (encoder->post_pll_disable)
@@ -6158,19 +6158,19 @@ static void intel_encoders_post_pll_disable(struct drm_crtc *crtc, } } -static void intel_encoders_update_pipe (struct drm_crtc *crtc, +static void intel_encoders_update_pipe (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *conn_state;struct drm_connector *conn;int i; -for_each_new_connector_in_state (old_state, conn, conn_state, i) { +for_each_new_connector_in_state (&old_state->base, conn, conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (conn_state->best_encoder); -if (conn_state->crtc != crtc) +if (conn_state->crtc != &crtc->base)continue ;if (encoder->update_pipe)
@@ -6187,15 +6187,13 @@ static void intel_disable_primary_plane(const struct intel_crtc_state *crtc_stat }static void ironlake_crtc_enable (struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state) +struct intel_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);int pipe = intel_crtc->pipe; -struct intel_atomic_state *old_intel_state = -to_intel_atomic_state (old_state);if (WARN_ON (intel_crtc->active))return ;
@@ -6231,7 +6229,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config, intel_crtc->active = true; -intel_encoders_pre_enable (crtc, pipe_config, old_state); +intel_encoders_pre_enable (intel_crtc, pipe_config, old_state);if (pipe_config->has_pch_encoder) {/* Note: FDI PLL enabling _must_ be done before we enable the
@@ -6255,16 +6253,16 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,intel_disable_primary_plane (pipe_config);if (dev_priv->display.initial_watermarks !=NULL ) - dev_priv->display.initial_watermarks (old_intel_state, pipe_config); + dev_priv->display.initial_watermarks (old_state, pipe_config);intel_enable_pipe (pipe_config);if (pipe_config->has_pch_encoder) -ironlake_pch_enable (old_intel_state, pipe_config); +ironlake_pch_enable (old_state, pipe_config);assert_vblank_disabled (crtc);intel_crtc_vblank_on (pipe_config); -intel_encoders_enable (crtc, pipe_config, old_state); +intel_encoders_enable (intel_crtc, pipe_config, old_state);if (HAS_PCH_CPT (dev_priv))cpt_verify_modeset (dev, intel_crtc->pipe);
@@ -6317,26 +6315,24 @@ static void icl_pipe_mbus_enable(struct intel_crtc *crtc) }static void haswell_crtc_enable (struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_crtc *crtc = pipe_config->base.crtc;struct drm_i915_private *dev_priv =to_i915 (crtc->dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);int pipe = intel_crtc->pipe, hsw_workaround_pipe;enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; -struct intel_atomic_state *old_intel_state = -to_intel_atomic_state (old_state);bool psl_clkgate_wa;if (WARN_ON (intel_crtc->active))return ; -intel_encoders_pre_pll_enable (crtc, pipe_config, old_state); +intel_encoders_pre_pll_enable (intel_crtc, pipe_config, old_state);if (pipe_config->shared_dpll)intel_enable_shared_dpll (pipe_config); -intel_encoders_pre_enable (crtc, pipe_config, old_state); +intel_encoders_pre_enable (intel_crtc, pipe_config, old_state);if (intel_crtc_has_dp_encoder (pipe_config))intel_dp_set_m_n (pipe_config,M1_N1 );
@@ -6394,7 +6390,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,intel_ddi_enable_transcoder_func (pipe_config);if (dev_priv->display.initial_watermarks !=NULL ) - dev_priv->display.initial_watermarks (old_intel_state, pipe_config); + dev_priv->display.initial_watermarks (old_state, pipe_config);if (INTEL_GEN (dev_priv) >=11 )icl_pipe_mbus_enable (intel_crtc);
@@ -6404,7 +6400,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,intel_enable_pipe (pipe_config);if (pipe_config->has_pch_encoder) -lpt_pch_enable (old_intel_state, pipe_config); +lpt_pch_enable (old_state, pipe_config);if (intel_crtc_has_type (pipe_config,INTEL_OUTPUT_DP_MST ))intel_ddi_set_vc_payload_alloc (pipe_config, true);
@@ -6412,7 +6408,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);intel_crtc_vblank_on (pipe_config); -intel_encoders_enable (crtc, pipe_config, old_state); +intel_encoders_enable (intel_crtc, pipe_config, old_state);if (psl_clkgate_wa) {intel_wait_for_vblank (dev_priv, pipe);
@@ -6444,7 +6440,7 @@ static void ironlake_pfit_disable(const struct intel_crtc_state *old_crtc_state) }static void ironlake_crtc_disable (struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_crtc *crtc = old_crtc_state->base.crtc;struct drm_device *dev = crtc->dev;
@@ -6460,7 +6456,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, false);intel_set_pch_fifo_underrun_reporting (dev_priv, pipe, false); -intel_encoders_disable (crtc, old_crtc_state, old_state); +intel_encoders_disable (intel_crtc, old_crtc_state, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);
@@ -6472,7 +6468,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,if (old_crtc_state->has_pch_encoder)ironlake_fdi_disable (crtc); -intel_encoders_post_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_disable (intel_crtc, old_crtc_state, old_state);if (old_crtc_state->has_pch_encoder) {ironlake_disable_pch_transcoder (dev_priv, pipe);
@@ -6503,14 +6499,14 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state, }static void haswell_crtc_disable (struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_crtc *crtc = old_crtc_state->base.crtc;struct drm_i915_private *dev_priv =to_i915 (crtc->dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; -intel_encoders_disable (crtc, old_crtc_state, old_state); +intel_encoders_disable (intel_crtc, old_crtc_state, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);
@@ -6532,9 +6528,9 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,else ironlake_pfit_disable (old_crtc_state); -intel_encoders_post_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_disable (intel_crtc, old_crtc_state, old_state); -intel_encoders_post_pll_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_pll_disable (intel_crtc, old_crtc_state, old_state); }static void i9xx_pfit_enable (const struct intel_crtc_state *crtc_state)
@@ -6633,14 +6629,13 @@ intel_aux_power_domain(struct intel_digital_port *dig_port) } } -static u64 get_crtc_power_domains (struct drm_crtc *crtc, +static u64 get_crtc_power_domains (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state) { -struct drm_device *dev = crtc->dev; +struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct drm_encoder *encoder; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -enum pipe pipe = intel_crtc->pipe; +enum pipe pipe = crtc->pipe;u64 mask;enum transcoder transcoder = crtc_state->cpu_transcoder;
@@ -6669,16 +6664,15 @@ static u64 get_crtc_power_domains(struct drm_crtc *crtc, }static u64 -modeset_get_crtc_power_domains (struct drm_crtc *crtc, +modeset_get_crtc_power_domains (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc->dev); -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum intel_display_power_domain domain;u64 domains, new_domains, old_domains; - old_domains = intel_crtc->enabled_power_domains; - intel_crtc->enabled_power_domains = new_domains = + old_domains = crtc->enabled_power_domains; + crtc->enabled_power_domains = new_domains =get_crtc_power_domains (crtc, crtc_state); domains = new_domains & ~old_domains;
@@ -6699,10 +6693,8 @@ static void modeset_put_power_domains(struct drm_i915_private *dev_priv, }static void valleyview_crtc_enable (struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) { -struct intel_atomic_state *old_intel_state = -to_intel_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);
@@ -6729,7 +6721,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, pipe_config, old_state); +intel_encoders_pre_pll_enable (intel_crtc, pipe_config, old_state);if (IS_CHERRYVIEW (dev_priv)) {chv_prepare_pll (intel_crtc, pipe_config);
@@ -6739,7 +6731,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,vlv_enable_pll (intel_crtc, pipe_config); } -intel_encoders_pre_enable (crtc, pipe_config, old_state); +intel_encoders_pre_enable (intel_crtc, pipe_config, old_state);i9xx_pfit_enable (pipe_config);
@@ -6748,14 +6740,13 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,/* update DSPCNTR to configure gamma for pipe bottom color */ intel_disable_primary_plane (pipe_config); - dev_priv->display.initial_watermarks (old_intel_state, - pipe_config); + dev_priv->display.initial_watermarks (old_state, pipe_config);intel_enable_pipe (pipe_config);assert_vblank_disabled (crtc);intel_crtc_vblank_on (pipe_config); -intel_encoders_enable (crtc, pipe_config, old_state); +intel_encoders_enable (intel_crtc, pipe_config, old_state); }static void i9xx_set_pll_dividers (const struct intel_crtc_state *crtc_state)
@@ -6768,10 +6759,8 @@ static void i9xx_set_pll_dividers(const struct intel_crtc_state *crtc_state) }static void i9xx_crtc_enable (struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) { -struct intel_atomic_state *old_intel_state = -to_intel_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);
@@ -6796,7 +6785,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,if (!IS_GEN (dev_priv,2 ))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -intel_encoders_pre_enable (crtc, pipe_config, old_state); +intel_encoders_pre_enable (intel_crtc, pipe_config, old_state);i9xx_enable_pll (intel_crtc, pipe_config);
@@ -6808,7 +6797,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,intel_disable_primary_plane (pipe_config);if (dev_priv->display.initial_watermarks !=NULL ) - dev_priv->display.initial_watermarks (old_intel_state, + dev_priv->display.initial_watermarks (old_state, pipe_config);else intel_update_watermarks (intel_crtc);
@@ -6817,7 +6806,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);intel_crtc_vblank_on (pipe_config); -intel_encoders_enable (crtc, pipe_config, old_state); +intel_encoders_enable (intel_crtc, pipe_config, old_state); }static void i9xx_pfit_disable (const struct intel_crtc_state *old_crtc_state)
@@ -6836,7 +6825,7 @@ static void i9xx_pfit_disable(const struct intel_crtc_state *old_crtc_state) }static void i9xx_crtc_disable (struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_crtc *crtc = old_crtc_state->base.crtc;struct drm_device *dev = crtc->dev;
@@ -6851,7 +6840,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,if (IS_GEN (dev_priv,2 ))intel_wait_for_vblank (dev_priv, pipe); -intel_encoders_disable (crtc, old_crtc_state, old_state); +intel_encoders_disable (intel_crtc, old_crtc_state, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);
@@ -6860,7 +6849,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_pfit_disable (old_crtc_state); -intel_encoders_post_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_disable (intel_crtc, old_crtc_state, old_state);if (!intel_crtc_has_type (old_crtc_state,INTEL_OUTPUT_DSI )) {if (IS_CHERRYVIEW (dev_priv))
@@ -6871,7 +6860,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_disable_pll (old_crtc_state); } -intel_encoders_post_pll_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_pll_disable (intel_crtc, old_crtc_state, old_state);if (!IS_GEN (dev_priv,2 ))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, false);
@@ -6925,7 +6914,7 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc,WARN_ON (IS_ERR (crtc_state) || ret); - dev_priv->display.crtc_disable (crtc_state, state); + dev_priv->display.crtc_disable (crtc_state,to_intel_atomic_state (state));drm_atomic_state_put (state);
@@ -13083,19 +13072,18 @@ verify_shared_dpll_state(struct drm_device *dev, struct drm_crtc *crtc, }static void -intel_modeset_verify_crtc (struct drm_crtc *crtc, -struct drm_atomic_state *state, -struct drm_crtc_state *old_state, -struct drm_crtc_state *new_state) +intel_modeset_verify_crtc (struct intel_crtc *crtc, +struct intel_atomic_state *state, +struct intel_crtc_state *old_state, +struct intel_crtc_state *new_state) { -if (!needs_modeset (to_intel_crtc_state (new_state)) && - !to_intel_crtc_state (new_state)->update_pipe) +if (!needs_modeset (new_state) && !new_state->update_pipe)return ; -verify_wm_state (crtc, new_state); -verify_connector_state (crtc->dev, state, crtc); -verify_crtc_state (crtc, old_state, new_state); -verify_shared_dpll_state (crtc->dev, crtc, old_state, new_state); +verify_wm_state (&crtc->base, &new_state->base); +verify_connector_state (crtc->base.dev, &state->base, &crtc->base); +verify_crtc_state (&crtc->base, &old_state->base, &new_state->base); +verify_shared_dpll_state (crtc->base.dev, &crtc->base, &old_state->base, &new_state->base); } static void
@@ -13110,10 +13098,10 @@ verify_disabled_dpll_state(struct drm_device *dev)static void intel_modeset_verify_disabled (struct drm_device *dev, -struct drm_atomic_state *state) +struct intel_atomic_state *state) { -verify_encoder_state (dev, state); -verify_connector_state (dev, state,NULL ); +verify_encoder_state (dev, &state->base); +verify_connector_state (dev, &state->base,NULL );verify_disabled_dpll_state (dev); }
@@ -13570,57 +13558,54 @@ u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)return dev->driver->get_vblank_counter (dev, crtc->pipe); } -static void intel_update_crtc (struct drm_crtc *crtc, -struct drm_atomic_state *state, -struct drm_crtc_state *old_crtc_state, -struct drm_crtc_state *new_crtc_state) +static void intel_update_crtc (struct intel_crtc *crtc, +struct intel_atomic_state *state, +struct intel_crtc_state *old_crtc_state, +struct intel_crtc_state *new_crtc_state) { -struct drm_device *dev = crtc->dev; +struct drm_device *dev = state->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_crtc_state *pipe_config =to_intel_crtc_state (new_crtc_state); -bool modeset =needs_modeset (pipe_config); +bool modeset =needs_modeset (new_crtc_state);struct intel_plane_state *new_plane_state = -intel_atomic_get_new_plane_state (to_intel_atomic_state (state), -to_intel_plane (crtc->primary)); +intel_atomic_get_new_plane_state (state, +to_intel_plane (crtc->base.primary));if (modeset) { -update_scanline_offset (pipe_config); - dev_priv->display.crtc_enable (pipe_config, state); +update_scanline_offset (new_crtc_state); + dev_priv->display.crtc_enable (new_crtc_state, state);/* vblanks work again, re-enable pipe CRC. */ -intel_crtc_enable_pipe_crc (intel_crtc); +intel_crtc_enable_pipe_crc (crtc); }else { -intel_pre_plane_update (to_intel_crtc_state (old_crtc_state), - pipe_config); +intel_pre_plane_update (old_crtc_state, new_crtc_state); -if (pipe_config->update_pipe) -intel_encoders_update_pipe (crtc, pipe_config, state); +if (new_crtc_state->update_pipe) +intel_encoders_update_pipe (crtc, new_crtc_state, state); } -if (pipe_config->update_pipe && !pipe_config->enable_fbc) -intel_fbc_disable (intel_crtc); +if (new_crtc_state->update_pipe && !new_crtc_state->enable_fbc) +intel_fbc_disable (crtc);else if (new_plane_state) -intel_fbc_enable (intel_crtc, pipe_config, new_plane_state); +intel_fbc_enable (crtc, new_crtc_state, new_plane_state); -intel_begin_crtc_commit (to_intel_atomic_state (state), intel_crtc); +intel_begin_crtc_commit (state, crtc);if (INTEL_GEN (dev_priv) >=9 ) -skl_update_planes_on_crtc (to_intel_atomic_state (state), intel_crtc); +skl_update_planes_on_crtc (state, crtc);else -i9xx_update_planes_on_crtc (to_intel_atomic_state (state), intel_crtc); +i9xx_update_planes_on_crtc (state, crtc); -intel_finish_crtc_commit (to_intel_atomic_state (state), intel_crtc); +intel_finish_crtc_commit (state, crtc); } -static void intel_update_crtcs (struct drm_atomic_state *state) +static void intel_update_crtcs (struct intel_atomic_state *state) { -struct drm_crtc *crtc; -struct drm_crtc_state *old_crtc_state, *new_crtc_state; +struct intel_crtc *crtc; +struct intel_crtc_state *old_crtc_state, *new_crtc_state;int i; -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -if (!new_crtc_state->active) +for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +if (!new_crtc_state->base.active)continue ; intel_update_crtc(crtc, state, old_crtc_state,
@@ -13628,26 +13613,23 @@ static void intel_update_crtcs(struct drm_atomic_state *state) } } -static void skl_update_crtcs (struct drm_atomic_state *state) +static void skl_update_crtcs (struct intel_atomic_state *state) { -struct drm_i915_private *dev_priv =to_i915 (state->dev); -struct intel_atomic_state *intel_state =to_intel_atomic_state (state); -struct drm_crtc *crtc; -struct intel_crtc *intel_crtc; -struct drm_crtc_state *old_crtc_state, *new_crtc_state; -struct intel_crtc_state *cstate; +struct drm_i915_private *dev_priv =to_i915 (state->base.dev); +struct intel_crtc *crtc; +struct intel_crtc_state *old_crtc_state, *new_crtc_state;unsigned int updated =0 ;bool progress;enum pipe pipe;int i;u8 hw_enabled_slices = dev_priv->wm.skl_hw.ddb.enabled_slices; -u8 required_slices = intel_state->wm_results.ddb.enabled_slices; +u8 required_slices = state->wm_results.ddb.enabled_slices;struct skl_ddb_entry entries[I915_MAX_PIPES ] = {}; -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) +for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i)/* ignore allocations for crtc's that have been turned off. */ -if (new_crtc_state->active) - entries[i] =to_intel_crtc_state (old_crtc_state)->wm.skl.ddb; +if (new_crtc_state->base.active) + entries[i] = old_crtc_state->wm.skl.ddb;/* If 2nd DBuf slice required, enable it here */ if (INTEL_GEN (dev_priv) >=11 && required_slices > hw_enabled_slices)
@@ -13662,24 +13644,22 @@ static void skl_update_crtcs(struct drm_atomic_state *state) do { progress = false; - for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { + for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { bool vbl_wait = false; - unsigned int cmask = drm_crtc_mask(crtc); + unsigned int cmask = drm_crtc_mask(&crtc->base); - intel_crtc = to_intel_crtc(crtc); - cstate = to_intel_crtc_state(new_crtc_state); - pipe = intel_crtc->pipe; + pipe = crtc->pipe; - if (updated & cmask || !cstate->base.active) + if (updated & cmask || !new_crtc_state->base.active) continue; - if (skl_ddb_allocation_overlaps(&cstate->wm.skl.ddb, + if (skl_ddb_allocation_overlaps(&new_crtc_state->wm.skl.ddb, entries, INTEL_INFO(dev_priv)->num_pipes, i)) continue; updated |= cmask; - entries[i] = cstate->wm.skl.ddb; + entries[i] = new_crtc_state->wm.skl.ddb; /* * If this is an already active pipe, it's DDB changed,
@@ -13687,10 +13667,10 @@ static void skl_update_crtcs(struct drm_atomic_state *state)* then we need to wait for a vblank to pass for the * new ddb allocation to take effect. */ -if (!skl_ddb_entry_equal (&cstate->wm.skl.ddb, - &to_intel_crtc_state (old_crtc_state)->wm.skl.ddb) && - !new_crtc_state->active_changed && - intel_state->wm_results.dirty_pipes != updated) +if (!skl_ddb_entry_equal (&new_crtc_state->wm.skl.ddb, + &old_crtc_state->wm.skl.ddb) && + !new_crtc_state->base.active_changed && + state->wm_results.dirty_pipes != updated) vbl_wait = true; intel_update_crtc(crtc, state, old_crtc_state,
@@ -13763,57 +13743,50 @@ static void intel_atomic_cleanup_work(struct work_struct *work)intel_atomic_helper_free_state (i915); } -static void intel_atomic_commit_tail (struct drm_atomic_state *state) +static void intel_atomic_commit_tail (struct intel_atomic_state *state) { -struct drm_device *dev = state->dev; -struct intel_atomic_state *intel_state =to_intel_atomic_state (state); +struct drm_device *dev = state->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct drm_crtc_state *old_crtc_state, *new_crtc_state; -struct intel_crtc_state *new_intel_crtc_state, *old_intel_crtc_state; -struct drm_crtc *crtc; -struct intel_crtc *intel_crtc; +struct intel_crtc_state *new_crtc_state, *old_crtc_state; +struct intel_crtc *crtc;u64 put_domains[I915_MAX_PIPES ] = {};intel_wakeref_t wakeref =0 ;int i; -intel_atomic_commit_fence_wait (intel_state); +intel_atomic_commit_fence_wait (state); -drm_atomic_helper_wait_for_dependencies (state); +drm_atomic_helper_wait_for_dependencies (&state->base); -if (intel_state->modeset) +if (state->modeset) wakeref =intel_display_power_get (dev_priv,POWER_DOMAIN_MODESET ); -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { - old_intel_crtc_state =to_intel_crtc_state (old_crtc_state); - new_intel_crtc_state =to_intel_crtc_state (new_crtc_state); - intel_crtc =to_intel_crtc (crtc); - -if (needs_modeset (new_intel_crtc_state) || - new_intel_crtc_state->update_pipe) { +for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +if (needs_modeset (new_crtc_state) || + new_crtc_state->update_pipe) { - put_domains[intel_crtc->pipe] = + put_domains[crtc->pipe] =modeset_get_crtc_power_domains (crtc, - new_intel_crtc_state); + new_crtc_state); } -if (!needs_modeset (new_intel_crtc_state)) +if (!needs_modeset (new_crtc_state))continue ; -intel_pre_plane_update (old_intel_crtc_state, new_intel_crtc_state); +intel_pre_plane_update (old_crtc_state, new_crtc_state); -if (old_crtc_state->active) { -intel_crtc_disable_planes (intel_state, intel_crtc); +if (old_crtc_state->base.active) { +intel_crtc_disable_planes (state, crtc);/* * We need to disable pipe CRC before disabling the pipe, * or we race against vblank off. */ -intel_crtc_disable_pipe_crc (intel_crtc); +intel_crtc_disable_pipe_crc (crtc); - dev_priv->display.crtc_disable (old_intel_crtc_state, state); - intel_crtc->active = false; -intel_fbc_disable (intel_crtc); -intel_disable_shared_dpll (old_intel_crtc_state); + dev_priv->display.crtc_disable (old_crtc_state, state); + crtc->active = false; +intel_fbc_disable (crtc); +intel_disable_shared_dpll (old_crtc_state);/* * Underruns don't always raise
@@ -13823,25 +13796,25 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)intel_check_pch_fifo_underruns (dev_priv);/* FIXME unify this for all platforms */ -if (!new_crtc_state->active && +if (!new_crtc_state->base.active && !HAS_GMCH (dev_priv) && dev_priv->display.initial_watermarks) - dev_priv->display.initial_watermarks (intel_state, - new_intel_crtc_state); + dev_priv->display.initial_watermarks (state, + new_crtc_state); } } -/* FIXME: Eventually get rid of our intel_crtc->config pointer */ -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) -to_intel_crtc (crtc)->config =to_intel_crtc_state (new_crtc_state); +/* FIXME: Eventually get rid of our crtc->config pointer */ +for_each_new_intel_crtc_in_state (state, crtc, new_crtc_state, i) + crtc->config = new_crtc_state; -if (intel_state->modeset) { -drm_atomic_helper_update_legacy_modeset_state (state->dev, state); +if (state->modeset) { +drm_atomic_helper_update_legacy_modeset_state (dev, &state->base);intel_set_cdclk_pre_plane_update (dev_priv, - &intel_state->cdclk.actual, + &state->cdclk.actual, &dev_priv->cdclk.actual, - intel_state->cdclk.pipe); + state->cdclk.pipe);/* * SKL workaround: bspec recommends we disable the SAGV when we
@@ -13854,27 +13827,27 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state) }/* Complete the events for pipes that have now been disabled */ -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { -bool modeset =needs_modeset (to_intel_crtc_state (new_crtc_state)); +for_each_new_intel_crtc_in_state (state, crtc, new_crtc_state, i) { +bool modeset =needs_modeset (new_crtc_state);/* Complete events for now disable pipes here. */ -if (modeset && !new_crtc_state->active && new_crtc_state->event) { +if (modeset && !new_crtc_state->base.active && new_crtc_state->base.event) {spin_lock_irq (&dev->event_lock); -drm_crtc_send_vblank_event (crtc, new_crtc_state->event); +drm_crtc_send_vblank_event (&crtc->base, new_crtc_state->base.event);spin_unlock_irq (&dev->event_lock); - new_crtc_state->event =NULL ; + new_crtc_state->base.event =NULL ; } }/* Now enable the clocks, plane, pipe, and connectors that we set up. */ dev_priv->display.update_crtcs (state); -if (intel_state->modeset) +if (state->modeset)intel_set_cdclk_post_plane_update (dev_priv, - &intel_state->cdclk.actual, + &state->cdclk.actual, &dev_priv->cdclk.actual, - intel_state->cdclk.pipe); + state->cdclk.pipe);/* FIXME: We should call drm_atomic_helper_commit_hw_done() here * already, but still need the state for the delayed optimization. To
@@ -13885,16 +13858,14 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)* - switch over to the vblank wait helper in the core after that since * we don't need out special handling any more. */ -drm_atomic_helper_wait_for_flip_done (dev, state); - -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { - new_intel_crtc_state =to_intel_crtc_state (new_crtc_state); +drm_atomic_helper_wait_for_flip_done (dev, &state->base); -if (new_crtc_state->active && - !needs_modeset (to_intel_crtc_state (new_crtc_state)) && - (new_intel_crtc_state->base.color_mgmt_changed || - new_intel_crtc_state->update_pipe)) -intel_color_load_luts (new_intel_crtc_state); +for_each_new_intel_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->base.active && + !needs_modeset (new_crtc_state) && + (new_crtc_state->base.color_mgmt_changed || + new_crtc_state->update_pipe)) +intel_color_load_luts (new_crtc_state); }/*
@@ -13904,16 +13875,14 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)* * TODO: Move this (and other cleanup) to an async worker eventually. */ -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { - new_intel_crtc_state =to_intel_crtc_state (new_crtc_state); - +for_each_new_intel_crtc_in_state (state, crtc, new_crtc_state, i) {if (dev_priv->display.optimize_watermarks) - dev_priv->display.optimize_watermarks (intel_state, - new_intel_crtc_state); + dev_priv->display.optimize_watermarks (state, + new_crtc_state); } -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -intel_post_plane_update (to_intel_crtc_state (old_crtc_state)); +for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +intel_post_plane_update (old_crtc_state);if (put_domains[i])modeset_put_power_domains (dev_priv, put_domains[i]);
@@ -13921,15 +13890,15 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)intel_modeset_verify_crtc (crtc, state, old_crtc_state, new_crtc_state); } -if (intel_state->modeset) -intel_verify_planes (intel_state); +if (state->modeset) +intel_verify_planes (state); -if (intel_state->modeset &&intel_can_enable_sagv (state)) +if (state->modeset &&intel_can_enable_sagv (state))intel_enable_sagv (dev_priv); -drm_atomic_helper_commit_hw_done (state); +drm_atomic_helper_commit_hw_done (&state->base); -if (intel_state->modeset) { +if (state->modeset) {/* As one of the primary mmio accessors, KMS has a high * likelihood of triggering bugs in unclaimed access. After we * finish modesetting, see if an error has been flagged, and if
@@ -13939,7 +13908,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)intel_uncore_arm_unclaimed_mmio_detection (&dev_priv->uncore);intel_display_power_put (dev_priv,POWER_DOMAIN_MODESET , wakeref); } -intel_runtime_pm_put (&dev_priv->runtime_pm, intel_state->wakeref); +intel_runtime_pm_put (&dev_priv->runtime_pm, state->wakeref);/* * Defer the cleanup of the old state to a separate worker to not
@@ -13949,14 +13918,14 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)* schedule point (cond_resched()) here anyway to keep latencies * down. */ -INIT_WORK (&state->commit_work, intel_atomic_cleanup_work); -queue_work (system_highpri_wq, &state->commit_work); +INIT_WORK (&state->base.commit_work, intel_atomic_cleanup_work); +queue_work (system_highpri_wq, &state->base.commit_work); }static void intel_atomic_commit_work (struct work_struct *work) { -struct drm_atomic_state *state = - container_of(work, struct drm_atomic_state, commit_work); +struct intel_atomic_state *state = + container_of(work, struct intel_atomic_state, base.commit_work);intel_atomic_commit_tail (state); }
@@ -14099,7 +14068,7 @@ static int intel_atomic_commit(struct drm_device *dev, }else {if (intel_state->modeset)flush_workqueue (dev_priv->modeset_wq); -intel_atomic_commit_tail (state); +intel_atomic_commit_tail (intel_state); }return 0 ;
@@ -16804,7 +16773,7 @@ intel_modeset_setup_hw_state(struct drm_device *dev,u64 put_domains; crtc_state =to_intel_crtc_state (crtc->base.state); - put_domains =modeset_get_crtc_power_domains (&crtc->base, crtc_state); + put_domains =modeset_get_crtc_power_domains (crtc, crtc_state);if (WARN_ON (put_domains))modeset_put_power_domains (dev_priv, put_domains); }
drivers/gpu/drm/i915/i915_drv.h +3 -3
@@ -306,10 +306,10 @@ struct drm_i915_display_funcs {int (*crtc_compute_clock)(struct intel_crtc *crtc,struct intel_crtc_state *crtc_state);void (*crtc_enable)(struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state); +struct intel_atomic_state *old_state);void (*crtc_disable)(struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state); -void (*update_crtcs)(struct drm_atomic_state *state); +struct intel_atomic_state *old_state); +void (*update_crtcs)(struct intel_atomic_state *state);void (*audio_codec_enable)(struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state,const struct drm_connector_state *conn_state);
drivers/gpu/drm/i915/intel_pm.c +5 -6
@@ -3736,11 +3736,10 @@ intel_disable_sagv(struct drm_i915_private *dev_priv)return 0 ; } -bool intel_can_enable_sagv (struct drm_atomic_state *state) +bool intel_can_enable_sagv (struct intel_atomic_state *state) { -struct drm_device *dev = state->dev; +struct drm_device *dev = state->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_atomic_state *intel_state =to_intel_atomic_state (state);struct intel_crtc *crtc;struct intel_plane *plane;struct intel_crtc_state *cstate;
@@ -3761,18 +3760,18 @@ bool intel_can_enable_sagv(struct drm_atomic_state *state)/* * If there are no active CRTCs, no additional checks need be performed */ -if (hweight32 (intel_state->active_crtcs) ==0 ) +if (hweight32 (state->active_crtcs) ==0 )return true;/* * SKL+ workaround: bspec recommends we disable SAGV when we have * more then one pipe enabled */ -if (hweight32 (intel_state->active_crtcs) >1 ) +if (hweight32 (state->active_crtcs) >1 )return false;/* Since we're now guaranteed to only have one active CRTC... */ - pipe =ffs (intel_state->active_crtcs) -1 ; + pipe =ffs (state->active_crtcs) -1 ; crtc =intel_get_crtc_for_pipe (dev_priv, pipe); cstate =to_intel_crtc_state (crtc->base.state);
drivers/gpu/drm/i915/intel_pm.h +2 -2
@@ -10,10 +10,10 @@#include "i915_reg.h" -struct drm_atomic_state ;struct drm_device ;struct drm_i915_private ;struct i915_request ; +struct intel_atomic_state ;struct intel_crtc ;struct intel_crtc_state ;struct intel_plane ;
@@ -52,7 +52,7 @@ void skl_pipe_wm_get_hw_state(struct intel_crtc *crtc, struct skl_pipe_wm *out);void g4x_wm_sanitize (struct drm_i915_private *dev_priv);void vlv_wm_sanitize (struct drm_i915_private *dev_priv); -bool intel_can_enable_sagv (struct drm_atomic_state *state); +bool intel_can_enable_sagv (struct intel_atomic_state *state);int intel_enable_sagv (struct drm_i915_private *dev_priv);int intel_disable_sagv (struct drm_i915_private *dev_priv); bool skl_wm_level_equals(const struct skl_wm_level *l1,
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/9] drm/i915: Convert most of atomic commit to take more intel state
Quoted 18 lines · Maarten Lankhorst
Instead of passing along
drm_crtc_stateanddrm_atomic_state, pass along moreintel_atomic_stateandintel_crtc_state. This will make the code more readable by not casting between drm state and intel state all the time.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 403 +++++++++---------- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/intel_pm.c | 11 +- drivers/gpu/drm/i915/intel_pm.h | 4 +- 4 files changed, 196 insertions(+), 228 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +0
-0
drivers/gpu/drm/i915/display/intel_display.c static void intel_crtc_disable_planes(struct intel_atomic_state *state, · line 6041
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_display.c +2
-2@@ -6036,19 +6036,19 @@ static void intel_crtc_disable_planes(struct intel_atomic_state *state,intel_frontbuffer_flip (dev_priv, fb_bits); } -static void intel_encoders_pre_pll_enable (struct drm_crtc *crtc, +static void intel_encoders_pre_pll_enable (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state)
Maybe s/old_state/state/ while at it?
Quoted 1,050 lines
drivers/gpu/drm/i915/display/intel_display.c +184
-215{struct drm_connector_state *conn_state;struct drm_connector *conn;int i; -for_each_new_connector_in_state (old_state, conn, conn_state, i) { +for_each_new_connector_in_state (&old_state->base, conn, conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (conn_state->best_encoder); -if (conn_state->crtc != crtc) +if (conn_state->crtc != &crtc->base)continue ;if (encoder->pre_pll_enable)@@ -6056,19 +6056,19 @@ static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc, } } -static void intel_encoders_pre_enable (struct drm_crtc *crtc, +static void intel_encoders_pre_enable (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *conn_state;struct drm_connector *conn;int i; -for_each_new_connector_in_state (old_state, conn, conn_state, i) { +for_each_new_connector_in_state (&old_state->base, conn, conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (conn_state->best_encoder); -if (conn_state->crtc != crtc) +if (conn_state->crtc != &crtc->base)continue ;if (encoder->pre_enable)@@ -6076,19 +6076,19 @@ static void intel_encoders_pre_enable(struct drm_crtc *crtc, } } -static void intel_encoders_enable (struct drm_crtc *crtc, +static void intel_encoders_enable (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *conn_state;struct drm_connector *conn;int i; -for_each_new_connector_in_state (old_state, conn, conn_state, i) { +for_each_new_connector_in_state (&old_state->base, conn, conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (conn_state->best_encoder); -if (conn_state->crtc != crtc) +if (conn_state->crtc != &crtc->base)continue ;if (encoder->enable)@@ -6097,19 +6097,19 @@ static void intel_encoders_enable(struct drm_crtc *crtc, } } -static void intel_encoders_disable (struct drm_crtc *crtc, +static void intel_encoders_disable (struct intel_crtc *crtc,struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *old_conn_state;struct drm_connector *conn;int i; -for_each_old_connector_in_state (old_state, conn, old_conn_state, i) { +for_each_old_connector_in_state (&old_state->base, conn, old_conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (old_conn_state->best_encoder); -if (old_conn_state->crtc != crtc) +if (old_conn_state->crtc != &crtc->base)continue ;intel_opregion_notify_encoder (encoder, false);@@ -6118,19 +6118,19 @@ static void intel_encoders_disable(struct drm_crtc *crtc, } } -static void intel_encoders_post_disable (struct drm_crtc *crtc, +static void intel_encoders_post_disable (struct intel_crtc *crtc,struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *old_conn_state;struct drm_connector *conn;int i; -for_each_old_connector_in_state (old_state, conn, old_conn_state, i) { +for_each_old_connector_in_state (&old_state->base, conn, old_conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (old_conn_state->best_encoder); -if (old_conn_state->crtc != crtc) +if (old_conn_state->crtc != &crtc->base)continue ;if (encoder->post_disable)@@ -6138,19 +6138,19 @@ static void intel_encoders_post_disable(struct drm_crtc *crtc, } } -static void intel_encoders_post_pll_disable (struct drm_crtc *crtc, +static void intel_encoders_post_pll_disable (struct intel_crtc *crtc,struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *old_conn_state;struct drm_connector *conn;int i; -for_each_old_connector_in_state (old_state, conn, old_conn_state, i) { +for_each_old_connector_in_state (&old_state->base, conn, old_conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (old_conn_state->best_encoder); -if (old_conn_state->crtc != crtc) +if (old_conn_state->crtc != &crtc->base)continue ;if (encoder->post_pll_disable)@@ -6158,19 +6158,19 @@ static void intel_encoders_post_pll_disable(struct drm_crtc *crtc, } } -static void intel_encoders_update_pipe (struct drm_crtc *crtc, +static void intel_encoders_update_pipe (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_connector_state *conn_state;struct drm_connector *conn;int i; -for_each_new_connector_in_state (old_state, conn, conn_state, i) { +for_each_new_connector_in_state (&old_state->base, conn, conn_state, i) {struct intel_encoder *encoder =to_intel_encoder (conn_state->best_encoder); -if (conn_state->crtc != crtc) +if (conn_state->crtc != &crtc->base)continue ;if (encoder->update_pipe)@@ -6187,15 +6187,13 @@ static void intel_disable_primary_plane(const struct intel_crtc_state *crtc_stat }static void ironlake_crtc_enable (struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state) +struct intel_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);int pipe = intel_crtc->pipe; -struct intel_atomic_state *old_intel_state = -to_intel_atomic_state (old_state);if (WARN_ON (intel_crtc->active))return ;@@ -6231,7 +6229,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config, intel_crtc->active = true; -intel_encoders_pre_enable (crtc, pipe_config, old_state); +intel_encoders_pre_enable (intel_crtc, pipe_config, old_state);if (pipe_config->has_pch_encoder) {/* Note: FDI PLL enabling _must_ be done before we enable the @@ -6255,16 +6253,16 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,intel_disable_primary_plane (pipe_config);if (dev_priv->display.initial_watermarks !=NULL ) - dev_priv->display.initial_watermarks (old_intel_state, pipe_config); + dev_priv->display.initial_watermarks (old_state, pipe_config);intel_enable_pipe (pipe_config);if (pipe_config->has_pch_encoder) -ironlake_pch_enable (old_intel_state, pipe_config); +ironlake_pch_enable (old_state, pipe_config);assert_vblank_disabled (crtc);intel_crtc_vblank_on (pipe_config); -intel_encoders_enable (crtc, pipe_config, old_state); +intel_encoders_enable (intel_crtc, pipe_config, old_state);if (HAS_PCH_CPT (dev_priv))cpt_verify_modeset (dev, intel_crtc->pipe);@@ -6317,26 +6315,24 @@ static void icl_pipe_mbus_enable(struct intel_crtc *crtc) }static void haswell_crtc_enable (struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_crtc *crtc = pipe_config->base.crtc;struct drm_i915_private *dev_priv =to_i915 (crtc->dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);int pipe = intel_crtc->pipe, hsw_workaround_pipe;enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; -struct intel_atomic_state *old_intel_state = -to_intel_atomic_state (old_state);bool psl_clkgate_wa;if (WARN_ON (intel_crtc->active))return ; -intel_encoders_pre_pll_enable (crtc, pipe_config, old_state); +intel_encoders_pre_pll_enable (intel_crtc, pipe_config, old_state);if (pipe_config->shared_dpll)intel_enable_shared_dpll (pipe_config); -intel_encoders_pre_enable (crtc, pipe_config, old_state); +intel_encoders_pre_enable (intel_crtc, pipe_config, old_state);if (intel_crtc_has_dp_encoder (pipe_config))intel_dp_set_m_n (pipe_config,M1_N1 );@@ -6394,7 +6390,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,intel_ddi_enable_transcoder_func (pipe_config);if (dev_priv->display.initial_watermarks !=NULL ) - dev_priv->display.initial_watermarks (old_intel_state, pipe_config); + dev_priv->display.initial_watermarks (old_state, pipe_config);if (INTEL_GEN (dev_priv) >=11 )icl_pipe_mbus_enable (intel_crtc);@@ -6404,7 +6400,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,intel_enable_pipe (pipe_config);if (pipe_config->has_pch_encoder) -lpt_pch_enable (old_intel_state, pipe_config); +lpt_pch_enable (old_state, pipe_config);if (intel_crtc_has_type (pipe_config,INTEL_OUTPUT_DP_MST ))intel_ddi_set_vc_payload_alloc (pipe_config, true);@@ -6412,7 +6408,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);intel_crtc_vblank_on (pipe_config); -intel_encoders_enable (crtc, pipe_config, old_state); +intel_encoders_enable (intel_crtc, pipe_config, old_state);if (psl_clkgate_wa) {intel_wait_for_vblank (dev_priv, pipe);@@ -6444,7 +6440,7 @@ static void ironlake_pfit_disable(const struct intel_crtc_state *old_crtc_state) }static void ironlake_crtc_disable (struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_crtc *crtc = old_crtc_state->base.crtc;struct drm_device *dev = crtc->dev;@@ -6460,7 +6456,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, false);intel_set_pch_fifo_underrun_reporting (dev_priv, pipe, false); -intel_encoders_disable (crtc, old_crtc_state, old_state); +intel_encoders_disable (intel_crtc, old_crtc_state, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);@@ -6472,7 +6468,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,if (old_crtc_state->has_pch_encoder)ironlake_fdi_disable (crtc); -intel_encoders_post_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_disable (intel_crtc, old_crtc_state, old_state);if (old_crtc_state->has_pch_encoder) {ironlake_disable_pch_transcoder (dev_priv, pipe);@@ -6503,14 +6499,14 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state, }static void haswell_crtc_disable (struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_crtc *crtc = old_crtc_state->base.crtc;struct drm_i915_private *dev_priv =to_i915 (crtc->dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; -intel_encoders_disable (crtc, old_crtc_state, old_state); +intel_encoders_disable (intel_crtc, old_crtc_state, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);@@ -6532,9 +6528,9 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,else ironlake_pfit_disable (old_crtc_state); -intel_encoders_post_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_disable (intel_crtc, old_crtc_state, old_state); -intel_encoders_post_pll_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_pll_disable (intel_crtc, old_crtc_state, old_state); }static void i9xx_pfit_enable (const struct intel_crtc_state *crtc_state)@@ -6633,14 +6629,13 @@ intel_aux_power_domain(struct intel_digital_port *dig_port) } } -static u64 get_crtc_power_domains (struct drm_crtc *crtc, +static u64 get_crtc_power_domains (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state) { -struct drm_device *dev = crtc->dev; +struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct drm_encoder *encoder; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -enum pipe pipe = intel_crtc->pipe; +enum pipe pipe = crtc->pipe;u64 mask;enum transcoder transcoder = crtc_state->cpu_transcoder;@@ -6669,16 +6664,15 @@ static u64 get_crtc_power_domains(struct drm_crtc *crtc, }static u64 -modeset_get_crtc_power_domains (struct drm_crtc *crtc, +modeset_get_crtc_power_domains (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc->dev); -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum intel_display_power_domain domain;u64 domains, new_domains, old_domains; - old_domains = intel_crtc->enabled_power_domains; - intel_crtc->enabled_power_domains = new_domains = + old_domains = crtc->enabled_power_domains; + crtc->enabled_power_domains = new_domains =get_crtc_power_domains (crtc, crtc_state); domains = new_domains & ~old_domains;@@ -6699,10 +6693,8 @@ static void modeset_put_power_domains(struct drm_i915_private *dev_priv, }static void valleyview_crtc_enable (struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) { -struct intel_atomic_state *old_intel_state = -to_intel_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);@@ -6729,7 +6721,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, pipe_config, old_state); +intel_encoders_pre_pll_enable (intel_crtc, pipe_config, old_state);if (IS_CHERRYVIEW (dev_priv)) {chv_prepare_pll (intel_crtc, pipe_config);@@ -6739,7 +6731,7 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,vlv_enable_pll (intel_crtc, pipe_config); } -intel_encoders_pre_enable (crtc, pipe_config, old_state); +intel_encoders_pre_enable (intel_crtc, pipe_config, old_state);i9xx_pfit_enable (pipe_config);@@ -6748,14 +6740,13 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,/* update DSPCNTR to configure gamma for pipe bottom color */ intel_disable_primary_plane (pipe_config); - dev_priv->display.initial_watermarks (old_intel_state, - pipe_config); + dev_priv->display.initial_watermarks (old_state, pipe_config);intel_enable_pipe (pipe_config);assert_vblank_disabled (crtc);intel_crtc_vblank_on (pipe_config); -intel_encoders_enable (crtc, pipe_config, old_state); +intel_encoders_enable (intel_crtc, pipe_config, old_state); }static void i9xx_set_pll_dividers (const struct intel_crtc_state *crtc_state)@@ -6768,10 +6759,8 @@ static void i9xx_set_pll_dividers(const struct intel_crtc_state *crtc_state) }static void i9xx_crtc_enable (struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) { -struct intel_atomic_state *old_intel_state = -to_intel_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);@@ -6796,7 +6785,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,if (!IS_GEN (dev_priv,2 ))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, true); -intel_encoders_pre_enable (crtc, pipe_config, old_state); +intel_encoders_pre_enable (intel_crtc, pipe_config, old_state);i9xx_enable_pll (intel_crtc, pipe_config);@@ -6808,7 +6797,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,intel_disable_primary_plane (pipe_config);if (dev_priv->display.initial_watermarks !=NULL ) - dev_priv->display.initial_watermarks (old_intel_state, + dev_priv->display.initial_watermarks (old_state, pipe_config);else intel_update_watermarks (intel_crtc);@@ -6817,7 +6806,7 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,assert_vblank_disabled (crtc);intel_crtc_vblank_on (pipe_config); -intel_encoders_enable (crtc, pipe_config, old_state); +intel_encoders_enable (intel_crtc, pipe_config, old_state); }static void i9xx_pfit_disable (const struct intel_crtc_state *old_crtc_state)@@ -6836,7 +6825,7 @@ static void i9xx_pfit_disable(const struct intel_crtc_state *old_crtc_state) }static void i9xx_crtc_disable (struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state) +struct intel_atomic_state *old_state) {struct drm_crtc *crtc = old_crtc_state->base.crtc;struct drm_device *dev = crtc->dev;@@ -6851,7 +6840,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,if (IS_GEN (dev_priv,2 ))intel_wait_for_vblank (dev_priv, pipe); -intel_encoders_disable (crtc, old_crtc_state, old_state); +intel_encoders_disable (intel_crtc, old_crtc_state, old_state);drm_crtc_vblank_off (crtc);assert_vblank_disabled (crtc);@@ -6860,7 +6849,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_pfit_disable (old_crtc_state); -intel_encoders_post_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_disable (intel_crtc, old_crtc_state, old_state);if (!intel_crtc_has_type (old_crtc_state,INTEL_OUTPUT_DSI )) {if (IS_CHERRYVIEW (dev_priv))@@ -6871,7 +6860,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,i9xx_disable_pll (old_crtc_state); } -intel_encoders_post_pll_disable (crtc, old_crtc_state, old_state); +intel_encoders_post_pll_disable (intel_crtc, old_crtc_state, old_state);if (!IS_GEN (dev_priv,2 ))intel_set_cpu_fifo_underrun_reporting (dev_priv, pipe, false);@@ -6925,7 +6914,7 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc,WARN_ON (IS_ERR (crtc_state) || ret); - dev_priv->display.crtc_disable (crtc_state, state); + dev_priv->display.crtc_disable (crtc_state,to_intel_atomic_state (state));drm_atomic_state_put (state);@@ -13083,19 +13072,18 @@ verify_shared_dpll_state(struct drm_device *dev, struct drm_crtc *crtc, }static void -intel_modeset_verify_crtc (struct drm_crtc *crtc, -struct drm_atomic_state *state, -struct drm_crtc_state *old_state, -struct drm_crtc_state *new_state) +intel_modeset_verify_crtc (struct intel_crtc *crtc, +struct intel_atomic_state *state, +struct intel_crtc_state *old_state, +struct intel_crtc_state *new_state) { -if (!needs_modeset (to_intel_crtc_state (new_state)) && - !to_intel_crtc_state (new_state)->update_pipe) +if (!needs_modeset (new_state) && !new_state->update_pipe)return ; -verify_wm_state (crtc, new_state); -verify_connector_state (crtc->dev, state, crtc); -verify_crtc_state (crtc, old_state, new_state); -verify_shared_dpll_state (crtc->dev, crtc, old_state, new_state); +verify_wm_state (&crtc->base, &new_state->base); +verify_connector_state (crtc->base.dev, &state->base, &crtc->base); +verify_crtc_state (&crtc->base, &old_state->base, &new_state->base); +verify_shared_dpll_state (crtc->base.dev, &crtc->base, &old_state->base, &new_state->base); } static void@@ -13110,10 +13098,10 @@ verify_disabled_dpll_state(struct drm_device *dev)static void intel_modeset_verify_disabled (struct drm_device *dev, -struct drm_atomic_state *state) +struct intel_atomic_state *state) { -verify_encoder_state (dev, state); -verify_connector_state (dev, state,NULL ); +verify_encoder_state (dev, &state->base); +verify_connector_state (dev, &state->base,NULL );verify_disabled_dpll_state (dev); }@@ -13570,57 +13558,54 @@ u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)return dev->driver->get_vblank_counter (dev, crtc->pipe); } -static void intel_update_crtc (struct drm_crtc *crtc, -struct drm_atomic_state *state, -struct drm_crtc_state *old_crtc_state, -struct drm_crtc_state *new_crtc_state) +static void intel_update_crtc (struct intel_crtc *crtc, +struct intel_atomic_state *state, +struct intel_crtc_state *old_crtc_state, +struct intel_crtc_state *new_crtc_state) { -struct drm_device *dev = crtc->dev; +struct drm_device *dev = state->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_crtc_state *pipe_config =to_intel_crtc_state (new_crtc_state); -bool modeset =needs_modeset (pipe_config); +bool modeset =needs_modeset (new_crtc_state);struct intel_plane_state *new_plane_state = -intel_atomic_get_new_plane_state (to_intel_atomic_state (state), -to_intel_plane (crtc->primary)); +intel_atomic_get_new_plane_state (state, +to_intel_plane (crtc->base.primary));if (modeset) { -update_scanline_offset (pipe_config); - dev_priv->display.crtc_enable (pipe_config, state); +update_scanline_offset (new_crtc_state); + dev_priv->display.crtc_enable (new_crtc_state, state);/* vblanks work again, re-enable pipe CRC. */ -intel_crtc_enable_pipe_crc (intel_crtc); +intel_crtc_enable_pipe_crc (crtc); }else { -intel_pre_plane_update (to_intel_crtc_state (old_crtc_state), - pipe_config); +intel_pre_plane_update (old_crtc_state, new_crtc_state); -if (pipe_config->update_pipe) -intel_encoders_update_pipe (crtc, pipe_config, state); +if (new_crtc_state->update_pipe) +intel_encoders_update_pipe (crtc, new_crtc_state, state); } -if (pipe_config->update_pipe && !pipe_config->enable_fbc) -intel_fbc_disable (intel_crtc); +if (new_crtc_state->update_pipe && !new_crtc_state->enable_fbc) +intel_fbc_disable (crtc);else if (new_plane_state) -intel_fbc_enable (intel_crtc, pipe_config, new_plane_state); +intel_fbc_enable (crtc, new_crtc_state, new_plane_state); -intel_begin_crtc_commit (to_intel_atomic_state (state), intel_crtc); +intel_begin_crtc_commit (state, crtc);if (INTEL_GEN (dev_priv) >=9 ) -skl_update_planes_on_crtc (to_intel_atomic_state (state), intel_crtc); +skl_update_planes_on_crtc (state, crtc);else -i9xx_update_planes_on_crtc (to_intel_atomic_state (state), intel_crtc); +i9xx_update_planes_on_crtc (state, crtc); -intel_finish_crtc_commit (to_intel_atomic_state (state), intel_crtc); +intel_finish_crtc_commit (state, crtc); } -static void intel_update_crtcs (struct drm_atomic_state *state) +static void intel_update_crtcs (struct intel_atomic_state *state) { -struct drm_crtc *crtc; -struct drm_crtc_state *old_crtc_state, *new_crtc_state; +struct intel_crtc *crtc; +struct intel_crtc_state *old_crtc_state, *new_crtc_state;int i; -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -if (!new_crtc_state->active) +for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +if (!new_crtc_state->base.active)continue ; intel_update_crtc(crtc, state, old_crtc_state,@@ -13628,26 +13613,23 @@ static void intel_update_crtcs(struct drm_atomic_state *state) } } -static void skl_update_crtcs (struct drm_atomic_state *state) +static void skl_update_crtcs (struct intel_atomic_state *state) { -struct drm_i915_private *dev_priv =to_i915 (state->dev); -struct intel_atomic_state *intel_state =to_intel_atomic_state (state); -struct drm_crtc *crtc; -struct intel_crtc *intel_crtc; -struct drm_crtc_state *old_crtc_state, *new_crtc_state; -struct intel_crtc_state *cstate; +struct drm_i915_private *dev_priv =to_i915 (state->base.dev); +struct intel_crtc *crtc; +struct intel_crtc_state *old_crtc_state, *new_crtc_state;unsigned int updated =0 ;bool progress;enum pipe pipe;int i;u8 hw_enabled_slices = dev_priv->wm.skl_hw.ddb.enabled_slices; -u8 required_slices = intel_state->wm_results.ddb.enabled_slices; +u8 required_slices = state->wm_results.ddb.enabled_slices;struct skl_ddb_entry entries[I915_MAX_PIPES ] = {}; -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) +for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i)/* ignore allocations for crtc's that have been turned off. */ -if (new_crtc_state->active) - entries[i] =to_intel_crtc_state (old_crtc_state)->wm.skl.ddb; +if (new_crtc_state->base.active) + entries[i] = old_crtc_state->wm.skl.ddb;/* If 2nd DBuf slice required, enable it here */ if (INTEL_GEN (dev_priv) >=11 && required_slices > hw_enabled_slices)@@ -13662,24 +13644,22 @@ static void skl_update_crtcs(struct drm_atomic_state *state) do { progress = false; - for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { + for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { bool vbl_wait = false; - unsigned int cmask = drm_crtc_mask(crtc); + unsigned int cmask = drm_crtc_mask(&crtc->base); - intel_crtc = to_intel_crtc(crtc); - cstate = to_intel_crtc_state(new_crtc_state); - pipe = intel_crtc->pipe; + pipe = crtc->pipe; - if (updated & cmask || !cstate->base.active) + if (updated & cmask || !new_crtc_state->base.active) continue; - if (skl_ddb_allocation_overlaps(&cstate->wm.skl.ddb, + if (skl_ddb_allocation_overlaps(&new_crtc_state->wm.skl.ddb, entries, INTEL_INFO(dev_priv)->num_pipes, i)) continue; updated |= cmask; - entries[i] = cstate->wm.skl.ddb; + entries[i] = new_crtc_state->wm.skl.ddb; /* * If this is an already active pipe, it's DDB changed,@@ -13687,10 +13667,10 @@ static void skl_update_crtcs(struct drm_atomic_state *state)* then we need to wait for a vblank to pass for the * new ddb allocation to take effect. */ -if (!skl_ddb_entry_equal (&cstate->wm.skl.ddb, - &to_intel_crtc_state (old_crtc_state)->wm.skl.ddb) && - !new_crtc_state->active_changed && - intel_state->wm_results.dirty_pipes != updated) +if (!skl_ddb_entry_equal (&new_crtc_state->wm.skl.ddb, + &old_crtc_state->wm.skl.ddb) && + !new_crtc_state->base.active_changed && + state->wm_results.dirty_pipes != updated) vbl_wait = true; intel_update_crtc(crtc, state, old_crtc_state,@@ -13763,57 +13743,50 @@ static void intel_atomic_cleanup_work(struct work_struct *work)intel_atomic_helper_free_state (i915); } -static void intel_atomic_commit_tail (struct drm_atomic_state *state) +static void intel_atomic_commit_tail (struct intel_atomic_state *state) { -struct drm_device *dev = state->dev; -struct intel_atomic_state *intel_state =to_intel_atomic_state (state); +struct drm_device *dev = state->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct drm_crtc_state *old_crtc_state, *new_crtc_state; -struct intel_crtc_state *new_intel_crtc_state, *old_intel_crtc_state; -struct drm_crtc *crtc; -struct intel_crtc *intel_crtc; +struct intel_crtc_state *new_crtc_state, *old_crtc_state; +struct intel_crtc *crtc;u64 put_domains[I915_MAX_PIPES ] = {};intel_wakeref_t wakeref =0 ;int i; -intel_atomic_commit_fence_wait (intel_state); +intel_atomic_commit_fence_wait (state); -drm_atomic_helper_wait_for_dependencies (state); +drm_atomic_helper_wait_for_dependencies (&state->base); -if (intel_state->modeset) +if (state->modeset) wakeref =intel_display_power_get (dev_priv,POWER_DOMAIN_MODESET ); -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { - old_intel_crtc_state =to_intel_crtc_state (old_crtc_state); - new_intel_crtc_state =to_intel_crtc_state (new_crtc_state); - intel_crtc =to_intel_crtc (crtc); - -if (needs_modeset (new_intel_crtc_state) || - new_intel_crtc_state->update_pipe) { +for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +if (needs_modeset (new_crtc_state) || + new_crtc_state->update_pipe) { - put_domains[intel_crtc->pipe] = + put_domains[crtc->pipe] =modeset_get_crtc_power_domains (crtc, - new_intel_crtc_state); + new_crtc_state); } -if (!needs_modeset (new_intel_crtc_state)) +if (!needs_modeset (new_crtc_state))continue ; -intel_pre_plane_update (old_intel_crtc_state, new_intel_crtc_state); +intel_pre_plane_update (old_crtc_state, new_crtc_state); -if (old_crtc_state->active) { -intel_crtc_disable_planes (intel_state, intel_crtc); +if (old_crtc_state->base.active) { +intel_crtc_disable_planes (state, crtc);/* * We need to disable pipe CRC before disabling the pipe, * or we race against vblank off. */ -intel_crtc_disable_pipe_crc (intel_crtc); +intel_crtc_disable_pipe_crc (crtc); - dev_priv->display.crtc_disable (old_intel_crtc_state, state); - intel_crtc->active = false; -intel_fbc_disable (intel_crtc); -intel_disable_shared_dpll (old_intel_crtc_state); + dev_priv->display.crtc_disable (old_crtc_state, state); + crtc->active = false; +intel_fbc_disable (crtc); +intel_disable_shared_dpll (old_crtc_state);/* * Underruns don't always raise @@ -13823,25 +13796,25 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)intel_check_pch_fifo_underruns (dev_priv);/* FIXME unify this for all platforms */ -if (!new_crtc_state->active && +if (!new_crtc_state->base.active && !HAS_GMCH (dev_priv) && dev_priv->display.initial_watermarks) - dev_priv->display.initial_watermarks (intel_state, - new_intel_crtc_state); + dev_priv->display.initial_watermarks (state, + new_crtc_state); } } -/* FIXME: Eventually get rid of our intel_crtc->config pointer */ -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) -to_intel_crtc (crtc)->config =to_intel_crtc_state (new_crtc_state); +/* FIXME: Eventually get rid of our crtc->config pointer */ +for_each_new_intel_crtc_in_state (state, crtc, new_crtc_state, i) + crtc->config = new_crtc_state; -if (intel_state->modeset) { -drm_atomic_helper_update_legacy_modeset_state (state->dev, state); +if (state->modeset) { +drm_atomic_helper_update_legacy_modeset_state (dev, &state->base);intel_set_cdclk_pre_plane_update (dev_priv, - &intel_state->cdclk.actual, + &state->cdclk.actual, &dev_priv->cdclk.actual, - intel_state->cdclk.pipe); + state->cdclk.pipe);/* * SKL workaround: bspec recommends we disable the SAGV when we @@ -13854,27 +13827,27 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state) }/* Complete the events for pipes that have now been disabled */ -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { -bool modeset =needs_modeset (to_intel_crtc_state (new_crtc_state)); +for_each_new_intel_crtc_in_state (state, crtc, new_crtc_state, i) { +bool modeset =needs_modeset (new_crtc_state);/* Complete events for now disable pipes here. */ -if (modeset && !new_crtc_state->active && new_crtc_state->event) { +if (modeset && !new_crtc_state->base.active && new_crtc_state->base.event) {spin_lock_irq (&dev->event_lock); -drm_crtc_send_vblank_event (crtc, new_crtc_state->event); +drm_crtc_send_vblank_event (&crtc->base, new_crtc_state->base.event);spin_unlock_irq (&dev->event_lock); - new_crtc_state->event =NULL ; + new_crtc_state->base.event =NULL ; } }/* Now enable the clocks, plane, pipe, and connectors that we set up. */ dev_priv->display.update_crtcs (state); -if (intel_state->modeset) +if (state->modeset)intel_set_cdclk_post_plane_update (dev_priv, - &intel_state->cdclk.actual, + &state->cdclk.actual, &dev_priv->cdclk.actual, - intel_state->cdclk.pipe); + state->cdclk.pipe);/* FIXME: We should call drm_atomic_helper_commit_hw_done() here * already, but still need the state for the delayed optimization. To @@ -13885,16 +13858,14 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)* - switch over to the vblank wait helper in the core after that since * we don't need out special handling any more. */ -drm_atomic_helper_wait_for_flip_done (dev, state); - -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { - new_intel_crtc_state =to_intel_crtc_state (new_crtc_state); +drm_atomic_helper_wait_for_flip_done (dev, &state->base); -if (new_crtc_state->active && - !needs_modeset (to_intel_crtc_state (new_crtc_state)) && - (new_intel_crtc_state->base.color_mgmt_changed || - new_intel_crtc_state->update_pipe)) -intel_color_load_luts (new_intel_crtc_state); +for_each_new_intel_crtc_in_state (state, crtc, new_crtc_state, i) { +if (new_crtc_state->base.active && + !needs_modeset (new_crtc_state) && + (new_crtc_state->base.color_mgmt_changed || + new_crtc_state->update_pipe)) +intel_color_load_luts (new_crtc_state); }/* @@ -13904,16 +13875,14 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)* * TODO: Move this (and other cleanup) to an async worker eventually. */ -for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { - new_intel_crtc_state =to_intel_crtc_state (new_crtc_state); - +for_each_new_intel_crtc_in_state (state, crtc, new_crtc_state, i) {if (dev_priv->display.optimize_watermarks) - dev_priv->display.optimize_watermarks (intel_state, - new_intel_crtc_state); + dev_priv->display.optimize_watermarks (state, + new_crtc_state); } -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { -intel_post_plane_update (to_intel_crtc_state (old_crtc_state)); +for_each_oldnew_intel_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +intel_post_plane_update (old_crtc_state);if (put_domains[i])modeset_put_power_domains (dev_priv, put_domains[i]);@@ -13921,15 +13890,15 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)intel_modeset_verify_crtc (crtc, state, old_crtc_state, new_crtc_state); } -if (intel_state->modeset) -intel_verify_planes (intel_state); +if (state->modeset) +intel_verify_planes (state); -if (intel_state->modeset &&intel_can_enable_sagv (state)) +if (state->modeset &&intel_can_enable_sagv (state))intel_enable_sagv (dev_priv); -drm_atomic_helper_commit_hw_done (state); +drm_atomic_helper_commit_hw_done (&state->base); -if (intel_state->modeset) { +if (state->modeset) {/* As one of the primary mmio accessors, KMS has a high * likelihood of triggering bugs in unclaimed access. After we * finish modesetting, see if an error has been flagged, and if @@ -13939,7 +13908,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)intel_uncore_arm_unclaimed_mmio_detection (&dev_priv->uncore);intel_display_power_put (dev_priv,POWER_DOMAIN_MODESET , wakeref); } -intel_runtime_pm_put (&dev_priv->runtime_pm, intel_state->wakeref); +intel_runtime_pm_put (&dev_priv->runtime_pm, state->wakeref);/* * Defer the cleanup of the old state to a separate worker to not @@ -13949,14 +13918,14 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)* schedule point (cond_resched()) here anyway to keep latencies * down. */ -INIT_WORK (&state->commit_work, intel_atomic_cleanup_work); -queue_work (system_highpri_wq, &state->commit_work); +INIT_WORK (&state->base.commit_work, intel_atomic_cleanup_work); +queue_work (system_highpri_wq, &state->base.commit_work); }static void intel_atomic_commit_work (struct work_struct *work) { -struct drm_atomic_state *state = - container_of(work, struct drm_atomic_state, commit_work); +struct intel_atomic_state *state = + container_of(work, struct intel_atomic_state, base.commit_work);intel_atomic_commit_tail (state); }@@ -14099,7 +14068,7 @@ static int intel_atomic_commit(struct drm_device *dev, }else {if (intel_state->modeset)flush_workqueue (dev_priv->modeset_wq); -intel_atomic_commit_tail (state); +intel_atomic_commit_tail (intel_state); }return 0 ;@@ -16804,7 +16773,7 @@ intel_modeset_setup_hw_state(struct drm_device *dev,u64 put_domains; crtc_state =to_intel_crtc_state (crtc->base.state); - put_domains =modeset_get_crtc_power_domains (&crtc->base, crtc_state); + put_domains =modeset_get_crtc_power_domains (crtc, crtc_state);if (WARN_ON (put_domains))modeset_put_power_domains (dev_priv, put_domains); }drivers/gpu/drm/i915/i915_drv.h +3
-3@@ -306,10 +306,10 @@ struct drm_i915_display_funcs {int (*crtc_compute_clock)(struct intel_crtc *crtc,struct intel_crtc_state *crtc_state);void (*crtc_enable)(struct intel_crtc_state *pipe_config, -struct drm_atomic_state *old_state); +struct intel_atomic_state *old_state);void (*crtc_disable)(struct intel_crtc_state *old_crtc_state, -struct drm_atomic_state *old_state); -void (*update_crtcs)(struct drm_atomic_state *state); +struct intel_atomic_state *old_state); +void (*update_crtcs)(struct intel_atomic_state *state);void (*audio_codec_enable)(struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state,const struct drm_connector_state *conn_state);drivers/gpu/drm/i915/intel_pm.c +5
-6@@ -3736,11 +3736,10 @@ intel_disable_sagv(struct drm_i915_private *dev_priv)return 0 ; } -bool intel_can_enable_sagv (struct drm_atomic_state *state) +bool intel_can_enable_sagv (struct intel_atomic_state *state) { -struct drm_device *dev = state->dev; +struct drm_device *dev = state->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_atomic_state *intel_state =to_intel_atomic_state (state);struct intel_crtc *crtc;struct intel_plane *plane;struct intel_crtc_state *cstate;@@ -3761,18 +3760,18 @@ bool intel_can_enable_sagv(struct drm_atomic_state *state)/* * If there are no active CRTCs, no additional checks need be performed */ -if (hweight32 (intel_state->active_crtcs) ==0 ) +if (hweight32 (state->active_crtcs) ==0 )return true;/* * SKL+ workaround: bspec recommends we disable SAGV when we have * more then one pipe enabled */ -if (hweight32 (intel_state->active_crtcs) >1 ) +if (hweight32 (state->active_crtcs) >1 )return false;/* Since we're now guaranteed to only have one active CRTC... */ - pipe =ffs (intel_state->active_crtcs) -1 ; + pipe =ffs (state->active_crtcs) -1 ; crtc =intel_get_crtc_for_pipe (dev_priv, pipe); cstate =to_intel_crtc_state (crtc->base.state);drivers/gpu/drm/i915/intel_pm.h +2
-2@@ -10,10 +10,10 @@#include "i915_reg.h" -struct drm_atomic_state ;struct drm_device ;struct drm_i915_private ;struct i915_request ; +struct intel_atomic_state ;struct intel_crtc ;struct intel_crtc_state ;struct intel_plane ;@@ -52,7 +52,7 @@ void skl_pipe_wm_get_hw_state(struct intel_crtc *crtc, struct skl_pipe_wm *out);void g4x_wm_sanitize (struct drm_i915_private *dev_priv);void vlv_wm_sanitize (struct drm_i915_private *dev_priv); -bool intel_can_enable_sagv (struct drm_atomic_state *state); +bool intel_can_enable_sagv (struct intel_atomic_state *state);int intel_enable_sagv (struct drm_i915_private *dev_priv);int intel_disable_sagv (struct drm_i915_private *dev_priv); bool skl_wm_level_equals(const struct skl_wm_level *l1,Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/9 drm/i915: Convert hw state verifier to take more intel state
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/display/intel_display.c | 154 +++++++++---------- 1 file changed, 74 insertions(+), 80 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +74 -80
@@ -6977,7 +6977,7 @@ void intel_encoder_destroy(struct drm_encoder *encoder)/* Cross check the actual hw state with our own modeset state tracking (and it's * internal consistency). */ -static void intel_connector_verify_state (struct drm_crtc_state *crtc_state, +static void intel_connector_verify_state (struct intel_crtc_state *crtc_state,struct drm_connector_state *conn_state) {struct intel_connector *connector =to_intel_connector (conn_state->connector);
@@ -6995,7 +6995,7 @@ static void intel_connector_verify_state(struct drm_crtc_state *crtc_state,if (!crtc_state)return ; -I915_STATE_WARN (!crtc_state->active, +I915_STATE_WARN (!crtc_state->base.active,"connector is active, but attached crtc isn't\n" );if (!encoder || encoder->type ==INTEL_OUTPUT_DP_MST )
@@ -7007,7 +7007,7 @@ static void intel_connector_verify_state(struct drm_crtc_state *crtc_state,I915_STATE_WARN (conn_state->crtc != encoder->base.crtc,"attached encoder crtc differs from connector crtc\n" ); }else { -I915_STATE_WARN (crtc_state && crtc_state->active, +I915_STATE_WARN (crtc_state && crtc_state->base.active,"attached crtc is active, but connector isn't\n" );I915_STATE_WARN (!crtc_state && conn_state->best_encoder,"best encoder set without crtc!\n" );
@@ -12695,10 +12695,10 @@ static void intel_pipe_config_sanity_check(struct drm_i915_private *dev_priv, } } -static void verify_wm_state (struct drm_crtc *crtc, -struct drm_crtc_state *new_state) +static void verify_wm_state (struct intel_crtc *crtc, +struct intel_crtc_state *new_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct skl_hw_state {struct skl_ddb_entry ddb_y[I915_MAX_PLANES ];struct skl_ddb_entry ddb_uv[I915_MAX_PLANES ];
@@ -12708,21 +12708,20 @@ static void verify_wm_state(struct drm_crtc *crtc,struct skl_ddb_allocation *sw_ddb;struct skl_pipe_wm *sw_wm;struct skl_ddb_entry *hw_ddb_entry, *sw_ddb_entry; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -const enum pipe pipe = intel_crtc->pipe; +const enum pipe pipe = crtc->pipe;int plane, level, max_level =ilk_wm_max_level (dev_priv); -if (INTEL_GEN (dev_priv) <9 || !new_state->active) +if (INTEL_GEN (dev_priv) <9 || !new_state->base.active)return ; hw =kzalloc (sizeof (*hw),GFP_KERNEL );if (!hw)return ; -skl_pipe_wm_get_hw_state (intel_crtc, &hw->wm); - sw_wm = &to_intel_crtc_state (new_state)->wm.skl.optimal; +skl_pipe_wm_get_hw_state (crtc, &hw->wm); + sw_wm = &new_state->wm.skl.optimal; -skl_pipe_ddb_get_hw_state (intel_crtc, hw->ddb_y, hw->ddb_uv); +skl_pipe_ddb_get_hw_state (crtc, hw->ddb_y, hw->ddb_uv);skl_ddb_get_hw_state (dev_priv, &hw->ddb); sw_ddb = &dev_priv->wm.skl_hw.ddb;
@@ -12770,7 +12769,7 @@ static void verify_wm_state(struct drm_crtc *crtc,/* DDB */ hw_ddb_entry = &hw->ddb_y[plane]; - sw_ddb_entry = &to_intel_crtc_state (new_state)->wm.skl.plane_ddb_y[plane]; + sw_ddb_entry = &new_state->wm.skl.plane_ddb_y[plane];if (!skl_ddb_entry_equal (hw_ddb_entry, sw_ddb_entry)) { DRM_ERROR("mismatch in DDB state pipe %c plane %d (expected (%u,%u), found (%u,%u))\n",
@@ -12822,7 +12821,7 @@ static void verify_wm_state(struct drm_crtc *crtc,/* DDB */ hw_ddb_entry = &hw->ddb_y[PLANE_CURSOR ]; - sw_ddb_entry = &to_intel_crtc_state (new_state)->wm.skl.plane_ddb_y[PLANE_CURSOR ]; + sw_ddb_entry = &new_state->wm.skl.plane_ddb_y[PLANE_CURSOR ];if (!skl_ddb_entry_equal (hw_ddb_entry, sw_ddb_entry)) { DRM_ERROR("mismatch in DDB state pipe %c cursor (expected (%u,%u), found (%u,%u))\n",
@@ -12836,23 +12835,22 @@ static void verify_wm_state(struct drm_crtc *crtc, }static void -verify_connector_state (struct drm_device *dev, -struct drm_atomic_state *state, -struct drm_crtc *crtc) +verify_connector_state (struct intel_atomic_state *state, +struct intel_crtc *crtc) {struct drm_connector *connector;struct drm_connector_state *new_conn_state;int i; -for_each_new_connector_in_state (state, connector, new_conn_state, i) { +for_each_new_connector_in_state (&state->base, connector, new_conn_state, i) {struct drm_encoder *encoder = connector->encoder; -struct drm_crtc_state *crtc_state =NULL ; +struct intel_crtc_state *crtc_state =NULL ; -if (new_conn_state->crtc != crtc) +if (new_conn_state->crtc != &crtc->base)continue ;if (crtc) - crtc_state =drm_atomic_get_new_crtc_state (state, new_conn_state->crtc); + crtc_state =intel_atomic_get_new_crtc_state (state, crtc);intel_connector_verify_state (crtc_state, new_conn_state);
@@ -12862,14 +12860,14 @@ verify_connector_state(struct drm_device *dev, }static void -verify_encoder_state (struct drm_device *dev,struct drm_atomic_state *state) +verify_encoder_state (struct drm_i915_private *dev_priv,struct intel_atomic_state *state) {struct intel_encoder *encoder;struct drm_connector *connector;struct drm_connector_state *old_conn_state, *new_conn_state;int i; -for_each_intel_encoder (dev, encoder) { +for_each_intel_encoder (&dev_priv->drm, encoder) {bool enabled = false, found = false;enum pipe pipe;
@@ -12877,7 +12875,7 @@ verify_encoder_state(struct drm_device *dev, struct drm_atomic_state *state) encoder->base.base.id, encoder->base.name); -for_each_oldnew_connector_in_state (state, connector, old_conn_state, +for_each_oldnew_connector_in_state (&state->base, connector, old_conn_state, new_conn_state, i) {if (old_conn_state->best_encoder == &encoder->base) found = true;
@@ -12911,50 +12909,49 @@ verify_encoder_state(struct drm_device *dev, struct drm_atomic_state *state) }static void -verify_crtc_state (struct drm_crtc *crtc, -struct drm_crtc_state *old_crtc_state, -struct drm_crtc_state *new_crtc_state) +verify_crtc_state (struct intel_crtc *crtc, +struct intel_crtc_state *old_crtc_state, +struct intel_crtc_state *new_crtc_state) { -struct drm_device *dev = crtc->dev; +struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_encoder *encoder; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_crtc_state *pipe_config, *sw_config; +struct intel_crtc_state *pipe_config;struct drm_atomic_state *old_state;bool active; - old_state = old_crtc_state->state; -__drm_atomic_helper_crtc_destroy_state (old_crtc_state); - pipe_config =to_intel_crtc_state (old_crtc_state); + old_state = old_crtc_state->base.state; +__drm_atomic_helper_crtc_destroy_state (&old_crtc_state->base); + pipe_config = old_crtc_state;memset (pipe_config,0 ,sizeof (*pipe_config)); - pipe_config->base.crtc = crtc; + pipe_config->base.crtc = &crtc->base; pipe_config->base.state = old_state; -DRM_DEBUG_KMS ("[CRTC:%d:%s]\n" , crtc->base.id, crtc->name); +DRM_DEBUG_KMS ("[CRTC:%d:%s]\n" , crtc->base.base.id, crtc->base.name); - active = dev_priv->display.get_pipe_config (intel_crtc, pipe_config); + active = dev_priv->display.get_pipe_config (crtc, pipe_config);/* we keep both pipes enabled on 830 */ if (IS_I830 (dev_priv)) - active = new_crtc_state->active; + active = new_crtc_state->base.active; -I915_STATE_WARN (new_crtc_state->active != active, +I915_STATE_WARN (new_crtc_state->base.active != active,"crtc active state doesn't match with hw state " -"(expected %i, found %i)\n" , new_crtc_state->active, active); +"(expected %i, found %i)\n" , new_crtc_state->base.active, active); -I915_STATE_WARN (intel_crtc->active != new_crtc_state->active, +I915_STATE_WARN (crtc->active != new_crtc_state->base.active,"transitional active state does not match atomic hw state " -"(expected %i, found %i)\n" , new_crtc_state->active, intel_crtc->active); +"(expected %i, found %i)\n" , new_crtc_state->base.active, crtc->active); -for_each_encoder_on_crtc (dev, crtc, encoder) { +for_each_encoder_on_crtc (dev, &crtc->base, encoder) {enum pipe pipe; active = encoder->get_hw_state (encoder, &pipe); -I915_STATE_WARN (active != new_crtc_state->active, +I915_STATE_WARN (active != new_crtc_state->base.active,"[ENCODER:%i] active %i with crtc active %i\n" , - encoder->base.base.id, active, new_crtc_state->active); + encoder->base.base.id, active, new_crtc_state->base.active); -I915_STATE_WARN (active && intel_crtc->pipe != pipe, +I915_STATE_WARN (active && crtc->pipe != pipe,"Encoder connected to wrong pipe %c\n" ,pipe_name (pipe));
@@ -12964,16 +12961,16 @@ verify_crtc_state(struct drm_crtc *crtc,intel_crtc_compute_pixel_rate (pipe_config); -if (!new_crtc_state->active) +if (!new_crtc_state->base.active)return ;intel_pipe_config_sanity_check (dev_priv, pipe_config); - sw_config =to_intel_crtc_state (new_crtc_state); -if (!intel_pipe_config_compare (sw_config, pipe_config, false)) { +if (!intel_pipe_config_compare (new_crtc_state, + pipe_config, false)) {I915_STATE_WARN (1 ,"pipe state doesn't match!\n" );intel_dump_pipe_config (pipe_config,NULL ,"[hw state]" ); -intel_dump_pipe_config (sw_config,NULL ,"[sw state]" ); +intel_dump_pipe_config (new_crtc_state,NULL ,"[sw state]" ); } }
@@ -12993,8 +12990,8 @@ intel_verify_planes(struct intel_atomic_state *state)static void verify_single_dpll_state (struct drm_i915_private *dev_priv,struct intel_shared_dpll *pll, -struct drm_crtc *crtc, -struct drm_crtc_state *new_state) +struct intel_crtc *crtc, +struct intel_crtc_state *new_state) {struct intel_dpll_hw_state dpll_hw_state;unsigned int crtc_mask;
@@ -13024,16 +13021,16 @@ verify_single_dpll_state(struct drm_i915_private *dev_priv,return ; } - crtc_mask =drm_crtc_mask (crtc); + crtc_mask =drm_crtc_mask (&crtc->base); -if (new_state->active) +if (new_state->base.active)I915_STATE_WARN (!(pll->active_mask & crtc_mask),"pll active mismatch (expected pipe %c in active mask 0x%02x)\n" , -pipe_name (drm_crtc_index (crtc)), pll->active_mask); +pipe_name (drm_crtc_index (&crtc->base)), pll->active_mask);else I915_STATE_WARN (pll->active_mask & crtc_mask,"pll active mismatch (didn't expect pipe %c in active mask 0x%02x)\n" , -pipe_name (drm_crtc_index (crtc)), pll->active_mask); +pipe_name (drm_crtc_index (&crtc->base)), pll->active_mask); I915_STATE_WARN(!(pll->state.crtc_mask & crtc_mask), "pll enabled crtcs mismatch (expected 0x%x in 0x%02x)\n",
@@ -13046,28 +13043,26 @@ verify_single_dpll_state(struct drm_i915_private *dev_priv, }static void -verify_shared_dpll_state (struct drm_device *dev,struct drm_crtc *crtc, -struct drm_crtc_state *old_crtc_state, -struct drm_crtc_state *new_crtc_state) +verify_shared_dpll_state (struct intel_crtc *crtc, +struct intel_crtc_state *old_crtc_state, +struct intel_crtc_state *new_crtc_state) { -struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc_state *old_state =to_intel_crtc_state (old_crtc_state); -struct intel_crtc_state *new_state =to_intel_crtc_state (new_crtc_state); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -if (new_state->shared_dpll) -verify_single_dpll_state (dev_priv, new_state->shared_dpll, crtc, new_crtc_state); +if (new_crtc_state->shared_dpll) +verify_single_dpll_state (dev_priv, new_crtc_state->shared_dpll, crtc, new_crtc_state); -if (old_state->shared_dpll && - old_state->shared_dpll != new_state->shared_dpll) { -unsigned int crtc_mask =drm_crtc_mask (crtc); -struct intel_shared_dpll *pll = old_state->shared_dpll; +if (old_crtc_state->shared_dpll && + old_crtc_state->shared_dpll != new_crtc_state->shared_dpll) { +unsigned int crtc_mask =drm_crtc_mask (&crtc->base); +struct intel_shared_dpll *pll = old_crtc_state->shared_dpll;I915_STATE_WARN (pll->active_mask & crtc_mask,"pll active mismatch (didn't expect pipe %c in active mask)\n" , -pipe_name (drm_crtc_index (crtc))); +pipe_name (drm_crtc_index (&crtc->base)));I915_STATE_WARN (pll->state.crtc_mask & crtc_mask,"pll enabled crtcs mismatch (found %x in enabled mask)\n" , -pipe_name (drm_crtc_index (crtc))); +pipe_name (drm_crtc_index (&crtc->base))); } }
@@ -13080,16 +13075,15 @@ intel_modeset_verify_crtc(struct intel_crtc *crtc,if (!needs_modeset (new_state) && !new_state->update_pipe)return ; -verify_wm_state (&crtc->base, &new_state->base); -verify_connector_state (crtc->base.dev, &state->base, &crtc->base); -verify_crtc_state (&crtc->base, &old_state->base, &new_state->base); -verify_shared_dpll_state (crtc->base.dev, &crtc->base, &old_state->base, &new_state->base); +verify_wm_state (crtc, new_state); +verify_connector_state (state, crtc); +verify_crtc_state (crtc, old_state, new_state); +verify_shared_dpll_state (crtc, old_state, new_state); }static void -verify_disabled_dpll_state (struct drm_device *dev) +verify_disabled_dpll_state (struct drm_i915_private *dev_priv) { -struct drm_i915_private *dev_priv =to_i915 (dev);int i;for (i =0 ; i < dev_priv->num_shared_dpll; i++)
@@ -13097,12 +13091,12 @@ verify_disabled_dpll_state(struct drm_device *dev) }static void -intel_modeset_verify_disabled (struct drm_device *dev, +intel_modeset_verify_disabled (struct drm_i915_private *dev_priv,struct intel_atomic_state *state) { -verify_encoder_state (dev, &state->base); -verify_connector_state (dev, &state->base,NULL ); -verify_disabled_dpll_state (dev); +verify_encoder_state (dev_priv, state); +verify_connector_state (state,NULL ); +verify_disabled_dpll_state (dev_priv); }static void update_scanline_offset (const struct intel_crtc_state *crtc_state)
@@ -13823,7 +13817,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)if (!intel_can_enable_sagv (state))intel_disable_sagv (dev_priv); -intel_modeset_verify_disabled (dev, state); +intel_modeset_verify_disabled (dev_priv, state); }/* Complete the events for pipes that have now been disabled */
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/9] drm/i915: Convert hw state verifier to take more intel state
Quoted 37 lines · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 154 +++++++++---------- 1 file changed, 74 insertions(+), 80 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +3
-3@@ -6977,7 +6977,7 @@ void intel_encoder_destroy(struct drm_encoder *encoder)/* Cross check the actual hw state with our own modeset state tracking (and it's * internal consistency). */ -static void intel_connector_verify_state (struct drm_crtc_state *crtc_state, +static void intel_connector_verify_state (struct intel_crtc_state *crtc_state,struct drm_connector_state *conn_state) {struct intel_connector *connector =to_intel_connector (conn_state->connector);@@ -6995,7 +6995,7 @@ static void intel_connector_verify_state(struct drm_crtc_state *crtc_state,if (!crtc_state)return ; -I915_STATE_WARN (!crtc_state->active, +I915_STATE_WARN (!crtc_state->base.active,"connector is active, but attached crtc isn't\n" );if (!encoder || encoder->type ==INTEL_OUTPUT_DP_MST )@@ -7007,7 +7007,7 @@ static void intel_connector_verify_state(struct drm_crtc_state *crtc_state,I915_STATE_WARN (conn_state->crtc != encoder->base.crtc,"attached encoder crtc differs from connector crtc\n" ); }else { -I915_STATE_WARN (crtc_state && crtc_state->active, +I915_STATE_WARN (crtc_state && crtc_state->base.active,"attached crtc is active, but connector isn't\n" );I915_STATE_WARN (!crtc_state && conn_state->best_encoder,"best encoder set without crtc!\n" );
drivers/gpu/drm/i915/display/intel_display.c static void intel_pipe_config_sanity_check(struct drm_i915_private *dev_priv, · line 12699
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_display.c +2
-2@@ -12695,10 +12695,10 @@ static void intel_pipe_config_sanity_check(struct drm_i915_private *dev_priv, } } -static void verify_wm_state (struct drm_crtc *crtc, -struct drm_crtc_state *new_state) +static void verify_wm_state (struct intel_crtc *crtc, +struct intel_crtc_state *new_state)
s/new_state/new_crtc_state/ etc. might be nice to do as well.
Quoted 124 lines
drivers/gpu/drm/i915/display/intel_display.c +21
-25{ -struct drm_i915_private *dev_priv =to_i915 (crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct skl_hw_state {struct skl_ddb_entry ddb_y[I915_MAX_PLANES ];struct skl_ddb_entry ddb_uv[I915_MAX_PLANES ];@@ -12708,21 +12708,20 @@ static void verify_wm_state(struct drm_crtc *crtc,struct skl_ddb_allocation *sw_ddb;struct skl_pipe_wm *sw_wm;struct skl_ddb_entry *hw_ddb_entry, *sw_ddb_entry; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -const enum pipe pipe = intel_crtc->pipe; +const enum pipe pipe = crtc->pipe;int plane, level, max_level =ilk_wm_max_level (dev_priv); -if (INTEL_GEN (dev_priv) <9 || !new_state->active) +if (INTEL_GEN (dev_priv) <9 || !new_state->base.active)return ; hw =kzalloc (sizeof (*hw),GFP_KERNEL );if (!hw)return ; -skl_pipe_wm_get_hw_state (intel_crtc, &hw->wm); - sw_wm = &to_intel_crtc_state (new_state)->wm.skl.optimal; +skl_pipe_wm_get_hw_state (crtc, &hw->wm); + sw_wm = &new_state->wm.skl.optimal; -skl_pipe_ddb_get_hw_state (intel_crtc, hw->ddb_y, hw->ddb_uv); +skl_pipe_ddb_get_hw_state (crtc, hw->ddb_y, hw->ddb_uv);skl_ddb_get_hw_state (dev_priv, &hw->ddb); sw_ddb = &dev_priv->wm.skl_hw.ddb;@@ -12770,7 +12769,7 @@ static void verify_wm_state(struct drm_crtc *crtc,/* DDB */ hw_ddb_entry = &hw->ddb_y[plane]; - sw_ddb_entry = &to_intel_crtc_state (new_state)->wm.skl.plane_ddb_y[plane]; + sw_ddb_entry = &new_state->wm.skl.plane_ddb_y[plane];if (!skl_ddb_entry_equal (hw_ddb_entry, sw_ddb_entry)) { DRM_ERROR("mismatch in DDB state pipe %c plane %d (expected (%u,%u), found (%u,%u))\n",@@ -12822,7 +12821,7 @@ static void verify_wm_state(struct drm_crtc *crtc,/* DDB */ hw_ddb_entry = &hw->ddb_y[PLANE_CURSOR ]; - sw_ddb_entry = &to_intel_crtc_state (new_state)->wm.skl.plane_ddb_y[PLANE_CURSOR ]; + sw_ddb_entry = &new_state->wm.skl.plane_ddb_y[PLANE_CURSOR ];if (!skl_ddb_entry_equal (hw_ddb_entry, sw_ddb_entry)) { DRM_ERROR("mismatch in DDB state pipe %c cursor (expected (%u,%u), found (%u,%u))\n",@@ -12836,23 +12835,22 @@ static void verify_wm_state(struct drm_crtc *crtc, }static void -verify_connector_state (struct drm_device *dev, -struct drm_atomic_state *state, -struct drm_crtc *crtc) +verify_connector_state (struct intel_atomic_state *state, +struct intel_crtc *crtc) {struct drm_connector *connector;struct drm_connector_state *new_conn_state;int i; -for_each_new_connector_in_state (state, connector, new_conn_state, i) { +for_each_new_connector_in_state (&state->base, connector, new_conn_state, i) {struct drm_encoder *encoder = connector->encoder; -struct drm_crtc_state *crtc_state =NULL ; +struct intel_crtc_state *crtc_state =NULL ; -if (new_conn_state->crtc != crtc) +if (new_conn_state->crtc != &crtc->base)continue ;if (crtc) - crtc_state =drm_atomic_get_new_crtc_state (state, new_conn_state->crtc); + crtc_state =intel_atomic_get_new_crtc_state (state, crtc);intel_connector_verify_state (crtc_state, new_conn_state);@@ -12862,14 +12860,14 @@ verify_connector_state(struct drm_device *dev, }static void -verify_encoder_state (struct drm_device *dev,struct drm_atomic_state *state) +verify_encoder_state (struct drm_i915_private *dev_priv,struct intel_atomic_state *state) {struct intel_encoder *encoder;struct drm_connector *connector;struct drm_connector_state *old_conn_state, *new_conn_state;int i; -for_each_intel_encoder (dev, encoder) { +for_each_intel_encoder (&dev_priv->drm, encoder) {bool enabled = false, found = false;enum pipe pipe;@@ -12877,7 +12875,7 @@ verify_encoder_state(struct drm_device *dev, struct drm_atomic_state *state) encoder->base.base.id, encoder->base.name); -for_each_oldnew_connector_in_state (state, connector, old_conn_state, +for_each_oldnew_connector_in_state (&state->base, connector, old_conn_state, new_conn_state, i) {if (old_conn_state->best_encoder == &encoder->base) found = true;@@ -12911,50 +12909,49 @@ verify_encoder_state(struct drm_device *dev, struct drm_atomic_state *state) }static void -verify_crtc_state (struct drm_crtc *crtc, -struct drm_crtc_state *old_crtc_state, -struct drm_crtc_state *new_crtc_state) +verify_crtc_state (struct intel_crtc *crtc, +struct intel_crtc_state *old_crtc_state, +struct intel_crtc_state *new_crtc_state) { -struct drm_device *dev = crtc->dev; +struct drm_device *dev = crtc->base.dev;struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_encoder *encoder; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_crtc_state *pipe_config, *sw_config;
drivers/gpu/drm/i915/display/intel_display.c verify_encoder_state(struct drm_device *dev, struct drm_atomic_state *state) · line 12925
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +4
-3+struct intel_crtc_state *pipe_config;struct drm_atomic_state *old_state;bool active; - old_state = old_crtc_state->state; -__drm_atomic_helper_crtc_destroy_state (old_crtc_state); - pipe_config =to_intel_crtc_state (old_crtc_state); + old_state = old_crtc_state->base.state; +__drm_atomic_helper_crtc_destroy_state (&old_crtc_state->base); + pipe_config = old_crtc_state;
This alias is somewhat pointless, except we do overwrite the old state here so maybe it's a good thing to keep this for now. Eventually we might want to avoid this overwriting entirely. IIRC it ever caused problems for me when I was last poking at vblank workers. So when I get back to those I might have to do something about this.
Patch looks all right.
Quoted 193 lines
drivers/gpu/drm/i915/display/intel_display.c +44
-47memset (pipe_config,0 ,sizeof (*pipe_config)); - pipe_config->base.crtc = crtc; + pipe_config->base.crtc = &crtc->base; pipe_config->base.state = old_state; -DRM_DEBUG_KMS ("[CRTC:%d:%s]\n" , crtc->base.id, crtc->name); +DRM_DEBUG_KMS ("[CRTC:%d:%s]\n" , crtc->base.base.id, crtc->base.name); - active = dev_priv->display.get_pipe_config (intel_crtc, pipe_config); + active = dev_priv->display.get_pipe_config (crtc, pipe_config);/* we keep both pipes enabled on 830 */ if (IS_I830 (dev_priv)) - active = new_crtc_state->active; + active = new_crtc_state->base.active; -I915_STATE_WARN (new_crtc_state->active != active, +I915_STATE_WARN (new_crtc_state->base.active != active,"crtc active state doesn't match with hw state " -"(expected %i, found %i)\n" , new_crtc_state->active, active); +"(expected %i, found %i)\n" , new_crtc_state->base.active, active); -I915_STATE_WARN (intel_crtc->active != new_crtc_state->active, +I915_STATE_WARN (crtc->active != new_crtc_state->base.active,"transitional active state does not match atomic hw state " -"(expected %i, found %i)\n" , new_crtc_state->active, intel_crtc->active); +"(expected %i, found %i)\n" , new_crtc_state->base.active, crtc->active); -for_each_encoder_on_crtc (dev, crtc, encoder) { +for_each_encoder_on_crtc (dev, &crtc->base, encoder) {enum pipe pipe; active = encoder->get_hw_state (encoder, &pipe); -I915_STATE_WARN (active != new_crtc_state->active, +I915_STATE_WARN (active != new_crtc_state->base.active,"[ENCODER:%i] active %i with crtc active %i\n" , - encoder->base.base.id, active, new_crtc_state->active); + encoder->base.base.id, active, new_crtc_state->base.active); -I915_STATE_WARN (active && intel_crtc->pipe != pipe, +I915_STATE_WARN (active && crtc->pipe != pipe,"Encoder connected to wrong pipe %c\n" ,pipe_name (pipe));@@ -12964,16 +12961,16 @@ verify_crtc_state(struct drm_crtc *crtc,intel_crtc_compute_pixel_rate (pipe_config); -if (!new_crtc_state->active) +if (!new_crtc_state->base.active)return ;intel_pipe_config_sanity_check (dev_priv, pipe_config); - sw_config =to_intel_crtc_state (new_crtc_state); -if (!intel_pipe_config_compare (sw_config, pipe_config, false)) { +if (!intel_pipe_config_compare (new_crtc_state, + pipe_config, false)) {I915_STATE_WARN (1 ,"pipe state doesn't match!\n" );intel_dump_pipe_config (pipe_config,NULL ,"[hw state]" ); -intel_dump_pipe_config (sw_config,NULL ,"[sw state]" ); +intel_dump_pipe_config (new_crtc_state,NULL ,"[sw state]" ); } }@@ -12993,8 +12990,8 @@ intel_verify_planes(struct intel_atomic_state *state)static void verify_single_dpll_state (struct drm_i915_private *dev_priv,struct intel_shared_dpll *pll, -struct drm_crtc *crtc, -struct drm_crtc_state *new_state) +struct intel_crtc *crtc, +struct intel_crtc_state *new_state) {struct intel_dpll_hw_state dpll_hw_state;unsigned int crtc_mask;@@ -13024,16 +13021,16 @@ verify_single_dpll_state(struct drm_i915_private *dev_priv,return ; } - crtc_mask =drm_crtc_mask (crtc); + crtc_mask =drm_crtc_mask (&crtc->base); -if (new_state->active) +if (new_state->base.active)I915_STATE_WARN (!(pll->active_mask & crtc_mask),"pll active mismatch (expected pipe %c in active mask 0x%02x)\n" , -pipe_name (drm_crtc_index (crtc)), pll->active_mask); +pipe_name (drm_crtc_index (&crtc->base)), pll->active_mask);else I915_STATE_WARN (pll->active_mask & crtc_mask,"pll active mismatch (didn't expect pipe %c in active mask 0x%02x)\n" , -pipe_name (drm_crtc_index (crtc)), pll->active_mask); +pipe_name (drm_crtc_index (&crtc->base)), pll->active_mask); I915_STATE_WARN(!(pll->state.crtc_mask & crtc_mask), "pll enabled crtcs mismatch (expected 0x%x in 0x%02x)\n",@@ -13046,28 +13043,26 @@ verify_single_dpll_state(struct drm_i915_private *dev_priv, }static void -verify_shared_dpll_state (struct drm_device *dev,struct drm_crtc *crtc, -struct drm_crtc_state *old_crtc_state, -struct drm_crtc_state *new_crtc_state) +verify_shared_dpll_state (struct intel_crtc *crtc, +struct intel_crtc_state *old_crtc_state, +struct intel_crtc_state *new_crtc_state) { -struct drm_i915_private *dev_priv =to_i915 (dev); -struct intel_crtc_state *old_state =to_intel_crtc_state (old_crtc_state); -struct intel_crtc_state *new_state =to_intel_crtc_state (new_crtc_state); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); -if (new_state->shared_dpll) -verify_single_dpll_state (dev_priv, new_state->shared_dpll, crtc, new_crtc_state); +if (new_crtc_state->shared_dpll) +verify_single_dpll_state (dev_priv, new_crtc_state->shared_dpll, crtc, new_crtc_state); -if (old_state->shared_dpll && - old_state->shared_dpll != new_state->shared_dpll) { -unsigned int crtc_mask =drm_crtc_mask (crtc); -struct intel_shared_dpll *pll = old_state->shared_dpll; +if (old_crtc_state->shared_dpll && + old_crtc_state->shared_dpll != new_crtc_state->shared_dpll) { +unsigned int crtc_mask =drm_crtc_mask (&crtc->base); +struct intel_shared_dpll *pll = old_crtc_state->shared_dpll;I915_STATE_WARN (pll->active_mask & crtc_mask,"pll active mismatch (didn't expect pipe %c in active mask)\n" , -pipe_name (drm_crtc_index (crtc))); +pipe_name (drm_crtc_index (&crtc->base)));I915_STATE_WARN (pll->state.crtc_mask & crtc_mask,"pll enabled crtcs mismatch (found %x in enabled mask)\n" , -pipe_name (drm_crtc_index (crtc))); +pipe_name (drm_crtc_index (&crtc->base))); } }@@ -13080,16 +13075,15 @@ intel_modeset_verify_crtc(struct intel_crtc *crtc,if (!needs_modeset (new_state) && !new_state->update_pipe)return ; -verify_wm_state (&crtc->base, &new_state->base); -verify_connector_state (crtc->base.dev, &state->base, &crtc->base); -verify_crtc_state (&crtc->base, &old_state->base, &new_state->base); -verify_shared_dpll_state (crtc->base.dev, &crtc->base, &old_state->base, &new_state->base); +verify_wm_state (crtc, new_state); +verify_connector_state (state, crtc); +verify_crtc_state (crtc, old_state, new_state); +verify_shared_dpll_state (crtc, old_state, new_state); }static void -verify_disabled_dpll_state (struct drm_device *dev) +verify_disabled_dpll_state (struct drm_i915_private *dev_priv) { -struct drm_i915_private *dev_priv =to_i915 (dev);int i;for (i =0 ; i < dev_priv->num_shared_dpll; i++)@@ -13097,12 +13091,12 @@ verify_disabled_dpll_state(struct drm_device *dev) }static void -intel_modeset_verify_disabled (struct drm_device *dev, +intel_modeset_verify_disabled (struct drm_i915_private *dev_priv,struct intel_atomic_state *state) { -verify_encoder_state (dev, &state->base); -verify_connector_state (dev, &state->base,NULL ); -verify_disabled_dpll_state (dev); +verify_encoder_state (dev_priv, state); +verify_connector_state (state,NULL ); +verify_disabled_dpll_state (dev_priv); }static void update_scanline_offset (const struct intel_crtc_state *crtc_state)@@ -13823,7 +13817,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)if (!intel_can_enable_sagv (state))intel_disable_sagv (dev_priv); -intel_modeset_verify_disabled (dev, state); +intel_modeset_verify_disabled (dev_priv, state); }/* Complete the events for pipes that have now been disabled */ Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/9 drm/i915: Use intel_crtc_state in sanitize_watermarks() too
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/display/intel_display.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +6 -8
@@ -15738,8 +15738,8 @@ static void sanitize_watermarks(struct drm_device *dev)struct drm_i915_private *dev_priv =to_i915 (dev);struct drm_atomic_state *state;struct intel_atomic_state *intel_state; -struct drm_crtc *crtc; -struct drm_crtc_state *cstate; +struct intel_crtc *crtc; +struct intel_crtc_state *cstate;struct drm_modeset_acquire_ctx ctx;int ret;int i;
@@ -15794,13 +15794,11 @@ static void sanitize_watermarks(struct drm_device *dev) }/* Write calculated watermark values back */ -for_each_new_crtc_in_state (state, crtc, cstate, i) { -struct intel_crtc_state *cs =to_intel_crtc_state (cstate); - - cs->wm.need_postvbl_update = true; - dev_priv->display.optimize_watermarks (intel_state, cs); +for_each_new_intel_crtc_in_state (intel_state, crtc, cstate, i) { + cstate->wm.need_postvbl_update = true; + dev_priv->display.optimize_watermarks (intel_state, cstate); -to_intel_crtc_state (crtc->state)->wm = cs->wm; +to_intel_crtc_state (crtc->base.state)->wm = cstate->wm; } put_state:
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/9] drm/i915: Use intel_crtc_state in sanitize_watermarks() too
Quoted 10 lines · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)drivers/gpu/drm/i915/display/intel_display.c +0
-0
drivers/gpu/drm/i915/display/intel_display.c static void sanitize_watermarks(struct drm_device *dev) · line 15742
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_display.c +2
-2@@ -15738,8 +15738,8 @@ static void sanitize_watermarks(struct drm_device *dev)struct drm_i915_private *dev_priv =to_i915 (dev);struct drm_atomic_state *state;struct intel_atomic_state *intel_state; -struct drm_crtc *crtc; -struct drm_crtc_state *cstate; +struct intel_crtc *crtc; +struct intel_crtc_state *cstate;
s/cstate/crtc_state/ might be good here too.
Quoted 28 lines
drivers/gpu/drm/i915/display/intel_display.c +4
-6struct drm_modeset_acquire_ctx ctx;int ret;int i;@@ -15794,13 +15794,11 @@ static void sanitize_watermarks(struct drm_device *dev) }/* Write calculated watermark values back */ -for_each_new_crtc_in_state (state, crtc, cstate, i) { -struct intel_crtc_state *cs =to_intel_crtc_state (cstate); - - cs->wm.need_postvbl_update = true; - dev_priv->display.optimize_watermarks (intel_state, cs); +for_each_new_intel_crtc_in_state (intel_state, crtc, cstate, i) { + cstate->wm.need_postvbl_update = true; + dev_priv->display.optimize_watermarks (intel_state, cstate); -to_intel_crtc_state (crtc->state)->wm = cs->wm; +to_intel_crtc_state (crtc->base.state)->wm = cstate->wm; } put_state:Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/9 drm/i915: Pass intel state to plane functions as well
In reply to Maarten Lankhorst--- .../gpu/drm/i915/display/intel_atomic_plane.c | 39 +++++++------ .../gpu/drm/i915/display/intel_atomic_plane.h | 5 +- drivers/gpu/drm/i915/display/intel_display.c | 58 +++++++++---------- 3 files changed, 49 insertions(+), 53 deletions(-)
drivers/gpu/drm/i915/display/intel_atomic_plane.c +21 -18
@@ -176,33 +176,36 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->data_rate[plane->id] =intel_plane_data_rate (new_crtc_state, new_plane_state); -return intel_plane_atomic_calc_changes (old_crtc_state, - &new_crtc_state->base, - old_plane_state, - &new_plane_state->base); +return intel_plane_atomic_calc_changes (old_crtc_state, new_crtc_state, + old_plane_state, new_plane_state); }static int intel_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *new_plane_state) { -struct drm_atomic_state *state = new_plane_state->state; -const struct drm_plane_state *old_plane_state = -drm_atomic_get_old_plane_state (state, plane); -struct drm_crtc *crtc = new_plane_state->crtc ?: old_plane_state->crtc; -const struct drm_crtc_state *old_crtc_state; -struct drm_crtc_state *new_crtc_state; - - new_plane_state->visible = false; +struct intel_atomic_state *state = +to_intel_atomic_state (new_plane_state->state); +const struct intel_plane_state *old_intel_plane_state = +intel_atomic_get_old_plane_state (state,to_intel_plane (plane)); +struct intel_plane_state *new_intel_plane_state = +to_intel_plane_state (new_plane_state); +struct drm_crtc *crtc = + new_intel_plane_state->base.crtc ?: old_intel_plane_state->base.crtc; +struct intel_crtc *intel_crtc = crtc ?to_intel_crtc (crtc) :NULL ; +const struct intel_crtc_state *old_crtc_state; +struct intel_crtc_state *new_crtc_state; + + new_intel_plane_state->base.visible = false;if (!crtc)return 0 ; - old_crtc_state =drm_atomic_get_old_crtc_state (state, crtc); - new_crtc_state =drm_atomic_get_new_crtc_state (state, crtc); + old_crtc_state =intel_atomic_get_old_crtc_state (state, intel_crtc); + new_crtc_state =intel_atomic_get_new_crtc_state (state, intel_crtc); -return intel_plane_atomic_check_with_state (to_intel_crtc_state (old_crtc_state), -to_intel_crtc_state (new_crtc_state), -to_intel_plane_state (old_plane_state), -to_intel_plane_state (new_plane_state)); +return intel_plane_atomic_check_with_state (old_crtc_state, + new_crtc_state, + old_intel_plane_state, + new_intel_plane_state); } static struct intel_plane *
drivers/gpu/drm/i915/display/intel_atomic_plane.h +2 -3
@@ -8,7 +8,6 @@#include <linux/types.h> -struct drm_crtc_state ;struct drm_plane ;struct drm_property ;struct intel_atomic_state ;
@@ -43,8 +42,8 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_const struct intel_plane_state *old_plane_state, struct intel_plane_state *intel_state);int intel_plane_atomic_calc_changes (const struct intel_crtc_state *old_crtc_state, -struct drm_crtc_state *crtc_state, +struct intel_crtc_state *crtc_state,const struct intel_plane_state *old_plane_state, -struct drm_plane_state *plane_state); +struct intel_plane_state *plane_state);#endif /* __INTEL_ATOMIC_PLANE_H__ */
drivers/gpu/drm/i915/display/intel_display.c +26 -32
125 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/9] drm/i915: Pass intel state to plane functions as well
Quoted 30 lines · Maarten Lankhorst
Signed-off-by Maarten Lankhorst <[email protected]>--- .../gpu/drm/i915/display/intel_atomic_plane.c | 39 +++++++------ .../gpu/drm/i915/display/intel_atomic_plane.h | 5 +- drivers/gpu/drm/i915/display/intel_display.c | 58 +++++++++---------- 3 files changed, 49 insertions(+), 53 deletions(-)drivers/gpu/drm/i915/display/intel_atomic_plane.c +2
-8@@ -176,33 +176,36 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ new_crtc_state->data_rate[plane->id] =intel_plane_data_rate (new_crtc_state, new_plane_state); -return intel_plane_atomic_calc_changes (old_crtc_state, - &new_crtc_state->base, - old_plane_state, - &new_plane_state->base); +return intel_plane_atomic_calc_changes (old_crtc_state, new_crtc_state, + old_plane_state, new_plane_state); }static int intel_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *new_plane_state) { -struct drm_atomic_state *state = new_plane_state->state; -const struct drm_plane_state *old_plane_state = -drm_atomic_get_old_plane_state (state, plane); -struct drm_crtc *crtc = new_plane_state->crtc ?: old_plane_state->crtc;
drivers/gpu/drm/i915/display/intel_atomic_plane.c int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ · line 191
Quoted 10 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c +6
-4-const struct drm_crtc_state *old_crtc_state; -struct drm_crtc_state *new_crtc_state; - - new_plane_state->visible = false; +struct intel_atomic_state *state = +to_intel_atomic_state (new_plane_state->state); +const struct intel_plane_state *old_intel_plane_state = +intel_atomic_get_old_plane_state (state,to_intel_plane (plane)); +struct intel_plane_state *new_intel_plane_state = +to_intel_plane_state (new_plane_state);
I think we should do the _new_plane_state trick for the function arguments and then use the non-underscore names for the intel types.
drivers/gpu/drm/i915/display/intel_atomic_plane.c int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ · line 194
Quoted 3 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c +3
-0+struct drm_crtc *crtc = + new_intel_plane_state->base.crtc ?: old_intel_plane_state->base.crtc; +struct intel_crtc *intel_crtc = crtc ?to_intel_crtc (crtc) :NULL ;
?: not needed. I also dislike the crtc vs. intel_crc thing. Maybe extract this mess into a small function that just returns the intel_crtc we want?
Quoted 187 lines
drivers/gpu/drm/i915/display/intel_atomic_plane.c +10
-6+const struct intel_crtc_state *old_crtc_state; +struct intel_crtc_state *new_crtc_state; + + new_intel_plane_state->base.visible = false;if (!crtc)return 0 ; - old_crtc_state =drm_atomic_get_old_crtc_state (state, crtc); - new_crtc_state =drm_atomic_get_new_crtc_state (state, crtc); + old_crtc_state =intel_atomic_get_old_crtc_state (state, intel_crtc); + new_crtc_state =intel_atomic_get_new_crtc_state (state, intel_crtc); -return intel_plane_atomic_check_with_state (to_intel_crtc_state (old_crtc_state), -to_intel_crtc_state (new_crtc_state), -to_intel_plane_state (old_plane_state), -to_intel_plane_state (new_plane_state)); +return intel_plane_atomic_check_with_state (old_crtc_state, + new_crtc_state, + old_intel_plane_state, + new_intel_plane_state); } static struct intel_plane *drivers/gpu/drm/i915/display/intel_atomic_plane.h +2
-3@@ -8,7 +8,6 @@#include <linux/types.h> -struct drm_crtc_state ;struct drm_plane ;struct drm_property ;struct intel_atomic_state ;@@ -43,8 +42,8 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_const struct intel_plane_state *old_plane_state, struct intel_plane_state *intel_state);int intel_plane_atomic_calc_changes (const struct intel_crtc_state *old_crtc_state, -struct drm_crtc_state *crtc_state, +struct intel_crtc_state *crtc_state,const struct intel_plane_state *old_plane_state, -struct drm_plane_state *plane_state); +struct intel_plane_state *plane_state);#endif /* __INTEL_ATOMIC_PLANE_H__ */ drivers/gpu/drm/i915/display/intel_display.c +26
-32@@ -11286,7 +11286,7 @@ static void intel_crtc_destroy(struct drm_crtc *crtc)* * Returns true or false. */ -static bool intel_wm_need_update (struct intel_plane_state *cur, +static bool intel_wm_need_update (const struct intel_plane_state *cur,struct intel_plane_state *new) {/* Update watermarks on tiling or size changes. */ @@ -11318,33 +11318,28 @@ static bool needs_scaling(const struct intel_plane_state *state) }int intel_plane_atomic_calc_changes (const struct intel_crtc_state *old_crtc_state, -struct drm_crtc_state *crtc_state, +struct intel_crtc_state *crtc_state,const struct intel_plane_state *old_plane_state, -struct drm_plane_state *plane_state) +struct intel_plane_state *plane_state) { -struct intel_crtc_state *pipe_config =to_intel_crtc_state (crtc_state); -struct drm_crtc *crtc = crtc_state->crtc; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_plane *plane =to_intel_plane (plane_state->plane); -struct drm_device *dev = crtc->dev; -struct drm_i915_private *dev_priv =to_i915 (dev); -bool mode_changed =needs_modeset (pipe_config); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_plane *plane =to_intel_plane (plane_state->base.plane); +struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev); +bool mode_changed =needs_modeset (crtc_state);bool was_crtc_enabled = old_crtc_state->base.active; -bool is_crtc_enabled = crtc_state->active; +bool is_crtc_enabled = crtc_state->base.active;bool turn_off, turn_on, visible, was_visible; -struct drm_framebuffer *fb = plane_state->fb; +struct drm_framebuffer *fb = plane_state->base.fb;int ret;if (INTEL_GEN (dev_priv) >=9 && plane->id !=PLANE_CURSOR ) { - ret =skl_update_scaler_plane ( -to_intel_crtc_state (crtc_state), -to_intel_plane_state (plane_state)); + ret =skl_update_scaler_plane (crtc_state, plane_state);if (ret)return ret; } was_visible = old_plane_state->base.visible; - visible = plane_state->visible; + visible = plane_state->base.visible;if (!was_crtc_enabled &&WARN_ON (was_visible)) was_visible = false;@@ -11360,22 +11355,22 @@ int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_stat* only combine the results from all planes in the current place? */ if (!is_crtc_enabled) { - plane_state->visible = visible = false; -to_intel_crtc_state (crtc_state)->active_planes &= ~BIT (plane->id); -to_intel_crtc_state (crtc_state)->data_rate[plane->id] =0 ; + plane_state->base.visible = visible = false; + crtc_state->active_planes &= ~BIT (plane->id); + crtc_state->data_rate[plane->id] =0 ; }if (!was_visible && !visible)return 0 ;if (fb != old_plane_state->base.fb) - pipe_config->fb_changed = true; + crtc_state->fb_changed = true; turn_off = was_visible && (!visible || mode_changed); turn_on = visible && (!was_visible || mode_changed);DRM_DEBUG_ATOMIC ("[CRTC:%d:%s] has [PLANE:%d:%s] with fb %i\n" , - intel_crtc->base.base.id, intel_crtc->base.name, + crtc->base.base.id, crtc->base.name, plane->base.base.id, plane->base.name, fb ? fb->base.id :-1 );@@ -11386,29 +11381,28 @@ int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_statif (turn_on) {if (INTEL_GEN (dev_priv) <5 && !IS_G4X (dev_priv)) - pipe_config->update_wm_pre = true; + crtc_state->update_wm_pre = true;/* must disable cxsr around plane enable/disable */ if (plane->id !=PLANE_CURSOR ) - pipe_config->disable_cxsr = true; + crtc_state->disable_cxsr = true; }else if (turn_off) {if (INTEL_GEN (dev_priv) <5 && !IS_G4X (dev_priv)) - pipe_config->update_wm_post = true; + crtc_state->update_wm_post = true;/* must disable cxsr around plane enable/disable */ if (plane->id !=PLANE_CURSOR ) - pipe_config->disable_cxsr = true; - }else if (intel_wm_need_update (to_intel_plane_state (plane->base.state), -to_intel_plane_state (plane_state))) { + crtc_state->disable_cxsr = true; + }else if (intel_wm_need_update (old_plane_state, plane_state)) {if (INTEL_GEN (dev_priv) <5 && !IS_G4X (dev_priv)) {/* FIXME bollocks */ - pipe_config->update_wm_pre = true; - pipe_config->update_wm_post = true; + crtc_state->update_wm_pre = true; + crtc_state->update_wm_post = true; } }if (visible || was_visible) - pipe_config->fb_bits |= plane->frontbuffer_bit; + crtc_state->fb_bits |= plane->frontbuffer_bit;/* * ILK/SNB DVSACNTR/Sprite Enable @@ -11447,8 +11441,8 @@ int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_stat (IS_GEN_RANGE (dev_priv,5 ,6 ) ||IS_IVYBRIDGE (dev_priv)) && (turn_on || (!needs_scaling (old_plane_state) && - needs_scaling(to_intel_plane_state(plane_state))))) - pipe_config->disable_lp_wm = true; + needs_scaling(plane_state)))) + crtc_state->disable_lp_wm = true;return 0 ; }Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/9 drm/i915: Use intel state as much as possible in wm code
In reply to Maarten LankhorstInstead of directly referencing drm_crtc_state, convert to intel_ctc_state and use the base struct. This is useful when we're making the split between uapi and hw state, and also makes the code slightly more readable.
--- drivers/gpu/drm/i915/intel_pm.c | 112 ++++++++++++++------------------ 1 file changed, 50 insertions(+), 62 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +50 -62
@@ -3857,8 +3857,8 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,struct drm_atomic_state *state = cstate->base.state;struct intel_atomic_state *intel_state =to_intel_atomic_state (state);struct drm_crtc *for_crtc = cstate->base.crtc; -const struct drm_crtc_state *crtc_state; -const struct drm_crtc *crtc; +const struct intel_crtc_state *crtc_state; +const struct intel_crtc *crtc;u32 pipe_width =0 , total_width =0 , width_before_pipe =0 ;enum pipe for_pipe =to_intel_crtc (for_crtc)->pipe;u16 ddb_size;
@@ -3901,16 +3901,16 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,* framebuffer, So instead of allocating DDB equally among pipes * distribute DDB based on resolution/width of the display. */ -for_each_new_crtc_in_state (state, crtc, crtc_state, i) { +for_each_new_intel_crtc_in_state (intel_state, crtc, crtc_state, i) {const struct drm_display_mode *adjusted_mode;int hdisplay, vdisplay;enum pipe pipe; -if (!crtc_state->enable) +if (!crtc_state->base.enable)continue ; - pipe =to_intel_crtc (crtc)->pipe; - adjusted_mode = &crtc_state->adjusted_mode; + pipe = crtc->pipe; + adjusted_mode = &crtc_state->base.adjusted_mode;drm_mode_get_hv_timing (adjusted_mode, &hdisplay, &vdisplay); total_width += hdisplay;
@@ -4139,11 +4139,9 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc, struct intel_crtc_state *cstate) {struct drm_i915_private *dev_priv =to_i915 (intel_crtc->base.dev); -struct drm_crtc_state *crtc_state = &cstate->base; -struct drm_atomic_state *state = crtc_state->state; +struct drm_atomic_state *state = cstate->base.state;struct drm_plane *plane; -const struct drm_plane_state *pstate; -struct intel_plane_state *intel_pstate; +const struct drm_plane_state *drm_pstate;int crtc_clock, dotclk;u32 pipe_max_pixel_rate;uint_fixed_16_16_t pipe_downscale;
@@ -4152,22 +4150,21 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,if (!cstate->base.enable)return 0 ; -drm_atomic_crtc_state_for_each_plane_state (plane, pstate, crtc_state) { +drm_atomic_crtc_state_for_each_plane_state (plane, drm_pstate, &cstate->base) {uint_fixed_16_16_t plane_downscale;uint_fixed_16_16_t fp_9_div_8 =div_fixed16 (9 ,8 );int bpp; +const struct intel_plane_state *pstate = +to_intel_plane_state (drm_pstate); -if (!intel_wm_plane_visible (cstate, -to_intel_plane_state (pstate))) +if (!intel_wm_plane_visible (cstate, pstate))continue ; -if (WARN_ON (!pstate->fb)) +if (WARN_ON (!pstate->base.fb))return -EINVAL ; - intel_pstate =to_intel_plane_state (pstate); - plane_downscale =skl_plane_downscale_amount (cstate, - intel_pstate); - bpp = pstate->fb->format->cpp[0 ] *8 ; + plane_downscale =skl_plane_downscale_amount (cstate, pstate); + bpp = pstate->base.fb->format->cpp[0 ] *8 ;if (bpp ==64 ) plane_downscale =mul_fixed16 (plane_downscale, fp_9_div_8);
@@ -4178,7 +4175,7 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc, pipe_downscale =mul_fixed16 (pipe_downscale, max_downscale); - crtc_clock = crtc_state->adjusted_mode.crtc_clock; + crtc_clock = cstate->base.adjusted_mode.crtc_clock; dotclk =to_intel_atomic_state (state)->cdclk.logical.cdclk;if (IS_GEMINILAKE (dev_priv) ||INTEL_GEN (dev_priv) >=10 )
@@ -4196,11 +4193,10 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,static u64 skl_plane_relative_data_rate (const struct intel_crtc_state *cstate, -const struct intel_plane_state *intel_pstate, +const struct intel_plane_state *pstate,const int plane) { -struct intel_plane *intel_plane = -to_intel_plane (intel_pstate->base.plane); +struct intel_plane *intel_plane =to_intel_plane (pstate->base.plane);u32 data_rate;u32 width =0 , height =0 ;struct drm_framebuffer *fb;
@@ -4208,10 +4204,10 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate,uint_fixed_16_16_t down_scale_amount;u64 rate; -if (!intel_pstate->base.visible) +if (!pstate->base.visible)return 0 ; - fb = intel_pstate->base.fb; + fb = pstate->base.fb; format = fb->format->format;if (intel_plane->id ==PLANE_CURSOR )
@@ -4224,8 +4220,8 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate,* the 90/270 degree plane rotation cases (to match the * GTT mapping), hence no need to account for rotation here. */ - width =drm_rect_width (&intel_pstate->base.src) >>16 ; - height =drm_rect_height (&intel_pstate->base.src) >>16 ; + width =drm_rect_width (&pstate->base.src) >>16 ; + height =drm_rect_height (&pstate->base.src) >>16 ;/* UV plane does 1/2 pixel sub-sampling */ if (plane ==1 &&is_planar_yuv_format (format)) {
@@ -4235,7 +4231,7 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate, data_rate = width * height; - down_scale_amount =skl_plane_downscale_amount (cstate, intel_pstate); + down_scale_amount =skl_plane_downscale_amount (cstate, pstate); rate =mul_round_up_u32_fixed16 (data_rate, down_scale_amount);
@@ -4244,35 +4240,32 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate, }static u64 -skl_get_total_relative_data_rate (struct intel_crtc_state *intel_cstate, +skl_get_total_relative_data_rate (struct intel_crtc_state *cstate,u64 *plane_data_rate,u64 *uv_plane_data_rate) { -struct drm_crtc_state *cstate = &intel_cstate->base; -struct drm_atomic_state *state = cstate->state; +struct drm_atomic_state *state = cstate->base.state;struct drm_plane *plane; -const struct drm_plane_state *pstate; +const struct drm_plane_state *drm_pstate;u64 total_data_rate =0 ;if (WARN_ON (!state))return 0 ;/* Calculate and cache data rate for each plane */ -drm_atomic_crtc_state_for_each_plane_state (plane, pstate, cstate) { +drm_atomic_crtc_state_for_each_plane_state (plane, drm_pstate, &cstate->base) {enum plane_id plane_id =to_intel_plane (plane)->id; +const struct intel_plane_state *pstate = +to_intel_plane_state (drm_pstate);u64 rate; -const struct intel_plane_state *intel_pstate = -to_intel_plane_state (pstate);/* packed/y */ - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,0 ); + rate =skl_plane_relative_data_rate (cstate, pstate,0 ); plane_data_rate[plane_id] = rate; total_data_rate += rate;/* uv-plane */ - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,1 ); + rate =skl_plane_relative_data_rate (cstate, pstate,1 ); uv_plane_data_rate[plane_id] = rate; total_data_rate += rate; }
@@ -4281,28 +4274,25 @@ skl_get_total_relative_data_rate(struct intel_crtc_state *intel_cstate, }static u64 -icl_get_total_relative_data_rate (struct intel_crtc_state *intel_cstate, +icl_get_total_relative_data_rate (struct intel_crtc_state *cstate,u64 *plane_data_rate) { -struct drm_crtc_state *cstate = &intel_cstate->base; -struct drm_atomic_state *state = cstate->state;struct drm_plane *plane; -const struct drm_plane_state *pstate; +const struct drm_plane_state *drm_pstate;u64 total_data_rate =0 ; -if (WARN_ON (!state)) +if (WARN_ON (!cstate->base.state))return 0 ;/* Calculate and cache data rate for each plane */ -drm_atomic_crtc_state_for_each_plane_state (plane, pstate, cstate) { -const struct intel_plane_state *intel_pstate = -to_intel_plane_state (pstate); +drm_atomic_crtc_state_for_each_plane_state (plane, drm_pstate, &cstate->base) { +const struct intel_plane_state *pstate = +to_intel_plane_state (drm_pstate);enum plane_id plane_id =to_intel_plane (plane)->id;u64 rate; -if (!intel_pstate->linked_plane) { - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,0 ); +if (!pstate->linked_plane) { + rate =skl_plane_relative_data_rate (cstate, pstate,0 ); plane_data_rate[plane_id] = rate; total_data_rate += rate; }else {
@@ -4315,18 +4305,16 @@ icl_get_total_relative_data_rate(struct intel_crtc_state *intel_cstate,* NULL if we try get_new_plane_state(), so we * always calculate from the master. */ -if (intel_pstate->slave) +if (pstate->slave)continue ;/* Y plane rate is calculated on the slave */ - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,0 ); - y_plane_id = intel_pstate->linked_plane->id; + rate =skl_plane_relative_data_rate (cstate, pstate,0 ); + y_plane_id = pstate->linked_plane->id; plane_data_rate[y_plane_id] = rate; total_data_rate += rate; - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,1 ); + rate =skl_plane_relative_data_rate (cstate, pstate,1 ); plane_data_rate[plane_id] = rate; total_data_rate += rate; }
@@ -5095,9 +5083,8 @@ static int skl_build_pipe_wm(struct intel_crtc_state *cstate) {struct drm_i915_private *dev_priv =to_i915 (cstate->base.crtc->dev);struct skl_pipe_wm *pipe_wm = &cstate->wm.skl.optimal; -struct drm_crtc_state *crtc_state = &cstate->base;struct drm_plane *plane; -const struct drm_plane_state *pstate; +const struct drm_plane_state *drm_pstate;int ret;/*
@@ -5106,14 +5093,15 @@ static int skl_build_pipe_wm(struct intel_crtc_state *cstate)*/ memset (pipe_wm->planes,0 ,sizeof (pipe_wm->planes)); -drm_atomic_crtc_state_for_each_plane_state (plane, pstate, crtc_state) { -const struct intel_plane_state *intel_pstate = -to_intel_plane_state (pstate); +drm_atomic_crtc_state_for_each_plane_state (plane, drm_pstate, + &cstate->base) { +const struct intel_plane_state *pstate = +to_intel_plane_state (drm_pstate);if (INTEL_GEN (dev_priv) >=11 ) - ret =icl_build_plane_wm (cstate, intel_pstate); + ret =icl_build_plane_wm (cstate, pstate);else - ret =skl_build_plane_wm (cstate, intel_pstate); + ret =skl_build_plane_wm (cstate, pstate);if (ret)return ret; }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 6/9] drm/i915: Use intel state as much as possible in wm code
Quoted 33 lines · Maarten Lankhorst
Instead of directly referencing
drm_crtc_state, convert tointel_ctc_stateand use the base struct. This is useful when we're making the split between uapi and hw state, and also makes the code slightly more readable.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 112 ++++++++++++++------------------ 1 file changed, 50 insertions(+), 62 deletions(-)drivers/gpu/drm/i915/intel_pm.c +3
-3@@ -3857,8 +3857,8 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,struct drm_atomic_state *state = cstate->base.state;struct intel_atomic_state *intel_state =to_intel_atomic_state (state);struct drm_crtc *for_crtc = cstate->base.crtc; -const struct drm_crtc_state *crtc_state; -const struct drm_crtc *crtc; +const struct intel_crtc_state *crtc_state; +const struct intel_crtc *crtc;u32 pipe_width =0 , total_width =0 , width_before_pipe =0 ;enum pipe for_pipe =to_intel_crtc (for_crtc)->pipe;u16 ddb_size;@@ -3901,16 +3901,16 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,* framebuffer, So instead of allocating DDB equally among pipes * distribute DDB based on resolution/width of the display. */ -for_each_new_crtc_in_state (state, crtc, crtc_state, i) { +for_each_new_intel_crtc_in_state (intel_state, crtc, crtc_state, i) {const struct drm_display_mode *adjusted_mode;int hdisplay, vdisplay;
drivers/gpu/drm/i915/intel_pm.c skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv, · line 3913
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +3
-3enum pipe pipe; -if (!crtc_state->enable) +if (!crtc_state->base.enable)continue ; - pipe =to_intel_crtc (crtc)->pipe; - adjusted_mode = &crtc_state->adjusted_mode; + pipe = crtc->pipe; + adjusted_mode = &crtc_state->base.adjusted_mode;
Those two could be done when declaring the variables.
Quoted 57 lines
drivers/gpu/drm/i915/intel_pm.c +10
-13drm_mode_get_hv_timing (adjusted_mode, &hdisplay, &vdisplay); total_width += hdisplay;@@ -4139,11 +4139,9 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc, struct intel_crtc_state *cstate) {struct drm_i915_private *dev_priv =to_i915 (intel_crtc->base.dev); -struct drm_crtc_state *crtc_state = &cstate->base; -struct drm_atomic_state *state = crtc_state->state; +struct drm_atomic_state *state = cstate->base.state;struct drm_plane *plane; -const struct drm_plane_state *pstate; -struct intel_plane_state *intel_pstate; +const struct drm_plane_state *drm_pstate;int crtc_clock, dotclk;u32 pipe_max_pixel_rate;uint_fixed_16_16_t pipe_downscale;@@ -4152,22 +4150,21 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,if (!cstate->base.enable)return 0 ; -drm_atomic_crtc_state_for_each_plane_state (plane, pstate, crtc_state) { +drm_atomic_crtc_state_for_each_plane_state (plane, drm_pstate, &cstate->base) {uint_fixed_16_16_t plane_downscale;uint_fixed_16_16_t fp_9_div_8 =div_fixed16 (9 ,8 );int bpp; +const struct intel_plane_state *pstate = +to_intel_plane_state (drm_pstate); -if (!intel_wm_plane_visible (cstate, -to_intel_plane_state (pstate))) +if (!intel_wm_plane_visible (cstate, pstate))continue ; -if (WARN_ON (!pstate->fb)) +if (WARN_ON (!pstate->base.fb))return -EINVAL ; - intel_pstate =to_intel_plane_state (pstate); - plane_downscale =skl_plane_downscale_amount (cstate, - intel_pstate); - bpp = pstate->fb->format->cpp[0 ] *8 ; + plane_downscale =skl_plane_downscale_amount (cstate, pstate); + bpp = pstate->base.fb->format->cpp[0 ] *8 ;if (bpp ==64 ) plane_downscale =mul_fixed16 (plane_downscale, fp_9_div_8);@@ -4178,7 +4175,7 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc, pipe_downscale =mul_fixed16 (pipe_downscale, max_downscale); - crtc_clock = crtc_state->adjusted_mode.crtc_clock; + crtc_clock = cstate->base.adjusted_mode.crtc_clock; dotclk =to_intel_atomic_state (state)->cdclk.logical.cdclk;if (IS_GEMINILAKE (dev_priv) ||INTEL_GEN (dev_priv) >=10 )
drivers/gpu/drm/i915/intel_pm.c int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc, · line 4197
Quoted 6 lines
drivers/gpu/drm/i915/intel_pm.c +1
-1@@ -4196,11 +4193,10 @@ int skl_check_pipe_max_pixel_rate(struct intel_crtc *intel_crtc,static u64 skl_plane_relative_data_rate (const struct intel_crtc_state *cstate, -const struct intel_plane_state *intel_pstate, +const struct intel_plane_state *pstate,const int plane)
Hmm. Didn't I rename that 'plane' to 'color_plane'? Maybe it was some other instance, or the patch never got in. Anyways I'd like to see that done and then we can use 'plane' for the intel_plane.
Quoted 42 lines
drivers/gpu/drm/i915/intel_pm.c +6
-7{ -struct intel_plane *intel_plane = -to_intel_plane (intel_pstate->base.plane); +struct intel_plane *intel_plane =to_intel_plane (pstate->base.plane);u32 data_rate;u32 width =0 , height =0 ;struct drm_framebuffer *fb;@@ -4208,10 +4204,10 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate,uint_fixed_16_16_t down_scale_amount;u64 rate; -if (!intel_pstate->base.visible) +if (!pstate->base.visible)return 0 ; - fb = intel_pstate->base.fb; + fb = pstate->base.fb; format = fb->format->format;if (intel_plane->id ==PLANE_CURSOR )@@ -4224,8 +4220,8 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate,* the 90/270 degree plane rotation cases (to match the * GTT mapping), hence no need to account for rotation here. */ - width =drm_rect_width (&intel_pstate->base.src) >>16 ; - height =drm_rect_height (&intel_pstate->base.src) >>16 ; + width =drm_rect_width (&pstate->base.src) >>16 ; + height =drm_rect_height (&pstate->base.src) >>16 ;/* UV plane does 1/2 pixel sub-sampling */ if (plane ==1 &&is_planar_yuv_format (format)) {@@ -4235,7 +4231,7 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate, data_rate = width * height; - down_scale_amount =skl_plane_downscale_amount (cstate, intel_pstate); + down_scale_amount =skl_plane_downscale_amount (cstate, pstate); rate =mul_round_up_u32_fixed16 (data_rate, down_scale_amount);@@ -4244,35 +4240,32 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate, }
drivers/gpu/drm/i915/intel_pm.c skl_plane_relative_data_rate(const struct intel_crtc_state *cstate, · line 4247
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +2
-3static u64 -skl_get_total_relative_data_rate (struct intel_crtc_state *intel_cstate, +skl_get_total_relative_data_rate (struct intel_crtc_state *cstate,u64 *plane_data_rate,u64 *uv_plane_data_rate) { -struct drm_crtc_state *cstate = &intel_cstate->base; -struct drm_atomic_state *state = cstate->state; +struct drm_atomic_state *state = cstate->base.state;
s/cstate/crtc_state/ etc. might be nice in a bunch of these functions.
Quoted 131 lines
drivers/gpu/drm/i915/intel_pm.c +25
-32struct drm_plane *plane; -const struct drm_plane_state *pstate; +const struct drm_plane_state *drm_pstate;u64 total_data_rate =0 ;if (WARN_ON (!state))return 0 ;/* Calculate and cache data rate for each plane */ -drm_atomic_crtc_state_for_each_plane_state (plane, pstate, cstate) { +drm_atomic_crtc_state_for_each_plane_state (plane, drm_pstate, &cstate->base) {enum plane_id plane_id =to_intel_plane (plane)->id; +const struct intel_plane_state *pstate = +to_intel_plane_state (drm_pstate);u64 rate; -const struct intel_plane_state *intel_pstate = -to_intel_plane_state (pstate);/* packed/y */ - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,0 ); + rate =skl_plane_relative_data_rate (cstate, pstate,0 ); plane_data_rate[plane_id] = rate; total_data_rate += rate;/* uv-plane */ - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,1 ); + rate =skl_plane_relative_data_rate (cstate, pstate,1 ); uv_plane_data_rate[plane_id] = rate; total_data_rate += rate; }@@ -4281,28 +4274,25 @@ skl_get_total_relative_data_rate(struct intel_crtc_state *intel_cstate, }static u64 -icl_get_total_relative_data_rate (struct intel_crtc_state *intel_cstate, +icl_get_total_relative_data_rate (struct intel_crtc_state *cstate,u64 *plane_data_rate) { -struct drm_crtc_state *cstate = &intel_cstate->base; -struct drm_atomic_state *state = cstate->state;struct drm_plane *plane; -const struct drm_plane_state *pstate; +const struct drm_plane_state *drm_pstate;u64 total_data_rate =0 ; -if (WARN_ON (!state)) +if (WARN_ON (!cstate->base.state))return 0 ;/* Calculate and cache data rate for each plane */ -drm_atomic_crtc_state_for_each_plane_state (plane, pstate, cstate) { -const struct intel_plane_state *intel_pstate = -to_intel_plane_state (pstate); +drm_atomic_crtc_state_for_each_plane_state (plane, drm_pstate, &cstate->base) { +const struct intel_plane_state *pstate = +to_intel_plane_state (drm_pstate);enum plane_id plane_id =to_intel_plane (plane)->id;u64 rate; -if (!intel_pstate->linked_plane) { - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,0 ); +if (!pstate->linked_plane) { + rate =skl_plane_relative_data_rate (cstate, pstate,0 ); plane_data_rate[plane_id] = rate; total_data_rate += rate; }else {@@ -4315,18 +4305,16 @@ icl_get_total_relative_data_rate(struct intel_crtc_state *intel_cstate,* NULL if we try get_new_plane_state(), so we * always calculate from the master. */ -if (intel_pstate->slave) +if (pstate->slave)continue ;/* Y plane rate is calculated on the slave */ - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,0 ); - y_plane_id = intel_pstate->linked_plane->id; + rate =skl_plane_relative_data_rate (cstate, pstate,0 ); + y_plane_id = pstate->linked_plane->id; plane_data_rate[y_plane_id] = rate; total_data_rate += rate; - rate =skl_plane_relative_data_rate (intel_cstate, - intel_pstate,1 ); + rate =skl_plane_relative_data_rate (cstate, pstate,1 ); plane_data_rate[plane_id] = rate; total_data_rate += rate; }@@ -5095,9 +5083,8 @@ static int skl_build_pipe_wm(struct intel_crtc_state *cstate) {struct drm_i915_private *dev_priv =to_i915 (cstate->base.crtc->dev);struct skl_pipe_wm *pipe_wm = &cstate->wm.skl.optimal; -struct drm_crtc_state *crtc_state = &cstate->base;struct drm_plane *plane; -const struct drm_plane_state *pstate; +const struct drm_plane_state *drm_pstate;int ret;/* @@ -5106,14 +5093,15 @@ static int skl_build_pipe_wm(struct intel_crtc_state *cstate)*/ memset (pipe_wm->planes,0 ,sizeof (pipe_wm->planes)); -drm_atomic_crtc_state_for_each_plane_state (plane, pstate, crtc_state) { -const struct intel_plane_state *intel_pstate = -to_intel_plane_state (pstate); +drm_atomic_crtc_state_for_each_plane_state (plane, drm_pstate, + &cstate->base) { +const struct intel_plane_state *pstate = +to_intel_plane_state (drm_pstate);if (INTEL_GEN (dev_priv) >=11 ) - ret =icl_build_plane_wm (cstate, intel_pstate); + ret =icl_build_plane_wm (cstate, pstate);else - ret =skl_build_plane_wm (cstate, intel_pstate); + ret =skl_build_plane_wm (cstate, pstate);if (ret)return ret; }Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/9 drm/i915: Prepare to split crtc state in uapi and hw state
In reply to Maarten LankhorstWe want to split drm_crtc_state into the user visible state and actual hardware state. To prepare for this, we need some ground rules what should be in each state:
In uapi we use:
- crtc, *_changed flags, event, commit, state, mode_blob, (plane/connector/encoder)_mask.
In hw state we use what's displayed in hardware:
- enable, active, (adjusted) mode, color property blobs.
clear_intel_crtc_state and hw readout need to be updated for these rules, which will allow us to enable 2 joined pipes.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 18 +- drivers/gpu/drm/i915/display/intel_atomic.c | 16 +- .../gpu/drm/i915/display/intel_atomic_plane.c | 6 +- drivers/gpu/drm/i915/display/intel_audio.c | 14 +- drivers/gpu/drm/i915/display/intel_bw.c | 4 +- drivers/gpu/drm/i915/display/intel_cdclk.c | 8 +- drivers/gpu/drm/i915/display/intel_color.c | 150 ++--- drivers/gpu/drm/i915/display/intel_crt.c | 24 +- drivers/gpu/drm/i915/display/intel_ddi.c | 28 +- drivers/gpu/drm/i915/display/intel_display.c | 521 +++++++++--------- drivers/gpu/drm/i915/display/intel_dp.c | 42 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 6 +- drivers/gpu/drm/i915/display/intel_dpio_phy.c | 14 +- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 36 +- drivers/gpu/drm/i915/display/intel_dvo.c | 14 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 62 +-- drivers/gpu/drm/i915/display/intel_lspcon.c | 4 +- drivers/gpu/drm/i915/display/intel_lvds.c | 12 +- drivers/gpu/drm/i915/display/intel_panel.c | 14 +- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 6 +- drivers/gpu/drm/i915/display/intel_psr.c | 10 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 22 +- drivers/gpu/drm/i915/display/intel_sprite.c | 25 +- drivers/gpu/drm/i915/display/intel_tv.c | 8 +- drivers/gpu/drm/i915/display/intel_vdsc.c | 10 +- drivers/gpu/drm/i915/display/vlv_dsi.c | 20 +- drivers/gpu/drm/i915/i915_debugfs.c | 14 +- drivers/gpu/drm/i915/intel_drv.h | 28 +- drivers/gpu/drm/i915/intel_pm.c | 179 +++--- 30 files changed, 678 insertions(+), 639 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +9 -9
@@ -277,7 +277,7 @@ static void configure_dual_link_mode(struct intel_encoder *encoder,if (intel_dsi->dual_link ==DSI_DUAL_LINK_FRONT_BACK ) {const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;u32 dss_ctl2;u16 hactive = adjusted_mode->crtc_hdisplay;u16 dl_buffer_depth;
@@ -622,7 +622,7 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder, {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 *intel_crtc =to_intel_crtc (pipe_config->base.crtc); +struct intel_crtc *intel_crtc =to_intel_crtc (pipe_config->uapi.crtc);enum pipe pipe = intel_crtc->pipe;u32 tmp;enum port port;
@@ -760,7 +760,7 @@ gen11_dsi_set_transcoder_timings(struct intel_encoder *encoder,struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;enum port port;enum transcoder dsi_trans;/* horizontal timings */
@@ -1201,7 +1201,7 @@ static void gen11_dsi_get_timings(struct intel_encoder *encoder, {struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;if (intel_dsi->dual_link) { adjusted_mode->crtc_hdisplay *=2 ;
@@ -1227,16 +1227,16 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base);/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */ pipe_config->port_clock =cnl_calc_wrpll_link (dev_priv, &pipe_config->dpll_hw_state); - pipe_config->base.adjusted_mode.crtc_clock = intel_dsi->pclk; + pipe_config->hw.adjusted_mode.crtc_clock = intel_dsi->pclk;if (intel_dsi->dual_link) - pipe_config->base.adjusted_mode.crtc_clock *=2 ; + pipe_config->hw.adjusted_mode.crtc_clock *=2 ;gen11_dsi_get_timings (encoder, pipe_config); pipe_config->output_types |=BIT (INTEL_OUTPUT_DSI );
@@ -1250,11 +1250,11 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder, struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi, base);struct intel_connector *intel_connector = intel_dsi->attached_connector; -struct intel_crtc *crtc =to_intel_crtc (pipe_config->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc);const struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode; pipe_config->output_format =INTEL_OUTPUT_FORMAT_RGB ;intel_fixed_panel_mode (fixed_mode, adjusted_mode);
drivers/gpu/drm/i915/display/intel_atomic.c +10 -6
@@ -186,13 +186,14 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector)struct drm_crtc_state *intel_crtc_duplicate_state (struct drm_crtc *crtc) { +const struct intel_crtc_state *old_crtc_state =to_intel_crtc_state (crtc->state);struct intel_crtc_state *crtc_state; - crtc_state =kmemdup (crtc->state,sizeof (*crtc_state),GFP_KERNEL ); + crtc_state =kmemdup (old_crtc_state,sizeof (*crtc_state),GFP_KERNEL );if (!crtc_state)return NULL ; -__drm_atomic_helper_crtc_duplicate_state (crtc, &crtc_state->base); +__drm_atomic_helper_crtc_duplicate_state (crtc, &crtc_state->uapi); crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false;
@@ -205,7 +206,7 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) crtc_state->fb_bits =0 ; crtc_state->update_planes =0 ; -return &crtc_state->base; +return &crtc_state->uapi; }/**
@@ -220,7 +221,10 @@ void intel_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state) { -drm_atomic_helper_crtc_destroy_state (crtc, state); + struct intel_crtc_state *crtc_state = to_intel_crtc_state(state); + +__drm_atomic_helper_crtc_destroy_state (&crtc_state->uapi); +kfree (crtc_state); } static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_state,
@@ -316,7 +320,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,struct intel_plane_state *plane_state =NULL ;struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state; -struct drm_atomic_state *drm_state = crtc_state->base.state; +struct drm_atomic_state *drm_state = crtc_state->uapi.state;struct intel_atomic_state *intel_state =to_intel_atomic_state (drm_state);int num_scalers_need;int i;
@@ -384,7 +388,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,* but since this plane is unchanged just do the * minimum required validation. */ - crtc_state->base.planes_changed = true; + crtc_state->uapi.planes_changed = true; } intel_plane =to_intel_plane (plane);
drivers/gpu/drm/i915/display/intel_atomic_plane.c +3 -3
@@ -256,7 +256,7 @@ void intel_update_plane(struct intel_plane *plane,const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);trace_intel_update_plane (&plane->base, crtc); plane->update_plane (plane, crtc_state, plane_state);
@@ -266,7 +266,7 @@ void intel_update_slave(struct intel_plane *plane,const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);trace_intel_update_plane (&plane->base, crtc); plane->update_slave (plane, crtc_state, plane_state);
@@ -275,7 +275,7 @@ void intel_update_slave(struct intel_plane *plane,void intel_disable_plane (struct intel_plane *plane,const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);trace_intel_disable_plane (&plane->base, crtc); plane->disable_plane (plane, crtc_state);
drivers/gpu/drm/i915/display/intel_audio.c +7 -7
@@ -188,7 +188,7 @@ static const struct {static u32 audio_config_hdmi_pixel_clock (const struct intel_crtc_state *crtc_state) {const struct drm_display_mode *adjusted_mode = - &crtc_state->base.adjusted_mode; + &crtc_state->hw.adjusted_mode;int i;for (i =0 ; i <ARRAY_SIZE (hdmi_audio_clock); i++) {
@@ -213,7 +213,7 @@ static int audio_config_hdmi_get_n(const struct intel_crtc_state *crtc_state, int rate) {const struct drm_display_mode *adjusted_mode = - &crtc_state->base.adjusted_mode; + &crtc_state->hw.adjusted_mode;int i;for (i =0 ; i <ARRAY_SIZE (hdmi_aud_ncts); i++) {
@@ -499,7 +499,7 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder, const struct drm_connector_state *old_conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;enum port port = encoder->port;u32 tmp, eldv;
@@ -545,7 +545,7 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder, const struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_connector *connector = conn_state->connector;enum pipe pipe = crtc->pipe;enum port port = encoder->port;
@@ -634,10 +634,10 @@ void intel_audio_codec_enable(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct i915_audio_component *acomp = dev_priv->audio_component; -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_connector *connector = conn_state->connector;const struct drm_display_mode *adjusted_mode = - &crtc_state->base.adjusted_mode; + &crtc_state->hw.adjusted_mode;enum port port = encoder->port;enum pipe pipe = crtc->pipe;
@@ -695,7 +695,7 @@ void intel_audio_codec_disable(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct i915_audio_component *acomp = dev_priv->audio_component; -struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc);enum port port = encoder->port;enum pipe pipe = crtc->pipe;
drivers/gpu/drm/i915/display/intel_bw.c +2 -2
@@ -259,7 +259,7 @@ static unsigned int intel_bw_crtc_num_active_planes(const struct intel_crtc_statstatic unsigned int intel_bw_crtc_data_rate (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);unsigned int data_rate =0 ;enum plane_id plane_id;
@@ -280,7 +280,7 @@ static unsigned int intel_bw_crtc_data_rate(const struct intel_crtc_state *crtc_void intel_bw_crtc_update (struct intel_bw_state *bw_state,const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); bw_state->data_rate[crtc->pipe] =intel_bw_crtc_data_rate (crtc_state);
drivers/gpu/drm/i915/display/intel_cdclk.c +4 -4
@@ -2202,10 +2202,10 @@ static int intel_pixel_rate_to_cdclk(struct drm_i915_private *dev_priv,int intel_crtc_compute_min_cdclk (const struct intel_crtc_state *crtc_state) {struct drm_i915_private *dev_priv = -to_i915 (crtc_state->base.crtc->dev); +to_i915 (crtc_state->uapi.crtc->dev);int min_cdclk; -if (!crtc_state->base.enable) +if (!crtc_state->hw.enable)return 0 ; min_cdclk =intel_pixel_rate_to_cdclk (dev_priv, crtc_state->pixel_rate);
@@ -2313,7 +2313,7 @@ static u8 cnl_compute_min_voltage_level(struct intel_atomic_state *state) sizeof(state->min_voltage_level));for_each_new_intel_crtc_in_state (state, crtc, crtc_state, i) { -if (crtc_state->base.enable) +if (crtc_state->hw.enable) state->min_voltage_level[i] = crtc_state->min_voltage_level;else
@@ -2399,7 +2399,7 @@ static int skl_dpll0_vco(struct intel_atomic_state *state) vco = dev_priv->skl_preferred_vco_freq;for_each_new_intel_crtc_in_state (state, crtc, crtc_state, i) { -if (!crtc_state->base.enable) +if (!crtc_state->hw.enable)continue ;if (!intel_crtc_has_type (crtc_state,INTEL_OUTPUT_EDP ))
drivers/gpu/drm/i915/display/intel_color.c +75 -75
424 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_crt.c +12 -12
@@ -132,9 +132,9 @@ static void intel_crt_get_config(struct intel_encoder *encoder, { pipe_config->output_types |=BIT (INTEL_OUTPUT_ANALOG ); - pipe_config->base.adjusted_mode.flags |=intel_crt_get_flags (encoder); + pipe_config->hw.adjusted_mode.flags |=intel_crt_get_flags (encoder); - pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; + pipe_config->hw.adjusted_mode.crtc_clock = pipe_config->port_clock; } static void hsw_crt_get_config(struct intel_encoder *encoder,
@@ -144,13 +144,13 @@ static void hsw_crt_get_config(struct intel_encoder *encoder,intel_ddi_get_config (encoder, pipe_config); - pipe_config->base.adjusted_mode.flags &= ~(DRM_MODE_FLAG_PHSYNC | + pipe_config->hw.adjusted_mode.flags &= ~(DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_NHSYNC |DRM_MODE_FLAG_PVSYNC |DRM_MODE_FLAG_NVSYNC ); - pipe_config->base.adjusted_mode.flags |=intel_crt_get_flags (encoder); + pipe_config->hw.adjusted_mode.flags |=intel_crt_get_flags (encoder); - pipe_config->base.adjusted_mode.crtc_clock =lpt_get_iclkip (dev_priv); + pipe_config->hw.adjusted_mode.crtc_clock =lpt_get_iclkip (dev_priv); }/* Note: The caller is required to filter out dpms modes not supported by the
@@ -161,8 +161,8 @@ static void intel_crt_set_dpms(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_crt *crt =intel_encoder_to_crt (encoder); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); -const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc); +const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;u32 adpa;if (INTEL_GEN (dev_priv) >=5 )
@@ -271,7 +271,7 @@ static void hsw_pre_enable_crt(struct intel_encoder *encoder, const struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;WARN_ON (!crtc_state->has_pch_encoder);
@@ -288,7 +288,7 @@ static void hsw_enable_crt(struct intel_encoder *encoder, const struct drm_connector_state *conn_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;WARN_ON (!crtc_state->has_pch_encoder);
@@ -358,7 +358,7 @@ static int intel_crt_compute_config(struct intel_encoder *encoder, struct drm_connector_state *conn_state) {struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;if (adjusted_mode->flags &DRM_MODE_FLAG_DBLSCAN )return -EINVAL ;
@@ -373,7 +373,7 @@ static int pch_crt_compute_config(struct intel_encoder *encoder, struct drm_connector_state *conn_state) {struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;if (adjusted_mode->flags &DRM_MODE_FLAG_DBLSCAN )return -EINVAL ;
@@ -390,7 +390,7 @@ static int hsw_crt_compute_config(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;if (adjusted_mode->flags &DRM_MODE_FLAG_DBLSCAN )return -EINVAL ;
drivers/gpu/drm/i915/display/intel_ddi.c +14 -14
@@ -1477,7 +1477,7 @@ static void ddi_dotclock_get(struct intel_crtc_state *pipe_config)if (pipe_config->pixel_multiplier) dotclock /= pipe_config->pixel_multiplier; - pipe_config->base.adjusted_mode.crtc_clock = dotclock; + pipe_config->hw.adjusted_mode.crtc_clock = dotclock; } static void icl_ddi_clock_get(struct intel_encoder *encoder,
@@ -1691,7 +1691,7 @@ static void intel_ddi_clock_get(struct intel_encoder *encoder,void intel_ddi_set_pipe_settings (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;u32 temp;
@@ -1745,7 +1745,7 @@ void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state)void intel_ddi_set_vc_payload_alloc (const struct intel_crtc_state *crtc_state,bool state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;u32 temp;
@@ -1760,7 +1760,7 @@ void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state,void intel_ddi_enable_transcoder_func (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct intel_encoder *encoder =intel_ddi_get_crtc_encoder (crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum pipe pipe = crtc->pipe;
@@ -1789,9 +1789,9 @@ void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)BUG (); } -if (crtc_state->base.adjusted_mode.flags &DRM_MODE_FLAG_PVSYNC ) +if (crtc_state->hw.adjusted_mode.flags &DRM_MODE_FLAG_PVSYNC ) temp |=TRANS_DDI_PVSYNC ; -if (crtc_state->base.adjusted_mode.flags &DRM_MODE_FLAG_PHSYNC ) +if (crtc_state->hw.adjusted_mode.flags &DRM_MODE_FLAG_PHSYNC ) temp |=TRANS_DDI_PHSYNC ;if (cpu_transcoder ==TRANSCODER_EDP ) {
@@ -1844,7 +1844,7 @@ void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)void intel_ddi_disable_transcoder_func (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;i915_reg_t reg =TRANS_DDI_FUNC_CTL (cpu_transcoder);
@@ -2116,7 +2116,7 @@ static void intel_ddi_get_power_domains(struct intel_encoder *encoder,void intel_ddi_enable_pipe_clock (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_encoder *encoder =intel_ddi_get_crtc_encoder (crtc);enum port port = encoder->port;
@@ -2129,7 +2129,7 @@ void intel_ddi_enable_pipe_clock(const struct intel_crtc_state *crtc_state)void intel_ddi_disable_pipe_clock (const struct intel_crtc_state *crtc_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;if (cpu_transcoder !=TRANSCODER_EDP )
@@ -3212,7 +3212,7 @@ static void intel_ddi_pre_enable(struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);enum pipe pipe = crtc->pipe;
@@ -3735,7 +3735,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *intel_crtc =to_intel_crtc (pipe_config->base.crtc); +struct intel_crtc *intel_crtc =to_intel_crtc (pipe_config->uapi.crtc);enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;struct intel_digital_port *intel_dig_port;u32 temp, flags =0 ;
@@ -3754,7 +3754,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder,else flags |=DRM_MODE_FLAG_NVSYNC ; - pipe_config->base.adjusted_mode.flags |= flags; + pipe_config->hw.adjusted_mode.flags |= flags;switch (temp &TRANS_DDI_BPC_MASK ) {case TRANS_DDI_BPC_6 :
@@ -3884,7 +3884,7 @@ static int intel_ddi_compute_config(struct intel_encoder *encoder,struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct intel_crtc *crtc = to_intel_crtc(pipe_config->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum port port = encoder->port;int ret;
@@ -4046,7 +4046,7 @@ static int intel_hdmi_reset_link(struct intel_encoder *encoder,WARN_ON (!intel_crtc_has_type (crtc_state,INTEL_OUTPUT_HDMI )); -if (!crtc_state->base.active) +if (!crtc_state->hw.active)return 0 ; if (!crtc_state->hdmi_high_tmds_clock_ratio &&
drivers/gpu/drm/i915/display/intel_display.c +265 -256
1,568 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_dp.c +21 -21
153 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_dp_mst.c +3 -3
@@ -42,13 +42,13 @@ static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder,struct drm_connector_state *conn_state, struct link_config_limits *limits) { - struct drm_atomic_state *state = crtc_state->base.state; + struct drm_atomic_state *state = crtc_state->uapi.state;struct intel_dp_mst_encoder *intel_mst =enc_to_mst (&encoder->base);struct intel_dp *intel_dp = &intel_mst->primary->dp;struct intel_connector *connector =to_intel_connector (conn_state->connector);const struct drm_display_mode *adjusted_mode = - &crtc_state->base.adjusted_mode; + &crtc_state->hw.adjusted_mode;void *port = connector->port;bool constant_n =drm_dp_has_quirk (&intel_dp->desc,DP_DPCD_QUIRK_CONSTANT_N );
@@ -99,7 +99,7 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,struct intel_digital_connector_state *intel_conn_state =to_intel_digital_connector_state (conn_state);const struct drm_display_mode *adjusted_mode = - &pipe_config->base.adjusted_mode; + &pipe_config->hw.adjusted_mode;void *port = connector->port;struct link_config_limits limits;int ret;
drivers/gpu/drm/i915/display/intel_dpio_phy.c +7 -7
@@ -741,7 +741,7 @@ void chv_data_lane_soft_reset(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);enum dpio_channel ch =vlv_dport_to_channel (enc_to_dig_port (&encoder->base)); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum pipe pipe = crtc->pipe;u32 val;
@@ -785,7 +785,7 @@ void chv_phy_pre_pll_enable(struct intel_encoder *encoder, {struct intel_digital_port *dport =enc_to_dig_port (&encoder->base);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum dpio_channel ch =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe; unsigned int lane_mask =
@@ -866,7 +866,7 @@ void chv_phy_pre_encoder_enable(struct intel_encoder *encoder,struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);struct intel_digital_port *dport =dp_to_dig_port (intel_dp);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum dpio_channel ch =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe;int data, i, stagger;
@@ -955,7 +955,7 @@ void chv_phy_post_pll_disable(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -enum pipe pipe =to_intel_crtc (old_crtc_state->base.crtc)->pipe; +enum pipe pipe =to_intel_crtc (old_crtc_state->uapi.crtc)->pipe;u32 val;vlv_dpio_get (dev_priv);
@@ -1018,7 +1018,7 @@ void vlv_phy_pre_pll_enable(struct intel_encoder *encoder, {struct intel_digital_port *dport =enc_to_dig_port (&encoder->base);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum dpio_channel port =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe;
@@ -1048,7 +1048,7 @@ void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder,struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base);struct intel_digital_port *dport =dp_to_dig_port (intel_dp);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);enum dpio_channel port =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe;u32 val;
@@ -1077,7 +1077,7 @@ void vlv_phy_reset_lanes(struct intel_encoder *encoder, {struct intel_digital_port *dport =enc_to_dig_port (&encoder->base);struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->uapi.crtc);enum dpio_channel port =vlv_dport_to_channel (dport);enum pipe pipe = crtc->pipe;
drivers/gpu/drm/i915/display/intel_dpll_mgr.c +18 -18
@@ -135,7 +135,7 @@ void assert_shared_dpll(struct drm_i915_private *dev_priv,*/ void intel_prepare_shared_dpll (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_shared_dpll *pll = crtc_state->shared_dpll;
@@ -162,7 +162,7 @@ void intel_prepare_shared_dpll(const struct intel_crtc_state *crtc_state)*/ void intel_enable_shared_dpll (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_shared_dpll *pll = crtc_state->shared_dpll;unsigned int crtc_mask =drm_crtc_mask (&crtc->base);
@@ -207,7 +207,7 @@ void intel_enable_shared_dpll(const struct intel_crtc_state *crtc_state)*/ void intel_disable_shared_dpll (const struct intel_crtc_state *crtc_state) { -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_shared_dpll *pll = crtc_state->shared_dpll;unsigned int crtc_mask =drm_crtc_mask (&crtc->base);
@@ -247,13 +247,13 @@ intel_find_shared_dpll(struct intel_crtc_state *crtc_state,enum intel_dpll_id range_min, enum intel_dpll_id range_max) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_shared_dpll *pll, *unused_pll =NULL ;struct intel_shared_dpll_state *shared_dpll;enum intel_dpll_id i; - shared_dpll =intel_atomic_get_shared_dpll_state (crtc_state->base.state); + shared_dpll =intel_atomic_get_shared_dpll_state (crtc_state->uapi.state);for (i = range_min; i <= range_max; i++) { pll = &dev_priv->shared_dplls[i];
@@ -293,10 +293,10 @@ intel_reference_shared_dpll(struct intel_shared_dpll *pll, struct intel_crtc_state *crtc_state) {struct intel_shared_dpll_state *shared_dpll; -struct intel_crtc *crtc =to_intel_crtc (crtc_state->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (crtc_state->uapi.crtc);const enum intel_dpll_id id = pll->info->id; - shared_dpll =intel_atomic_get_shared_dpll_state (crtc_state->base.state); + shared_dpll =intel_atomic_get_shared_dpll_state (crtc_state->uapi.state);if (shared_dpll[id].crtc_mask ==0 ) shared_dpll[id].hw_state =
@@ -425,7 +425,7 @@ static struct intel_shared_dpll * ibx_get_dpll(struct intel_crtc_state *crtc_state, struct intel_encoder *encoder) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_shared_dpll *pll;enum intel_dpll_id i;
@@ -793,7 +793,7 @@ static struct intel_shared_dpll *hsw_ddi_hdmi_get_dpll(struct intel_crtc_state *static struct intel_shared_dpll *hsw_ddi_dp_get_dpll (struct intel_crtc_state *crtc_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);struct intel_shared_dpll *pll;enum intel_dpll_id pll_id;int clock = crtc_state->port_clock;
@@ -1693,7 +1693,7 @@ static bool bxt_ddi_hdmi_pll_dividers(struct intel_crtc_state *crtc_state, struct bxt_clk_div *clk_div) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);struct dpll best_clock;/* Calculate HDMI div */
@@ -1831,7 +1831,7 @@ static struct intel_shared_dpll * bxt_get_dpll(struct intel_crtc_state *crtc_state, struct intel_encoder *encoder) { - struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);struct drm_i915_private *dev_priv =to_i915 (crtc->base.dev);struct intel_shared_dpll *pll;enum intel_dpll_id id;
@@ -2217,7 +2217,7 @@ static bool cnl_ddi_calculate_wrpll(struct intel_crtc_state *crtc_state, struct skl_wrpll_params *wrpll_params) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);u32 afe_clock = crtc_state->port_clock *5 ;u32 ref_clock;u32 dco_min =7998000 ;
@@ -2476,7 +2476,7 @@ static const struct skl_wrpll_params icl_tbt_pll_19_2MHz_values = {static bool icl_calc_dp_combo_pll (struct intel_crtc_state *crtc_state,struct skl_wrpll_params *pll_params) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);const struct icl_combo_pll_params *params = dev_priv->cdclk.hw.ref ==24000 ? icl_dp_combo_pll_24MHz_values :
@@ -2498,7 +2498,7 @@ static bool icl_calc_dp_combo_pll(struct intel_crtc_state *crtc_state,static bool icl_calc_tbt_pll (struct intel_crtc_state *crtc_state,struct skl_wrpll_params *pll_params) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev); *pll_params = dev_priv->cdclk.hw.ref ==24000 ? icl_tbt_pll_24MHz_values : icl_tbt_pll_19_2MHz_values;
@@ -2508,7 +2508,7 @@ static bool icl_calc_tbt_pll(struct intel_crtc_state *crtc_state,static bool icl_calc_dpll_state (struct intel_crtc_state *crtc_state,struct intel_encoder *encoder) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);u32 cfgcr0, cfgcr1;struct skl_wrpll_params pll_params = {0 };bool ret;
@@ -2629,7 +2629,7 @@ static bool icl_mg_pll_find_divisors(int clock_khz, bool is_dp, bool use_ssc,*/ static bool icl_calc_mg_pll_state (struct intel_crtc_state *crtc_state) { -struct drm_i915_private *dev_priv =to_i915 (crtc_state->base.crtc->dev); +struct drm_i915_private *dev_priv =to_i915 (crtc_state->uapi.crtc->dev);struct intel_dpll_hw_state *pll_state = &crtc_state->dpll_hw_state;int refclk_khz = dev_priv->cdclk.hw.ref;int clock = crtc_state->port_clock;
@@ -2796,7 +2796,7 @@ static struct intel_shared_dpll * icl_get_dpll(struct intel_crtc_state *crtc_state, struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);struct intel_digital_port *intel_dig_port;struct intel_shared_dpll *pll;enum port port = encoder->port;
@@ -3304,7 +3304,7 @@ struct intel_shared_dpll * intel_get_shared_dpll(struct intel_crtc_state *crtc_state, struct intel_encoder *encoder) { - struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev); + struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);const struct intel_dpll_mgr *dpll_mgr = dev_priv->dpll_mgr;if (WARN_ON (!dpll_mgr))
drivers/gpu/drm/i915/display/intel_dvo.c +7 -7
@@ -178,9 +178,9 @@ static void intel_dvo_get_config(struct intel_encoder *encoder,else flags |=DRM_MODE_FLAG_NVSYNC ; - pipe_config->base.adjusted_mode.flags |= flags; + pipe_config->hw.adjusted_mode.flags |= flags; - pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock; + pipe_config->hw.adjusted_mode.crtc_clock = pipe_config->port_clock; } static void intel_disable_dvo(struct intel_encoder *encoder,
@@ -207,8 +207,8 @@ static void intel_enable_dvo(struct intel_encoder *encoder,u32 temp =I915_READ (dvo_reg); intel_dvo->dev.dev_ops->mode_set (&intel_dvo->dev, - &pipe_config->base.mode, - &pipe_config->base.adjusted_mode); + &pipe_config->hw.mode, + &pipe_config->hw.adjusted_mode);I915_WRITE (dvo_reg, temp |DVO_ENABLE );I915_READ (dvo_reg);
@@ -253,7 +253,7 @@ static int intel_dvo_compute_config(struct intel_encoder *encoder,struct intel_dvo *intel_dvo =enc_to_dvo (encoder);const struct drm_display_mode *fixed_mode = intel_dvo->attached_connector->panel.fixed_mode; -struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; +struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;/* * If we have timings from the BIOS for the panel, put them in
@@ -277,8 +277,8 @@ static void intel_dvo_pre_enable(struct intel_encoder *encoder, const struct drm_connector_state *conn_state) {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_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc); +const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;struct intel_dvo *intel_dvo =enc_to_dvo (encoder);int pipe = crtc->pipe;u32 dvo_val;
drivers/gpu/drm/i915/display/intel_fbc.c +1 -1
@@ -668,7 +668,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, cache->vma =NULL ; cache->flags =0 ; - cache->crtc.mode_flags = crtc_state->base.adjusted_mode.flags; + cache->crtc.mode_flags = crtc_state->hw.adjusted_mode.flags;if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) cache->crtc.hsw_bdw_pixel_rate = crtc_state->pixel_rate;
drivers/gpu/drm/i915/display/intel_hdmi.c +31 -31
171 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_lspcon.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_lvds.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_panel.c +7 -7
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_pipe_crc.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_psr.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_sdvo.c +11 -11
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_sprite.c +13 -12
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_tv.c +4 -4
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/intel_vdsc.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/display/vlv_dsi.c +10 -10
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/i915/intel_pm.c +90 -89
179 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Part of the diff is not shown here. View the raw message.
PATCH 8/9 drm/i915: Handle a few more cases for hw/sw split
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/display/intel_display.c | 38 ++++++++++---------- drivers/gpu/drm/i915/display/intel_dp_mst.c | 2 +- drivers/gpu/drm/i915/display/intel_psr.c | 4 +-- 3 files changed, 22 insertions(+), 22 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +19 -19
@@ -11594,10 +11594,10 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,bool mode_changed =needs_modeset (pipe_config);if (INTEL_GEN (dev_priv) <5 && !IS_G4X (dev_priv) && - mode_changed && !crtc_state->active) + mode_changed && !pipe_config->hw.active) pipe_config->update_wm_post = true; -if (mode_changed && crtc_state->enable && +if (mode_changed && pipe_config->hw.enable && dev_priv->display.crtc_compute_clock && !WARN_ON (pipe_config->shared_dpll)) { ret = dev_priv->display.crtc_compute_clock(intel_crtc,
@@ -11611,10 +11611,10 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,* when C8 planes are getting enabled/disabled. */ if (c8_planes_changed (pipe_config)) - crtc_state->color_mgmt_changed = true; + pipe_config->uapi.color_mgmt_changed = true;if (mode_changed || pipe_config->update_pipe || - crtc_state->color_mgmt_changed) { + pipe_config->uapi.color_mgmt_changed) { ret =intel_color_check (pipe_config);if (ret)return ret;
@@ -13251,30 +13251,30 @@ static int intel_lock_all_pipes(struct drm_atomic_state *state)static int intel_modeset_all_pipes (struct drm_atomic_state *state) { -struct drm_crtc *crtc; +struct intel_crtc *crtc;/* * Add all pipes to the state, and force * a modeset on all the active ones. */ -for_each_crtc (state->dev, crtc) { -struct drm_crtc_state *crtc_state; +for_each_intel_crtc (state->dev, crtc) { +struct intel_crtc_state *crtc_state;int ret; - crtc_state =drm_atomic_get_crtc_state (state, crtc); + crtc_state =intel_atomic_get_crtc_state (state, crtc);if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (!crtc_state->active ||needs_modeset (to_intel_crtc_state (crtc_state))) +if (!crtc_state->hw.active ||needs_modeset (crtc_state))continue ; - crtc_state->mode_changed = true; + crtc_state->uapi.mode_changed = true; - ret =drm_atomic_add_affected_connectors (state, crtc); + ret =drm_atomic_add_affected_connectors (state, &crtc->base);if (ret)return ret; - ret =drm_atomic_add_affected_planes (state, crtc); + ret =drm_atomic_add_affected_planes (state, &crtc->base);if (ret)return ret; }
@@ -15827,8 +15827,8 @@ static int intel_initial_commit(struct drm_device *dev) {struct drm_atomic_state *state =NULL ;struct drm_modeset_acquire_ctx ctx; -struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; +struct intel_crtc *crtc; +struct intel_crtc_state *crtc_state;int ret =0 ; state =drm_atomic_state_alloc (dev);
@@ -15840,15 +15840,15 @@ static int intel_initial_commit(struct drm_device *dev) retry: state->acquire_ctx = &ctx; -drm_for_each_crtc (crtc, dev) { - crtc_state =drm_atomic_get_crtc_state (state, crtc); +for_each_intel_crtc (dev, crtc) { + crtc_state =intel_atomic_get_crtc_state (state, crtc);if (IS_ERR (crtc_state)) { ret =PTR_ERR (crtc_state); goto out; } -if (crtc_state->active) { - ret =drm_atomic_add_affected_planes (state, crtc); +if (crtc_state->hw.active) { + ret =drm_atomic_add_affected_planes (state, &crtc->base);if (ret) goto out;
@@ -15858,7 +15858,7 @@ static int intel_initial_commit(struct drm_device *dev)* having a proper LUT loaded. Remove once we * have readout for pipe gamma enable. */ - crtc_state->color_mgmt_changed = true; + crtc_state->uapi.color_mgmt_changed = true; } }
drivers/gpu/drm/i915/display/intel_dp_mst.c +1 -1
@@ -179,7 +179,7 @@ intel_dp_mst_atomic_check(struct drm_connector *connector,if (!crtc_state || !drm_atomic_crtc_needs_modeset (crtc_state) || - crtc_state->enable) +to_intel_crtc_state (crtc_state)->hw.enable)return 0 ; }
drivers/gpu/drm/i915/display/intel_psr.c +2 -2
@@ -1025,9 +1025,9 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv) intel_crtc_state =to_intel_crtc_state (crtc_state); -if (crtc_state->active && intel_crtc_state->has_psr) { +if (intel_crtc_state->hw.active && intel_crtc_state->has_psr) {/* Mark mode as changed to trigger a pipe->update() */ - crtc_state->mode_changed = true; + intel_crtc_state->uapi.mode_changed = true;break ; } }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/9 drm/i915: Complete sw/hw split
In reply to Maarten Lankhorst--- drivers/gpu/drm/i915/display/intel_atomic.c | 16 +++++++ drivers/gpu/drm/i915/display/intel_atomic.h | 1 + drivers/gpu/drm/i915/display/intel_display.c | 46 +++++++++++++++++--- drivers/gpu/drm/i915/intel_drv.h | 8 ++-- 4 files changed, 63 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/display/intel_atomic.c +16 -0
@@ -195,6 +195,14 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)__drm_atomic_helper_crtc_duplicate_state (crtc, &crtc_state->uapi); +/* copy color blobs */ +if (crtc_state->hw.degamma_lut) +drm_property_blob_get (crtc_state->hw.degamma_lut); +if (crtc_state->hw.ctm) +drm_property_blob_get (crtc_state->hw.ctm); +if (crtc_state->hw.gamma_lut) +drm_property_blob_get (crtc_state->hw.gamma_lut); + crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false;
@@ -209,6 +217,13 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)return &crtc_state->uapi; } +void intel_crtc_put_hw_blobs (struct intel_crtc_state *crtc_state) +{ +drm_property_blob_put (crtc_state->hw.degamma_lut); +drm_property_blob_put (crtc_state->hw.gamma_lut); +drm_property_blob_put (crtc_state->hw.ctm); +} +/** * intel_crtc_destroy_state - destroy crtc state * @crtc: drm crtc
@@ -224,6 +239,7 @@ intel_crtc_destroy_state(struct drm_crtc *crtc,struct intel_crtc_state *crtc_state =to_intel_crtc_state (state);__drm_atomic_helper_crtc_destroy_state (&crtc_state->uapi); +intel_crtc_put_hw_blobs (crtc_state);kfree (crtc_state); }
drivers/gpu/drm/i915/display/intel_atomic.h +1 -0
@@ -35,6 +35,7 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector);struct drm_crtc_state *intel_crtc_duplicate_state (struct drm_crtc *crtc);void intel_crtc_destroy_state (struct drm_crtc *crtc,struct drm_crtc_state *state); +void intel_crtc_put_hw_blobs (struct intel_crtc_state *crtc_state);struct drm_atomic_state *intel_atomic_state_alloc (struct drm_device *dev);void intel_atomic_state_clear (struct drm_atomic_state *state);
drivers/gpu/drm/i915/display/intel_display.c +41 -5
112 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +5 -3
@@ -713,7 +713,6 @@ enum intel_output_format { };struct intel_crtc_state { -union {/* * uapi (drm) state. This is the software state shown to userspace. * In particular, the following members are used for bookkeeping:
@@ -736,8 +735,11 @@ struct intel_crtc_state {* * During initial hw readout, they need to be copied to uapi. */ -struct drm_crtc_state hw; - }; +struct { +bool active, enable; +struct drm_property_blob *degamma_lut, *gamma_lut, *ctm; +struct drm_display_mode mode, adjusted_mode; + } hw;/** * quirks - bitfield with hw state readout quirks
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for Split hw and drm state.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: Split hw and drm state.
URL : https://patchwork.freedesktop.org/series/62485/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 43159ab9270f drm/i915: Pass intel_crtc_state to needs_modeset() -:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 231 lines checked 10743f477195 drm/i915: Convert most of atomic commit to take more intel state -:380: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #380: FILE: drivers/gpu/drm/i915/display/intel_display.c:6675:
+ crtc->enabled_power_domains = new_domains =
-:682: WARNING:LONG_LINE: line over 100 characters #682: FILE: drivers/gpu/drm/i915/display/intel_display.c:13647:
+ for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
total: 0 errors, 1 warnings, 1 checks, 985 lines checked c6a1846ce000 drm/i915: Convert hw state verifier to take more intel state -:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
-:27: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #27: FILE: drivers/gpu/drm/i915/display/intel_display.c:6999:
+ I915_STATE_WARN(!crtc_state->base.active,
"connector is active, but attached crtc isn't\n");
-:36: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #36: FILE: drivers/gpu/drm/i915/display/intel_display.c:7011:
+ I915_STATE_WARN(crtc_state && crtc_state->base.active,
"attached crtc is active, but connector isn't\n");
-:199: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #199: FILE: drivers/gpu/drm/i915/display/intel_display.c:12939:
+ I915_STATE_WARN(new_crtc_state->base.active != active,
"crtc active state doesn't match with hw state "
-:205: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #205: FILE: drivers/gpu/drm/i915/display/intel_display.c:12943:
+ I915_STATE_WARN(crtc->active != new_crtc_state->base.active,
"transitional active state does not match atomic hw state "
-:216: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #216: FILE: drivers/gpu/drm/i915/display/intel_display.c:12951:
+ I915_STATE_WARN(active != new_crtc_state->base.active,
"[ENCODER:%i] active %i with crtc active %i\n",
-:297: WARNING:LONG_LINE: line over 100 characters #297: FILE: drivers/gpu/drm/i915/display/intel_display.c:13053:
+ verify_single_dpll_state(dev_priv, new_crtc_state->shared_dpll, crtc, new_crtc_state);
total: 0 errors, 2 warnings, 5 checks, 337 lines checked ade264d7f94f drm/i915: Use intel_crtc_state in sanitize_watermarks() too -:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 27 lines checked 8d0923e49528 drm/i915: Pass intel state to plane functions as well -:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
-:154: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #154: FILE: drivers/gpu/drm/i915/display/intel_display.c:11358:
+ plane_state->base.visible = visible = false;
total: 0 errors, 1 warnings, 1 checks, 196 lines checkedcf6478f30379 drm/i915: Use intel state as much as possible in wm codee80bd07d6220 drm/i915: Prepare to split crtc state in uapi and hw state
-:11: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #11:
- crtc, *_changed flags, event, commit, state, mode_blob, (plane/connector/encoder)_mask.
-:1950: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #1950: FILE: drivers/gpu/drm/i915/display/intel_display.c:11011:
+ crtc_state->uapi.active = crtc_state->uapi.enable = true;
-:2607: CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided #2607: FILE: drivers/gpu/drm/i915/display/intel_display.c:16437:
+ crtc_state->hw.active = crtc_state->hw.enable =
-:3778: ERROR:CODE_INDENT: code indent should use tabs where possible #3778: FILE: drivers/gpu/drm/i915/display/intel_sprite.c:223:
+^I^I^I^I new_crtc_state->uapi.event);$
-:3778: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #3778: FILE: drivers/gpu/drm/i915/display/intel_sprite.c:223:
+ drm_crtc_arm_vblank_event(&crtc->base,
+ new_crtc_state->uapi.event);
total: 1 errors, 1 warnings, 3 checks, 4207 lines checked 24ddbe924837 drm/i915: Handle a few more cases for hw/sw split
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 118 lines checked fd5e35bacee3 drm/i915: Complete sw/hw split
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 173 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for Split hw and drm state.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: Split hw and drm state.
URL : https://patchwork.freedesktop.org/series/62485/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.5.2 Commit: drm/i915: Pass intel_crtc_state to needs_modeset() Okay!
Commit: drm/i915: Convert most of atomic commit to take more intel state Okay!
Commit: drm/i915: Convert hw state verifier to take more intel state Okay!
Commit: drm/i915: Use intel_crtc_state in sanitize_watermarks() too Okay!
Commit: drm/i915: Pass intel state to plane functions as well Okay!
Commit: drm/i915: Use intel state as much as possible in wm code Okay!
Commit: drm/i915: Prepare to split crtc state in uapi and hw state -O:drivers/gpu/drm/i915/intel_pm.c:2548:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2548:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2548:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2548:16: warning: expression using sizeof(void)
Commit: drm/i915: Handle a few more cases for hw/sw split Okay!
Commit: drm/i915: Complete sw/hw split
Okay!
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for Split hw and drm state.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: Split hw and drm state.
URL : https://patchwork.freedesktop.org/series/62485/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_6318 -> Patchwork_13377
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_13377 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_13377, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_13377:
### IGT changes ###
#### Possible regressions ####
* igt@kms_force_connector_basic@force-load-detect:
- fi-hsw-4770: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-hsw-4770/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-hsw-4770/igt@[email protected]
- fi-ivb-3770: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-ivb-3770/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-ivb-3770/igt@[email protected]
- fi-blb-e6850: [PASS][5] -> [INCOMPLETE][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-blb-e6850/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-blb-e6850/igt@[email protected]
- fi-bwr-2160: [PASS][7] -> [INCOMPLETE][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-bwr-2160/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-bwr-2160/igt@[email protected]
- fi-ilk-650: [PASS][9] -> [INCOMPLETE][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-ilk-650/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-ilk-650/igt@[email protected]
- fi-snb-2520m: [PASS][11] -> [INCOMPLETE][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-snb-2520m/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-snb-2520m/igt@[email protected]
* igt@vgem_basic@dmabuf-export:
- fi-bxt-dsi: [PASS][13] -> [DMESG-WARN][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-bxt-dsi/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-bxt-dsi/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_13377 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s4-devices:
- fi-kbl-7500u: [PASS][15] -> [DMESG-WARN][16] ([fdo#105128] / [fdo#107139])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-kbl-7500u/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-kbl-7500u/igt@[email protected]
* igt@kms_force_connector_basic@force-load-detect:
- fi-byt-j1900: [PASS][17] -> [INCOMPLETE][18] ([fdo#102657])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-byt-j1900/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-byt-j1900/igt@[email protected]
- fi-snb-2600: [PASS][19] -> [INCOMPLETE][20] ([fdo#105411])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-snb-2600/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-snb-2600/igt@[email protected]
- fi-elk-e7500: [PASS][21] -> [INCOMPLETE][22] ([fdo#103989])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-elk-e7500/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-elk-e7500/igt@[email protected]
- fi-pnv-d510: [PASS][23] -> [INCOMPLETE][24] ([fdo#110740])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-pnv-d510/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-pnv-d510/igt@[email protected]
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
- fi-glk-dsi: [PASS][25] -> [DMESG-WARN][26] ([fdo#106107])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-glk-dsi/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-glk-dsi/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_reloc@basic-cpu-read-noreloc:
- fi-icl-u3: [DMESG-WARN][27] ([fdo#107724]) -> [PASS][28] +1 similar issue
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-icl-u3/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-icl-u3/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][29] ([fdo#109485]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6318/fi-kbl-7500u/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/fi-kbl-7500u/igt@[email protected]
[fdo#102657]: https://bugs.freedesktop.org/show_bug.cgi?id=102657
[fdo#103989]: https://bugs.freedesktop.org/show_bug.cgi?id=103989
[fdo#105128]: https://bugs.freedesktop.org/show_bug.cgi?id=105128
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#106107]: https://bugs.freedesktop.org/show_bug.cgi?id=106107
[fdo#107139]: https://bugs.freedesktop.org/show_bug.cgi?id=107139
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
[fdo#110740]: https://bugs.freedesktop.org/show_bug.cgi?id=110740
Participating hosts (52 -> 43)
------------------------------
Missing (9): fi-ilk-m540 fi-skl-gvtdvm fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-gdg-551 fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_6318 -> Patchwork_13377
CI_DRM_6318: 56b793e31c67ac9e0aa1dd72c013202f38cb5174 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5064: 22850c1906550fb97b405c019275dcfb34be8cf7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13377: fd5e35bacee3dd788265fd46b0e94494d97950da @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
fd5e35bacee3 drm/i915: Complete sw/hw split24ddbe924837 drm/i915: Handle a few more cases for hw/sw split e80bd07d6220 drm/i915: Prepare to split crtc state in uapi and hw state cf6478f30379 drm/i915: Use intel state as much as possible in wm code 8d0923e49528 drm/i915: Pass intel state to plane functions as well ade264d7f94f drm/i915: Use intel_crtc_state in sanitize_watermarks() too c6a1846ce000 drm/i915: Convert hw state verifier to take more intel state 10743f477195 drm/i915: Convert most of atomic commit to take more intel state 43159ab9270f drm/i915: Pass intel_crtc_state to needs_modeset()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13377/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx