Commit 73b506e6 authored by Suraj Kandpal's avatar Suraj Kandpal
Browse files

drm/i915/ltphy: Compare only certain fields in state verify function



Verify only the config[0,2] fields in the LT PHY state since these
are the only reliable values we can get back when we read the VDR
registers. The reason being that the state does not persist for other
VDR registers when power gating comes into picture.
Though not ideal this change does not hit us badly in perspective of how
we use the compare function to decide if fastset is required or if we
wrote the state correctly. VDR0_CONFIG and VDR1_CONFIG hold the values
that indicate the PLL operating mode and link rate which is usually
what we need to check if something has changed or not.

Signed-off-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260105055937.136522-2-suraj.kandpal@intel.com
parent c7830b51
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -2207,13 +2207,18 @@ bool
intel_lt_phy_pll_compare_hw_state(const struct intel_lt_phy_pll_state *a,
				  const struct intel_lt_phy_pll_state *b)
{
	if (memcmp(&a->config, &b->config, sizeof(a->config)) != 0)
		return false;
	/*
	 * With LT PHY values other than VDR0_CONFIG and VDR2_CONFIG are
	 * unreliable. They cannot always be read back since internally
	 * after power gating values are not restored back to the
	 * shadow VDR registers. Thus we do not compare the whole state
	 * just the two VDR registers.
	 */
	if (a->config[0] == b->config[0] &&
	    a->config[2] == b->config[2])
		return true;

	if (memcmp(&a->data, &b->data, sizeof(a->data)) != 0)
	return false;

	return true;
}

void intel_lt_phy_pll_readout_hw_state(struct intel_encoder *encoder,