drm/i915: Change use get_new_plane_state instead of existing plane state
Subsystems (2)
PATCH 1/4 drm/i915: Change use get_new_plane_state instead of existing plane state
The get_existing macros are deprecated and should be replaced by get_old/new_state for clarity.
--- drivers/gpu/drm/i915/intel_atomic.c | 5 +++-- drivers/gpu/drm/i915/intel_drv.h | 11 ----------- drivers/gpu/drm/i915/intel_pm.c | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/intel_atomic.c +3 -2
@@ -227,6 +227,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state;struct drm_atomic_state *drm_state = crtc_state->base.state; +struct intel_atomic_state *intel_state =to_intel_atomic_state (drm_state);int num_scalers_need;int i, j;
@@ -304,8 +305,8 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,continue ; } - plane_state =intel_atomic_get_existing_plane_state (drm_state, - intel_plane); + plane_state =intel_atomic_get_new_plane_state (intel_state, + intel_plane); scaler_id = &plane_state->scaler_id; }
drivers/gpu/drm/i915/intel_drv.h +0 -11
@@ -2109,17 +2109,6 @@ intel_atomic_get_existing_crtc_state(struct drm_atomic_state *state,return NULL ; } -static inline struct intel_plane_state * -intel_atomic_get_existing_plane_state (struct drm_atomic_state *state, -struct intel_plane *plane) -{ -struct drm_plane_state *plane_state; - - plane_state =drm_atomic_get_existing_plane_state (state, &plane->base); - -return to_intel_plane_state (plane_state); -} -int intel_atomic_setup_scalers (struct drm_i915_private *dev_priv,struct intel_crtc *intel_crtc,struct intel_crtc_state *crtc_state);
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -5037,7 +5037,7 @@ skl_ddb_add_affected_planes(struct intel_crtc_state *cstate)struct drm_plane *plane;enum pipe pipe = intel_crtc->pipe; -WARN_ON (!drm_atomic_get_existing_crtc_state (state, crtc)); +WARN_ON (!drm_atomic_get_new_crtc_state (state, crtc));drm_for_each_plane_mask (plane, dev, cstate->base.plane_mask) {enum plane_id plane_id =to_intel_plane (plane)->id;
Signature · 6 lines
2.16.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915: Remove get_existing_crtc_state
get_existing_crtc_state is currently unused, get rid of it.
--- drivers/gpu/drm/i915/intel_drv.h | 14 -------------- 1 file changed, 14 deletions(-)
drivers/gpu/drm/i915/intel_drv.h +0 -14
@@ -2095,20 +2095,6 @@ intel_atomic_get_crtc_state(struct drm_atomic_state *state,return to_intel_crtc_state (crtc_state); } -static inline struct intel_crtc_state * -intel_atomic_get_existing_crtc_state (struct drm_atomic_state *state, -struct intel_crtc *crtc) -{ -struct drm_crtc_state *crtc_state; - - crtc_state =drm_atomic_get_existing_crtc_state (state, &crtc->base); - -if (crtc_state) -return to_intel_crtc_state (crtc_state); -else -return NULL ; -} -int intel_atomic_setup_scalers (struct drm_i915_private *dev_priv,struct intel_crtc *intel_crtc,struct intel_crtc_state *crtc_state);
Signature · 6 lines
2.16.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/4] drm/i915: Remove get_existing_crtc_state
Quoted 3 lines · Maarten Lankhorst
get_existing_crtc_stateis currently unused, get rid of it.Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 36 lines
--- drivers/gpu/drm/i915/intel_drv.h | 14 -------------- 1 file changed, 14 deletions(-)drivers/gpu/drm/i915/intel_drv.h +0
-14@@ -2095,20 +2095,6 @@ intel_atomic_get_crtc_state(struct drm_atomic_state *state,return to_intel_crtc_state (crtc_state); } -static inline struct intel_crtc_state * -intel_atomic_get_existing_crtc_state (struct drm_atomic_state *state, -struct intel_crtc *crtc) -{ -struct drm_crtc_state *crtc_state; - - crtc_state =drm_atomic_get_existing_crtc_state (state, &crtc->base); - -if (crtc_state) -return to_intel_crtc_state (crtc_state); -else -return NULL ; -} -int intel_atomic_setup_scalers (struct drm_i915_private *dev_priv,struct intel_crtc *intel_crtc,struct intel_crtc_state *crtc_state);Signature · 6 lines
2.16.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 drm/i915: Remove last references to drm_atomic_get_existing* macros
In reply to Maarten LankhorstAll the references to get_existing_state can be converted to get_new_state or get_old_state, which means that i915 is now get_existing_state free.
--- drivers/gpu/drm/i915/intel_display.c | 51 ++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 28 deletions(-)
drivers/gpu/drm/i915/intel_display.c +23 -28
@@ -5148,8 +5148,8 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)intel_atomic_get_new_crtc_state (to_intel_atomic_state (old_state), crtc);struct drm_plane *primary = crtc->base.primary; -struct drm_plane_state *old_pri_state = -drm_atomic_get_existing_plane_state (old_state, primary); +struct drm_plane_state *old_primary_state = +drm_atomic_get_old_plane_state (old_state, primary);intel_frontbuffer_flip (to_i915 (crtc->base.dev), pipe_config->fb_bits);
@@ -5159,19 +5159,16 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)if (hsw_post_update_enable_ips (old_crtc_state, pipe_config))hsw_enable_ips (pipe_config); -if (old_pri_state) { -struct intel_plane_state *primary_state = -intel_atomic_get_new_plane_state (to_intel_atomic_state (old_state), -to_intel_plane (primary)); -struct intel_plane_state *old_primary_state = -to_intel_plane_state (old_pri_state); -struct drm_framebuffer *fb = primary_state->base.fb; +if (old_primary_state) { +struct drm_plane_state *new_primary_state = +drm_atomic_get_new_plane_state (old_state, primary); +struct drm_framebuffer *fb = new_primary_state->fb;intel_fbc_post_update (crtc); -if (primary_state->base.visible && +if (new_primary_state->visible && (needs_modeset (&pipe_config->base) || - !old_primary_state->base.visible)) + !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config);/* Display WA 827 */
@@ -5192,8 +5189,8 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct drm_i915_private *dev_priv =to_i915 (dev);struct drm_atomic_state *old_state = old_crtc_state->base.state;struct drm_plane *primary = crtc->base.primary; -struct drm_plane_state *old_pri_state = -drm_atomic_get_existing_plane_state (old_state, primary); +struct drm_plane_state *old_primary_state = +drm_atomic_get_old_plane_state (old_state, primary);bool modeset =needs_modeset (&pipe_config->base);struct intel_atomic_state *old_intel_state =to_intel_atomic_state (old_state);
@@ -5201,13 +5198,11 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,if (hsw_pre_update_disable_ips (old_crtc_state, pipe_config))hsw_disable_ips (old_crtc_state); -if (old_pri_state) { -struct intel_plane_state *primary_state = +if (old_primary_state) { +struct intel_plane_state *new_primary_state =intel_atomic_get_new_plane_state (old_intel_state,to_intel_plane (primary)); -struct intel_plane_state *old_primary_state = -to_intel_plane_state (old_pri_state); -struct drm_framebuffer *fb = primary_state->base.fb; +struct drm_framebuffer *fb = new_primary_state->base.fb;/* Display WA 827 */ if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) ||
@@ -5216,13 +5211,13 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,skl_wa_clkgate (dev_priv, crtc->pipe, true); } -intel_fbc_pre_update (crtc, pipe_config, primary_state); +intel_fbc_pre_update (crtc, pipe_config, new_primary_state);/* * Gen2 reports pipe underruns whenever all planes are disabled. * So disable underrun reporting before all the planes get disabled. */ -if (IS_GEN2 (dev_priv) && old_primary_state->base.visible && - (modeset || !primary_state->base.visible)) +if (IS_GEN2 (dev_priv) && old_primary_state->visible && + (modeset || !new_primary_state->base.visible))intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, false); }
@@ -10836,7 +10831,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)struct drm_connector_state *connector_state;struct intel_encoder *encoder; - connector_state =drm_atomic_get_existing_connector_state (state, connector); + connector_state =drm_atomic_get_new_connector_state (state, connector);if (!connector_state) connector_state = connector->state;
@@ -12199,6 +12194,9 @@ static void intel_update_crtc(struct drm_crtc *crtc,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); +struct intel_plane_state *new_plane_state = +intel_atomic_get_new_plane_state (to_intel_atomic_state (state), +to_intel_plane (crtc->primary));if (modeset) {update_scanline_offset (intel_crtc);
@@ -12211,11 +12209,8 @@ static void intel_update_crtc(struct drm_crtc *crtc, pipe_config); } -if (drm_atomic_get_existing_plane_state (state, crtc->primary)) { -intel_fbc_enable ( - intel_crtc, pipe_config, -to_intel_plane_state (crtc->primary->state)); - } +if (new_plane_state) +intel_fbc_enable (intel_crtc, pipe_config, new_plane_state);drm_atomic_helper_commit_planes_on_crtc (old_crtc_state); }
@@ -12796,7 +12791,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,if (old_obj) {struct drm_crtc_state *crtc_state = -drm_atomic_get_existing_crtc_state (new_state->state, +drm_atomic_get_new_crtc_state (new_state->state, plane->state->crtc);/* Big Hammer, we also need to ensure that any pending
Signature · 6 lines
2.16.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/4] drm/i915: Remove last references to drm_atomic_get_existing* macros
Quoted 129 lines · Maarten Lankhorst
All the references to
get_existing_statecan be converted toget_new_stateorget_old_state, which means that i915 is nowget_existing_statefree.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 51 ++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 28 deletions(-)drivers/gpu/drm/i915/intel_display.c +22
-27@@ -5148,8 +5148,8 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)intel_atomic_get_new_crtc_state (to_intel_atomic_state (old_state), crtc);struct drm_plane *primary = crtc->base.primary; -struct drm_plane_state *old_pri_state = -drm_atomic_get_existing_plane_state (old_state, primary); +struct drm_plane_state *old_primary_state = +drm_atomic_get_old_plane_state (old_state, primary);intel_frontbuffer_flip (to_i915 (crtc->base.dev), pipe_config->fb_bits);@@ -5159,19 +5159,16 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)if (hsw_post_update_enable_ips (old_crtc_state, pipe_config))hsw_enable_ips (pipe_config); -if (old_pri_state) { -struct intel_plane_state *primary_state = -intel_atomic_get_new_plane_state (to_intel_atomic_state (old_state), -to_intel_plane (primary)); -struct intel_plane_state *old_primary_state = -to_intel_plane_state (old_pri_state); -struct drm_framebuffer *fb = primary_state->base.fb; +if (old_primary_state) { +struct drm_plane_state *new_primary_state = +drm_atomic_get_new_plane_state (old_state, primary); +struct drm_framebuffer *fb = new_primary_state->fb;intel_fbc_post_update (crtc); -if (primary_state->base.visible && +if (new_primary_state->visible && (needs_modeset (&pipe_config->base) || - !old_primary_state->base.visible)) + !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config);/* Display WA 827 */ @@ -5192,8 +5189,8 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct drm_i915_private *dev_priv =to_i915 (dev);struct drm_atomic_state *old_state = old_crtc_state->base.state;struct drm_plane *primary = crtc->base.primary; -struct drm_plane_state *old_pri_state = -drm_atomic_get_existing_plane_state (old_state, primary); +struct drm_plane_state *old_primary_state = +drm_atomic_get_old_plane_state (old_state, primary);bool modeset =needs_modeset (&pipe_config->base);struct intel_atomic_state *old_intel_state =to_intel_atomic_state (old_state);@@ -5201,13 +5198,11 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,if (hsw_pre_update_disable_ips (old_crtc_state, pipe_config))hsw_disable_ips (old_crtc_state); -if (old_pri_state) { -struct intel_plane_state *primary_state = +if (old_primary_state) { +struct intel_plane_state *new_primary_state =intel_atomic_get_new_plane_state (old_intel_state,to_intel_plane (primary)); -struct intel_plane_state *old_primary_state = -to_intel_plane_state (old_pri_state); -struct drm_framebuffer *fb = primary_state->base.fb; +struct drm_framebuffer *fb = new_primary_state->base.fb;/* Display WA 827 */ if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) ||@@ -5216,13 +5211,13 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,skl_wa_clkgate (dev_priv, crtc->pipe, true); } -intel_fbc_pre_update (crtc, pipe_config, primary_state); +intel_fbc_pre_update (crtc, pipe_config, new_primary_state);/* * Gen2 reports pipe underruns whenever all planes are disabled. * So disable underrun reporting before all the planes get disabled. */ -if (IS_GEN2 (dev_priv) && old_primary_state->base.visible && - (modeset || !primary_state->base.visible)) +if (IS_GEN2 (dev_priv) && old_primary_state->visible && + (modeset || !new_primary_state->base.visible))intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, false); }@@ -10836,7 +10831,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)struct drm_connector_state *connector_state;struct intel_encoder *encoder; - connector_state =drm_atomic_get_existing_connector_state (state, connector); + connector_state =drm_atomic_get_new_connector_state (state, connector);if (!connector_state) connector_state = connector->state;@@ -12199,6 +12194,9 @@ static void intel_update_crtc(struct drm_crtc *crtc,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); +struct intel_plane_state *new_plane_state = +intel_atomic_get_new_plane_state (to_intel_atomic_state (state), +to_intel_plane (crtc->primary));if (modeset) {update_scanline_offset (intel_crtc);@@ -12211,11 +12209,8 @@ static void intel_update_crtc(struct drm_crtc *crtc, pipe_config); } -if (drm_atomic_get_existing_plane_state (state, crtc->primary)) { -intel_fbc_enable ( - intel_crtc, pipe_config, -to_intel_plane_state (crtc->primary->state)); - } +if (new_plane_state) +intel_fbc_enable (intel_crtc, pipe_config, new_plane_state);drm_atomic_helper_commit_planes_on_crtc (old_crtc_state); }
drivers/gpu/drm/i915/intel_display.c intel_prepare_plane_fb(struct drm_plane *plane, · line 12795
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +1
-1@@ -12796,7 +12791,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,if (old_obj) {struct drm_crtc_state *crtc_state = -drm_atomic_get_existing_crtc_state (new_state->state, +drm_atomic_get_new_crtc_state (new_state->state, plane->state->crtc);
The second line would wish to be realigned.
Otherwise
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +0
-0/* Big Hammer, we also need to ensure that any pending Signature · 6 lines
2.16.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/4] drm/i915: Remove last references to drm_atomic_get_existing* macros
Op 09-04-18 om 15:04 schreef Ville Syrjälä:
Quoted 138 lines · Maarten Lankhorst
Quoted 129 lines
All the references to
get_existing_statecan be converted toget_new_stateorget_old_state, which means that i915 is nowget_existing_statefree.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 51 ++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 28 deletions(-)drivers/gpu/drm/i915/intel_display.c +22
-27@@ -5148,8 +5148,8 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)intel_atomic_get_new_crtc_state (to_intel_atomic_state (old_state), crtc);struct drm_plane *primary = crtc->base.primary; -struct drm_plane_state *old_pri_state = -drm_atomic_get_existing_plane_state (old_state, primary); +struct drm_plane_state *old_primary_state = +drm_atomic_get_old_plane_state (old_state, primary);intel_frontbuffer_flip (to_i915 (crtc->base.dev), pipe_config->fb_bits);@@ -5159,19 +5159,16 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)if (hsw_post_update_enable_ips (old_crtc_state, pipe_config))hsw_enable_ips (pipe_config); -if (old_pri_state) { -struct intel_plane_state *primary_state = -intel_atomic_get_new_plane_state (to_intel_atomic_state (old_state), -to_intel_plane (primary)); -struct intel_plane_state *old_primary_state = -to_intel_plane_state (old_pri_state); -struct drm_framebuffer *fb = primary_state->base.fb; +if (old_primary_state) { +struct drm_plane_state *new_primary_state = +drm_atomic_get_new_plane_state (old_state, primary); +struct drm_framebuffer *fb = new_primary_state->fb;intel_fbc_post_update (crtc); -if (primary_state->base.visible && +if (new_primary_state->visible && (needs_modeset (&pipe_config->base) || - !old_primary_state->base.visible)) + !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config);/* Display WA 827 */ @@ -5192,8 +5189,8 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct drm_i915_private *dev_priv =to_i915 (dev);struct drm_atomic_state *old_state = old_crtc_state->base.state;struct drm_plane *primary = crtc->base.primary; -struct drm_plane_state *old_pri_state = -drm_atomic_get_existing_plane_state (old_state, primary); +struct drm_plane_state *old_primary_state = +drm_atomic_get_old_plane_state (old_state, primary);bool modeset =needs_modeset (&pipe_config->base);struct intel_atomic_state *old_intel_state =to_intel_atomic_state (old_state);@@ -5201,13 +5198,11 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,if (hsw_pre_update_disable_ips (old_crtc_state, pipe_config))hsw_disable_ips (old_crtc_state); -if (old_pri_state) { -struct intel_plane_state *primary_state = +if (old_primary_state) { +struct intel_plane_state *new_primary_state =intel_atomic_get_new_plane_state (old_intel_state,to_intel_plane (primary)); -struct intel_plane_state *old_primary_state = -to_intel_plane_state (old_pri_state); -struct drm_framebuffer *fb = primary_state->base.fb; +struct drm_framebuffer *fb = new_primary_state->base.fb;/* Display WA 827 */ if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) ||@@ -5216,13 +5211,13 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,skl_wa_clkgate (dev_priv, crtc->pipe, true); } -intel_fbc_pre_update (crtc, pipe_config, primary_state); +intel_fbc_pre_update (crtc, pipe_config, new_primary_state);/* * Gen2 reports pipe underruns whenever all planes are disabled. * So disable underrun reporting before all the planes get disabled. */ -if (IS_GEN2 (dev_priv) && old_primary_state->base.visible && - (modeset || !primary_state->base.visible)) +if (IS_GEN2 (dev_priv) && old_primary_state->visible && + (modeset || !new_primary_state->base.visible))intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, false); }@@ -10836,7 +10831,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)struct drm_connector_state *connector_state;struct intel_encoder *encoder; - connector_state =drm_atomic_get_existing_connector_state (state, connector); + connector_state =drm_atomic_get_new_connector_state (state, connector);if (!connector_state) connector_state = connector->state;@@ -12199,6 +12194,9 @@ static void intel_update_crtc(struct drm_crtc *crtc,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); +struct intel_plane_state *new_plane_state = +intel_atomic_get_new_plane_state (to_intel_atomic_state (state), +to_intel_plane (crtc->primary));if (modeset) {update_scanline_offset (intel_crtc);@@ -12211,11 +12209,8 @@ static void intel_update_crtc(struct drm_crtc *crtc, pipe_config); } -if (drm_atomic_get_existing_plane_state (state, crtc->primary)) { -intel_fbc_enable ( - intel_crtc, pipe_config, -to_intel_plane_state (crtc->primary->state)); - } +if (new_plane_state) +intel_fbc_enable (intel_crtc, pipe_config, new_plane_state);drm_atomic_helper_commit_planes_on_crtc (old_crtc_state); }drivers/gpu/drm/i915/intel_display.c intel_prepare_plane_fb(struct drm_plane *plane, · line 12795
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +1
-1@@ -12796,7 +12791,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,if (old_obj) {struct drm_crtc_state *crtc_state = -drm_atomic_get_existing_crtc_state (new_state->state, +drm_atomic_get_new_crtc_state (new_state->state, plane->state->crtc);The second line would wish to be realigned.
Quoted 2 lines
Otherwise
Reviewed-by Ville Syrjälä <[email protected]>
Thanks, pushed up to here. Will resend the workaround patch.
~Maarten
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915: Enable display workaround 827 for all planes.
In reply to Maarten LankhorstThe workaround was applied only to the primary plane, but is required on all planes. Iterate over all planes in the crtc atomic check to see if the workaround is enabled, and only perform the actual toggling in the pre/post plane update functions.
--- drivers/gpu/drm/i915/intel_display.c | 40 +++++++++++++++++++++--------------- drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 24 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/intel_display.c +23 -17
@@ -5162,7 +5162,6 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)if (old_primary_state) {struct drm_plane_state *new_primary_state =drm_atomic_get_new_plane_state (old_state, primary); -struct drm_framebuffer *fb = new_primary_state->fb;intel_fbc_post_update (crtc);
@@ -5170,15 +5169,11 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) (needs_modeset(&pipe_config->base) || !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config); - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, false); - } - } + +/* Display WA 827 */ +if (old_crtc_state->nv12_wa && !pipe_config->nv12_wa) +skl_wa_clkgate (dev_priv, crtc->pipe, false); } static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
@@ -5202,14 +5197,6 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct intel_plane_state *new_primary_state =intel_atomic_get_new_plane_state (old_intel_state,to_intel_plane (primary)); -struct drm_framebuffer *fb = new_primary_state->base.fb; - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, true); - }intel_fbc_pre_update (crtc, pipe_config, new_primary_state);/*
@@ -5221,6 +5208,10 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, false); } +/* Display WA 827 */ +if (!old_crtc_state->nv12_wa && pipe_config->nv12_wa) +skl_wa_clkgate (dev_priv, crtc->pipe, true); +/* * Vblank time updates from the shadow to live plane control register * are blocked if the memory self-refresh mode is active at that
@@ -10485,6 +10476,21 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,return ret; } + pipe_config->nv12_wa = false; + +/* Apply display WA 827 if required. */ +if (crtc_state->active && + ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || +IS_CANNONLAKE (dev_priv))) { +struct drm_plane *plane; +const struct drm_plane_state *plane_state; + +drm_atomic_crtc_state_for_each_plane_state (plane, plane_state, crtc_state) +if (plane_state->fb && + plane_state->fb->format->format ==DRM_FORMAT_NV12 ) + pipe_config->nv12_wa = true; + } +if (crtc_state->color_mgmt_changed) { ret =intel_color_check (crtc, crtc_state);if (ret)
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -723,6 +723,7 @@ struct intel_crtc_state {bool update_wm_pre, update_wm_post;/* watermarks are updated */ bool fb_changed;/* fb on any of the planes is changed */ bool fifo_changed;/* FIFO split is changed */ +bool nv12_wa;/* Whether display WA 827 needs to be enabled. */ /* Pipe source size (ie. panel fitter input size) * All planes will be positioned inside this space,
Signature · 6 lines
2.16.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/4] drm/i915: Enable display workaround 827 for all planes.
Quoted 70 lines · Maarten Lankhorst
The workaround was applied only to the primary plane, but is required on all planes. Iterate over all planes in the crtc atomic check to see if the workaround is enabled, and only perform the actual toggling in the pre/post plane update functions.
Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 40 +++++++++++++++++++++--------------- drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 24 insertions(+), 17 deletions(-)drivers/gpu/drm/i915/intel_display.c +8
-17@@ -5162,7 +5162,6 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)if (old_primary_state) {struct drm_plane_state *new_primary_state =drm_atomic_get_new_plane_state (old_state, primary); -struct drm_framebuffer *fb = new_primary_state->fb;intel_fbc_post_update (crtc);@@ -5170,15 +5169,11 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) (needs_modeset(&pipe_config->base) || !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config); - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, false); - } - } + +/* Display WA 827 */ +if (old_crtc_state->nv12_wa && !pipe_config->nv12_wa) +skl_wa_clkgate (dev_priv, crtc->pipe, false); } static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,@@ -5202,14 +5197,6 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct intel_plane_state *new_primary_state =intel_atomic_get_new_plane_state (old_intel_state,to_intel_plane (primary)); -struct drm_framebuffer *fb = new_primary_state->base.fb; - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, true); - }intel_fbc_pre_update (crtc, pipe_config, new_primary_state);/* @@ -5221,6 +5208,10 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, false); } +/* Display WA 827 */ +if (!old_crtc_state->nv12_wa && pipe_config->nv12_wa) +skl_wa_clkgate (dev_priv, crtc->pipe, true); +/* * Vblank time updates from the shadow to live plane control register * are blocked if the memory self-refresh mode is active at that
drivers/gpu/drm/i915/intel_display.c static int intel_crtc_atomic_check(struct drm_crtc *crtc, · line 10484
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +6
-0@@ -10485,6 +10476,21 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,return ret; } + pipe_config->nv12_wa = false; + +/* Apply display WA 827 if required. */ +if (crtc_state->active && + ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || +IS_CANNONLAKE (dev_priv))) {
GLK doesn't need this? That seems odd to say the least.
drivers/gpu/drm/i915/intel_display.c static int intel_crtc_atomic_check(struct drm_crtc *crtc, · line 10488
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+struct drm_plane *plane; +const struct drm_plane_state *plane_state; + +drm_atomic_crtc_state_for_each_plane_state (plane, plane_state, crtc_state)
I'd prefer a bitmask instead of that sneaky peeking of the plane states.
It should also avoid polluting this sort of central/generic piece of code with platform specific w/as.
Quoted 27 lines
drivers/gpu/drm/i915/intel_display.c +5
-0+if (plane_state->fb && + plane_state->fb->format->format ==DRM_FORMAT_NV12 ) + pipe_config->nv12_wa = true; + } +if (crtc_state->color_mgmt_changed) { ret =intel_color_check (crtc, crtc_state);if (ret)drivers/gpu/drm/i915/intel_drv.h +1
-0@@ -723,6 +723,7 @@ struct intel_crtc_state {bool update_wm_pre, update_wm_post;/* watermarks are updated */ bool fb_changed;/* fb on any of the planes is changed */ bool fifo_changed;/* FIFO split is changed */ +bool nv12_wa;/* Whether display WA 827 needs to be enabled. */ /* Pipe source size (ie. panel fitter input size) * All planes will be positioned inside this space, Signature · 6 lines
2.16.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 60 lines · Maarten Lankhorst
The
get_existingmacros are deprecated and should be replaced by get_old/new_state for clarity.Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/i915/intel_atomic.c | 5 +++-- drivers/gpu/drm/i915/intel_drv.h | 11 ----------- drivers/gpu/drm/i915/intel_pm.c | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-)drivers/gpu/drm/i915/intel_atomic.c +3
-2@@ -227,6 +227,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state;struct drm_atomic_state *drm_state = crtc_state->base.state; +struct intel_atomic_state *intel_state =to_intel_atomic_state (drm_state);int num_scalers_need;int i, j;@@ -304,8 +305,8 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,continue ; } - plane_state =intel_atomic_get_existing_plane_state (drm_state, - intel_plane); + plane_state =intel_atomic_get_new_plane_state (intel_state, + intel_plane); scaler_id = &plane_state->scaler_id; }drivers/gpu/drm/i915/intel_drv.h +0
-11@@ -2109,17 +2109,6 @@ intel_atomic_get_existing_crtc_state(struct drm_atomic_state *state,return NULL ; } -static inline struct intel_plane_state * -intel_atomic_get_existing_plane_state (struct drm_atomic_state *state, -struct intel_plane *plane) -{ -struct drm_plane_state *plane_state; - - plane_state =drm_atomic_get_existing_plane_state (state, &plane->base); - -return to_intel_plane_state (plane_state); -} -int intel_atomic_setup_scalers (struct drm_i915_private *dev_priv,struct intel_crtc *intel_crtc,struct intel_crtc_state *crtc_state);drivers/gpu/drm/i915/intel_pm.c +0
-0
drivers/gpu/drm/i915/intel_pm.c skl_ddb_add_affected_planes(struct intel_crtc_state *cstate) · line 5040
Quoted 5 lines
drivers/gpu/drm/i915/intel_pm.c +1
-1@@ -5037,7 +5037,7 @@ skl_ddb_add_affected_planes(struct intel_crtc_state *cstate)struct drm_plane *plane;enum pipe pipe = intel_crtc->pipe; -WARN_ON (!drm_atomic_get_existing_crtc_state (state, crtc)); +WARN_ON (!drm_atomic_get_new_crtc_state (state, crtc));
This assert seems rather pointless since we got the drm_atomic_state via cstate->base.state.
Anyways, patch is
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +0
-0drm_for_each_plane_mask (plane, dev, cstate->base.plane_mask) {enum plane_id plane_id =to_intel_plane (plane)->id;Signature · 6 lines
2.16.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915: Change use get_new_plane_state instead of existing plane state
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915: Change use get_new_plane_state instead of existing plane state
URL : https://patchwork.freedesktop.org/series/41370/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 591b58b45998 drm/i915: Change use get_new_plane_state instead of existing plane state 2c8e55a34368 drm/i915: Remove get_existing_crtc_state 78e0056cb594 drm/i915: Remove last references to drm_atomic_get_existing* macros -:142: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #142: FILE: drivers/gpu/drm/i915/intel_display.c:12795: + drm_atomic_get_new_crtc_state(new_state->state, plane->state->crtc);
total: 0 errors, 0 warnings, 1 checks, 115 lines checked 90d0615ca37a drm/i915: Enable display workaround 827 for all planes.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/4] drm/i915: Change use get_new_plane_state instead of existing plane state
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915: Change use get_new_plane_state instead of existing plane state
URL : https://patchwork.freedesktop.org/series/41370/
State : success
== Summary ==
Series 41370v1 series starting with [1/4] drm/i915: Change use get_new_plane_state instead of existing plane state
https://patchwork.freedesktop.org/api/1.0/series/41370/revisions/1/mbox/
---- Known issues:
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
pass -> DMESG-WARN (fi-cnl-y3) fdo#104951fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:430s fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:449s fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:382s fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:543s fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:297s fi-bxt-dsi total:285 pass:255 dwarn:0 dfail:0 fail:0 skip:30 time:516s fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:519s fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:520s fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:514s fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:414s fi-cfl-s3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:561s fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:511s fi-cnl-y3 total:285 pass:258 dwarn:1 dfail:0 fail:0 skip:26 time:580s fi-elk-e7500 total:285 pass:226 dwarn:0 dfail:0 fail:0 skip:59 time:424s fi-gdg-551 total:285 pass:177 dwarn:0 dfail:0 fail:0 skip:108 time:316s fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:544s fi-glk-j4005 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:483s fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:410s fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:423s fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:469s fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:434s fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:472s fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:466s fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:508s fi-pnv-d510 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:671s fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:439s fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:542s fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:508s fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:501s fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:428s fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:446s fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:590s fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:399s
e5a01dd0c5d224beec064e40184cc63a82ae79ce drm-tip: 2018y-04m-09d-12h-37m-09s UTC integration manifest 90d0615ca37a drm/i915: Enable display workaround 827 for all planes.78e0056cb594 drm/i915: Remove last references to drm_atomic_get_existing* macros 2c8e55a34368 drm/i915: Remove get_existing_crtc_state591b58b45998 drm/i915: Change use get_new_plane_state instead of existing plane state
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8643/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [1/4] drm/i915: Change use get_new_plane_state instead of existing plane state
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915: Change use get_new_plane_state instead of existing plane state
URL : https://patchwork.freedesktop.org/series/41370/
State : success
== Summary ==
---- Known issues:
Test kms_flip:
Subgroup flip-vs-absolute-wf_vblank:
pass -> FAIL (shard-hsw) fdo#100368
Subgroup flip-vs-expired-vblank:
pass -> FAIL (shard-hsw) fdo#102887fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
shard-apl total:2680 pass:1835 dwarn:1 dfail:0 fail:7 skip:836 time:12644s shard-hsw total:2680 pass:1783 dwarn:1 dfail:0 fail:4 skip:891 time:11369s Blacklisted hosts: shard-kbl total:2680 pass:1964 dwarn:1 dfail:0 fail:6 skip:709 time:9202s shard-snb total:2680 pass:1366 dwarn:1 dfail:0 fail:10 skip:1303 time:6924s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8643/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx