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

Commit a971558c authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Ben Skeggs
Browse files

drm/nouveau/disp: keep track of high-speed state, program into clock



The register programmed by the clock method needs to contain a different
setting for the link speed as well as special divider settings.

Signed-off-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 4834e050
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -31,4 +31,6 @@ gm200_hdmi_scdc(struct nvkm_ior *ior, int head, u8 scdc)
	const u32 ctrl = scdc & 0x3;

	nvkm_mask(device, 0x61c5bc + hoff, 0x00000003, ctrl);

	ior->tmds.high_speed = !!(scdc & 0x2);
}
+5 −0
Original line number Diff line number Diff line
@@ -41,6 +41,11 @@ struct nvkm_ior {
		u8 nr;
		u8 bw;
	} dp;

	/* Armed TMDS state. */
	struct {
		bool high_speed;
	} tmds;
};

struct nvkm_ior_func {
+7 −4
Original line number Diff line number Diff line
@@ -120,13 +120,16 @@ void
gf119_sor_clock(struct nvkm_ior *sor)
{
	struct nvkm_device *device = sor->disp->engine.subdev.device;
	const int  div = sor->asy.link == 3;
	const u32 soff = nv50_ior_base(sor);
	u32 div1 = sor->asy.link == 3;
	u32 div2 = sor->asy.link == 3;
	if (sor->asy.proto == TMDS) {
		/* NFI why, but this sets DP_LINK_BW_2_7 when using TMDS. */
		nvkm_mask(device, 0x612300 + soff, 0x007c0000, 0x0a << 18);
		const u32 speed = sor->tmds.high_speed ? 0x14 : 0x0a;
		nvkm_mask(device, 0x612300 + soff, 0x007c0000, speed << 18);
		if (sor->tmds.high_speed)
			div2 = 1;
	}
	nvkm_mask(device, 0x612300 + soff, 0x00000707, (div << 8) | div);
	nvkm_mask(device, 0x612300 + soff, 0x00000707, (div2 << 8) | div1);
}

void