diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2022-06-01 13:46:26 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2022-07-27 02:05:45 +0300 |
commit | 0407b33fadcd7a5d31ba3c473cef95b2b418d8c4 (patch) | |
tree | 4bc4239975d74ecca0787366fb26aa86d99504c1 /drivers/gpu/drm/nouveau/nvkm/engine/disp | |
parent | 412dfcf34e0695fa1714ad422b2a5d0ed1406437 (diff) | |
download | linux-0407b33fadcd7a5d31ba3c473cef95b2b418d8c4.tar.xz |
drm/nouveau/disp: collapse nv50_disp_func into nvkm_disp_func
Aside from a chicken-and-egg problem with a duplicate 'root' member,
this is a straight dump of function pointers from one struct into
another.
The left-over wrapping mess in >=nv50 structs will be fixed later.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/disp')
21 files changed, 192 insertions, 127 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c index 5daa77755276..accfabf87994 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c @@ -197,9 +197,8 @@ nvkm_disp_class_get(struct nvkm_oclass *oclass, int index, { struct nvkm_disp *disp = nvkm_disp(oclass->engine); if (index == 0) { - const struct nvkm_disp_oclass *root = disp->func->root(disp); - oclass->base = root->base; - oclass->engn = root; + oclass->base = disp->func->root->base; + oclass->engn = disp->func->root; *class = &nvkm_disp_sclass; return 0; } diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c index 156bbe8b2de3..2a13931ceb57 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c @@ -26,11 +26,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func g84_disp = { - .init = nv50_disp_init, - .fini = nv50_disp_fini, - .intr = nv50_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = nv50_disp_init, + .fini_ = nv50_disp_fini, + .intr_ = nv50_disp_intr, .uevent = &nv50_disp_chan_uevent, .super = nv50_disp_super, .root = &g84_disp_root_oclass, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c index 3425b5d3bc72..551615582882 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c @@ -26,11 +26,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func g94_disp = { - .init = nv50_disp_init, - .fini = nv50_disp_fini, - .intr = nv50_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = nv50_disp_init, + .fini_ = nv50_disp_fini, + .intr_ = nv50_disp_intr, .uevent = &nv50_disp_chan_uevent, .super = nv50_disp_super, .root = &g94_disp_root_oclass, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c index 68aa52588d92..c7b280973d86 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c @@ -25,11 +25,16 @@ #include "channv50.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func ga102_disp = { - .init = tu102_disp_init, - .fini = gv100_disp_fini, - .intr = gv100_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = tu102_disp_init, + .fini_ = gv100_disp_fini, + .intr_ = gv100_disp_intr, .uevent = &gv100_disp_chan_uevent, .super = gv100_disp_super, .root = &ga102_disp_root_oclass, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c index a6bafe7fea1f..905ee2acbd7e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c @@ -251,11 +251,16 @@ gf119_disp_init(struct nv50_disp *disp) return 0; } -static const struct nv50_disp_func +static const struct nvkm_disp_func gf119_disp = { - .init = gf119_disp_init, - .fini = gf119_disp_fini, - .intr = gf119_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = gf119_disp_init, + .fini_ = gf119_disp_fini, + .intr_ = gf119_disp_intr, .intr_error = gf119_disp_intr_error, .uevent = &gf119_disp_chan_uevent, .super = gf119_disp_super, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c index 3b79cf233ac5..15c750240903 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c @@ -26,11 +26,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func gk104_disp = { - .init = gf119_disp_init, - .fini = gf119_disp_fini, - .intr = gf119_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = gf119_disp_init, + .fini_ = gf119_disp_fini, + .intr_ = gf119_disp_intr, .intr_error = gf119_disp_intr_error, .uevent = &gf119_disp_chan_uevent, .super = gf119_disp_super, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c index 988eb12237a6..fcde0c5da111 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c @@ -26,11 +26,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func gk110_disp = { - .init = gf119_disp_init, - .fini = gf119_disp_fini, - .intr = gf119_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = gf119_disp_init, + .fini_ = gf119_disp_fini, + .intr_ = gf119_disp_intr, .intr_error = gf119_disp_intr_error, .uevent = &gf119_disp_chan_uevent, .super = gf119_disp_super, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c index 5d8108feeacd..8a072663b062 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c @@ -26,11 +26,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func gm107_disp = { - .init = gf119_disp_init, - .fini = gf119_disp_fini, - .intr = gf119_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = gf119_disp_init, + .fini_ = gf119_disp_fini, + .intr_ = gf119_disp_intr, .intr_error = gf119_disp_intr_error, .uevent = &gf119_disp_chan_uevent, .super = gf119_disp_super, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c index f7bb66087476..af21bf0baf7e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c @@ -26,11 +26,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func gm200_disp = { - .init = gf119_disp_init, - .fini = gf119_disp_fini, - .intr = gf119_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = gf119_disp_init, + .fini_ = gf119_disp_fini, + .intr_ = gf119_disp_intr, .intr_error = gf119_disp_intr_error, .uevent = &gf119_disp_chan_uevent, .super = gf119_disp_super, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c index af0ca812a394..ac43cfb7c7bd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c @@ -26,11 +26,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func gp100_disp = { - .init = gf119_disp_init, - .fini = gf119_disp_fini, - .intr = gf119_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = gf119_disp_init, + .fini_ = gf119_disp_fini, + .intr_ = gf119_disp_intr, .intr_error = gf119_disp_intr_error, .uevent = &gf119_disp_chan_uevent, .super = gf119_disp_super, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c index 065fea1bdfd1..235e4b6556eb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c @@ -53,11 +53,16 @@ gp102_disp_intr_error(struct nv50_disp *disp, int chid) nvkm_wr32(device, 0x6111f0 + (chid * 12), 0x90000000); } -static const struct nv50_disp_func +static const struct nvkm_disp_func gp102_disp = { - .init = gf119_disp_init, - .fini = gf119_disp_fini, - .intr = gf119_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = gf119_disp_init, + .fini_ = gf119_disp_fini, + .intr_ = gf119_disp_intr, .intr_error = gp102_disp_intr_error, .uevent = &gf119_disp_chan_uevent, .super = gf119_disp_super, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c index 22bc269df64a..e3d1789e66a8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c @@ -26,11 +26,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func gt200_disp = { - .init = nv50_disp_init, - .fini = nv50_disp_fini, - .intr = nv50_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = nv50_disp_init, + .fini_ = nv50_disp_fini, + .intr_ = nv50_disp_intr, .uevent = &nv50_disp_chan_uevent, .super = nv50_disp_super, .root = >200_disp_root_oclass, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c index 63a912b174d7..c38f1a8df8ac 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c @@ -26,11 +26,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func gt215_disp = { - .init = nv50_disp_init, - .fini = nv50_disp_fini, - .intr = nv50_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = nv50_disp_init, + .fini_ = nv50_disp_fini, + .intr_ = nv50_disp_intr, .uevent = &nv50_disp_chan_uevent, .super = nv50_disp_super, .root = >215_disp_root_oclass, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c index 53879d5271cf..fa9d44611bcb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c @@ -426,11 +426,16 @@ gv100_disp_init(struct nv50_disp *disp) return 0; } -static const struct nv50_disp_func +static const struct nvkm_disp_func gv100_disp = { - .init = gv100_disp_init, - .fini = gv100_disp_fini, - .intr = gv100_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = gv100_disp_init, + .fini_ = gv100_disp_fini, + .intr_ = gv100_disp_intr, .uevent = &gv100_disp_chan_uevent, .super = gv100_disp_super, .root = &gv100_disp_root_oclass, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c index 762a59f24bbb..d92921198f47 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c @@ -24,11 +24,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func mcp77_disp = { - .init = nv50_disp_init, - .fini = nv50_disp_fini, - .intr = nv50_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = nv50_disp_init, + .fini_ = nv50_disp_fini, + .intr_ = nv50_disp_intr, .uevent = &nv50_disp_chan_uevent, .super = nv50_disp_super, .root = &g94_disp_root_oclass, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c index e5c58aae15de..644dfe300df5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c @@ -24,11 +24,16 @@ #include "ior.h" #include "rootnv50.h" -static const struct nv50_disp_func +static const struct nvkm_disp_func mcp89_disp = { - .init = nv50_disp_init, - .fini = nv50_disp_fini, - .intr = nv50_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = nv50_disp_init, + .fini_ = nv50_disp_fini, + .intr_ = nv50_disp_intr, .uevent = &nv50_disp_chan_uevent, .super = nv50_disp_super, .root = >215_disp_root_oclass, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv04.c index a12097db2c2a..454199cc88fb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv04.c @@ -24,12 +24,6 @@ #include "priv.h" #include "head.h" -static const struct nvkm_disp_oclass * -nv04_disp_root(struct nvkm_disp *disp) -{ - return &nv04_disp_root_oclass; -} - static void nv04_disp_intr(struct nvkm_disp *disp) { @@ -60,7 +54,7 @@ nv04_disp_intr(struct nvkm_disp *disp) static const struct nvkm_disp_func nv04_disp = { .intr = nv04_disp_intr, - .root = nv04_disp_root, + .root = &nv04_disp_root_oclass, }; int diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c index 3f20e49070ce..a4713415a2a8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c @@ -36,34 +36,28 @@ #include <subdev/devinit.h> #include <subdev/timer.h> -static const struct nvkm_disp_oclass * -nv50_disp_root_(struct nvkm_disp *base) -{ - return nv50_disp(base)->func->root; -} - -static void +void nv50_disp_intr_(struct nvkm_disp *base) { struct nv50_disp *disp = nv50_disp(base); - disp->func->intr(disp); + disp->func->intr_(disp); } -static void +void nv50_disp_fini_(struct nvkm_disp *base) { struct nv50_disp *disp = nv50_disp(base); - disp->func->fini(disp); + disp->func->fini_(disp); } -static int +int nv50_disp_init_(struct nvkm_disp *base) { struct nv50_disp *disp = nv50_disp(base); - return disp->func->init(disp); + return disp->func->init_(disp); } -static void * +void * nv50_disp_dtor_(struct nvkm_disp *base) { struct nv50_disp *disp = nv50_disp(base); @@ -78,11 +72,11 @@ nv50_disp_dtor_(struct nvkm_disp *base) return disp; } -static int +int nv50_disp_oneinit_(struct nvkm_disp *base) { struct nv50_disp *disp = nv50_disp(base); - const struct nv50_disp_func *func = disp->func; + const struct nvkm_disp_func *func = disp->func; struct nvkm_subdev *subdev = &disp->base.engine.subdev; struct nvkm_device *device = subdev->device; int ret, i; @@ -142,18 +136,8 @@ nv50_disp_oneinit_(struct nvkm_disp *base) 0x1000, 0, disp->inst, &disp->ramht); } -static const struct nvkm_disp_func -nv50_disp_ = { - .dtor = nv50_disp_dtor_, - .oneinit = nv50_disp_oneinit_, - .init = nv50_disp_init_, - .fini = nv50_disp_fini_, - .intr = nv50_disp_intr_, - .root = nv50_disp_root_, -}; - int -nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device, +nv50_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_disp **pdisp) { struct nv50_disp *disp; @@ -164,7 +148,7 @@ nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device, disp->func = func; *pdisp = &disp->base; - ret = nvkm_disp_ctor(&nv50_disp_, device, type, inst, &disp->base); + ret = nvkm_disp_ctor(func, device, type, inst, &disp->base); if (ret) return ret; @@ -754,11 +738,16 @@ nv50_disp_init(struct nv50_disp *disp) return 0; } -static const struct nv50_disp_func +static const struct nvkm_disp_func nv50_disp = { - .init = nv50_disp_init, - .fini = nv50_disp_fini, - .intr = nv50_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = nv50_disp_init, + .fini_ = nv50_disp_fini, + .intr_ = nv50_disp_intr, .uevent = &nv50_disp_chan_uevent, .super = nv50_disp_super, .root = &nv50_disp_root_oclass, diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h index 025cacd7c3b0..87e934c8d88b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h @@ -8,7 +8,7 @@ struct nvkm_head; #include <core/enum.h> struct nv50_disp { - const struct nv50_disp_func *func; + const struct nvkm_disp_func *func; struct nvkm_disp base; struct workqueue_struct *wq; @@ -47,28 +47,9 @@ void nv50_disp_super_2_1(struct nv50_disp *, struct nvkm_head *); void nv50_disp_super_2_2(struct nv50_disp *, struct nvkm_head *); void nv50_disp_super_3_0(struct nv50_disp *, struct nvkm_head *); -int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int, +int nv50_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_disp **); -struct nv50_disp_func { - int (*init)(struct nv50_disp *); - void (*fini)(struct nv50_disp *); - void (*intr)(struct nv50_disp *); - void (*intr_error)(struct nv50_disp *, int chid); - - const struct nvkm_event_func *uevent; - void (*super)(struct work_struct *); - - const struct nvkm_disp_oclass *root; - - struct { - int (*cnt)(struct nvkm_disp *, unsigned long *mask); - int (*new)(struct nvkm_disp *, int id); - } wndw, head, dac, sor, pior; - - u16 ramht_size; -}; - int nv50_disp_init(struct nv50_disp *); void nv50_disp_fini(struct nv50_disp *); void nv50_disp_intr(struct nv50_disp *); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h index ec57d8b6bce9..3df687781f9a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h @@ -3,6 +3,7 @@ #define __NVKM_DISP_PRIV_H__ #include <engine/disp.h> #include "outp.h" +struct nv50_disp; int nvkm_disp_ctor(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_disp *); @@ -17,13 +18,34 @@ struct nvkm_disp_func { void (*fini)(struct nvkm_disp *); void (*intr)(struct nvkm_disp *); - const struct nvkm_disp_oclass *(*root)(struct nvkm_disp *); + const struct nvkm_disp_oclass *root; + + int (*init_)(struct nv50_disp *); + void (*fini_)(struct nv50_disp *); + void (*intr_)(struct nv50_disp *); + void (*intr_error)(struct nv50_disp *, int chid); + + const struct nvkm_event_func *uevent; + void (*super)(struct work_struct *); + + struct { + int (*cnt)(struct nvkm_disp *, unsigned long *mask); + int (*new)(struct nvkm_disp *, int id); + } wndw, head, dac, sor, pior; + + u16 ramht_size; }; int nvkm_disp_ntfy(struct nvkm_object *, u32, struct nvkm_event **); extern const struct nvkm_disp_oclass nv04_disp_root_oclass; +void *nv50_disp_dtor_(struct nvkm_disp *); +int nv50_disp_oneinit_(struct nvkm_disp *); +int nv50_disp_init_(struct nvkm_disp *); +void nv50_disp_fini_(struct nvkm_disp *); +void nv50_disp_intr_(struct nvkm_disp *); + struct nvkm_disp_oclass { int (*ctor)(struct nvkm_disp *, const struct nvkm_oclass *, void *data, u32 size, struct nvkm_object **); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c index f5f8dc8e8f35..39f1aff1e475 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c @@ -131,11 +131,16 @@ tu102_disp_init(struct nv50_disp *disp) return 0; } -static const struct nv50_disp_func +static const struct nvkm_disp_func tu102_disp = { - .init = tu102_disp_init, - .fini = gv100_disp_fini, - .intr = gv100_disp_intr, + .dtor = nv50_disp_dtor_, + .oneinit = nv50_disp_oneinit_, + .init = nv50_disp_init_, + .fini = nv50_disp_fini_, + .intr = nv50_disp_intr_, + .init_ = tu102_disp_init, + .fini_ = gv100_disp_fini, + .intr_ = gv100_disp_intr, .uevent = &gv100_disp_chan_uevent, .super = gv100_disp_super, .root = &tu102_disp_root_oclass, |