Commit Graph

25 Commits

Author SHA1 Message Date
Ben Skeggs ad6a2bc758 drm/nouveau/disp: power down unused DP links during init
[ Upstream commit 6eaa1f3c59a707332e921e32782ffcad49915c5e ]

When booted with multiple displays attached, the EFI GOP driver on (at
least) Ampere, can leave DP links powered up that aren't being used to
display anything.  This confuses our tracking of SOR routing, with the
likely result being a failed modeset and display engine hang.

Fix this by (ab?)using the DisableLT IED script to power-down the link,
restoring HW to a state the driver expects.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-03 10:08:15 +02:00
Ben Skeggs 13d03e9daf drm/nouveau/disp/dp: respect sink limits when selecting failsafe link configuration
Where possible, we want the failsafe link configuration (one which won't
hang the OR during modeset because of not enough bandwidth for the mode)
to also be supported by the sink.

This prevents "link rate unsupported by sink" messages when link training
fails.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2019-05-14 16:58:06 +10:00
Ben Skeggs e04cfdc9b7 drm/nouveau/disp: fix DP disable race
If a HPD pulse signalling the need to retrain the link occurs between
the KMS driver releasing the output and the supervisor interrupt that
finishes the teardown, it was possible get a NULL-ptr deref.

Avoid this by marking the link as inactive earlier.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2018-09-07 06:54:28 +10:00
Ben Skeggs f6d52b2172 drm/nouveau/disp: move eDP panel power handling
We need to do this earlier to prevent aux channel timeouts in resume
paths on certain systems.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2018-09-07 06:54:28 +10:00
Ben Skeggs 8d7ef84d90 drm/nouveau/disp/nv50-: implement a common supervisor 2.2
This makes use of all the additional routing and state added in previous
commits, making it possible to deal with GM20x macro link routing, while
also sharing code between the NV50 and GF119 implementations.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:05:00 +10:00
Ben Skeggs d52e948c67 drm/nouveau/disp/nv50-: implement a common supervisor 2.0
This makes use of all the additional routing and state added in previous
commits, making it possible to deal with GM20x macro link routing, while
also sharing code between the NV50 and GF119 implementations.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:59 +10:00
Ben Skeggs 32a232c514 drm/nouveau/disp/dp: use new devinit script interpreter entry-point
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:58 +10:00
Ben Skeggs 9648da5a71 drm/nouveau/disp/dp: determine link bandwidth requirements from head state
Training/Untraining will be hooked up to the routing logic, which
doesn't allow us to pass in a data rate.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:58 +10:00
Ben Skeggs 6c22ea3747 drm/nouveau/disp: introduce acquire/release display path methods
These exist to give NVKM information on the set of display paths that
the DD needs to be active at any given time.

Previously, the supervisor attempted to determine this solely from OR
state, but there's a few configurations where this information on its
own isn't enough to determine the specific display paths in question:

- ANX9805, where the PIOR protocol for both DP and TMDS is TMDS.
- On a device using DCB Switched Outputs.
- On GM20x and newer, with a crossbar between the SOR and macro links.

After this commit, the DD tells NVKM *exactly* which display path it's
attempting a modeset on.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:57 +10:00
Ben Skeggs 3c66c87dc9 drm/nouveau/disp: remove hw-specific customisation of output paths
All of the necessary hw-specific logic is now handled at the output
resource level, so all of this can go away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:57 +10:00
Ben Skeggs 7d1fede03c drm/nouveau/disp/g94-: port OR DP drive setting control to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:56 +10:00
Ben Skeggs a1de2b522f drm/nouveau/disp/g94-: port OR DP training pattern control to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:56 +10:00
Ben Skeggs a3e81117ce drm/nouveau/disp/g94-: port OR DP link power control to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:55 +10:00
Ben Skeggs 7dc0bac4aa drm/nouveau/disp/g94-: port OR DP link setup to nvkm_ior
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:55 +10:00
Ben Skeggs 7d0a01a6de drm/nouveau/disp/dp: train link only when actively displaying an image
This essentially (unless the link becomes unstable and needs to be
re-trained) gives us a single entry-point to link training, during
supervisor handling, where we can ensure all routing is up to date.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:52 +10:00
Ben Skeggs 22e008f90d drm/nouveau/disp/dp: only check for re-train when the link is active
An upcoming commit will limit link training to only when the sink is
meant to be displaying an image.

We still need IRQs enabled even when the link isn't trained (for MST
messages), but don't want to train the link unnecessarily.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:52 +10:00
Ben Skeggs 49f2b376df drm/nouveau/disp/dp: determine a failsafe link training rate
The aim here is to protect the OR against locking up when something
unexpected happens (such as the display disappearing during modeset,
or the DD misbehaving).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:51 +10:00
Ben Skeggs fafa8b5c9f drm/nouveau/disp/dp: use cached link configuration when checking link status
Saves some trips across the aux channel.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:51 +10:00
Ben Skeggs 4423c743ef drm/nouveau/disp/dp: no need for lt_state except during manual link training
This struct doesn't hold link configuration data anymore, so we can
limit its use to internal DP training (anx9805 handles training for
external DP).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:51 +10:00
Ben Skeggs 75eefe95ee drm/nouveau/disp/dp: store current link configuration in nvkm_ior
We care about this information outside of link training.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:50 +10:00
Ben Skeggs 01a976376b drm/nouveau/disp: identity-map display paths to output resources
This essentially replicates our current behaviour in a way that's
compatible with the new model that's emerging, so that we're able
to start porting the hw-specific functions to it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:49 +10:00
Ben Skeggs 981a8162e2 drm/nouveau/disp: s/nvkm_connector/nvkm_conn/
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:47 +10:00
Ben Skeggs f3e70d2991 drm/nouveau/disp: rename nvkm_output_dp to nvkm_dp
Not all users of nvkm_output_dp have been changed here.  The remaining
ones belong to code that's disappearing in upcoming commits.

This also modifies the debug level of some messages.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:46 +10:00
Ben Skeggs d7ce92e273 drm/nouveau/disp: rename nvkm_output to nvkm_outp
This isn't technically "output", but, "display/output path".

Not all users of nvkm_output have been changed here.  The remaining
ones belong to code that's disappearing in upcoming commits.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:46 +10:00
Ben Skeggs af85389c61 drm/nouveau/disp: shuffle functions around
Upcoming changes to split OR from output path drastically change the
placement of various operations.

In order to make the real changes clearer, do the moving around part
ahead of time.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2017-06-16 14:04:46 +10:00