Commit f2a40513 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/disp/sor/gf119-: add method to control mst enable

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 1f8711ba
...@@ -34,6 +34,7 @@ struct nv50_disp_mthd_v1 { ...@@ -34,6 +34,7 @@ struct nv50_disp_mthd_v1 {
#define NV50_DISP_MTHD_V1_SOR_HDMI_PWR 0x22 #define NV50_DISP_MTHD_V1_SOR_HDMI_PWR 0x22
#define NV50_DISP_MTHD_V1_SOR_LVDS_SCRIPT 0x23 #define NV50_DISP_MTHD_V1_SOR_LVDS_SCRIPT 0x23
#define NV50_DISP_MTHD_V1_SOR_DP_PWR 0x24 #define NV50_DISP_MTHD_V1_SOR_DP_PWR 0x24
#define NV50_DISP_MTHD_V1_SOR_DP_MST_LINK 0x25
#define NV50_DISP_MTHD_V1_PIOR_PWR 0x30 #define NV50_DISP_MTHD_V1_PIOR_PWR 0x30
__u8 method; __u8 method;
__u16 hasht; __u16 hasht;
...@@ -90,6 +91,12 @@ struct nv50_disp_sor_dp_pwr_v0 { ...@@ -90,6 +91,12 @@ struct nv50_disp_sor_dp_pwr_v0 {
__u8 pad02[6]; __u8 pad02[6];
}; };
struct nv50_disp_sor_dp_mst_link_v0 {
__u8 version;
__u8 state;
__u8 pad02[6];
};
struct nv50_disp_pior_pwr_v0 { struct nv50_disp_pior_pwr_v0 {
__u8 version; __u8 version;
__u8 state; __u8 state;
......
...@@ -203,17 +203,19 @@ gf119_disp_intr_unk2_0(struct nv50_disp *disp, int head) ...@@ -203,17 +203,19 @@ gf119_disp_intr_unk2_0(struct nv50_disp *disp, int head)
/* see note in nv50_disp_intr_unk20_0() */ /* see note in nv50_disp_intr_unk20_0() */
if (outp && outp->info.type == DCB_OUTPUT_DP) { if (outp && outp->info.type == DCB_OUTPUT_DP) {
struct nvkm_output_dp *outpdp = nvkm_output_dp(outp); struct nvkm_output_dp *outpdp = nvkm_output_dp(outp);
struct nvbios_init init = { if (!outpdp->lt.mst) {
.subdev = subdev, struct nvbios_init init = {
.bios = subdev->device->bios, .subdev = subdev,
.outp = &outp->info, .bios = subdev->device->bios,
.crtc = head, .outp = &outp->info,
.offset = outpdp->info.script[4], .crtc = head,
.execute = 1, .offset = outpdp->info.script[4],
}; .execute = 1,
};
nvbios_exec(&init); nvbios_exec(&init);
atomic_set(&outpdp->lt.done, 0); atomic_set(&outpdp->lt.done, 0);
}
} }
} }
......
...@@ -32,6 +32,7 @@ struct nvkm_output_dp { ...@@ -32,6 +32,7 @@ struct nvkm_output_dp {
struct mutex mutex; struct mutex mutex;
struct { struct {
atomic_t done; atomic_t done;
bool mst;
} lt; } lt;
}; };
......
...@@ -180,6 +180,26 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size) ...@@ -180,6 +180,26 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
return ret; return ret;
} }
break; break;
case NV50_DISP_MTHD_V1_SOR_DP_MST_LINK: {
struct nvkm_output_dp *outpdp = nvkm_output_dp(outp);
union {
struct nv50_disp_sor_dp_mst_link_v0 v0;
} *args = data;
int ret = -ENOSYS;
nvif_ioctl(object, "disp sor dp mst link size %d\n", size);
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",
args->v0.version, args->v0.state);
if (outpdp->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;
} else
return ret;
}
break;
case NV50_DISP_MTHD_V1_PIOR_PWR: case NV50_DISP_MTHD_V1_PIOR_PWR:
if (!func->pior.power) if (!func->pior.power)
return -ENODEV; return -ENODEV;
......
...@@ -56,11 +56,13 @@ gf119_sor_dp_lnk_ctl(struct nvkm_output_dp *outp, int nr, int bw, bool ef) ...@@ -56,11 +56,13 @@ gf119_sor_dp_lnk_ctl(struct nvkm_output_dp *outp, int nr, int bw, bool ef)
clksor |= bw << 18; clksor |= bw << 18;
dpctrl |= ((1 << nr) - 1) << 16; dpctrl |= ((1 << nr) - 1) << 16;
if (outp->lt.mst)
dpctrl |= 0x40000000;
if (ef) if (ef)
dpctrl |= 0x00004000; dpctrl |= 0x00004000;
nvkm_mask(device, 0x612300 + soff, 0x007c0000, clksor); nvkm_mask(device, 0x612300 + soff, 0x007c0000, clksor);
nvkm_mask(device, 0x61c10c + loff, 0x001f4000, dpctrl); nvkm_mask(device, 0x61c10c + loff, 0x401f4000, dpctrl);
return 0; return 0;
} }
......
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