Commit 33378104 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/disp/g94-: port OR DP lane mapping to nvkm_ior

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 797b2fb8
...@@ -49,6 +49,10 @@ struct nvkm_ior_func { ...@@ -49,6 +49,10 @@ struct nvkm_ior_func {
u8 max_ac_packet, u8 rekey, u8 *avi, u8 avi_size, u8 max_ac_packet, u8 rekey, u8 *avi, u8 avi_size,
u8 *vendor, u8 vendor_size); u8 *vendor, u8 vendor_size);
} hdmi; } hdmi;
struct {
u8 lanes[4];
} dp;
}; };
int nvkm_ior_new_(const struct nvkm_ior_func *func, struct nvkm_disp *, int nvkm_ior_new_(const struct nvkm_ior_func *func, struct nvkm_disp *,
......
...@@ -44,14 +44,7 @@ g94_sor_loff(struct nvkm_output_dp *outp) ...@@ -44,14 +44,7 @@ g94_sor_loff(struct nvkm_output_dp *outp)
u32 u32
g94_sor_dp_lane_map(struct nvkm_device *device, u8 lane) g94_sor_dp_lane_map(struct nvkm_device *device, u8 lane)
{ {
static const u8 gm100[] = { 0, 8, 16, 24 }; return nvkm_ior_find(device->disp, SOR, -1)->func->dp.lanes[lane] * 8;
static const u8 mcp89[] = { 24, 16, 8, 0 }; /* thanks, apple.. */
static const u8 g94[] = { 16, 8, 0, 24 };
if (device->chipset >= 0x110)
return gm100[lane];
if (device->chipset == 0xaf)
return mcp89[lane];
return g94[lane];
} }
static int static int
...@@ -305,6 +298,9 @@ static const struct nvkm_ior_func ...@@ -305,6 +298,9 @@ static const struct nvkm_ior_func
g94_sor = { g94_sor = {
.state = g94_sor_state, .state = g94_sor_state,
.power = nv50_sor_power, .power = nv50_sor_power,
.dp = {
.lanes = { 2, 1, 0, 3},
},
}; };
int int
......
...@@ -160,6 +160,9 @@ gf119_sor = { ...@@ -160,6 +160,9 @@ gf119_sor = {
.hdmi = { .hdmi = {
.ctrl = gf119_hdmi_ctrl, .ctrl = gf119_hdmi_ctrl,
}, },
.dp = {
.lanes = { 2, 1, 0, 3 },
},
}; };
int int
......
...@@ -28,6 +28,9 @@ gk104_sor = { ...@@ -28,6 +28,9 @@ gk104_sor = {
.hdmi = { .hdmi = {
.ctrl = gk104_hdmi_ctrl, .ctrl = gk104_hdmi_ctrl,
}, },
.dp = {
.lanes = { 2, 1, 0, 3 },
},
}; };
int int
......
...@@ -60,6 +60,9 @@ gm107_sor = { ...@@ -60,6 +60,9 @@ gm107_sor = {
.hdmi = { .hdmi = {
.ctrl = gk104_hdmi_ctrl, .ctrl = gk104_hdmi_ctrl,
}, },
.dp = {
.lanes = { 0, 1, 2, 3 },
},
}; };
int int
......
...@@ -41,7 +41,7 @@ gm200_sor_loff(struct nvkm_output_dp *outp) ...@@ -41,7 +41,7 @@ gm200_sor_loff(struct nvkm_output_dp *outp)
static inline u32 static inline u32
gm200_sor_dp_lane_map(struct nvkm_device *device, u8 lane) gm200_sor_dp_lane_map(struct nvkm_device *device, u8 lane)
{ {
return lane * 0x08; return nvkm_ior_find(device->disp, SOR, -1)->func->dp.lanes[lane] * 8;
} }
static int static int
...@@ -137,6 +137,9 @@ gm200_sor = { ...@@ -137,6 +137,9 @@ gm200_sor = {
.hdmi = { .hdmi = {
.ctrl = gk104_hdmi_ctrl, .ctrl = gk104_hdmi_ctrl,
}, },
.dp = {
.lanes = { 0, 1, 2, 3 },
},
}; };
int int
......
...@@ -28,6 +28,9 @@ gt215_sor = { ...@@ -28,6 +28,9 @@ gt215_sor = {
.hdmi = { .hdmi = {
.ctrl = gt215_hdmi_ctrl, .ctrl = gt215_hdmi_ctrl,
}, },
.dp = {
.lanes = { 2, 1, 0, 3 },
},
}; };
int int
......
...@@ -28,6 +28,9 @@ mcp77_sor = { ...@@ -28,6 +28,9 @@ mcp77_sor = {
.hdmi = { .hdmi = {
.ctrl = g84_hdmi_ctrl, .ctrl = g84_hdmi_ctrl,
}, },
.dp = {
.lanes = { 2, 1, 0, 3},
},
}; };
int int
......
...@@ -28,6 +28,9 @@ mcp89_sor = { ...@@ -28,6 +28,9 @@ mcp89_sor = {
.hdmi = { .hdmi = {
.ctrl = gt215_hdmi_ctrl, .ctrl = gt215_hdmi_ctrl,
}, },
.dp = {
.lanes = { 3, 2, 1, 0 },
},
}; };
int int
......
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