drm/i915/display: Enhance iterators for modeset en/disable
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Wed, 18 Sep 2024 06:30:16 +0000 (12:00 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Thu, 19 Sep 2024 09:59:56 +0000 (15:29 +0530)
commitae5d0397b7e6a563aeb8708b08cad17390755a8f
tree74f86db5191f7a2495ee9351c774fcfc6c4c9e5c
parent0644d2be99cd044e8c78e7a1ee781c622b60917c
drm/i915/display: Enhance iterators for modeset en/disable

Joiners have specific enabling and disabling order dependent on primary
and secondary pipes. This becomes more complex with ultrajoiner where we
have ultrajoiner primary/secondary pipes in addition to bigjoiner
primary/secondary pipes. To unify the approach that works for present
and future joiner cases, use primary and secondary pipe masks to
iterate over pipes.

If joiner is used, derive bigoiner primary and secondary pipe masks
and use following sequences:
Disabling : disable primary pipes followed by secondary pipes,
Enabling: enable secondary pipes followed by primary pipes.

This works well with ultrajoiner too, as ultrajoiner has 2 bigjoiner
primary/secondary pairs (AC, BD).

For non joiner case, enable/disable based on usual pipe order A-D, D-A
respectively.

v2:
-Simplify the iterator macro. (Ville)
-Use struct intel_display. (Ville)
-Add prefix _intel to the helper name. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240918063016.2667721-3-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_ddi.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display.h
drivers/gpu/drm/i915/display/intel_dp_mst.c