Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau/disp: remove hw-specific customisation of output paths

All of the necessary hw-specific logic is now handled at the output
resource level, so all of this can go away.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

+36 -342
+21 -33
drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c
··· 23 23 */ 24 24 #include "priv.h" 25 25 #include "conn.h" 26 + #include "dp.h" 26 27 #include "head.h" 27 28 #include "ior.h" 28 29 #include "outp.h" ··· 253 252 nvkm_disp_oneinit(struct nvkm_engine *engine) 254 253 { 255 254 struct nvkm_disp *disp = nvkm_disp(engine); 256 - struct nvkm_bios *bios = disp->engine.subdev.device->bios; 255 + struct nvkm_subdev *subdev = &disp->engine.subdev; 256 + struct nvkm_bios *bios = subdev->device->bios; 257 257 struct nvkm_outp *outp, *outt, *pair; 258 258 struct nvkm_conn *conn; 259 259 struct nvkm_head *head; ··· 267 265 /* Create output path objects for each VBIOS display path. */ 268 266 i = -1; 269 267 while ((data = dcb_outp_parse(bios, ++i, &ver, &hdr, &dcbE))) { 270 - const struct nvkm_disp_func_outp *outps; 271 - int (*ctor)(struct nvkm_disp *, int, struct dcb_output *, 272 - struct nvkm_outp **); 273 - 274 268 if (dcbE.type == DCB_OUTPUT_UNUSED) 275 269 continue; 276 270 if (dcbE.type == DCB_OUTPUT_EOL) 277 271 break; 278 272 outp = NULL; 279 273 280 - switch (dcbE.location) { 281 - case 0: outps = &disp->func->outp.internal; break; 282 - case 1: outps = &disp->func->outp.external; break; 283 - default: 284 - nvkm_warn(&disp->engine.subdev, 285 - "dcb %d locn %d unknown\n", i, dcbE.location); 286 - continue; 287 - } 288 - 289 274 switch (dcbE.type) { 290 - case DCB_OUTPUT_ANALOG: ctor = outps->crt ; break; 291 - case DCB_OUTPUT_TV : ctor = outps->tv ; break; 292 - case DCB_OUTPUT_TMDS : ctor = outps->tmds; break; 293 - case DCB_OUTPUT_LVDS : ctor = outps->lvds; break; 294 - case DCB_OUTPUT_DP : ctor = outps->dp ; break; 275 + case DCB_OUTPUT_ANALOG: 276 + case DCB_OUTPUT_TV: 277 + case DCB_OUTPUT_TMDS: 278 + case DCB_OUTPUT_LVDS: 279 + ret = nvkm_outp_new(disp, i, &dcbE, &outp); 280 + break; 281 + case DCB_OUTPUT_DP: 282 + ret = nvkm_dp_new(disp, i, &dcbE, &outp); 283 + break; 295 284 default: 296 - nvkm_warn(&disp->engine.subdev, 297 - "dcb %d type %d unknown\n", i, dcbE.type); 285 + nvkm_warn(subdev, "dcb %d type %d unknown\n", 286 + i, dcbE.type); 298 287 continue; 299 288 } 300 - 301 - if (ctor) 302 - ret = ctor(disp, i, &dcbE, &outp); 303 - else 304 - ret = -ENODEV; 305 289 306 290 if (ret) { 307 - if (ret == -ENODEV) { 308 - nvkm_debug(&disp->engine.subdev, 309 - "dcb %d %d/%d not supported\n", 310 - i, dcbE.location, dcbE.type); 291 + if (outp) { 292 + if (ret != -ENODEV) 293 + OUTP_ERR(outp, "ctor failed: %d", ret); 294 + else 295 + OUTP_DBG(outp, "not supported"); 296 + nvkm_outp_del(&outp); 311 297 continue; 312 298 } 313 - nvkm_error(&disp->engine.subdev, 314 - "failed to create outp %d\n", i); 315 - nvkm_outp_del(&outp); 299 + nvkm_error(subdev, "failed to create outp %d\n", i); 316 300 continue; 317 301 } 318 302
-13
drivers/gpu/drm/nouveau/nvkm/engine/disp/dacnv50.c
··· 22 22 * Authors: Ben Skeggs 23 23 */ 24 24 #include "ior.h" 25 - #include "outp.h" 26 25 27 26 #include <subdev/timer.h> 28 - 29 - static const struct nvkm_output_func 30 - nv50_dac_output_func = { 31 - }; 32 - 33 - int 34 - nv50_dac_output_new(struct nvkm_disp *disp, int index, 35 - struct dcb_output *dcbE, struct nvkm_output **poutp) 36 - { 37 - return nvkm_output_new_(&nv50_dac_output_func, disp, 38 - index, dcbE, poutp); 39 - } 40 27 41 28 int 42 29 nv50_dac_sense(struct nvkm_ior *dac, u32 loadval)
+4 -6
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
··· 580 580 dp->aux = aux; 581 581 if (!dp->aux) { 582 582 OUTP_ERR(&dp->outp, "no aux"); 583 - return -ENODEV; 583 + return -EINVAL; 584 584 } 585 585 586 586 /* bios data is not optional */ ··· 589 589 &hdr, &cnt, &len, &dp->info); 590 590 if (!data) { 591 591 OUTP_ERR(&dp->outp, "no bios dp data"); 592 - return -ENODEV; 592 + return -EINVAL; 593 593 } 594 594 595 595 OUTP_DBG(&dp->outp, "bios dp %02x %02x %02x %02x", ··· 616 616 } 617 617 618 618 int 619 - nvkm_output_dp_new_(const struct nvkm_output_dp_func *func, 620 - struct nvkm_disp *disp, int index, struct dcb_output *dcbE, 621 - struct nvkm_outp **poutp) 619 + nvkm_dp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, 620 + struct nvkm_outp **poutp) 622 621 { 623 622 struct nvkm_i2c *i2c = disp->engine.subdev.device->i2c; 624 623 struct nvkm_i2c_aux *aux; ··· 630 631 631 632 if (!(dp = kzalloc(sizeof(*dp), GFP_KERNEL))) 632 633 return -ENOMEM; 633 - dp->func = func; 634 634 *poutp = &dp->outp; 635 635 636 636 return nvkm_dp_ctor(disp, index, dcbE, aux, dp);
+2 -21
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
··· 8 8 #include <subdev/bios/dp.h> 9 9 10 10 struct nvkm_dp { 11 - const struct nvkm_output_dp_func *func; 12 11 union { 13 12 struct nvkm_outp base; 14 13 struct nvkm_outp outp; ··· 31 32 32 33 #define nvkm_output_dp nvkm_dp 33 34 34 - struct nvkm_output_dp_func { 35 - }; 36 - 37 35 int nvkm_output_dp_train(struct nvkm_output *, u32 rate); 38 36 39 - int nvkm_output_dp_new_(const struct nvkm_output_dp_func *, struct nvkm_disp *, 40 - int index, struct dcb_output *, struct nvkm_output **); 41 - 42 - int nv50_pior_dp_new(struct nvkm_disp *, int, struct dcb_output *, 43 - struct nvkm_output **); 44 - 45 - int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, 46 - struct nvkm_output **); 47 - 48 - int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, 49 - struct nvkm_output **); 50 - 51 - int gm107_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, 52 - struct nvkm_output **); 53 - 54 - int gm200_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, 55 - struct nvkm_output **); 37 + int nvkm_dp_new(struct nvkm_disp *, int index, struct dcb_output *, 38 + struct nvkm_outp **); 56 39 57 40 /* DPCD Receiver Capabilities */ 58 41 #define DPCD_RC00_DPCD_REV 0x00000
-5
drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c
··· 33 33 .super = nv50_disp_super, 34 34 .root = &g84_disp_root_oclass, 35 35 .head.new = nv50_head_new, 36 - .outp.internal.crt = nv50_dac_output_new, 37 - .outp.internal.tmds = nv50_sor_output_new, 38 - .outp.internal.lvds = nv50_sor_output_new, 39 - .outp.external.tmds = nv50_pior_output_new, 40 - .outp.external.dp = nv50_pior_dp_new, 41 36 .dac = { .nr = 3, .new = nv50_dac_new }, 42 37 .sor = { .nr = 2, .new = g84_sor_new }, 43 38 .pior = { .nr = 3, .new = nv50_pior_new },
-6
drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c
··· 33 33 .super = nv50_disp_super, 34 34 .root = &g94_disp_root_oclass, 35 35 .head.new = nv50_head_new, 36 - .outp.internal.crt = nv50_dac_output_new, 37 - .outp.internal.tmds = nv50_sor_output_new, 38 - .outp.internal.lvds = nv50_sor_output_new, 39 - .outp.internal.dp = g94_sor_dp_new, 40 - .outp.external.tmds = nv50_pior_output_new, 41 - .outp.external.dp = nv50_pior_dp_new, 42 36 .dac = { .nr = 3, .new = nv50_dac_new }, 43 37 .sor = { .nr = 4, .new = g94_sor_new }, 44 38 .pior = { .nr = 3, .new = nv50_pior_new },
-4
drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c
··· 502 502 .super = gf119_disp_super, 503 503 .root = &gf119_disp_root_oclass, 504 504 .head.new = gf119_head_new, 505 - .outp.internal.crt = nv50_dac_output_new, 506 - .outp.internal.tmds = nv50_sor_output_new, 507 - .outp.internal.lvds = nv50_sor_output_new, 508 - .outp.internal.dp = gf119_sor_dp_new, 509 505 .dac = { .nr = 3, .new = gf119_dac_new }, 510 506 .sor = { .nr = 4, .new = gf119_sor_new }, 511 507 };
-4
drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c
··· 34 34 .super = gf119_disp_super, 35 35 .root = &gk104_disp_root_oclass, 36 36 .head.new = gf119_head_new, 37 - .outp.internal.crt = nv50_dac_output_new, 38 - .outp.internal.tmds = nv50_sor_output_new, 39 - .outp.internal.lvds = nv50_sor_output_new, 40 - .outp.internal.dp = gf119_sor_dp_new, 41 37 .dac = { .nr = 3, .new = gf119_dac_new }, 42 38 .sor = { .nr = 4, .new = gk104_sor_new }, 43 39 };
-4
drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c
··· 34 34 .super = gf119_disp_super, 35 35 .root = &gk110_disp_root_oclass, 36 36 .head.new = gf119_head_new, 37 - .outp.internal.crt = nv50_dac_output_new, 38 - .outp.internal.tmds = nv50_sor_output_new, 39 - .outp.internal.lvds = nv50_sor_output_new, 40 - .outp.internal.dp = gf119_sor_dp_new, 41 37 .dac = { .nr = 3, .new = gf119_dac_new }, 42 38 .sor = { .nr = 4, .new = gk104_sor_new }, 43 39 };
-4
drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c
··· 34 34 .super = gf119_disp_super, 35 35 .root = &gm107_disp_root_oclass, 36 36 .head.new = gf119_head_new, 37 - .outp.internal.crt = nv50_dac_output_new, 38 - .outp.internal.tmds = nv50_sor_output_new, 39 - .outp.internal.lvds = nv50_sor_output_new, 40 - .outp.internal.dp = gm107_sor_dp_new, 41 37 .dac = { .nr = 3, .new = gf119_dac_new }, 42 38 .sor = { .nr = 4, .new = gm107_sor_new }, 43 39 };
-4
drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c
··· 34 34 .super = gf119_disp_super, 35 35 .root = &gm200_disp_root_oclass, 36 36 .head.new = gf119_head_new, 37 - .outp.internal.crt = nv50_dac_output_new, 38 - .outp.internal.tmds = nv50_sor_output_new, 39 - .outp.internal.lvds = nv50_sor_output_new, 40 - .outp.internal.dp = gm200_sor_dp_new, 41 37 .dac = { .nr = 3, .new = gf119_dac_new }, 42 38 .sor.nr = 4, 43 39 .sor.new = gm200_sor_new,
-3
drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c
··· 34 34 .super = gf119_disp_super, 35 35 .root = &gp100_disp_root_oclass, 36 36 .head.new = gf119_head_new, 37 - .outp.internal.tmds = nv50_sor_output_new, 38 - .outp.internal.lvds = nv50_sor_output_new, 39 - .outp.internal.dp = gm200_sor_dp_new, 40 37 .sor.nr = 4, 41 38 .sor.new = gm200_sor_new, 42 39 .sor.magic = gm200_sor_magic,
-3
drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c
··· 60 60 .super = gf119_disp_super, 61 61 .root = &gp102_disp_root_oclass, 62 62 .head.new = gf119_head_new, 63 - .outp.internal.tmds = nv50_sor_output_new, 64 - .outp.internal.lvds = nv50_sor_output_new, 65 - .outp.internal.dp = gm200_sor_dp_new, 66 63 .sor.nr = 4, 67 64 .sor.new = gm200_sor_new, 68 65 .sor.magic = gm200_sor_magic,
-5
drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c
··· 33 33 .super = nv50_disp_super, 34 34 .root = &gt200_disp_root_oclass, 35 35 .head.new = nv50_head_new, 36 - .outp.internal.crt = nv50_dac_output_new, 37 - .outp.internal.tmds = nv50_sor_output_new, 38 - .outp.internal.lvds = nv50_sor_output_new, 39 - .outp.external.tmds = nv50_pior_output_new, 40 - .outp.external.dp = nv50_pior_dp_new, 41 36 .dac = { .nr = 3, .new = nv50_dac_new }, 42 37 .sor = { .nr = 2, .new = g84_sor_new }, 43 38 .pior = { .nr = 3, .new = nv50_pior_new },
-6
drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c
··· 33 33 .super = nv50_disp_super, 34 34 .root = &gt215_disp_root_oclass, 35 35 .head.new = nv50_head_new, 36 - .outp.internal.crt = nv50_dac_output_new, 37 - .outp.internal.tmds = nv50_sor_output_new, 38 - .outp.internal.lvds = nv50_sor_output_new, 39 - .outp.internal.dp = g94_sor_dp_new, 40 - .outp.external.tmds = nv50_pior_output_new, 41 - .outp.external.dp = nv50_pior_dp_new, 42 36 .dac = { .nr = 3, .new = nv50_dac_new }, 43 37 .sor = { .nr = 4, .new = gt215_sor_new }, 44 38 .pior = { .nr = 3, .new = nv50_pior_new },
-6
drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c
··· 31 31 .super = nv50_disp_super, 32 32 .root = &g94_disp_root_oclass, 33 33 .head.new = nv50_head_new, 34 - .outp.internal.crt = nv50_dac_output_new, 35 - .outp.internal.tmds = nv50_sor_output_new, 36 - .outp.internal.lvds = nv50_sor_output_new, 37 - .outp.internal.dp = g94_sor_dp_new, 38 - .outp.external.tmds = nv50_pior_output_new, 39 - .outp.external.dp = nv50_pior_dp_new, 40 34 .dac = { .nr = 3, .new = nv50_dac_new }, 41 35 .sor = { .nr = 4, .new = mcp77_sor_new }, 42 36 .pior = { .nr = 3, .new = nv50_pior_new },
-6
drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c
··· 31 31 .super = nv50_disp_super, 32 32 .root = &gt215_disp_root_oclass, 33 33 .head.new = nv50_head_new, 34 - .outp.internal.crt = nv50_dac_output_new, 35 - .outp.internal.tmds = nv50_sor_output_new, 36 - .outp.internal.lvds = nv50_sor_output_new, 37 - .outp.internal.dp = g94_sor_dp_new, 38 - .outp.external.tmds = nv50_pior_output_new, 39 - .outp.external.dp = nv50_pior_dp_new, 40 34 .dac = { .nr = 3, .new = nv50_dac_new }, 41 35 .sor = { .nr = 4, .new = mcp89_sor_new }, 42 36 .pior = { .nr = 3, .new = nv50_pior_new },
-68
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c
··· 42 42 return nv50_disp(base)->func->root; 43 43 } 44 44 45 - static int 46 - nv50_disp_outp_internal_crt_(struct nvkm_disp *base, int index, 47 - struct dcb_output *dcb, struct nvkm_output **poutp) 48 - { 49 - struct nv50_disp *disp = nv50_disp(base); 50 - return disp->func->outp.internal.crt(base, index, dcb, poutp); 51 - } 52 - 53 - static int 54 - nv50_disp_outp_internal_tmds_(struct nvkm_disp *base, int index, 55 - struct dcb_output *dcb, 56 - struct nvkm_output **poutp) 57 - { 58 - struct nv50_disp *disp = nv50_disp(base); 59 - return disp->func->outp.internal.tmds(base, index, dcb, poutp); 60 - } 61 - 62 - static int 63 - nv50_disp_outp_internal_lvds_(struct nvkm_disp *base, int index, 64 - struct dcb_output *dcb, 65 - struct nvkm_output **poutp) 66 - { 67 - struct nv50_disp *disp = nv50_disp(base); 68 - return disp->func->outp.internal.lvds(base, index, dcb, poutp); 69 - } 70 - 71 - static int 72 - nv50_disp_outp_internal_dp_(struct nvkm_disp *base, int index, 73 - struct dcb_output *dcb, struct nvkm_output **poutp) 74 - { 75 - struct nv50_disp *disp = nv50_disp(base); 76 - if (disp->func->outp.internal.dp) 77 - return disp->func->outp.internal.dp(base, index, dcb, poutp); 78 - return -ENODEV; 79 - } 80 - 81 - static int 82 - nv50_disp_outp_external_tmds_(struct nvkm_disp *base, int index, 83 - struct dcb_output *dcb, 84 - struct nvkm_output **poutp) 85 - { 86 - struct nv50_disp *disp = nv50_disp(base); 87 - if (disp->func->outp.external.tmds) 88 - return disp->func->outp.external.tmds(base, index, dcb, poutp); 89 - return -ENODEV; 90 - } 91 - 92 - static int 93 - nv50_disp_outp_external_dp_(struct nvkm_disp *base, int index, 94 - struct dcb_output *dcb, struct nvkm_output **poutp) 95 - { 96 - struct nv50_disp *disp = nv50_disp(base); 97 - if (disp->func->outp.external.dp) 98 - return disp->func->outp.external.dp(base, index, dcb, poutp); 99 - return -ENODEV; 100 - } 101 - 102 45 static void 103 46 nv50_disp_intr_(struct nvkm_disp *base) 104 47 { ··· 64 121 .dtor = nv50_disp_dtor_, 65 122 .intr = nv50_disp_intr_, 66 123 .root = nv50_disp_root_, 67 - .outp.internal.crt = nv50_disp_outp_internal_crt_, 68 - .outp.internal.tmds = nv50_disp_outp_internal_tmds_, 69 - .outp.internal.lvds = nv50_disp_outp_internal_lvds_, 70 - .outp.internal.dp = nv50_disp_outp_internal_dp_, 71 - .outp.external.tmds = nv50_disp_outp_external_tmds_, 72 - .outp.external.dp = nv50_disp_outp_external_dp_, 73 124 }; 74 125 75 126 int ··· 776 839 .super = nv50_disp_super, 777 840 .root = &nv50_disp_root_oclass, 778 841 .head.new = nv50_head_new, 779 - .outp.internal.crt = nv50_dac_output_new, 780 - .outp.internal.tmds = nv50_sor_output_new, 781 - .outp.internal.lvds = nv50_sor_output_new, 782 - .outp.external.tmds = nv50_pior_output_new, 783 - .outp.external.dp = nv50_pior_dp_new, 784 842 .dac = { .nr = 3, .new = nv50_dac_new }, 785 843 .sor = { .nr = 2, .new = nv50_sor_new }, 786 844 .pior = { .nr = 3, .new = nv50_pior_new },
-18
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
··· 32 32 int gf119_disp_new_(const struct nv50_disp_func *, struct nvkm_device *, 33 33 int index, struct nvkm_disp **); 34 34 35 - struct nv50_disp_func_outp { 36 - int (* crt)(struct nvkm_disp *, int index, struct dcb_output *, 37 - struct nvkm_output **); 38 - int (* tv)(struct nvkm_disp *, int index, struct dcb_output *, 39 - struct nvkm_output **); 40 - int (*tmds)(struct nvkm_disp *, int index, struct dcb_output *, 41 - struct nvkm_output **); 42 - int (*lvds)(struct nvkm_disp *, int index, struct dcb_output *, 43 - struct nvkm_output **); 44 - int (* dp)(struct nvkm_disp *, int index, struct dcb_output *, 45 - struct nvkm_output **); 46 - }; 47 - 48 35 struct nv50_disp_func { 49 36 void (*intr)(struct nv50_disp *); 50 37 void (*intr_error)(struct nv50_disp *, int chid); ··· 44 57 struct { 45 58 int (*new)(struct nvkm_disp *, int id); 46 59 } head; 47 - 48 - struct { 49 - const struct nv50_disp_func_outp internal; 50 - const struct nv50_disp_func_outp external; 51 - } outp; 52 60 53 61 struct { 54 62 int nr;
+7 -4
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c
··· 142 142 return 0; 143 143 } 144 144 145 + static const struct nvkm_outp_func 146 + nvkm_outp = { 147 + }; 148 + 145 149 int 146 - nvkm_outp_new_(const struct nvkm_outp_func *func, 147 - struct nvkm_disp *disp, int index, struct dcb_output *dcbE, 148 - struct nvkm_outp **poutp) 150 + nvkm_outp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, 151 + struct nvkm_outp **poutp) 149 152 { 150 153 if (!(*poutp = kzalloc(sizeof(**poutp), GFP_KERNEL))) 151 154 return -ENOMEM; 152 - return nvkm_outp_ctor(func, disp, index, dcbE, *poutp); 155 + return nvkm_outp_ctor(&nvkm_outp, disp, index, dcbE, *poutp); 153 156 }
+2 -10
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h
··· 23 23 24 24 int nvkm_outp_ctor(const struct nvkm_outp_func *, struct nvkm_disp *, 25 25 int index, struct dcb_output *, struct nvkm_outp *); 26 + int nvkm_outp_new(struct nvkm_disp *, int index, struct dcb_output *, 27 + struct nvkm_outp **); 26 28 void nvkm_outp_del(struct nvkm_outp **); 27 29 void nvkm_outp_init(struct nvkm_outp *); 28 30 void nvkm_outp_fini(struct nvkm_outp *); ··· 38 36 #define nvkm_output nvkm_outp 39 37 #define nvkm_output_func nvkm_outp_func 40 38 #define nvkm_output_new_ nvkm_outp_new_ 41 - 42 - int nvkm_outp_new_(const struct nvkm_outp_func *, struct nvkm_disp *, 43 - int index, struct dcb_output *, struct nvkm_output **); 44 - 45 - int nv50_dac_output_new(struct nvkm_disp *, int, struct dcb_output *, 46 - struct nvkm_output **); 47 - int nv50_sor_output_new(struct nvkm_disp *, int, struct dcb_output *, 48 - struct nvkm_output **); 49 - int nv50_pior_output_new(struct nvkm_disp *, int, struct dcb_output *, 50 - struct nvkm_output **); 51 39 52 40 void gm200_sor_magic(struct nvkm_output *outp); 53 41
-31
drivers/gpu/drm/nouveau/nvkm/engine/disp/piornv50.c
··· 22 22 * Authors: Ben Skeggs 23 23 */ 24 24 #include "ior.h" 25 - #include "dp.h" 26 25 27 26 #include <subdev/i2c.h> 28 27 #include <subdev/timer.h> 29 28 30 - /****************************************************************************** 31 - * TMDS 32 - *****************************************************************************/ 33 - static const struct nvkm_output_func 34 - nv50_pior_output_func = { 35 - }; 36 - 37 - int 38 - nv50_pior_output_new(struct nvkm_disp *disp, int index, 39 - struct dcb_output *dcbE, struct nvkm_output **poutp) 40 - { 41 - return nvkm_output_new_(&nv50_pior_output_func, disp, 42 - index, dcbE, poutp); 43 - } 44 - 45 - /****************************************************************************** 46 - * DisplayPort 47 - *****************************************************************************/ 48 29 static int 49 30 nv50_pior_dp_links(struct nvkm_ior *pior, struct nvkm_i2c_aux *aux) 50 31 { ··· 34 53 if (ret) 35 54 return ret; 36 55 return 1; 37 - } 38 - 39 - static const struct nvkm_output_dp_func 40 - nv50_pior_output_dp_func = { 41 - }; 42 - 43 - int 44 - nv50_pior_dp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, 45 - struct nvkm_output **poutp) 46 - { 47 - return nvkm_output_dp_new_(&nv50_pior_output_dp_func, disp, 48 - index, dcbE, poutp); 49 56 } 50 57 51 58 static void
-18
drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h
··· 9 9 int index, struct nvkm_disp **); 10 10 void nvkm_disp_vblank(struct nvkm_disp *, int head); 11 11 12 - struct nvkm_disp_func_outp { 13 - int (* crt)(struct nvkm_disp *, int index, struct dcb_output *, 14 - struct nvkm_output **); 15 - int (* tv)(struct nvkm_disp *, int index, struct dcb_output *, 16 - struct nvkm_output **); 17 - int (*tmds)(struct nvkm_disp *, int index, struct dcb_output *, 18 - struct nvkm_output **); 19 - int (*lvds)(struct nvkm_disp *, int index, struct dcb_output *, 20 - struct nvkm_output **); 21 - int (* dp)(struct nvkm_disp *, int index, struct dcb_output *, 22 - struct nvkm_output **); 23 - }; 24 - 25 12 struct nvkm_disp_func { 26 13 void *(*dtor)(struct nvkm_disp *); 27 14 void (*intr)(struct nvkm_disp *); 28 15 29 16 const struct nvkm_disp_oclass *(*root)(struct nvkm_disp *); 30 - 31 - struct { 32 - const struct nvkm_disp_func_outp internal; 33 - const struct nvkm_disp_func_outp external; 34 - } outp; 35 17 }; 36 18 37 19 int nvkm_disp_ntfy(struct nvkm_object *, u32, struct nvkm_event **);
-11
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c
··· 91 91 return 0; 92 92 } 93 93 94 - static const struct nvkm_output_dp_func 95 - g94_sor_dp_func = { 96 - }; 97 - 98 - int 99 - g94_sor_dp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, 100 - struct nvkm_output **poutp) 101 - { 102 - return nvkm_output_dp_new_(&g94_sor_dp_func, disp, index, dcbE, poutp); 103 - } 104 - 105 94 static bool 106 95 nv50_disp_dptmds_war(struct nvkm_device *device) 107 96 {
-12
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c
··· 22 22 * Authors: Ben Skeggs 23 23 */ 24 24 #include "ior.h" 25 - #include "nv50.h" 26 25 27 26 #include <subdev/timer.h> 28 27 ··· 97 98 nvkm_mask(device, 0x612300 + soff, 0x007c0000, clksor); 98 99 nvkm_mask(device, 0x61c10c + loff, 0x401f4000, dpctrl); 99 100 return 0; 100 - } 101 - 102 - static const struct nvkm_output_dp_func 103 - gf119_sor_dp_func = { 104 - }; 105 - 106 - int 107 - gf119_sor_dp_new(struct nvkm_disp *disp, int index, 108 - struct dcb_output *dcbE, struct nvkm_output **poutp) 109 - { 110 - return nvkm_output_dp_new_(&gf119_sor_dp_func, disp, index, dcbE, poutp); 111 101 } 112 102 113 103 void
-12
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c
··· 22 22 * Authors: Ben Skeggs <bskeggs@redhat.com> 23 23 */ 24 24 #include "ior.h" 25 - #include "nv50.h" 26 25 27 26 void 28 27 gm107_sor_dp_pattern(struct nvkm_ior *sor, int pattern) ··· 33 34 nvkm_mask(device, 0x61c110 + soff, 0x0f0f0f0f, data); 34 35 else 35 36 nvkm_mask(device, 0x61c12c + soff, 0x0f0f0f0f, data); 36 - } 37 - 38 - static const struct nvkm_output_dp_func 39 - gm107_sor_dp_func = { 40 - }; 41 - 42 - int 43 - gm107_sor_dp_new(struct nvkm_disp *disp, int index, 44 - struct dcb_output *dcbE, struct nvkm_output **poutp) 45 - { 46 - return nvkm_output_dp_new_(&gm107_sor_dp_func, disp, index, dcbE, poutp); 47 37 } 48 38 49 39 static const struct nvkm_ior_func
-12
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c
··· 22 22 * Authors: Ben Skeggs 23 23 */ 24 24 #include "ior.h" 25 - #include "nv50.h" 26 25 27 26 static void 28 27 gm200_sor_dp_drive(struct nvkm_ior *sor, int ln, int pc, int dc, int pe, int pu) ··· 43 44 nvkm_wr32(device, 0x61c130 + loff, data[2]); 44 45 data[3] = nvkm_rd32(device, 0x61c13c + loff) & ~(0x000000ff << shift); 45 46 nvkm_wr32(device, 0x61c13c + loff, data[3] | (pc << shift)); 46 - } 47 - 48 - static const struct nvkm_output_dp_func 49 - gm200_sor_dp_func = { 50 - }; 51 - 52 - int 53 - gm200_sor_dp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, 54 - struct nvkm_output **poutp) 55 - { 56 - return nvkm_output_dp_new_(&gm200_sor_dp_func, disp, index, dcbE, poutp); 57 47 } 58 48 59 49 void
-13
drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c
··· 22 22 * Authors: Ben Skeggs 23 23 */ 24 24 #include "ior.h" 25 - #include "outp.h" 26 25 27 26 #include <subdev/timer.h> 28 - 29 - static const struct nvkm_output_func 30 - nv50_sor_output_func = { 31 - }; 32 - 33 - int 34 - nv50_sor_output_new(struct nvkm_disp *disp, int index, 35 - struct dcb_output *dcbE, struct nvkm_output **poutp) 36 - { 37 - return nvkm_output_new_(&nv50_sor_output_func, disp, 38 - index, dcbE, poutp); 39 - } 40 27 41 28 static void 42 29 nv50_sor_power_wait(struct nvkm_device *device, u32 soff)