drm: rcar-du: Centralise routing configuration in commit tail handler
Routing configuration for the DU is complex. Depending on the SoC
generation various routing options are available:
- The VSP to DU routing is not available on Gen1, is configurable on
Gen2 and is fixed on Gen3. When configurable, the routing affects both
CRTC groups but is set in a register of the first CRTC group.
- The DU channel to DPAD output routing is explicitly configurable on
some SoCs of the Gen2 and Gen3 family. When configurable, the DPAD
outputs never offer routing options to CRTCs belonging to different
groups.
- On all SoCs the routing of DU channels to DU pin controllers (internal
output of the DU channels) can be swapped within a group. This feature
is only used on Gen1 to control routing of the DPAD1 output.
Routing is thus handled at the group level, but for Gen2 hardware
requires configuration of the DPAD1 and VSPD1 routing in the first group
even when only the second group is enabled.
Routing at the group level is currently configured when applying CRTC
configuration. Global routing is configured at the same time, and is
additionally configured by the plane setup code to set VSPD1 routing.
This results in code paths that are difficult to follow.
Simplify the routing configuration by performing it all directly, based
on CRTC and CRTC group state. Group-level routing is moved to group
setup as it only depends on the group state and the state of the CRTCs
it contains. Global routing is moved to the commit tail handler, and
based on global DU state.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
v6:
- Fix bitrot with cmm
6 files changed