Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260105055937.136522-2-suraj.kandpal@intel.com

+11 -6
+11 -6
drivers/gpu/drm/i915/display/intel_lt_phy.c
··· 2207 2207 intel_lt_phy_pll_compare_hw_state(const struct intel_lt_phy_pll_state *a, 2208 2208 const struct intel_lt_phy_pll_state *b) 2209 2209 { 2210 - if (memcmp(&a->config, &b->config, sizeof(a->config)) != 0) 2211 - return false; 2210 + /* 2211 + * With LT PHY values other than VDR0_CONFIG and VDR2_CONFIG are 2212 + * unreliable. They cannot always be read back since internally 2213 + * after power gating values are not restored back to the 2214 + * shadow VDR registers. Thus we do not compare the whole state 2215 + * just the two VDR registers. 2216 + */ 2217 + if (a->config[0] == b->config[0] && 2218 + a->config[2] == b->config[2]) 2219 + return true; 2212 2220 2213 - if (memcmp(&a->data, &b->data, sizeof(a->data)) != 0) 2214 - return false; 2215 - 2216 - return true; 2221 + return false; 2217 2222 } 2218 2223 2219 2224 void intel_lt_phy_pll_readout_hw_state(struct intel_encoder *encoder,