]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/nouveau/pm: switch to instanced constructor
authorBen Skeggs <bskeggs@redhat.com>
Fri, 4 Dec 2020 06:07:49 +0000 (16:07 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 11 Feb 2021 01:49:59 +0000 (11:49 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
18 files changed:
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/include/nvkm/core/layout.h
drivers/gpu/drm/nouveau/include/nvkm/engine/pm.h
drivers/gpu/drm/nouveau/nvkm/core/subdev.c
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/g84.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.h
drivers/gpu/drm/nouveau/nvkm/engine/pm/gf108.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/gf117.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/gt200.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/gt215.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.h
drivers/gpu/drm/nouveau/nvkm/engine/pm/nv50.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h

index 9b7e1c3642a60364b6ca1125777804046cef39fd..edb74df50575ecc6decc47f5d5b36b04f2370dda 100644 (file)
@@ -60,7 +60,6 @@ struct nvkm_device {
                struct notifier_block nb;
        } acpi;
 
-       struct nvkm_pm *pm;
        struct nvkm_engine *sec;
        struct nvkm_sec2 *sec2;
        struct nvkm_sw *sw;
@@ -106,7 +105,6 @@ struct nvkm_device_chip {
 #undef NVKM_LAYOUT_INST
 #undef NVKM_LAYOUT_ONCE
 
-       int (*pm      )(struct nvkm_device *, int idx, struct nvkm_pm **);
        int (*sec     )(struct nvkm_device *, int idx, struct nvkm_engine **);
        int (*sec2    )(struct nvkm_device *, int idx, struct nvkm_sec2 **);
        int (*sw      )(struct nvkm_device *, int idx, struct nvkm_sw **);
index 32c425965178870131c1ce3505b949fc08c93a3f..9d82580851f35da2e752740bb62e9ba2a35af2d2 100644 (file)
@@ -41,4 +41,5 @@ NVKM_LAYOUT_ONCE(NVKM_ENGINE_MSPPP   , struct nvkm_engine  ,    msppp)
 NVKM_LAYOUT_ONCE(NVKM_ENGINE_MSVLD   , struct nvkm_engine  ,    msvld)
 NVKM_LAYOUT_INST(NVKM_ENGINE_NVDEC   , struct nvkm_nvdec   ,    nvdec, 3)
 NVKM_LAYOUT_INST(NVKM_ENGINE_NVENC   , struct nvkm_nvenc   ,    nvenc, 3)
+NVKM_LAYOUT_ONCE(NVKM_ENGINE_PM      , struct nvkm_pm      ,       pm)
 NVKM_LAYOUT_ONCE(NVKM_ENGINE_VP      , struct nvkm_engine  ,       vp)
index 005409052d3801c0e740b3c566ca54b974594f1c..af89d46ea3603ad3423bda116b86d0585e8e014f 100644 (file)
@@ -17,13 +17,13 @@ struct nvkm_pm {
        u32 sequence;
 };
 
-int nv40_pm_new(struct nvkm_device *, int, struct nvkm_pm **);
-int nv50_pm_new(struct nvkm_device *, int, struct nvkm_pm **);
-int g84_pm_new(struct nvkm_device *, int, struct nvkm_pm **);
-int gt200_pm_new(struct nvkm_device *, int, struct nvkm_pm **);
-int gt215_pm_new(struct nvkm_device *, int, struct nvkm_pm **);
-int gf100_pm_new(struct nvkm_device *, int, struct nvkm_pm **);
-int gf108_pm_new(struct nvkm_device *, int, struct nvkm_pm **);
-int gf117_pm_new(struct nvkm_device *, int, struct nvkm_pm **);
-int gk104_pm_new(struct nvkm_device *, int, struct nvkm_pm **);
+int nv40_pm_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pm **);
+int nv50_pm_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pm **);
+int g84_pm_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pm **);
+int gt200_pm_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pm **);
+int gt215_pm_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pm **);
+int gf100_pm_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pm **);
+int gf108_pm_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pm **);
+int gf117_pm_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pm **);
+int gk104_pm_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pm **);
 #endif
index d7e2d3e6f4db1b127e0a69193d0227f0ee8e9999..5b49a6b56bd69500dbc46f0bb80992cc7b44ae09 100644 (file)
@@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = {
 #include <core/layout.h>
 #undef NVKM_LAYOUT_ONCE
 #undef NVKM_LAYOUT_INST
-       [NVKM_ENGINE_PM      ] = "pm",
        [NVKM_ENGINE_SEC     ] = "sec",
        [NVKM_ENGINE_SEC2    ] = "sec2",
        [NVKM_ENGINE_SW      ] = "sw",
index 1894fb1760b43b615bec7e014e05cdff08f100a4..a148176de12ae2ed20c1e92a61a57c2834e4ae19 100644 (file)
@@ -491,7 +491,7 @@ nv40_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv40_gr_new },
        .mpeg     = { 0x00000001, nv40_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -517,7 +517,7 @@ nv41_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv40_gr_new },
        .mpeg     = { 0x00000001, nv40_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -543,7 +543,7 @@ nv42_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv40_gr_new },
        .mpeg     = { 0x00000001, nv40_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -569,7 +569,7 @@ nv43_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv40_gr_new },
        .mpeg     = { 0x00000001, nv40_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -595,7 +595,7 @@ nv44_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv44_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -621,7 +621,7 @@ nv45_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv40_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -647,7 +647,7 @@ nv46_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv44_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -673,7 +673,7 @@ nv47_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv40_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -699,7 +699,7 @@ nv49_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv40_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -725,7 +725,7 @@ nv4a_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv44_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -751,7 +751,7 @@ nv4b_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv40_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -777,7 +777,7 @@ nv4c_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv44_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -803,7 +803,7 @@ nv4e_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv44_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -832,7 +832,7 @@ nv50_chipset = {
        .fifo     = { 0x00000001, nv50_fifo_new },
        .gr       = { 0x00000001, nv50_gr_new },
        .mpeg     = { 0x00000001, nv50_mpeg_new },
-       .pm = nv50_pm_new,
+       .pm       = { 0x00000001, nv50_pm_new },
        .sw = nv50_sw_new,
 };
 
@@ -858,7 +858,7 @@ nv63_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv44_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -884,7 +884,7 @@ nv67_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv44_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -910,7 +910,7 @@ nv68_chipset = {
        .fifo     = { 0x00000001, nv40_fifo_new },
        .gr       = { 0x00000001, nv44_gr_new },
        .mpeg     = { 0x00000001, nv44_mpeg_new },
-       .pm = nv40_pm_new,
+       .pm       = { 0x00000001, nv40_pm_new },
        .sw = nv10_sw_new,
 };
 
@@ -941,7 +941,7 @@ nv84_chipset = {
        .fifo     = { 0x00000001, g84_fifo_new },
        .gr       = { 0x00000001, g84_gr_new },
        .mpeg     = { 0x00000001, g84_mpeg_new },
-       .pm = g84_pm_new,
+       .pm       = { 0x00000001, g84_pm_new },
        .sw = nv50_sw_new,
        .vp       = { 0x00000001, g84_vp_new },
 };
@@ -973,7 +973,7 @@ nv86_chipset = {
        .fifo     = { 0x00000001, g84_fifo_new },
        .gr       = { 0x00000001, g84_gr_new },
        .mpeg     = { 0x00000001, g84_mpeg_new },
-       .pm = g84_pm_new,
+       .pm       = { 0x00000001, g84_pm_new },
        .sw = nv50_sw_new,
        .vp       = { 0x00000001, g84_vp_new },
 };
@@ -1005,7 +1005,7 @@ nv92_chipset = {
        .fifo     = { 0x00000001, g84_fifo_new },
        .gr       = { 0x00000001, g84_gr_new },
        .mpeg     = { 0x00000001, g84_mpeg_new },
-       .pm = g84_pm_new,
+       .pm       = { 0x00000001, g84_pm_new },
        .sw = nv50_sw_new,
        .vp       = { 0x00000001, g84_vp_new },
 };
@@ -1037,7 +1037,7 @@ nv94_chipset = {
        .fifo     = { 0x00000001, g84_fifo_new },
        .gr       = { 0x00000001, g84_gr_new },
        .mpeg     = { 0x00000001, g84_mpeg_new },
-       .pm = g84_pm_new,
+       .pm       = { 0x00000001, g84_pm_new },
        .sw = nv50_sw_new,
        .vp       = { 0x00000001, g84_vp_new },
 };
@@ -1069,7 +1069,7 @@ nv96_chipset = {
        .fifo     = { 0x00000001, g84_fifo_new },
        .gr       = { 0x00000001, g84_gr_new },
        .mpeg     = { 0x00000001, g84_mpeg_new },
-       .pm = g84_pm_new,
+       .pm       = { 0x00000001, g84_pm_new },
        .sw = nv50_sw_new,
        .vp       = { 0x00000001, g84_vp_new },
 };
@@ -1101,7 +1101,7 @@ nv98_chipset = {
        .mspdec   = { 0x00000001, g98_mspdec_new },
        .msppp    = { 0x00000001, g98_msppp_new },
        .msvld    = { 0x00000001, g98_msvld_new },
-       .pm = g84_pm_new,
+       .pm       = { 0x00000001, g84_pm_new },
        .sec = g98_sec_new,
        .sw = nv50_sw_new,
 };
@@ -1133,7 +1133,7 @@ nva0_chipset = {
        .fifo     = { 0x00000001, g84_fifo_new },
        .gr       = { 0x00000001, gt200_gr_new },
        .mpeg     = { 0x00000001, g84_mpeg_new },
-       .pm = gt200_pm_new,
+       .pm       = { 0x00000001, gt200_pm_new },
        .sw = nv50_sw_new,
        .vp       = { 0x00000001, g84_vp_new },
 };
@@ -1168,7 +1168,7 @@ nva3_chipset = {
        .mspdec   = { 0x00000001, gt215_mspdec_new },
        .msppp    = { 0x00000001, gt215_msppp_new },
        .msvld    = { 0x00000001, gt215_msvld_new },
-       .pm = gt215_pm_new,
+       .pm       = { 0x00000001, gt215_pm_new },
        .sw = nv50_sw_new,
 };
 
@@ -1201,7 +1201,7 @@ nva5_chipset = {
        .mspdec   = { 0x00000001, gt215_mspdec_new },
        .msppp    = { 0x00000001, gt215_msppp_new },
        .msvld    = { 0x00000001, gt215_msvld_new },
-       .pm = gt215_pm_new,
+       .pm       = { 0x00000001, gt215_pm_new },
        .sw = nv50_sw_new,
 };
 
@@ -1234,7 +1234,7 @@ nva8_chipset = {
        .mspdec   = { 0x00000001, gt215_mspdec_new },
        .msppp    = { 0x00000001, gt215_msppp_new },
        .msvld    = { 0x00000001, gt215_msvld_new },
-       .pm = gt215_pm_new,
+       .pm       = { 0x00000001, gt215_pm_new },
        .sw = nv50_sw_new,
 };
 
@@ -1265,7 +1265,7 @@ nvaa_chipset = {
        .mspdec   = { 0x00000001, g98_mspdec_new },
        .msppp    = { 0x00000001, g98_msppp_new },
        .msvld    = { 0x00000001, g98_msvld_new },
-       .pm = g84_pm_new,
+       .pm       = { 0x00000001, g84_pm_new },
        .sec = g98_sec_new,
        .sw = nv50_sw_new,
 };
@@ -1297,7 +1297,7 @@ nvac_chipset = {
        .mspdec   = { 0x00000001, g98_mspdec_new },
        .msppp    = { 0x00000001, g98_msppp_new },
        .msvld    = { 0x00000001, g98_msvld_new },
-       .pm = g84_pm_new,
+       .pm       = { 0x00000001, g84_pm_new },
        .sec = g98_sec_new,
        .sw = nv50_sw_new,
 };
@@ -1331,7 +1331,7 @@ nvaf_chipset = {
        .mspdec   = { 0x00000001, gt215_mspdec_new },
        .msppp    = { 0x00000001, gt215_msppp_new },
        .msvld    = { 0x00000001, mcp89_msvld_new },
-       .pm = gt215_pm_new,
+       .pm       = { 0x00000001, gt215_pm_new },
        .sw = nv50_sw_new,
 };
 
@@ -1367,7 +1367,7 @@ nvc0_chipset = {
        .mspdec   = { 0x00000001, gf100_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gf100_msvld_new },
-       .pm = gf100_pm_new,
+       .pm       = { 0x00000001, gf100_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1403,7 +1403,7 @@ nvc1_chipset = {
        .mspdec   = { 0x00000001, gf100_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gf100_msvld_new },
-       .pm = gf108_pm_new,
+       .pm       = { 0x00000001, gf108_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1439,7 +1439,7 @@ nvc3_chipset = {
        .mspdec   = { 0x00000001, gf100_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gf100_msvld_new },
-       .pm = gf100_pm_new,
+       .pm       = { 0x00000001, gf100_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1475,7 +1475,7 @@ nvc4_chipset = {
        .mspdec   = { 0x00000001, gf100_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gf100_msvld_new },
-       .pm = gf100_pm_new,
+       .pm       = { 0x00000001, gf100_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1511,7 +1511,7 @@ nvc8_chipset = {
        .mspdec   = { 0x00000001, gf100_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gf100_msvld_new },
-       .pm = gf100_pm_new,
+       .pm       = { 0x00000001, gf100_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1547,7 +1547,7 @@ nvce_chipset = {
        .mspdec   = { 0x00000001, gf100_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gf100_msvld_new },
-       .pm = gf100_pm_new,
+       .pm       = { 0x00000001, gf100_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1583,7 +1583,7 @@ nvcf_chipset = {
        .mspdec   = { 0x00000001, gf100_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gf100_msvld_new },
-       .pm = gf100_pm_new,
+       .pm       = { 0x00000001, gf100_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1618,7 +1618,7 @@ nvd7_chipset = {
        .mspdec   = { 0x00000001, gf100_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gf100_msvld_new },
-       .pm = gf117_pm_new,
+       .pm       = { 0x00000001, gf117_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1654,7 +1654,7 @@ nvd9_chipset = {
        .mspdec   = { 0x00000001, gf100_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gf100_msvld_new },
-       .pm = gf117_pm_new,
+       .pm       = { 0x00000001, gf117_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1691,7 +1691,7 @@ nve4_chipset = {
        .mspdec   = { 0x00000001, gk104_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gk104_msvld_new },
-       .pm = gk104_pm_new,
+       .pm       = { 0x00000001, gk104_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1728,7 +1728,7 @@ nve6_chipset = {
        .mspdec   = { 0x00000001, gk104_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gk104_msvld_new },
-       .pm = gk104_pm_new,
+       .pm       = { 0x00000001, gk104_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1765,7 +1765,7 @@ nve7_chipset = {
        .mspdec   = { 0x00000001, gk104_mspdec_new },
        .msppp    = { 0x00000001, gf100_msppp_new },
        .msvld    = { 0x00000001, gk104_msvld_new },
-       .pm = gk104_pm_new,
+       .pm       = { 0x00000001, gk104_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -1790,7 +1790,7 @@ nvea_chipset = {
        .dma      = { 0x00000001, gf119_dma_new },
        .fifo     = { 0x00000001, gk20a_fifo_new },
        .gr       = { 0x00000001, gk20a_gr_new },
-       .pm = gk104_pm_new,
+       .pm       = { 0x00000001, gk104_pm_new },
        .sw = gf100_sw_new,
 };
 
@@ -3162,7 +3162,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
 #include <core/layout.h>
 #undef NVKM_LAYOUT_INST
 #undef NVKM_LAYOUT_ONCE
-               _(NVKM_ENGINE_PM      ,       pm);
                _(NVKM_ENGINE_SEC     ,      sec);
                _(NVKM_ENGINE_SEC2    ,     sec2);
                _(NVKM_ENGINE_SW      ,       sw);
index f875fb74f131439234950b4cfc4e0b7944d1093b..8fe0444f761e5aa4fff4175d5ff96a9b418a479e 100644 (file)
@@ -858,11 +858,11 @@ nvkm_pm = {
 
 int
 nvkm_pm_ctor(const struct nvkm_pm_func *func, struct nvkm_device *device,
-            int index, struct nvkm_pm *pm)
+            enum nvkm_subdev_type type, int inst, struct nvkm_pm *pm)
 {
        pm->func = func;
        INIT_LIST_HEAD(&pm->domains);
        INIT_LIST_HEAD(&pm->sources);
        spin_lock_init(&pm->client.lock);
-       return nvkm_engine_ctor(&nvkm_pm, device, index, true, &pm->engine);
+       return nvkm_engine_ctor(&nvkm_pm, device, type, inst, true, &pm->engine);
 }
index 6e441ddafd86fdea39feec0967fed4755cc1c998..0086d00eb16230b009fa0706cd4dc199f139c05b 100644 (file)
@@ -159,7 +159,7 @@ g84_pm[] = {
 };
 
 int
-g84_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
+g84_pm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
-       return nv40_pm_new_(g84_pm, device, index, ppm);
+       return nv40_pm_new_(g84_pm, device, type, inst, ppm);
 }
index fe2532ee4145b33effa772d583426dcd646eb39d..8e02701def8e8e3d43b1ef57134e01f78ad8a6f7 100644 (file)
@@ -187,7 +187,7 @@ gf100_pm_ = {
 
 int
 gf100_pm_new_(const struct gf100_pm_func *func, struct nvkm_device *device,
-             int index, struct nvkm_pm **ppm)
+             enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
        struct nvkm_pm *pm;
        u32 mask;
@@ -196,7 +196,7 @@ gf100_pm_new_(const struct gf100_pm_func *func, struct nvkm_device *device,
        if (!(pm = *ppm = kzalloc(sizeof(*pm), GFP_KERNEL)))
                return -ENOMEM;
 
-       ret = nvkm_pm_ctor(&gf100_pm_, device, index, pm);
+       ret = nvkm_pm_ctor(&gf100_pm_, device, type, inst, pm);
        if (ret)
                return ret;
 
@@ -237,7 +237,7 @@ gf100_pm = {
 };
 
 int
-gf100_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
+gf100_pm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
-       return gf100_pm_new_(&gf100_pm, device, index, ppm);
+       return gf100_pm_new_(&gf100_pm, device, type, inst, ppm);
 }
index 461bb219b1c0fb64eb7614c3a19d58f00004217d..bc4b014c4e8ebbaae1a6c094067d681b041c75a9 100644 (file)
@@ -9,8 +9,8 @@ struct gf100_pm_func {
        const struct nvkm_specdom *doms_part;
 };
 
-int gf100_pm_new_(const struct gf100_pm_func *, struct nvkm_device *,
-                 int index, struct nvkm_pm **);
+int gf100_pm_new_(const struct gf100_pm_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
+                 struct nvkm_pm **);
 
 extern const struct nvkm_funcdom gf100_perfctr_func;
 extern const struct nvkm_specdom gf100_pm_gpc[];
index 49b24c98a7f7fd221b4f7c0ea35e6f7ca47683ae..505565866b5911d518e5a546d888879a6b92d94a 100644 (file)
@@ -60,7 +60,7 @@ gf108_pm = {
 };
 
 int
-gf108_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
+gf108_pm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
-       return gf100_pm_new_(&gf108_pm, device, index, ppm);
+       return gf100_pm_new_(&gf108_pm, device, type, inst, ppm);
 }
index 9170025fc9887da8aab814d56c89c0208079dc5b..c61e8c010bb3a9a2df879438166a6285171dc3d8 100644 (file)
@@ -74,7 +74,7 @@ gf117_pm = {
 };
 
 int
-gf117_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
+gf117_pm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
-       return gf100_pm_new_(&gf117_pm, device, index, ppm);
+       return gf100_pm_new_(&gf117_pm, device, type, inst, ppm);
 }
index 07f946d26ac6c5b68d54fd2fcb541aebe049a769..75bf3df1cb186e75a2648895f0edd39fe5ca0089 100644 (file)
@@ -178,7 +178,7 @@ gk104_pm = {
 };
 
 int
-gk104_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
+gk104_pm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
-       return gf100_pm_new_(&gk104_pm, device, index, ppm);
+       return gf100_pm_new_(&gk104_pm, device, type, inst, ppm);
 }
index 5cf5dd536fd0fec9ebd1ccf00ed813188e28e78d..25874c5414865508dc17c9d55969541eef9f8d72 100644 (file)
@@ -151,7 +151,7 @@ gt200_pm[] = {
 };
 
 int
-gt200_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
+gt200_pm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
-       return nv40_pm_new_(gt200_pm, device, index, ppm);
+       return nv40_pm_new_(gt200_pm, device, type, inst, ppm);
 }
index c9227ad41b04bf3a0ceebda93fd5345ca3a89eee..54c23e2b6645f367fd0113a8b60e656ac9b76198 100644 (file)
@@ -132,7 +132,7 @@ gt215_pm[] = {
 };
 
 int
-gt215_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
+gt215_pm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
-       return nv40_pm_new_(gt215_pm, device, index, ppm);
+       return nv40_pm_new_(gt215_pm, device, type, inst, ppm);
 }
index 3fda594700e023f71d3cc5b885ef80232e4873d9..eba5b3b79340455246ac812d756cc978a15596c6 100644 (file)
@@ -80,7 +80,7 @@ nv40_pm_ = {
 
 int
 nv40_pm_new_(const struct nvkm_specdom *doms, struct nvkm_device *device,
-            int index, struct nvkm_pm **ppm)
+            enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
        struct nv40_pm *pm;
        int ret;
@@ -89,7 +89,7 @@ nv40_pm_new_(const struct nvkm_specdom *doms, struct nvkm_device *device,
                return -ENOMEM;
        *ppm = &pm->base;
 
-       ret = nvkm_pm_ctor(&nv40_pm_, device, index, &pm->base);
+       ret = nvkm_pm_ctor(&nv40_pm_, device, type, inst, &pm->base);
        if (ret)
                return ret;
 
@@ -117,7 +117,7 @@ nv40_pm[] = {
 };
 
 int
-nv40_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
+nv40_pm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
-       return nv40_pm_new_(nv40_pm, device, index, ppm);
+       return nv40_pm_new_(nv40_pm, device, type, inst, ppm);
 }
index 8ed19320fda10f9acb001c3bd6f01fa02678342a..afb79843723d95a889ab45ddc91e233905a10e70 100644 (file)
@@ -9,7 +9,7 @@ struct nv40_pm {
        u32 sequence;
 };
 
-int nv40_pm_new_(const struct nvkm_specdom *, struct nvkm_device *,
-                int index, struct nvkm_pm **);
+int nv40_pm_new_(const struct nvkm_specdom *, struct nvkm_device *, enum nvkm_subdev_type, int,
+                struct nvkm_pm **);
 extern const struct nvkm_funcdom nv40_perfctr_func;
 #endif
index cc5a41d4c6f226a6ed55a440db1b8915d2918080..bbd3404901f95351b28d0552aafe4ad126909a8a 100644 (file)
@@ -169,7 +169,7 @@ nv50_pm[] = {
 };
 
 int
-nv50_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
+nv50_pm_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_pm **ppm)
 {
-       return nv40_pm_new_(nv50_pm, device, index, ppm);
+       return nv40_pm_new_(nv50_pm, device, type, inst, ppm);
 }
index cd6f8f79b235fe81a30c6a3e8b6bf7852fe3395e..6ae25d3e7f45c814759f8881827550dd80bde39a 100644 (file)
@@ -4,8 +4,8 @@
 #define nvkm_pm(p) container_of((p), struct nvkm_pm, engine)
 #include <engine/pm.h>
 
-int nvkm_pm_ctor(const struct nvkm_pm_func *, struct nvkm_device *,
-                int index, struct nvkm_pm *);
+int nvkm_pm_ctor(const struct nvkm_pm_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
+                struct nvkm_pm *);
 
 struct nvkm_pm_func {
        void (*fini)(struct nvkm_pm *);