diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h index 0b5115dac4d6b030cb1187da5d9bc17558635a68..f40819ead3207e1b5761ad7cfedb38f9b1707069 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h @@ -49,6 +49,10 @@ struct nvkm_ior_func { u8 max_ac_packet, u8 rekey, u8 *avi, u8 avi_size, u8 *vendor, u8 vendor_size); } hdmi; + + struct { + u8 lanes[4]; + } dp; }; int nvkm_ior_new_(const struct nvkm_ior_func *func, struct nvkm_disp *, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c index 3175bb3031b57ecd13e73154feb5a69b05a77dbd..3bcd31adecd8ee65eac7d8537cf8ca5dd45caaf8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c @@ -44,14 +44,7 @@ g94_sor_loff(struct nvkm_output_dp *outp) u32 g94_sor_dp_lane_map(struct nvkm_device *device, u8 lane) { - static const u8 gm100[] = { 0, 8, 16, 24 }; - 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]; + return nvkm_ior_find(device->disp, SOR, -1)->func->dp.lanes[lane] * 8; } static int @@ -305,6 +298,9 @@ static const struct nvkm_ior_func g94_sor = { .state = g94_sor_state, .power = nv50_sor_power, + .dp = { + .lanes = { 2, 1, 0, 3}, + }, }; int diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c index c3ce42e7a12e35d2b520f20f65eef8dd6a71e3db..c97c178be3dc1efc2981c7cb11f04601bfab5054 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c @@ -160,6 +160,9 @@ gf119_sor = { .hdmi = { .ctrl = gf119_hdmi_ctrl, }, + .dp = { + .lanes = { 2, 1, 0, 3 }, + }, }; int diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c index 9f71f9438c6ab853219c644e7ad1e7ad798907b4..6d85a285e47b95ed65e3f6769ffde1805ba42017 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c @@ -28,6 +28,9 @@ gk104_sor = { .hdmi = { .ctrl = gk104_hdmi_ctrl, }, + .dp = { + .lanes = { 2, 1, 0, 3 }, + }, }; int diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c index acffeff59a70c0314b9c8efeaecfe9c8a3eee7ad..bb055cd91b2f9fbffe134979845338478db6f44b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c @@ -60,6 +60,9 @@ gm107_sor = { .hdmi = { .ctrl = gk104_hdmi_ctrl, }, + .dp = { + .lanes = { 0, 1, 2, 3 }, + }, }; int diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c index c8773d0580730918e8c5dc85576c0e82019a6026..11fed49fa9b6f4a773e298a09406ee6e02c27fe8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c @@ -41,7 +41,7 @@ gm200_sor_loff(struct nvkm_output_dp *outp) static inline u32 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 @@ -137,6 +137,9 @@ gm200_sor = { .hdmi = { .ctrl = gk104_hdmi_ctrl, }, + .dp = { + .lanes = { 0, 1, 2, 3 }, + }, }; int diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgt215.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgt215.c index 7036eeeace570f89de4abdf8b813f592822afa83..221255228e041363437d046f3839e329c704af66 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgt215.c @@ -28,6 +28,9 @@ gt215_sor = { .hdmi = { .ctrl = gt215_hdmi_ctrl, }, + .dp = { + .lanes = { 2, 1, 0, 3 }, + }, }; int diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp77.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp77.c index a074a4733ca0409d172810b0424a0ed5cf149530..a771d10f253b73caeeff098364351357396c9be5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp77.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp77.c @@ -28,6 +28,9 @@ mcp77_sor = { .hdmi = { .ctrl = g84_hdmi_ctrl, }, + .dp = { + .lanes = { 2, 1, 0, 3}, + }, }; int diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp89.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp89.c index 56cf11ff0659226492a0d62684c4e90bf463dba2..aece6bec5ecf091eedf035f51de782b6a42d6023 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp89.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sormcp89.c @@ -28,6 +28,9 @@ mcp89_sor = { .hdmi = { .ctrl = gt215_hdmi_ctrl, }, + .dp = { + .lanes = { 3, 2, 1, 0 }, + }, }; int