Commit 7d0a01a6 authored by Ben Skeggs's avatar Ben Skeggs

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: default avatarBen Skeggs <bskeggs@redhat.com>
parent 22e008f9
...@@ -417,7 +417,9 @@ nvkm_output_dp_train(struct nvkm_outp *outp, u32 datakbps) ...@@ -417,7 +417,9 @@ nvkm_output_dp_train(struct nvkm_outp *outp, u32 datakbps)
/* Check that link configuration meets current requirements. */ /* Check that link configuration meets current requirements. */
linkKBps = ior->dp.bw * 27000 * ior->dp.nr; linkKBps = ior->dp.bw * 27000 * ior->dp.nr;
dataKBps = DIV_ROUND_UP(datakbps, 8); dataKBps = DIV_ROUND_UP(datakbps, 8);
if (linkKBps < dataKBps) { OUTP_DBG(&dp->outp, "data %d KB/s link %d KB/s mst %d->%d",
dataKBps, linkKBps, ior->dp.mst, dp->lt.mst);
if (linkKBps < dataKBps || ior->dp.mst != dp->lt.mst) {
OUTP_DBG(&dp->outp, "link requirements changed"); OUTP_DBG(&dp->outp, "link requirements changed");
goto done; goto done;
} }
...@@ -466,10 +468,8 @@ nvkm_dp_enable(struct nvkm_dp *dp, bool enable) ...@@ -466,10 +468,8 @@ nvkm_dp_enable(struct nvkm_dp *dp, bool enable)
} }
if (!nvkm_rdaux(aux, DPCD_RC00_DPCD_REV, dp->dpcd, if (!nvkm_rdaux(aux, DPCD_RC00_DPCD_REV, dp->dpcd,
sizeof(dp->dpcd))) { sizeof(dp->dpcd)))
nvkm_output_dp_train(&dp->outp, 0);
return; return;
}
} }
if (dp->present) { if (dp->present) {
......
...@@ -125,7 +125,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size) ...@@ -125,7 +125,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
} }
break; break;
case NV50_DISP_MTHD_V1_SOR_DP_MST_LINK: { case NV50_DISP_MTHD_V1_SOR_DP_MST_LINK: {
struct nvkm_output_dp *outpdp = nvkm_output_dp(outp); struct nvkm_dp *dp = nvkm_dp(outp);
union { union {
struct nv50_disp_sor_dp_mst_link_v0 v0; struct nv50_disp_sor_dp_mst_link_v0 v0;
} *args = data; } *args = data;
...@@ -134,11 +134,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size) ...@@ -134,11 +134,7 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) { if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))) {
nvif_ioctl(object, "disp sor dp mst link vers %d state %d\n", nvif_ioctl(object, "disp sor dp mst link vers %d state %d\n",
args->v0.version, args->v0.state); args->v0.version, args->v0.state);
if (outpdp->lt.mst != !!args->v0.state) { dp->lt.mst = !!args->v0.state;
outpdp->lt.mst = !!args->v0.state;
atomic_set(&outpdp->lt.done, 0);
nvkm_output_dp_train(&outpdp->base, 0);
}
return 0; return 0;
} else } else
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment