return 0;
}
- dp->func->lnk_pwr(dp, ior->dp.nr);
+ ior->func->dp.power(ior, ior->dp.nr);
/* Set desired link configuration on the sink. */
sink[0] = ior->dp.bw;
struct nvkm_output_dp_func {
int (*pattern)(struct nvkm_output_dp *, int);
- int (*lnk_pwr)(struct nvkm_output_dp *, int nr);
int (*drv_ctl)(struct nvkm_output_dp *, int ln, int vs, int pe, int pc);
void (*vcpi)(struct nvkm_output_dp *, int head, u8 start_slot,
u8 num_slots, u16 pbn, u16 aligned_pbn);
int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
struct nvkm_output **);
-int g94_sor_dp_lnk_pwr(struct nvkm_dp *, int);
int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
struct nvkm_output **);
struct {
u8 lanes[4];
int (*links)(struct nvkm_ior *, struct nvkm_i2c_aux *);
+ void (*power)(struct nvkm_ior *, int nr);
} dp;
};
void g94_sor_state(struct nvkm_ior *, struct nvkm_ior_state *);
int g94_sor_dp_links(struct nvkm_ior *, struct nvkm_i2c_aux *);
+void g94_sor_dp_power(struct nvkm_ior *, int);
void gf119_sor_state(struct nvkm_ior *, struct nvkm_ior_state *);
int gf119_sor_dp_links(struct nvkm_ior *, struct nvkm_i2c_aux *);
return 0;
}
-static int
-nv50_pior_output_dp_lnk_pwr(struct nvkm_output_dp *outp, int nr)
-{
- return 0;
-}
-
static int
nv50_pior_dp_links(struct nvkm_ior *pior, struct nvkm_i2c_aux *aux)
{
static const struct nvkm_output_dp_func
nv50_pior_output_dp_func = {
.pattern = nv50_pior_output_dp_pattern,
- .lnk_pwr = nv50_pior_output_dp_lnk_pwr,
};
int
return 0;
}
-int
-g94_sor_dp_lnk_pwr(struct nvkm_output_dp *outp, int nr)
+void
+g94_sor_dp_power(struct nvkm_ior *sor, int nr)
{
- struct nvkm_device *device = outp->base.disp->engine.subdev.device;
- const u32 soff = g94_sor_soff(outp);
- const u32 loff = g94_sor_loff(outp);
+ struct nvkm_device *device = sor->disp->engine.subdev.device;
+ const u32 soff = nv50_ior_base(sor);
+ const u32 loff = nv50_sor_link(sor);
u32 mask = 0, i;
for (i = 0; i < nr; i++)
- mask |= 1 << (g94_sor_dp_lane_map(device, i) >> 3);
+ mask |= 1 << sor->func->dp.lanes[i];
nvkm_mask(device, 0x61c130 + loff, 0x0000000f, mask);
nvkm_mask(device, 0x61c034 + soff, 0x80000000, 0x80000000);
if (!(nvkm_rd32(device, 0x61c034 + soff) & 0x80000000))
break;
);
- return 0;
}
int
static const struct nvkm_output_dp_func
g94_sor_dp_func = {
.pattern = g94_sor_dp_pattern,
- .lnk_pwr = g94_sor_dp_lnk_pwr,
.drv_ctl = g94_sor_dp_drv_ctl,
};
.dp = {
.lanes = { 2, 1, 0, 3},
.links = g94_sor_dp_links,
+ .power = g94_sor_dp_power,
},
};
static const struct nvkm_output_dp_func
gf119_sor_dp_func = {
.pattern = gf119_sor_dp_pattern,
- .lnk_pwr = g94_sor_dp_lnk_pwr,
.drv_ctl = gf119_sor_dp_drv_ctl,
.vcpi = gf119_sor_dp_vcpi,
};
.dp = {
.lanes = { 2, 1, 0, 3 },
.links = gf119_sor_dp_links,
+ .power = g94_sor_dp_power,
},
};
.dp = {
.lanes = { 2, 1, 0, 3 },
.links = gf119_sor_dp_links,
+ .power = g94_sor_dp_power,
},
};
static const struct nvkm_output_dp_func
gm107_sor_dp_func = {
.pattern = gm107_sor_dp_pattern,
- .lnk_pwr = g94_sor_dp_lnk_pwr,
.drv_ctl = gf119_sor_dp_drv_ctl,
.vcpi = gf119_sor_dp_vcpi,
};
.dp = {
.lanes = { 0, 1, 2, 3 },
.links = gf119_sor_dp_links,
+ .power = g94_sor_dp_power,
},
};
#include "ior.h"
#include "nv50.h"
-#include <subdev/timer.h>
-
static inline u32
gm200_sor_soff(struct nvkm_output_dp *outp)
{
return 0;
}
-static int
-gm200_sor_dp_lnk_pwr(struct nvkm_output_dp *outp, int nr)
-{
- struct nvkm_device *device = outp->base.disp->engine.subdev.device;
- const u32 soff = gm200_sor_soff(outp);
- const u32 loff = gm200_sor_loff(outp);
- u32 mask = 0, i;
-
- for (i = 0; i < nr; i++)
- mask |= 1 << (gm200_sor_dp_lane_map(device, i) >> 3);
-
- nvkm_mask(device, 0x61c130 + loff, 0x0000000f, mask);
- nvkm_mask(device, 0x61c034 + soff, 0x80000000, 0x80000000);
- nvkm_msec(device, 2000,
- if (!(nvkm_rd32(device, 0x61c034 + soff) & 0x80000000))
- break;
- );
- return 0;
-}
-
static const struct nvkm_output_dp_func
gm200_sor_dp_func = {
.pattern = gm107_sor_dp_pattern,
- .lnk_pwr = gm200_sor_dp_lnk_pwr,
.drv_ctl = gm200_sor_dp_drv_ctl,
.vcpi = gf119_sor_dp_vcpi,
};
.dp = {
.lanes = { 0, 1, 2, 3 },
.links = gf119_sor_dp_links,
+ .power = g94_sor_dp_power,
},
};
.dp = {
.lanes = { 2, 1, 0, 3 },
.links = g94_sor_dp_links,
+ .power = g94_sor_dp_power,
},
};
.dp = {
.lanes = { 2, 1, 0, 3},
.links = g94_sor_dp_links,
+ .power = g94_sor_dp_power,
},
};
.dp = {
.lanes = { 3, 2, 1, 0 },
.links = g94_sor_dp_links,
+ .power = g94_sor_dp_power,
},
};