Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad6a2bc7 authored by Ben Skeggs's avatar Ben Skeggs Committed by Greg Kroah-Hartman
Browse files

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: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 689179c4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -419,7 +419,7 @@ nvkm_dp_train(struct nvkm_dp *dp, u32 dataKBps)
	return ret;
}

static void
void
nvkm_dp_disable(struct nvkm_outp *outp, struct nvkm_ior *ior)
{
	struct nvkm_dp *dp = nvkm_dp(outp);
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ struct nvkm_dp {

int nvkm_dp_new(struct nvkm_disp *, int index, struct dcb_output *,
		struct nvkm_outp **);
void nvkm_dp_disable(struct nvkm_outp *, struct nvkm_ior *);

/* DPCD Receiver Capabilities */
#define DPCD_RC00_DPCD_REV                                              0x00000
+9 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
 * Authors: Ben Skeggs
 */
#include "outp.h"
#include "dp.h"
#include "ior.h"

#include <subdev/bios.h>
@@ -216,6 +217,14 @@ nvkm_outp_init_route(struct nvkm_outp *outp)
	if (!ior->arm.head || ior->arm.proto != proto) {
		OUTP_DBG(outp, "no heads (%x %d %d)", ior->arm.head,
			 ior->arm.proto, proto);

		/* The EFI GOP driver on Ampere can leave unused DP links routed,
		 * which we don't expect.  The DisableLT IED script *should* get
		 * us back to where we need to be.
		 */
		if (ior->func->route.get && !ior->arm.head && outp->info.type == DCB_OUTPUT_DP)
			nvkm_dp_disable(outp, ior);

		return;
	}