[PATCH 2/2] drm/i915/icl: Clear the shared port PLLs from the put_dplls() hook

Imre Deak imre.deak at intel.com
Wed Jul 3 18:40:46 UTC 2019


For consistency clear the icl_port_dplls, when releasing these DPLLs.
Leaving them set could result in releasing the same PLL multiple times
from the same CRTC incorrectly (if the CRTC was first used for a TypeC
port then for a combo PHY port). This happens not to cause a problem
(since the incorrect releasing will be a NOP), but it's better to avoid
that.

Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
index 7dbb4995b594..7f02e57aec8d 100644
--- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
+++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
@@ -3018,15 +3018,16 @@ static void icl_put_dplls(struct intel_atomic_state *state,
 	enum icl_port_dpll_id id;
 
 	for (id = ICL_PORT_DPLL_DEFAULT; id < ICL_PORT_DPLL_COUNT; id++) {
-		struct icl_port_dpll *port_dpll =
+		struct icl_port_dpll *old_port_dpll =
 			&old_crtc_state->icl_port_dplls[id];
+		struct icl_port_dpll *new_port_dpll =
+			&new_crtc_state->icl_port_dplls[id];
 
-		if (!port_dpll->pll)
+		if (!old_port_dpll->pll)
 			continue;
 
-		intel_unreference_shared_dpll(state, crtc, port_dpll->pll);
-
-		/* FIXME: Clear the icl_port_dplls from the new crtc state */
+		intel_unreference_shared_dpll(state, crtc, old_port_dpll->pll);
+		new_port_dpll->pll = NULL;
 	}
 
 	new_crtc_state->shared_dpll = NULL;
-- 
2.17.1



More information about the Intel-gfx-trybot mailing list