drm/i915: Fix inconsistance between pfit.enable and scaler freeing
Subsystems (3)
PATCH v2 1/1 drm/i915: Fix inconsistance between pfit.enable and scaler freeing
Despite that during hw readout we seem to have scalers assigned to pipes, then call atomic_setup_scalers, at the commit stage in skl_update_scaler there is a check, that if we have fb src and dest of same size, we stage freeing of that scaler.
However we don't update pfit.enabled flag then, which makes the state inconsistent, which in turn triggers a WARN_ON in skl_pfit_enable, because we have pfit enabled, but no assigned scaler.
To me this looks weird that we kind of do the decision to use or not use the scaler at skl_update_scaler stage but not in intel_atomic_setup_scalers, moreover not updating the whole state consistently.
This fix is to not free the scaler if we have pfit.enabled flag set, so that the state is now consistent
and the warnings are gone.
Bugzilla: https://gitlab.freedesktop.org/drm/intel/issues/577
--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
@@ -5953,7 +5953,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,* the 90/270 degree plane rotation cases (to match the * GTT mapping), hence no need to account for rotation here. */ -if (src_w != dst_w || src_h != dst_h) +if (src_w != dst_w || src_h != dst_h || crtc_state->pch_pfit.enabled) need_scaler = true;/*
Signature · 6 lines
2.24.1.485.gad05a3d8e5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 30 lines · Stanislav Lisovskiy
Despite that during hw readout we seem to have scalers assigned to pipes, then call
atomic_setup_scalers, at the commit stage inskl_update_scalerthere is a check, that if we have fb src and dest of same size, we stage freeing of that scaler.However we don't update pfit.enabled flag then, which makes the state inconsistent, which in turn triggers a
WARN_ONinskl_pfit_enable, because we have pfit enabled, but no assigned scaler.To me this looks weird that we kind of do the decision to use or not use the scaler at
skl_update_scalerstage but not inintel_atomic_setup_scalers, moreover not updating the whole state consistently.This fix is to not free the scaler if we have pfit.enabled flag set, so that the state is now consistent
and the warnings are gone.Bugzilla: https://gitlab.freedesktop.org/drm/intel/issues/577
Signed-off-by Stanislav Lisovskiy <[email protected]>--- drivers/gpu/drm/i915/display/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/display/intel_display.c +0
-0
drivers/gpu/drm/i915/display/intel_display.c skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, · line 5956
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_display.c +1
-1@@ -5953,7 +5953,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,* the 90/270 degree plane rotation cases (to match the * GTT mapping), hence no need to account for rotation here. */ -if (src_w != dst_w || src_h != dst_h) +if (src_w != dst_w || src_h != dst_h || crtc_state->pch_pfit.enabled)
This is called for both pfit and planes. So you need to put that pfit check into the pfit specific function.
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_display.c +0
-0need_scaler = true;/* Signature · 1 line
2.24.1.485.gad05a3d8e5
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx