drm/nouveau/disp/gf119-: port OR DP VCPI control to nvkm_ior
authorBen Skeggs <bskeggs@redhat.com>
Fri, 19 May 2017 13:59:35 +0000 (23:59 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 16 Jun 2017 04:04:57 +0000 (14:04 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgk104.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c

index 21f20bc92ae42b81b1ab8d276ee190ae71d5fe13..edd416c62d3eaadc69eddc991cef5da826a27c3e 100644 (file)
@@ -33,8 +33,6 @@ struct nvkm_dp {
 #define nvkm_output_dp nvkm_dp
 
 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);
@@ -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 *,
                     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 *,
                     struct nvkm_output **);
index 0127474dc6c23c39ffdab0fbe78edb6bd93aed84..a43a924debfe2fc2cb39c2cb93a24c1f7b841211 100644 (file)
@@ -58,6 +58,8 @@ struct nvkm_ior_func {
                void (*pattern)(struct nvkm_ior *, int pattern);
                void (*drive)(struct nvkm_ior *, int ln, int pc,
                              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);
        } dp;
 
@@ -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 *);
 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_vcpi(struct nvkm_ior *, int, u8, u8, u16, u16);
 void gf119_sor_dp_audio(struct nvkm_ior *, int, bool);
 
 void gm107_sor_dp_pattern(struct nvkm_ior *, int);
index d6371110f5a0be4af36878560897b7c6c3590123..f3ebdd032b9be2fe1ce06dbd18a3edc506593e7b 100644 (file)
@@ -217,7 +217,6 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
        }
                break;
        case NV50_DISP_MTHD_V1_SOR_DP_MST_VCPI: {
-               struct nvkm_output_dp *outpdp = nvkm_output_dp(outp);
                union {
                        struct nv50_disp_sor_dp_mst_vcpi_v0 v0;
                } *args = data;
@@ -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.num_slots, args->v0.pbn,
                                   args->v0.aligned_pbn);
-                       if (!outpdp->func->vcpi)
+                       if (!outp->ior->func->dp.vcpi)
                                return -ENODEV;
-                       outpdp->func->vcpi(outpdp, hidx, args->v0.start_slot,
-                                          args->v0.num_slots, args->v0.pbn,
-                                          args->v0.aligned_pbn);
+                       outp->ior->func->dp.vcpi(outp->ior, hidx,
+                                                args->v0.start_slot,
+                                                args->v0.num_slots,
+                                                args->v0.pbn,
+                                                args->v0.aligned_pbn);
                        return 0;
                } else
                        return ret;
index c3dbfd26ace895bc6125e71236072e5b2d63b9fd..b313beda00d7397608bb903143f065679da2dbc8 100644 (file)
@@ -41,10 +41,10 @@ gf119_sor_dp_audio(struct nvkm_ior *sor, int head, bool enable)
 }
 
 void
-gf119_sor_dp_vcpi(struct nvkm_output_dp *outp, int head, u8 slot,
-                 u8 slot_nr, u16 pbn, u16 aligned)
+gf119_sor_dp_vcpi(struct nvkm_ior *sor, int head,
+                 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;
 
        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)
 
 static const struct nvkm_output_dp_func
 gf119_sor_dp_func = {
-       .vcpi = gf119_sor_dp_vcpi,
 };
 
 int
@@ -147,6 +146,7 @@ gf119_sor = {
                .links = gf119_sor_dp_links,
                .power = g94_sor_dp_power,
                .pattern = gf119_sor_dp_pattern,
+               .vcpi = gf119_sor_dp_vcpi,
                .audio = gf119_sor_dp_audio,
        },
        .hda = {
index ee6bf54077a2b4a983faaa6498686949e0dd837c..24fc026cd18d546ccda6fda9a160723adc18a8ee 100644 (file)
@@ -34,6 +34,7 @@ gk104_sor = {
                .power = g94_sor_dp_power,
                .pattern = gf119_sor_dp_pattern,
                .drive = gf119_sor_dp_drive,
+               .vcpi = gf119_sor_dp_vcpi,
                .audio = gf119_sor_dp_audio,
        },
        .hda = {
index a6710758d7ed1e2a2937061df6a3cd1dc163b434..77873874e178b3c38f532b2463243cf9378c53f3 100644 (file)
@@ -38,7 +38,6 @@ gm107_sor_dp_pattern(struct nvkm_ior *sor, int pattern)
 
 static const struct nvkm_output_dp_func
 gm107_sor_dp_func = {
-       .vcpi = gf119_sor_dp_vcpi,
 };
 
 int
@@ -61,6 +60,7 @@ gm107_sor = {
                .power = g94_sor_dp_power,
                .pattern = gm107_sor_dp_pattern,
                .drive = gf119_sor_dp_drive,
+               .vcpi = gf119_sor_dp_vcpi,
                .audio = gf119_sor_dp_audio,
        },
        .hda = {
index 3b152e116b8801ee5747e012d6149ff74c6fcad4..9078ba271a1223e7af37731ab10c14b336432a80 100644 (file)
@@ -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
 gm200_sor_dp_func = {
-       .vcpi = gf119_sor_dp_vcpi,
 };
 
 int
@@ -83,6 +82,7 @@ gm200_sor = {
                .power = g94_sor_dp_power,
                .pattern = gm107_sor_dp_pattern,
                .drive = gm200_sor_dp_drive,
+               .vcpi = gf119_sor_dp_vcpi,
                .audio = gf119_sor_dp_audio,
        },
        .hda = {