mbox series

[0/5] Add HDMI PLL Algorithm for SNPS/C10PHY

Message ID 20240813031941.3553574-1-ankit.k.nautiyal@intel.com (mailing list archive)
Headers show
Series Add HDMI PLL Algorithm for SNPS/C10PHY | expand

Message

Nautiyal, Ankit K Aug. 13, 2024, 3:19 a.m. UTC
The HDMI PLL programming involves pre-calculated values for specific
frequencies and an algorithm to compute values for other frequencies.
While the algorithm itself wasn't part of the driver, tables were
added based on it for known modes.

Some HDMI modes were pruned due to lack of support (for example issues
[1],[2], and [3]).
This series adds the algorithm for computing HDMI PLLs for SNPS/C10PHY
to work with all modes supported by the hardware.

The original algorithm uses floating-point math, which has been
converted to integers while preserving precision. As a result,
the values in the existing computable tables are very close but not
exact. Testing with DG2 and MTL on various panels revealed no issues.

[1] https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9722
[2] https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10654
[3] https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10956

Rev2:
-Changed the name of the new file for HDMI PLL algorithm.
-Fixed styling issues and bit refactoring for readbility.
-Fixed issues reported by kernel test bot.

Rev3:
-Modified the names of helper functions to align with filename.

Ankit Nautiyal (5):
  drm/i915/display: Add support for SNPS PHY HDMI PLL algorithm for DG2
  drm/i915/snps_phy: Use HDMI PLL algorithm for DG2
  drm/i915/cx0_phy_regs: Add C10 registers bits
  drm/i915/intel_snps_hdmi_pll: Compute C10 HDMI PLLs with algorithm
  drm/i915/cx0_phy: Use HDMI PLL algorithm for C10 PHY

 drivers/gpu/drm/i915/Makefile                 |   1 +
 drivers/gpu/drm/i915/display/intel_cx0_phy.c  |  49 +--
 drivers/gpu/drm/i915/display/intel_cx0_phy.h  |   1 -
 .../gpu/drm/i915/display/intel_cx0_phy_regs.h |  24 ++
 drivers/gpu/drm/i915/display/intel_hdmi.c     |  12 -
 .../drm/i915/display/intel_snps_hdmi_pll.c    | 362 ++++++++++++++++++
 .../drm/i915/display/intel_snps_hdmi_pll.h    |  17 +
 drivers/gpu/drm/i915/display/intel_snps_phy.c |  37 +-
 drivers/gpu/drm/i915/display/intel_snps_phy.h |   1 -
 drivers/gpu/drm/xe/Makefile                   |   1 +
 10 files changed, 425 insertions(+), 80 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_snps_hdmi_pll.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_snps_hdmi_pll.h