diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2017-05-19 09:59:35 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-06-16 00:04:57 -0400 |
commit | 3c66c87dc96b3113b5ee84604800c2aabbb48994 (patch) | |
tree | 78ccda009a1493c3af1426ce615e98bb3ce8e9f7 | |
parent | e8ccc96dd5f4baa1deb21b6d3b2c4a07bcf62254 (diff) |
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>
28 files changed, 36 insertions, 342 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c index 24d2f325cbc5..c7c84d34d97e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c | |||
@@ -23,6 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | #include "priv.h" | 24 | #include "priv.h" |
25 | #include "conn.h" | 25 | #include "conn.h" |
26 | #include "dp.h" | ||
26 | #include "head.h" | 27 | #include "head.h" |
27 | #include "ior.h" | 28 | #include "ior.h" |
28 | #include "outp.h" | 29 | #include "outp.h" |
@@ -252,7 +253,8 @@ static int | |||
252 | nvkm_disp_oneinit(struct nvkm_engine *engine) | 253 | nvkm_disp_oneinit(struct nvkm_engine *engine) |
253 | { | 254 | { |
254 | struct nvkm_disp *disp = nvkm_disp(engine); | 255 | struct nvkm_disp *disp = nvkm_disp(engine); |
255 | struct nvkm_bios *bios = disp->engine.subdev.device->bios; | 256 | struct nvkm_subdev *subdev = &disp->engine.subdev; |
257 | struct nvkm_bios *bios = subdev->device->bios; | ||
256 | struct nvkm_outp *outp, *outt, *pair; | 258 | struct nvkm_outp *outp, *outt, *pair; |
257 | struct nvkm_conn *conn; | 259 | struct nvkm_conn *conn; |
258 | struct nvkm_head *head; | 260 | struct nvkm_head *head; |
@@ -265,52 +267,38 @@ nvkm_disp_oneinit(struct nvkm_engine *engine) | |||
265 | /* Create output path objects for each VBIOS display path. */ | 267 | /* Create output path objects for each VBIOS display path. */ |
266 | i = -1; | 268 | i = -1; |
267 | while ((data = dcb_outp_parse(bios, ++i, &ver, &hdr, &dcbE))) { | 269 | while ((data = dcb_outp_parse(bios, ++i, &ver, &hdr, &dcbE))) { |
268 | const struct nvkm_disp_func_outp *outps; | ||
269 | int (*ctor)(struct nvkm_disp *, int, struct dcb_output *, | ||
270 | struct nvkm_outp **); | ||
271 | |||
272 | if (dcbE.type == DCB_OUTPUT_UNUSED) | 270 | if (dcbE.type == DCB_OUTPUT_UNUSED) |
273 | continue; | 271 | continue; |
274 | if (dcbE.type == DCB_OUTPUT_EOL) | 272 | if (dcbE.type == DCB_OUTPUT_EOL) |
275 | break; | 273 | break; |
276 | outp = NULL; | 274 | outp = NULL; |
277 | 275 | ||
278 | switch (dcbE.location) { | ||
279 | case 0: outps = &disp->func->outp.internal; break; | ||
280 | case 1: outps = &disp->func->outp.external; break; | ||
281 | default: | ||
282 | nvkm_warn(&disp->engine.subdev, | ||
283 | "dcb %d locn %d unknown\n", i, dcbE.location); | ||
284 | continue; | ||
285 | } | ||
286 | |||
287 | switch (dcbE.type) { | 276 | switch (dcbE.type) { |
288 | case DCB_OUTPUT_ANALOG: ctor = outps->crt ; break; | 277 | case DCB_OUTPUT_ANALOG: |
289 | case DCB_OUTPUT_TV : ctor = outps->tv ; break; | 278 | case DCB_OUTPUT_TV: |
290 | case DCB_OUTPUT_TMDS : ctor = outps->tmds; break; | 279 | case DCB_OUTPUT_TMDS: |
291 | case DCB_OUTPUT_LVDS : ctor = outps->lvds; break; | 280 | case DCB_OUTPUT_LVDS: |
292 | case DCB_OUTPUT_DP : ctor = outps->dp ; break; | 281 | ret = nvkm_outp_new(disp, i, &dcbE, &outp); |
282 | break; | ||
283 | case DCB_OUTPUT_DP: | ||
284 | ret = nvkm_dp_new(disp, i, &dcbE, &outp); | ||
285 | break; | ||
293 | default: | 286 | default: |
294 | nvkm_warn(&disp->engine.subdev, | 287 | nvkm_warn(subdev, "dcb %d type %d unknown\n", |
295 | "dcb %d type %d unknown\n", i, dcbE.type); | 288 | i, dcbE.type); |
296 | continue; | 289 | continue; |
297 | } | 290 | } |
298 | 291 | ||
299 | if (ctor) | ||
300 | ret = ctor(disp, i, &dcbE, &outp); | ||
301 | else | ||
302 | ret = -ENODEV; | ||
303 | |||
304 | if (ret) { | 292 | if (ret) { |
305 | if (ret == -ENODEV) { | 293 | if (outp) { |
306 | nvkm_debug(&disp->engine.subdev, | 294 | if (ret != -ENODEV) |
307 | "dcb %d %d/%d not supported\n", | 295 | OUTP_ERR(outp, "ctor failed: %d", ret); |
308 | i, dcbE.location, dcbE.type); | 296 | else |
297 | OUTP_DBG(outp, "not supported"); | ||
298 | nvkm_outp_del(&outp); | ||
309 | continue; | 299 | continue; |
310 | } | 300 | } |
311 | nvkm_error(&disp->engine.subdev, | 301 | nvkm_error(subdev, "failed to create outp %d\n", i); |
312 | "failed to create outp %d\n", i); | ||
313 | nvkm_outp_del(&outp); | ||
314 | continue; | 302 | continue; |
315 | } | 303 | } |
316 | 304 | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dacnv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dacnv50.c index 0e51e144c1bd..64de64fdc9d1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dacnv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dacnv50.c | |||
@@ -22,22 +22,9 @@ | |||
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
23 | */ | 23 | */ |
24 | #include "ior.h" | 24 | #include "ior.h" |
25 | #include "outp.h" | ||
26 | 25 | ||
27 | #include <subdev/timer.h> | 26 | #include <subdev/timer.h> |
28 | 27 | ||
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 | |||
41 | int | 28 | int |
42 | nv50_dac_sense(struct nvkm_ior *dac, u32 loadval) | 29 | nv50_dac_sense(struct nvkm_ior *dac, u32 loadval) |
43 | { | 30 | { |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c index 2d8f93323309..b531890b1a6f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c | |||
@@ -580,7 +580,7 @@ nvkm_dp_ctor(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, | |||
580 | dp->aux = aux; | 580 | dp->aux = aux; |
581 | if (!dp->aux) { | 581 | if (!dp->aux) { |
582 | OUTP_ERR(&dp->outp, "no aux"); | 582 | OUTP_ERR(&dp->outp, "no aux"); |
583 | return -ENODEV; | 583 | return -EINVAL; |
584 | } | 584 | } |
585 | 585 | ||
586 | /* bios data is not optional */ | 586 | /* bios data is not optional */ |
@@ -589,7 +589,7 @@ nvkm_dp_ctor(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, | |||
589 | &hdr, &cnt, &len, &dp->info); | 589 | &hdr, &cnt, &len, &dp->info); |
590 | if (!data) { | 590 | if (!data) { |
591 | OUTP_ERR(&dp->outp, "no bios dp data"); | 591 | OUTP_ERR(&dp->outp, "no bios dp data"); |
592 | return -ENODEV; | 592 | return -EINVAL; |
593 | } | 593 | } |
594 | 594 | ||
595 | OUTP_DBG(&dp->outp, "bios dp %02x %02x %02x %02x", | 595 | OUTP_DBG(&dp->outp, "bios dp %02x %02x %02x %02x", |
@@ -616,9 +616,8 @@ nvkm_dp_ctor(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, | |||
616 | } | 616 | } |
617 | 617 | ||
618 | int | 618 | int |
619 | nvkm_output_dp_new_(const struct nvkm_output_dp_func *func, | 619 | nvkm_dp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, |
620 | struct nvkm_disp *disp, int index, struct dcb_output *dcbE, | 620 | struct nvkm_outp **poutp) |
621 | struct nvkm_outp **poutp) | ||
622 | { | 621 | { |
623 | struct nvkm_i2c *i2c = disp->engine.subdev.device->i2c; | 622 | struct nvkm_i2c *i2c = disp->engine.subdev.device->i2c; |
624 | struct nvkm_i2c_aux *aux; | 623 | struct nvkm_i2c_aux *aux; |
@@ -631,7 +630,6 @@ nvkm_output_dp_new_(const struct nvkm_output_dp_func *func, | |||
631 | 630 | ||
632 | if (!(dp = kzalloc(sizeof(*dp), GFP_KERNEL))) | 631 | if (!(dp = kzalloc(sizeof(*dp), GFP_KERNEL))) |
633 | return -ENOMEM; | 632 | return -ENOMEM; |
634 | dp->func = func; | ||
635 | *poutp = &dp->outp; | 633 | *poutp = &dp->outp; |
636 | 634 | ||
637 | return nvkm_dp_ctor(disp, index, dcbE, aux, dp); | 635 | return nvkm_dp_ctor(disp, index, dcbE, aux, dp); |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h index edd416c62d3e..34e58b70a394 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h | |||
@@ -8,7 +8,6 @@ | |||
8 | #include <subdev/bios/dp.h> | 8 | #include <subdev/bios/dp.h> |
9 | 9 | ||
10 | struct nvkm_dp { | 10 | struct nvkm_dp { |
11 | const struct nvkm_output_dp_func *func; | ||
12 | union { | 11 | union { |
13 | struct nvkm_outp base; | 12 | struct nvkm_outp base; |
14 | struct nvkm_outp outp; | 13 | struct nvkm_outp outp; |
@@ -32,28 +31,10 @@ struct nvkm_dp { | |||
32 | 31 | ||
33 | #define nvkm_output_dp nvkm_dp | 32 | #define nvkm_output_dp nvkm_dp |
34 | 33 | ||
35 | struct nvkm_output_dp_func { | ||
36 | }; | ||
37 | |||
38 | int nvkm_output_dp_train(struct nvkm_output *, u32 rate); | 34 | int nvkm_output_dp_train(struct nvkm_output *, u32 rate); |
39 | 35 | ||
40 | int nvkm_output_dp_new_(const struct nvkm_output_dp_func *, struct nvkm_disp *, | 36 | int nvkm_dp_new(struct nvkm_disp *, int index, struct dcb_output *, |
41 | int index, struct dcb_output *, struct nvkm_output **); | 37 | struct nvkm_outp **); |
42 | |||
43 | int nv50_pior_dp_new(struct nvkm_disp *, int, struct dcb_output *, | ||
44 | struct nvkm_output **); | ||
45 | |||
46 | int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, | ||
47 | struct nvkm_output **); | ||
48 | |||
49 | int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, | ||
50 | struct nvkm_output **); | ||
51 | |||
52 | int gm107_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, | ||
53 | struct nvkm_output **); | ||
54 | |||
55 | int gm200_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, | ||
56 | struct nvkm_output **); | ||
57 | 38 | ||
58 | /* DPCD Receiver Capabilities */ | 39 | /* DPCD Receiver Capabilities */ |
59 | #define DPCD_RC00_DPCD_REV 0x00000 | 40 | #define DPCD_RC00_DPCD_REV 0x00000 |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c index 50fbe1cb6653..842e1b72ee42 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c | |||
@@ -33,11 +33,6 @@ g84_disp = { | |||
33 | .super = nv50_disp_super, | 33 | .super = nv50_disp_super, |
34 | .root = &g84_disp_root_oclass, | 34 | .root = &g84_disp_root_oclass, |
35 | .head.new = nv50_head_new, | 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 | .dac = { .nr = 3, .new = nv50_dac_new }, | 36 | .dac = { .nr = 3, .new = nv50_dac_new }, |
42 | .sor = { .nr = 2, .new = g84_sor_new }, | 37 | .sor = { .nr = 2, .new = g84_sor_new }, |
43 | .pior = { .nr = 3, .new = nv50_pior_new }, | 38 | .pior = { .nr = 3, .new = nv50_pior_new }, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c index 8cc2a8c03fc6..d184e6ab8918 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c | |||
@@ -33,12 +33,6 @@ g94_disp = { | |||
33 | .super = nv50_disp_super, | 33 | .super = nv50_disp_super, |
34 | .root = &g94_disp_root_oclass, | 34 | .root = &g94_disp_root_oclass, |
35 | .head.new = nv50_head_new, | 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 | .dac = { .nr = 3, .new = nv50_dac_new }, | 36 | .dac = { .nr = 3, .new = nv50_dac_new }, |
43 | .sor = { .nr = 4, .new = g94_sor_new }, | 37 | .sor = { .nr = 4, .new = g94_sor_new }, |
44 | .pior = { .nr = 3, .new = nv50_pior_new }, | 38 | .pior = { .nr = 3, .new = nv50_pior_new }, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c index bb816f78230f..c0d730af4c97 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c | |||
@@ -502,10 +502,6 @@ gf119_disp = { | |||
502 | .super = gf119_disp_super, | 502 | .super = gf119_disp_super, |
503 | .root = &gf119_disp_root_oclass, | 503 | .root = &gf119_disp_root_oclass, |
504 | .head.new = gf119_head_new, | 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 | .dac = { .nr = 3, .new = gf119_dac_new }, | 505 | .dac = { .nr = 3, .new = gf119_dac_new }, |
510 | .sor = { .nr = 4, .new = gf119_sor_new }, | 506 | .sor = { .nr = 4, .new = gf119_sor_new }, |
511 | }; | 507 | }; |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c index e45cc01aed1c..e8fe9f315d64 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c | |||
@@ -34,10 +34,6 @@ gk104_disp = { | |||
34 | .super = gf119_disp_super, | 34 | .super = gf119_disp_super, |
35 | .root = &gk104_disp_root_oclass, | 35 | .root = &gk104_disp_root_oclass, |
36 | .head.new = gf119_head_new, | 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 | .dac = { .nr = 3, .new = gf119_dac_new }, | 37 | .dac = { .nr = 3, .new = gf119_dac_new }, |
42 | .sor = { .nr = 4, .new = gk104_sor_new }, | 38 | .sor = { .nr = 4, .new = gk104_sor_new }, |
43 | }; | 39 | }; |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c index e0990ffd3f57..769687502e7a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c | |||
@@ -34,10 +34,6 @@ gk110_disp = { | |||
34 | .super = gf119_disp_super, | 34 | .super = gf119_disp_super, |
35 | .root = &gk110_disp_root_oclass, | 35 | .root = &gk110_disp_root_oclass, |
36 | .head.new = gf119_head_new, | 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 | .dac = { .nr = 3, .new = gf119_dac_new }, | 37 | .dac = { .nr = 3, .new = gf119_dac_new }, |
42 | .sor = { .nr = 4, .new = gk104_sor_new }, | 38 | .sor = { .nr = 4, .new = gk104_sor_new }, |
43 | }; | 39 | }; |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c index e42ab42b9dd1..ede70e5d188e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c | |||
@@ -34,10 +34,6 @@ gm107_disp = { | |||
34 | .super = gf119_disp_super, | 34 | .super = gf119_disp_super, |
35 | .root = &gm107_disp_root_oclass, | 35 | .root = &gm107_disp_root_oclass, |
36 | .head.new = gf119_head_new, | 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 | .dac = { .nr = 3, .new = gf119_dac_new }, | 37 | .dac = { .nr = 3, .new = gf119_dac_new }, |
42 | .sor = { .nr = 4, .new = gm107_sor_new }, | 38 | .sor = { .nr = 4, .new = gm107_sor_new }, |
43 | }; | 39 | }; |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c index 287c00159481..ae0b97332e46 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c | |||
@@ -34,10 +34,6 @@ gm200_disp = { | |||
34 | .super = gf119_disp_super, | 34 | .super = gf119_disp_super, |
35 | .root = &gm200_disp_root_oclass, | 35 | .root = &gm200_disp_root_oclass, |
36 | .head.new = gf119_head_new, | 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 | .dac = { .nr = 3, .new = gf119_dac_new }, | 37 | .dac = { .nr = 3, .new = gf119_dac_new }, |
42 | .sor.nr = 4, | 38 | .sor.nr = 4, |
43 | .sor.new = gm200_sor_new, | 39 | .sor.new = gm200_sor_new, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c index c83883c0bd43..c6fe7797a803 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c | |||
@@ -34,9 +34,6 @@ gp100_disp = { | |||
34 | .super = gf119_disp_super, | 34 | .super = gf119_disp_super, |
35 | .root = &gp100_disp_root_oclass, | 35 | .root = &gp100_disp_root_oclass, |
36 | .head.new = gf119_head_new, | 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 | .sor.nr = 4, | 37 | .sor.nr = 4, |
41 | .sor.new = gm200_sor_new, | 38 | .sor.new = gm200_sor_new, |
42 | .sor.magic = gm200_sor_magic, | 39 | .sor.magic = gm200_sor_magic, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c index bac4d05a0015..279d125fe265 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c | |||
@@ -60,9 +60,6 @@ gp102_disp = { | |||
60 | .super = gf119_disp_super, | 60 | .super = gf119_disp_super, |
61 | .root = &gp102_disp_root_oclass, | 61 | .root = &gp102_disp_root_oclass, |
62 | .head.new = gf119_head_new, | 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 | .sor.nr = 4, | 63 | .sor.nr = 4, |
67 | .sor.new = gm200_sor_new, | 64 | .sor.new = gm200_sor_new, |
68 | .sor.magic = gm200_sor_magic, | 65 | .sor.magic = gm200_sor_magic, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c index 387f57bc517b..bf00c4e3be3a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c | |||
@@ -33,11 +33,6 @@ gt200_disp = { | |||
33 | .super = nv50_disp_super, | 33 | .super = nv50_disp_super, |
34 | .root = >200_disp_root_oclass, | 34 | .root = >200_disp_root_oclass, |
35 | .head.new = nv50_head_new, | 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 | .dac = { .nr = 3, .new = nv50_dac_new }, | 36 | .dac = { .nr = 3, .new = nv50_dac_new }, |
42 | .sor = { .nr = 2, .new = g84_sor_new }, | 37 | .sor = { .nr = 2, .new = g84_sor_new }, |
43 | .pior = { .nr = 3, .new = nv50_pior_new }, | 38 | .pior = { .nr = 3, .new = nv50_pior_new }, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c index 0c761feca2d4..2cdd4d7a98d3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c | |||
@@ -33,12 +33,6 @@ gt215_disp = { | |||
33 | .super = nv50_disp_super, | 33 | .super = nv50_disp_super, |
34 | .root = >215_disp_root_oclass, | 34 | .root = >215_disp_root_oclass, |
35 | .head.new = nv50_head_new, | 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 | .dac = { .nr = 3, .new = nv50_dac_new }, | 36 | .dac = { .nr = 3, .new = nv50_dac_new }, |
43 | .sor = { .nr = 4, .new = gt215_sor_new }, | 37 | .sor = { .nr = 4, .new = gt215_sor_new }, |
44 | .pior = { .nr = 3, .new = nv50_pior_new }, | 38 | .pior = { .nr = 3, .new = nv50_pior_new }, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c index 4f4e4e68de33..d7e0fbb12bf1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c | |||
@@ -31,12 +31,6 @@ mcp77_disp = { | |||
31 | .super = nv50_disp_super, | 31 | .super = nv50_disp_super, |
32 | .root = &g94_disp_root_oclass, | 32 | .root = &g94_disp_root_oclass, |
33 | .head.new = nv50_head_new, | 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 | .dac = { .nr = 3, .new = nv50_dac_new }, | 34 | .dac = { .nr = 3, .new = nv50_dac_new }, |
41 | .sor = { .nr = 4, .new = mcp77_sor_new }, | 35 | .sor = { .nr = 4, .new = mcp77_sor_new }, |
42 | .pior = { .nr = 3, .new = nv50_pior_new }, | 36 | .pior = { .nr = 3, .new = nv50_pior_new }, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c index 80e0f523f071..7b75c57c12ed 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c | |||
@@ -31,12 +31,6 @@ mcp89_disp = { | |||
31 | .super = nv50_disp_super, | 31 | .super = nv50_disp_super, |
32 | .root = >215_disp_root_oclass, | 32 | .root = >215_disp_root_oclass, |
33 | .head.new = nv50_head_new, | 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 | .dac = { .nr = 3, .new = nv50_dac_new }, | 34 | .dac = { .nr = 3, .new = nv50_dac_new }, |
41 | .sor = { .nr = 4, .new = mcp89_sor_new }, | 35 | .sor = { .nr = 4, .new = mcp89_sor_new }, |
42 | .pior = { .nr = 3, .new = nv50_pior_new }, | 36 | .pior = { .nr = 3, .new = nv50_pior_new }, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c index ae570f65e097..b7365b56ed19 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c | |||
@@ -42,63 +42,6 @@ nv50_disp_root_(struct nvkm_disp *base) | |||
42 | return nv50_disp(base)->func->root; | 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 | static void | 45 | static void |
103 | nv50_disp_intr_(struct nvkm_disp *base) | 46 | nv50_disp_intr_(struct nvkm_disp *base) |
104 | { | 47 | { |
@@ -121,12 +64,6 @@ nv50_disp_ = { | |||
121 | .dtor = nv50_disp_dtor_, | 64 | .dtor = nv50_disp_dtor_, |
122 | .intr = nv50_disp_intr_, | 65 | .intr = nv50_disp_intr_, |
123 | .root = nv50_disp_root_, | 66 | .root = nv50_disp_root_, |
124 | .outp.internal.crt = nv50_disp_outp_internal_crt_, | ||
125 | .outp.internal.tmds = nv50_disp_outp_internal_tmds_, | ||
126 | .outp.internal.lvds = nv50_disp_outp_internal_lvds_, | ||
127 | .outp.internal.dp = nv50_disp_outp_internal_dp_, | ||
128 | .outp.external.tmds = nv50_disp_outp_external_tmds_, | ||
129 | .outp.external.dp = nv50_disp_outp_external_dp_, | ||
130 | }; | 67 | }; |
131 | 68 | ||
132 | int | 69 | int |
@@ -839,11 +776,6 @@ nv50_disp = { | |||
839 | .super = nv50_disp_super, | 776 | .super = nv50_disp_super, |
840 | .root = &nv50_disp_root_oclass, | 777 | .root = &nv50_disp_root_oclass, |
841 | .head.new = nv50_head_new, | 778 | .head.new = nv50_head_new, |
842 | .outp.internal.crt = nv50_dac_output_new, | ||
843 | .outp.internal.tmds = nv50_sor_output_new, | ||
844 | .outp.internal.lvds = nv50_sor_output_new, | ||
845 | .outp.external.tmds = nv50_pior_output_new, | ||
846 | .outp.external.dp = nv50_pior_dp_new, | ||
847 | .dac = { .nr = 3, .new = nv50_dac_new }, | 779 | .dac = { .nr = 3, .new = nv50_dac_new }, |
848 | .sor = { .nr = 2, .new = nv50_sor_new }, | 780 | .sor = { .nr = 2, .new = nv50_sor_new }, |
849 | .pior = { .nr = 3, .new = nv50_pior_new }, | 781 | .pior = { .nr = 3, .new = nv50_pior_new }, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h index d00ce1da1637..f87422de12b3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h | |||
@@ -32,19 +32,6 @@ int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *, | |||
32 | int gf119_disp_new_(const struct nv50_disp_func *, struct nvkm_device *, | 32 | int gf119_disp_new_(const struct nv50_disp_func *, struct nvkm_device *, |
33 | int index, struct nvkm_disp **); | 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 | struct nv50_disp_func { | 35 | struct nv50_disp_func { |
49 | void (*intr)(struct nv50_disp *); | 36 | void (*intr)(struct nv50_disp *); |
50 | void (*intr_error)(struct nv50_disp *, int chid); | 37 | void (*intr_error)(struct nv50_disp *, int chid); |
@@ -59,11 +46,6 @@ struct nv50_disp_func { | |||
59 | } head; | 46 | } head; |
60 | 47 | ||
61 | struct { | 48 | struct { |
62 | const struct nv50_disp_func_outp internal; | ||
63 | const struct nv50_disp_func_outp external; | ||
64 | } outp; | ||
65 | |||
66 | struct { | ||
67 | int nr; | 49 | int nr; |
68 | int (*new)(struct nvkm_disp *, int id); | 50 | int (*new)(struct nvkm_disp *, int id); |
69 | } dac; | 51 | } dac; |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c index 895a84ca1501..09e8ebbd4ee9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | |||
@@ -142,12 +142,15 @@ nvkm_outp_ctor(const struct nvkm_outp_func *func, struct nvkm_disp *disp, | |||
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | 144 | ||
145 | static const struct nvkm_outp_func | ||
146 | nvkm_outp = { | ||
147 | }; | ||
148 | |||
145 | int | 149 | int |
146 | nvkm_outp_new_(const struct nvkm_outp_func *func, | 150 | nvkm_outp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, |
147 | struct nvkm_disp *disp, int index, struct dcb_output *dcbE, | 151 | struct nvkm_outp **poutp) |
148 | struct nvkm_outp **poutp) | ||
149 | { | 152 | { |
150 | if (!(*poutp = kzalloc(sizeof(**poutp), GFP_KERNEL))) | 153 | if (!(*poutp = kzalloc(sizeof(**poutp), GFP_KERNEL))) |
151 | return -ENOMEM; | 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 | } |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h index 80d4a0d34f14..785a920eaf74 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h | |||
@@ -23,6 +23,8 @@ struct nvkm_outp { | |||
23 | 23 | ||
24 | int nvkm_outp_ctor(const struct nvkm_outp_func *, struct nvkm_disp *, | 24 | int nvkm_outp_ctor(const struct nvkm_outp_func *, struct nvkm_disp *, |
25 | int index, struct dcb_output *, struct nvkm_outp *); | 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 | void nvkm_outp_del(struct nvkm_outp **); | 28 | void nvkm_outp_del(struct nvkm_outp **); |
27 | void nvkm_outp_init(struct nvkm_outp *); | 29 | void nvkm_outp_init(struct nvkm_outp *); |
28 | void nvkm_outp_fini(struct nvkm_outp *); | 30 | void nvkm_outp_fini(struct nvkm_outp *); |
@@ -37,16 +39,6 @@ struct nvkm_outp_func { | |||
37 | #define nvkm_output_func nvkm_outp_func | 39 | #define nvkm_output_func nvkm_outp_func |
38 | #define nvkm_output_new_ nvkm_outp_new_ | 40 | #define nvkm_output_new_ nvkm_outp_new_ |
39 | 41 | ||
40 | int nvkm_outp_new_(const struct nvkm_outp_func *, struct nvkm_disp *, | ||
41 | int index, struct dcb_output *, struct nvkm_output **); | ||
42 | |||
43 | int nv50_dac_output_new(struct nvkm_disp *, int, struct dcb_output *, | ||
44 | struct nvkm_output **); | ||
45 | int nv50_sor_output_new(struct nvkm_disp *, int, struct dcb_output *, | ||
46 | struct nvkm_output **); | ||
47 | int nv50_pior_output_new(struct nvkm_disp *, int, struct dcb_output *, | ||
48 | struct nvkm_output **); | ||
49 | |||
50 | void gm200_sor_magic(struct nvkm_output *outp); | 42 | void gm200_sor_magic(struct nvkm_output *outp); |
51 | 43 | ||
52 | #define OUTP_MSG(o,l,f,a...) do { \ | 44 | #define OUTP_MSG(o,l,f,a...) do { \ |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/piornv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/piornv50.c index a3c4386a5a90..f66beda1ae11 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/piornv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/piornv50.c | |||
@@ -22,29 +22,10 @@ | |||
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
23 | */ | 23 | */ |
24 | #include "ior.h" | 24 | #include "ior.h" |
25 | #include "dp.h" | ||
26 | 25 | ||
27 | #include <subdev/i2c.h> | 26 | #include <subdev/i2c.h> |
28 | #include <subdev/timer.h> | 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 | static int | 29 | static int |
49 | nv50_pior_dp_links(struct nvkm_ior *pior, struct nvkm_i2c_aux *aux) | 30 | nv50_pior_dp_links(struct nvkm_ior *pior, struct nvkm_i2c_aux *aux) |
50 | { | 31 | { |
@@ -55,18 +36,6 @@ nv50_pior_dp_links(struct nvkm_ior *pior, struct nvkm_i2c_aux *aux) | |||
55 | return 1; | 36 | return 1; |
56 | } | 37 | } |
57 | 38 | ||
58 | static const struct nvkm_output_dp_func | ||
59 | nv50_pior_output_dp_func = { | ||
60 | }; | ||
61 | |||
62 | int | ||
63 | nv50_pior_dp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, | ||
64 | struct nvkm_output **poutp) | ||
65 | { | ||
66 | return nvkm_output_dp_new_(&nv50_pior_output_dp_func, disp, | ||
67 | index, dcbE, poutp); | ||
68 | } | ||
69 | |||
70 | static void | 39 | static void |
71 | nv50_pior_power_wait(struct nvkm_device *device, u32 poff) | 40 | nv50_pior_power_wait(struct nvkm_device *device, u32 poff) |
72 | { | 41 | { |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h index e8dcae14a9ae..5772f0094129 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h | |||
@@ -9,29 +9,11 @@ int nvkm_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, | |||
9 | int index, struct nvkm_disp **); | 9 | int index, struct nvkm_disp **); |
10 | void nvkm_disp_vblank(struct nvkm_disp *, int head); | 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 | struct nvkm_disp_func { | 12 | struct nvkm_disp_func { |
26 | void *(*dtor)(struct nvkm_disp *); | 13 | void *(*dtor)(struct nvkm_disp *); |
27 | void (*intr)(struct nvkm_disp *); | 14 | void (*intr)(struct nvkm_disp *); |
28 | 15 | ||
29 | const struct nvkm_disp_oclass *(*root)(struct nvkm_disp *); | 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 | int nvkm_disp_ntfy(struct nvkm_object *, u32, struct nvkm_event **); | 19 | int nvkm_disp_ntfy(struct nvkm_object *, u32, struct nvkm_event **); |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c index a4a4749d3c4b..bfc7b0e053a4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorg94.c | |||
@@ -91,17 +91,6 @@ g94_sor_dp_links(struct nvkm_ior *sor, struct nvkm_i2c_aux *aux) | |||
91 | return 0; | 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 | static bool | 94 | static bool |
106 | nv50_disp_dptmds_war(struct nvkm_device *device) | 95 | nv50_disp_dptmds_war(struct nvkm_device *device) |
107 | { | 96 | { |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c index b313beda00d7..d37cd037ee03 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c | |||
@@ -22,7 +22,6 @@ | |||
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
23 | */ | 23 | */ |
24 | #include "ior.h" | 24 | #include "ior.h" |
25 | #include "nv50.h" | ||
26 | 25 | ||
27 | #include <subdev/timer.h> | 26 | #include <subdev/timer.h> |
28 | 27 | ||
@@ -100,17 +99,6 @@ gf119_sor_dp_links(struct nvkm_ior *sor, struct nvkm_i2c_aux *aux) | |||
100 | return 0; | 99 | return 0; |
101 | } | 100 | } |
102 | 101 | ||
103 | static const struct nvkm_output_dp_func | ||
104 | gf119_sor_dp_func = { | ||
105 | }; | ||
106 | |||
107 | int | ||
108 | gf119_sor_dp_new(struct nvkm_disp *disp, int index, | ||
109 | struct dcb_output *dcbE, struct nvkm_output **poutp) | ||
110 | { | ||
111 | return nvkm_output_dp_new_(&gf119_sor_dp_func, disp, index, dcbE, poutp); | ||
112 | } | ||
113 | |||
114 | void | 102 | void |
115 | gf119_sor_state(struct nvkm_ior *sor, struct nvkm_ior_state *state) | 103 | gf119_sor_state(struct nvkm_ior *sor, struct nvkm_ior_state *state) |
116 | { | 104 | { |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c index 77873874e178..e467f8eaf2ee 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm107.c | |||
@@ -22,7 +22,6 @@ | |||
22 | * Authors: Ben Skeggs <bskeggs@redhat.com> | 22 | * Authors: Ben Skeggs <bskeggs@redhat.com> |
23 | */ | 23 | */ |
24 | #include "ior.h" | 24 | #include "ior.h" |
25 | #include "nv50.h" | ||
26 | 25 | ||
27 | void | 26 | void |
28 | gm107_sor_dp_pattern(struct nvkm_ior *sor, int pattern) | 27 | gm107_sor_dp_pattern(struct nvkm_ior *sor, int pattern) |
@@ -36,17 +35,6 @@ gm107_sor_dp_pattern(struct nvkm_ior *sor, int pattern) | |||
36 | nvkm_mask(device, 0x61c12c + soff, 0x0f0f0f0f, data); | 35 | nvkm_mask(device, 0x61c12c + soff, 0x0f0f0f0f, data); |
37 | } | 36 | } |
38 | 37 | ||
39 | static const struct nvkm_output_dp_func | ||
40 | gm107_sor_dp_func = { | ||
41 | }; | ||
42 | |||
43 | int | ||
44 | gm107_sor_dp_new(struct nvkm_disp *disp, int index, | ||
45 | struct dcb_output *dcbE, struct nvkm_output **poutp) | ||
46 | { | ||
47 | return nvkm_output_dp_new_(&gm107_sor_dp_func, disp, index, dcbE, poutp); | ||
48 | } | ||
49 | |||
50 | static const struct nvkm_ior_func | 38 | static const struct nvkm_ior_func |
51 | gm107_sor = { | 39 | gm107_sor = { |
52 | .state = gf119_sor_state, | 40 | .state = gf119_sor_state, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c index 9078ba271a12..0ba7d03efa78 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgm200.c | |||
@@ -22,7 +22,6 @@ | |||
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
23 | */ | 23 | */ |
24 | #include "ior.h" | 24 | #include "ior.h" |
25 | #include "nv50.h" | ||
26 | 25 | ||
27 | static void | 26 | static void |
28 | gm200_sor_dp_drive(struct nvkm_ior *sor, int ln, int pc, int dc, int pe, int pu) | 27 | gm200_sor_dp_drive(struct nvkm_ior *sor, int ln, int pc, int dc, int pe, int pu) |
@@ -46,17 +45,6 @@ gm200_sor_dp_drive(struct nvkm_ior *sor, int ln, int pc, int dc, int pe, int pu) | |||
46 | nvkm_wr32(device, 0x61c13c + loff, data[3] | (pc << shift)); | 45 | nvkm_wr32(device, 0x61c13c + loff, data[3] | (pc << shift)); |
47 | } | 46 | } |
48 | 47 | ||
49 | static const struct nvkm_output_dp_func | ||
50 | gm200_sor_dp_func = { | ||
51 | }; | ||
52 | |||
53 | int | ||
54 | gm200_sor_dp_new(struct nvkm_disp *disp, int index, struct dcb_output *dcbE, | ||
55 | struct nvkm_output **poutp) | ||
56 | { | ||
57 | return nvkm_output_dp_new_(&gm200_sor_dp_func, disp, index, dcbE, poutp); | ||
58 | } | ||
59 | |||
60 | void | 48 | void |
61 | gm200_sor_magic(struct nvkm_output *outp) | 49 | gm200_sor_magic(struct nvkm_output *outp) |
62 | { | 50 | { |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c index 543b6d0ee74c..2ca600c744cd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sornv50.c | |||
@@ -22,22 +22,9 @@ | |||
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
23 | */ | 23 | */ |
24 | #include "ior.h" | 24 | #include "ior.h" |
25 | #include "outp.h" | ||
26 | 25 | ||
27 | #include <subdev/timer.h> | 26 | #include <subdev/timer.h> |
28 | 27 | ||
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 | |||
41 | static void | 28 | static void |
42 | nv50_sor_power_wait(struct nvkm_device *device, u32 soff) | 29 | nv50_sor_power_wait(struct nvkm_device *device, u32 soff) |
43 | { | 30 | { |