Commit e8ccc96d authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/disp/gf119-: port OR DP VCPI control to nvkm_ior

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 409b9e54
...@@ -33,8 +33,6 @@ struct nvkm_dp { ...@@ -33,8 +33,6 @@ struct nvkm_dp {
#define nvkm_output_dp nvkm_dp #define nvkm_output_dp nvkm_dp
struct nvkm_output_dp_func { struct nvkm_output_dp_func {
void (*vcpi)(struct nvkm_output_dp *, int head, u8 start_slot,
u8 num_slots, u16 pbn, u16 aligned_pbn);
}; };
int nvkm_output_dp_train(struct nvkm_output *, u32 rate); int nvkm_output_dp_train(struct nvkm_output *, u32 rate);
...@@ -50,7 +48,6 @@ int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, ...@@ -50,7 +48,6 @@ int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
struct nvkm_output **); struct nvkm_output **);
void gf119_sor_dp_vcpi(struct nvkm_dp *, int, u8, u8, u16, u16);
int gm107_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, int gm107_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *,
struct nvkm_output **); struct nvkm_output **);
......
...@@ -58,6 +58,8 @@ struct nvkm_ior_func { ...@@ -58,6 +58,8 @@ struct nvkm_ior_func {
void (*pattern)(struct nvkm_ior *, int pattern); void (*pattern)(struct nvkm_ior *, int pattern);
void (*drive)(struct nvkm_ior *, int ln, int pc, void (*drive)(struct nvkm_ior *, int ln, int pc,
int dc, int pe, int tx_pu); int dc, int pe, int tx_pu);
void (*vcpi)(struct nvkm_ior *, int head, u8 slot,
u8 slot_nr, u16 pbn, u16 aligned);
void (*audio)(struct nvkm_ior *, int head, bool enable); void (*audio)(struct nvkm_ior *, int head, bool enable);
} dp; } dp;
...@@ -102,6 +104,7 @@ void gf119_sor_state(struct nvkm_ior *, struct nvkm_ior_state *); ...@@ -102,6 +104,7 @@ void gf119_sor_state(struct nvkm_ior *, struct nvkm_ior_state *);
int gf119_sor_dp_links(struct nvkm_ior *, struct nvkm_i2c_aux *); int gf119_sor_dp_links(struct nvkm_ior *, struct nvkm_i2c_aux *);
void gf119_sor_dp_pattern(struct nvkm_ior *, int); void gf119_sor_dp_pattern(struct nvkm_ior *, int);
void gf119_sor_dp_drive(struct nvkm_ior *, int, int, int, int, int); void gf119_sor_dp_drive(struct nvkm_ior *, int, int, int, int, int);
void gf119_sor_dp_vcpi(struct nvkm_ior *, int, u8, u8, u16, u16);
void gf119_sor_dp_audio(struct nvkm_ior *, int, bool); void gf119_sor_dp_audio(struct nvkm_ior *, int, bool);
void gm107_sor_dp_pattern(struct nvkm_ior *, int); void gm107_sor_dp_pattern(struct nvkm_ior *, int);
......
...@@ -217,7 +217,6 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size) ...@@ -217,7 +217,6 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
} }
break; break;
case NV50_DISP_MTHD_V1_SOR_DP_MST_VCPI: { case NV50_DISP_MTHD_V1_SOR_DP_MST_VCPI: {
struct nvkm_output_dp *outpdp = nvkm_output_dp(outp);
union { union {
struct nv50_disp_sor_dp_mst_vcpi_v0 v0; struct nv50_disp_sor_dp_mst_vcpi_v0 v0;
} *args = data; } *args = data;
...@@ -229,11 +228,13 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size) ...@@ -229,11 +228,13 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
args->v0.version, args->v0.start_slot, args->v0.version, args->v0.start_slot,
args->v0.num_slots, args->v0.pbn, args->v0.num_slots, args->v0.pbn,
args->v0.aligned_pbn); args->v0.aligned_pbn);
if (!outpdp->func->vcpi) if (!outp->ior->func->dp.vcpi)
return -ENODEV; return -ENODEV;
outpdp->func->vcpi(outpdp, hidx, args->v0.start_slot, outp->ior->func->dp.vcpi(outp->ior, hidx,
args->v0.num_slots, args->v0.pbn, args->v0.start_slot,
args->v0.aligned_pbn); args->v0.num_slots,
args->v0.pbn,
args->v0.aligned_pbn);
return 0; return 0;
} else } else
return ret; return ret;
......
...@@ -41,10 +41,10 @@ gf119_sor_dp_audio(struct nvkm_ior *sor, int head, bool enable) ...@@ -41,10 +41,10 @@ gf119_sor_dp_audio(struct nvkm_ior *sor, int head, bool enable)
} }
void void
gf119_sor_dp_vcpi(struct nvkm_output_dp *outp, int head, u8 slot, gf119_sor_dp_vcpi(struct nvkm_ior *sor, int head,
u8 slot_nr, u16 pbn, u16 aligned) u8 slot, u8 slot_nr, u16 pbn, u16 aligned)
{ {
struct nvkm_device *device = outp->base.disp->engine.subdev.device; struct nvkm_device *device = sor->disp->engine.subdev.device;
const u32 hoff = head * 0x800; const u32 hoff = head * 0x800;
nvkm_mask(device, 0x616588 + hoff, 0x00003f3f, (slot_nr << 8) | slot); nvkm_mask(device, 0x616588 + hoff, 0x00003f3f, (slot_nr << 8) | slot);
...@@ -102,7 +102,6 @@ gf119_sor_dp_links(struct nvkm_ior *sor, struct nvkm_i2c_aux *aux) ...@@ -102,7 +102,6 @@ gf119_sor_dp_links(struct nvkm_ior *sor, struct nvkm_i2c_aux *aux)
static const struct nvkm_output_dp_func static const struct nvkm_output_dp_func
gf119_sor_dp_func = { gf119_sor_dp_func = {
.vcpi = gf119_sor_dp_vcpi,
}; };
int int
...@@ -147,6 +146,7 @@ gf119_sor = { ...@@ -147,6 +146,7 @@ gf119_sor = {
.links = gf119_sor_dp_links, .links = gf119_sor_dp_links,
.power = g94_sor_dp_power, .power = g94_sor_dp_power,
.pattern = gf119_sor_dp_pattern, .pattern = gf119_sor_dp_pattern,
.vcpi = gf119_sor_dp_vcpi,
.audio = gf119_sor_dp_audio, .audio = gf119_sor_dp_audio,
}, },
.hda = { .hda = {
......
...@@ -34,6 +34,7 @@ gk104_sor = { ...@@ -34,6 +34,7 @@ gk104_sor = {
.power = g94_sor_dp_power, .power = g94_sor_dp_power,
.pattern = gf119_sor_dp_pattern, .pattern = gf119_sor_dp_pattern,
.drive = gf119_sor_dp_drive, .drive = gf119_sor_dp_drive,
.vcpi = gf119_sor_dp_vcpi,
.audio = gf119_sor_dp_audio, .audio = gf119_sor_dp_audio,
}, },
.hda = { .hda = {
......
...@@ -38,7 +38,6 @@ gm107_sor_dp_pattern(struct nvkm_ior *sor, int pattern) ...@@ -38,7 +38,6 @@ gm107_sor_dp_pattern(struct nvkm_ior *sor, int pattern)
static const struct nvkm_output_dp_func static const struct nvkm_output_dp_func
gm107_sor_dp_func = { gm107_sor_dp_func = {
.vcpi = gf119_sor_dp_vcpi,
}; };
int int
...@@ -61,6 +60,7 @@ gm107_sor = { ...@@ -61,6 +60,7 @@ gm107_sor = {
.power = g94_sor_dp_power, .power = g94_sor_dp_power,
.pattern = gm107_sor_dp_pattern, .pattern = gm107_sor_dp_pattern,
.drive = gf119_sor_dp_drive, .drive = gf119_sor_dp_drive,
.vcpi = gf119_sor_dp_vcpi,
.audio = gf119_sor_dp_audio, .audio = gf119_sor_dp_audio,
}, },
.hda = { .hda = {
......
...@@ -48,7 +48,6 @@ gm200_sor_dp_drive(struct nvkm_ior *sor, int ln, int pc, int dc, int pe, int pu) ...@@ -48,7 +48,6 @@ gm200_sor_dp_drive(struct nvkm_ior *sor, int ln, int pc, int dc, int pe, int pu)
static const struct nvkm_output_dp_func static const struct nvkm_output_dp_func
gm200_sor_dp_func = { gm200_sor_dp_func = {
.vcpi = gf119_sor_dp_vcpi,
}; };
int int
...@@ -83,6 +82,7 @@ gm200_sor = { ...@@ -83,6 +82,7 @@ gm200_sor = {
.power = g94_sor_dp_power, .power = g94_sor_dp_power,
.pattern = gm107_sor_dp_pattern, .pattern = gm107_sor_dp_pattern,
.drive = gm200_sor_dp_drive, .drive = gm200_sor_dp_drive,
.vcpi = gf119_sor_dp_vcpi,
.audio = gf119_sor_dp_audio, .audio = gf119_sor_dp_audio,
}, },
.hda = { .hda = {
......
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