drm/i915/xe2lpd: Move D2D enable/disable
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 26 Jan 2024 22:46:36 +0000 (14:46 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 30 Jan 2024 15:20:21 +0000 (07:20 -0800)
commitd5c7854b50e634097da5dd6d221997ecf31ec8c1
tree711bc09cc5e4a288a68e20db9e53efda5e960e36
parent4073dbbc56baafcf1ada13dca2af40e06806580e
drm/i915/xe2lpd: Move D2D enable/disable

Bits to enable/disable and check state for D2D moved from
XELPDP_PORT_BUF_CTL1 to DDI_BUF_CTL (now named DDI_CTL_DE in the spec).
Make the functions mtl_ddi_disable_d2d() and mtl_ddi_enable_d2d generic
to work with multiple reg location and bitfield layout.

v2: Set/Clear XE2LPD_DDI_BUF_D2D_LINK_ENABLE in saved_port_bits when
    enabling/disabling D2D so DDI_BUF_CTL is correctly programmed in
    other places without overriding these bits (Clint)
v3: Leave saved_port_bits alone as those bits are not meant to be
    modified outside of the port initialization. Rather propagate the
    additional bit in DDI_BUF_CTL to be set when that register is
    written again after D2D is enabled.

Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240126224638.4132016-2-lucas.demarchi@intel.com
drivers/gpu/drm/i915/display/intel_ddi.c
drivers/gpu/drm/i915/i915_reg.h