]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
drm/i915: Simplify intel_cx0_program_phy_lane() with loop
authorGustavo Sousa <gustavo.sousa@intel.com>
Mon, 14 Aug 2023 13:13:29 +0000 (10:13 -0300)
committerMatt Roper <matthew.d.roper@intel.com>
Thu, 17 Aug 2023 19:25:14 +0000 (12:25 -0700)
commit0f5c2e5bd2fc8d2e09043b6bb3c81a889a483997
treeaee0d51830164b2f56f0a5c5cfe31abb1880962c
parent3a8ecd4c3ede7283619536917e61c1aa3b9db6b7
drm/i915: Simplify intel_cx0_program_phy_lane() with loop

It is possible to generalize the "disable" value for the transmitters to
be a bit mask based on the port width and the port reversal boolean,
with a small exception for DP-alt mode with "x1" port width.

Simplify the code by using such a mask and a for-loop instead of using
switch-case statements.

v2:
  - Use (i < 2) instead of (i / 2 == 0) for PHY lane mask selection.
    (Jani)

BSpec: 64539
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230814131331.69516-3-gustavo.sousa@intel.com
drivers/gpu/drm/i915/display/intel_cx0_phy.c