drm/nouveau/falcon: convert user classes to new-style nvkm_object
authorBen Skeggs <bskeggs@redhat.com>
Thu, 20 Aug 2015 04:54:19 +0000 (14:54 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 28 Aug 2015 02:40:40 +0000 (12:40 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 files changed:
drivers/gpu/drm/nouveau/include/nvif/class.h
drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h
drivers/gpu/drm/nouveau/nvkm/engine/ce/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/ce/gt215.c
drivers/gpu/drm/nouveau/nvkm/engine/falcon.c
drivers/gpu/drm/nouveau/nvkm/engine/mspdec/g98.c
drivers/gpu/drm/nouveau/nvkm/engine/mspdec/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/mspdec/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/msppp/g98.c
drivers/gpu/drm/nouveau/nvkm/engine/msppp/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/msvld/g98.c
drivers/gpu/drm/nouveau/nvkm/engine/msvld/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/msvld/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/sec/g98.c

index d8bad60642ac5f066e9c935fe2b8540eac2bb1f7..10b6685cf5e7a7ee262b4a196a3dd3b6ede33781 100644 (file)
 #define MAXWELL_A                                                    0x0000b097
 #define MAXWELL_B                                                    0x0000b197
 
+#define GT212_MSVLD                                                  0x000085b1
+#define IGT21A_MSVLD                                                 0x000086b1
+#define G98_MSVLD                                                    0x000088b1
+#define GF100_MSVLD                                                  0x000090b1
+#define GK104_MSVLD                                                  0x000095b1
+
+#define GT212_MSPDEC                                                 0x000085b2
+#define G98_MSPDEC                                                   0x000088b2
+#define GF100_MSPDEC                                                 0x000090b2
+#define GK104_MSPDEC                                                 0x000095b2
+
+#define GT212_MSPPP                                                  0x000085b3
+#define G98_MSPPP                                                    0x000088b3
+#define GF100_MSPPP                                                  0x000090b3
+
+#define G98_SEC                                                      0x000088b4
+
+#define GT212_DMA                                                    0x000085b5
+#define FERMI_DMA                                                    0x000090b5
+
+#define FERMI_DECOMPRESS                                             0x000090b8
+
 #define FERMI_COMPUTE_A                                              0x000090c0
 #define FERMI_COMPUTE_B                                              0x000091c0
 
index bdadc8b602811bfb150bf36bd74cb4efa8516fac..cd113fcbfccb203f61acc4247d6f878c281a115a 100644 (file)
@@ -1,34 +1,13 @@
 #ifndef __NVKM_FALCON_H__
 #define __NVKM_FALCON_H__
-#include <core/engctx.h>
+#define nvkm_falcon(p) container_of((p), struct nvkm_falcon, engine)
+#include <core/engine.h>
 struct nvkm_fifo_chan;
 
-struct nvkm_falcon_chan {
-       struct nvkm_engctx base;
-};
-
-#define nvkm_falcon_context_create(p,e,c,g,s,a,f,d)                         \
-       nvkm_engctx_create((p), (e), (c), (g), (s), (a), (f), (d))
-#define nvkm_falcon_context_destroy(d)                                      \
-       nvkm_engctx_destroy(&(d)->base)
-#define nvkm_falcon_context_init(d)                                         \
-       nvkm_engctx_init(&(d)->base)
-#define nvkm_falcon_context_fini(d,s)                                       \
-       nvkm_engctx_fini(&(d)->base, (s))
-
-#define _nvkm_falcon_context_ctor _nvkm_engctx_ctor
-#define _nvkm_falcon_context_dtor _nvkm_engctx_dtor
-#define _nvkm_falcon_context_init _nvkm_engctx_init
-#define _nvkm_falcon_context_fini _nvkm_engctx_fini
-#define _nvkm_falcon_context_rd32 _nvkm_engctx_rd32
-#define _nvkm_falcon_context_wr32 _nvkm_engctx_wr32
-
 struct nvkm_falcon_data {
        bool external;
 };
 
-#include <core/engine.h>
-
 struct nvkm_falcon {
        struct nvkm_engine engine;
        const struct nvkm_falcon_func *func;
@@ -55,6 +34,7 @@ struct nvkm_falcon {
 
 struct nvkm_falcon_func {
        void (*intr)(struct nvkm_falcon *, struct nvkm_fifo_chan *);
+       struct nvkm_sclass sclass[];
 };
 
 #define nv_falcon(priv) ((struct nvkm_falcon *)priv)
index 6faf38e3dbbc5ce1d72b8b9bbc306d20e4d50c7d..3abab3992e7cdeb6683616de4aee63a98c5cb5fb 100644 (file)
 #include <engine/falcon.h>
 #include "fuc/gf100.fuc3.h"
 
-/*******************************************************************************
- * Copy object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-gf100_ce0_sclass[] = {
-       { 0x90b5, &nvkm_object_ofuncs },
-       {},
-};
-
-static struct nvkm_oclass
-gf100_ce1_sclass[] = {
-       { 0x90b8, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PCE context
- ******************************************************************************/
-
-static struct nvkm_ofuncs
-gf100_ce_context_ofuncs = {
-       .ctor = _nvkm_falcon_context_ctor,
-       .dtor = _nvkm_falcon_context_dtor,
-       .init = _nvkm_falcon_context_init,
-       .fini = _nvkm_falcon_context_fini,
-       .rd32 = _nvkm_falcon_context_rd32,
-       .wr32 = _nvkm_falcon_context_wr32,
-};
-
-static struct nvkm_oclass
-gf100_ce0_cclass = {
-       .handle = NV_ENGCTX(CE0, 0xc0),
-       .ofuncs = &gf100_ce_context_ofuncs,
-};
-
-static struct nvkm_oclass
-gf100_ce1_cclass = {
-       .handle = NV_ENGCTX(CE1, 0xc0),
-       .ofuncs = &gf100_ce_context_ofuncs,
-};
-
-/*******************************************************************************
- * PCE engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static int
 gf100_ce_init(struct nvkm_object *object)
@@ -89,8 +45,12 @@ gf100_ce_init(struct nvkm_object *object)
 }
 
 static const struct nvkm_falcon_func
-gf100_ce_func = {
+gf100_ce0_func = {
        .intr = gt215_ce_intr,
+       .sclass = {
+               { -1, -1, FERMI_DMA },
+               {}
+       }
 };
 
 static int
@@ -101,15 +61,13 @@ gf100_ce0_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
        struct nvkm_falcon *ce;
        int ret;
 
-       ret = nvkm_falcon_create(&gf100_ce_func, parent, engine, oclass,
+       ret = nvkm_falcon_create(&gf100_ce0_func, parent, engine, oclass,
                                 0x104000, true, "PCE0", "ce0", &ce);
        *pobject = nv_object(ce);
        if (ret)
                return ret;
 
        nv_subdev(ce)->unit = 0x00000040;
-       nv_engine(ce)->cclass = &gf100_ce0_cclass;
-       nv_engine(ce)->sclass = gf100_ce0_sclass;
        nv_falcon(ce)->code.data = gf100_ce_code;
        nv_falcon(ce)->code.size = sizeof(gf100_ce_code);
        nv_falcon(ce)->data.data = gf100_ce_data;
@@ -117,6 +75,15 @@ gf100_ce0_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
        return 0;
 }
 
+static const struct nvkm_falcon_func
+gf100_ce1_func = {
+       .intr = gt215_ce_intr,
+       .sclass = {
+               { -1, -1, FERMI_DECOMPRESS },
+               {}
+       }
+};
+
 static int
 gf100_ce1_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
               struct nvkm_oclass *oclass, void *data, u32 size,
@@ -125,15 +92,13 @@ gf100_ce1_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
        struct nvkm_falcon *ce;
        int ret;
 
-       ret = nvkm_falcon_create(&gf100_ce_func, parent, engine, oclass,
+       ret = nvkm_falcon_create(&gf100_ce1_func, parent, engine, oclass,
                                 0x105000, true, "PCE1", "ce1", &ce);
        *pobject = nv_object(ce);
        if (ret)
                return ret;
 
        nv_subdev(ce)->unit = 0x00000080;
-       nv_engine(ce)->cclass = &gf100_ce1_cclass;
-       nv_engine(ce)->sclass = gf100_ce1_sclass;
        nv_falcon(ce)->code.data = gf100_ce_code;
        nv_falcon(ce)->code.size = sizeof(gf100_ce_code);
        nv_falcon(ce)->data.data = gf100_ce_data;
index 1a15b8d6fecead84788813f94d2b7504320caccf..35e4d578b153b28d9e671f33b58ee3cd01201e7e 100644 (file)
 #include <core/client.h>
 #include <core/enum.h>
 
-/*******************************************************************************
- * Copy object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-gt215_ce_sclass[] = {
-       { 0x85b5, &nvkm_object_ofuncs },
-       {}
-};
-
-/*******************************************************************************
- * PCE context
- ******************************************************************************/
-
-static struct nvkm_oclass
-gt215_ce_cclass = {
-       .handle = NV_ENGCTX(CE0, 0xa3),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-
-       },
-};
-
-/*******************************************************************************
- * PCE engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static const struct nvkm_enum
 gt215_ce_isr_error_name[] = {
@@ -93,6 +63,10 @@ gt215_ce_intr(struct nvkm_falcon *ce, struct nvkm_fifo_chan *chan)
 static const struct nvkm_falcon_func
 gt215_ce_func = {
        .intr = gt215_ce_intr,
+       .sclass = {
+               { -1, -1, GT212_DMA },
+               {}
+       }
 };
 
 static int
@@ -111,8 +85,6 @@ gt215_ce_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(ce)->unit = 0x00802000;
-       nv_engine(ce)->cclass = &gt215_ce_cclass;
-       nv_engine(ce)->sclass = gt215_ce_sclass;
        nv_falcon(ce)->code.data = gt215_ce_code;
        nv_falcon(ce)->code.size = sizeof(gt215_ce_code);
        nv_falcon(ce)->data.data = gt215_ce_data;
index b0cbe819497a4fda2e5c0c91398ca8c627bcb321..3d3e73cfb6b0d914caefe7ab7dc784089ccc29b8 100644 (file)
 
 #include <subdev/timer.h>
 
+static int
+nvkm_falcon_oclass_get(struct nvkm_oclass *oclass, int index)
+{
+       struct nvkm_falcon *falcon = nvkm_falcon(oclass->engine);
+       int c = 0;
+
+       while (falcon->func->sclass[c].oclass) {
+               if (c++ == index) {
+                       oclass->base = falcon->func->sclass[index];
+                       return index;
+               }
+       }
+
+       return c;
+}
+
+static int
+nvkm_falcon_cclass_bind(struct nvkm_object *object, struct nvkm_gpuobj *parent,
+                       int align, struct nvkm_gpuobj **pgpuobj)
+{
+       return nvkm_gpuobj_new(object->engine->subdev.device, 256,
+                              align, true, parent, pgpuobj);
+}
+
+static const struct nvkm_object_func
+nvkm_falcon_cclass = {
+       .bind = nvkm_falcon_cclass_bind,
+};
+
 static void
 nvkm_falcon_intr(struct nvkm_subdev *subdev)
 {
@@ -275,6 +304,12 @@ _nvkm_falcon_fini(struct nvkm_object *object, bool suspend)
        return nvkm_engine_fini_old(&falcon->engine, suspend);
 }
 
+static const struct nvkm_engine_func
+nvkm_falcon = {
+       .fifo.sclass = nvkm_falcon_oclass_get,
+       .cclass = &nvkm_falcon_cclass,
+};
+
 int
 nvkm_falcon_create_(const struct nvkm_falcon_func *func,
                    struct nvkm_object *parent, struct nvkm_object *engine,
@@ -292,6 +327,7 @@ nvkm_falcon_create_(const struct nvkm_falcon_func *func,
                return ret;
 
        falcon->engine.subdev.intr = nvkm_falcon_intr;
+       falcon->engine.func = &nvkm_falcon;
        falcon->func = func;
        falcon->addr = addr;
        return 0;
index fbb38450f1e50892763dca1f7b09ca20e17f874d..f14971783270c6748efa12a9e615df2456780274 100644 (file)
 #include <engine/mspdec.h>
 #include <engine/falcon.h>
 
-/*******************************************************************************
- * MSPDEC object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-g98_mspdec_sclass[] = {
-       { 0x88b2, &nvkm_object_ofuncs },
-       { 0x85b2, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PMSPDEC context
- ******************************************************************************/
-
-static struct nvkm_oclass
-g98_mspdec_cclass = {
-       .handle = NV_ENGCTX(MSPDEC, 0x98),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-       },
-};
-
-/*******************************************************************************
- * PMSPDEC engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static int
 g98_mspdec_init(struct nvkm_object *object)
@@ -74,6 +44,11 @@ g98_mspdec_init(struct nvkm_object *object)
 
 static const struct nvkm_falcon_func
 g98_mspdec_func = {
+       .sclass = {
+               { -1, -1, G98_MSPDEC },
+               { -1, -1, GT212_MSPDEC },
+               {}
+       },
 };
 
 static int
@@ -91,8 +66,6 @@ g98_mspdec_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(mspdec)->unit = 0x01020000;
-       nv_engine(mspdec)->cclass = &g98_mspdec_cclass;
-       nv_engine(mspdec)->sclass = g98_mspdec_sclass;
        return 0;
 }
 
index 71b75e9177b4326f570e0d3931505716b33c28a3..1296f775ea31041cb8abffe525897bb596022a85 100644 (file)
 #include <engine/mspdec.h>
 #include <engine/falcon.h>
 
-/*******************************************************************************
- * MSPDEC object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-gf100_mspdec_sclass[] = {
-       { 0x90b2, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PMSPDEC context
- ******************************************************************************/
-
-static struct nvkm_oclass
-gf100_mspdec_cclass = {
-       .handle = NV_ENGCTX(MSPDEC, 0xc0),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-       },
-};
-
-/*******************************************************************************
- * PMSPDEC engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static int
 gf100_mspdec_init(struct nvkm_object *object)
@@ -73,6 +44,10 @@ gf100_mspdec_init(struct nvkm_object *object)
 
 static const struct nvkm_falcon_func
 gf100_mspdec_func = {
+       .sclass = {
+               { -1, -1, GF100_MSPDEC },
+               {}
+       }
 };
 
 static int
@@ -90,8 +65,6 @@ gf100_mspdec_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(mspdec)->unit = 0x00020000;
-       nv_engine(mspdec)->cclass = &gf100_mspdec_cclass;
-       nv_engine(mspdec)->sclass = gf100_mspdec_sclass;
        return 0;
 }
 
index a103789a261121e5400c4ce14bd2c242fd48aa48..315da1695c72a59216a96525b2007943d121fbfa 100644 (file)
 #include <engine/mspdec.h>
 #include <engine/falcon.h>
 
-/*******************************************************************************
- * MSPDEC object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-gk104_mspdec_sclass[] = {
-       { 0x95b2, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PMSPDEC context
- ******************************************************************************/
-
-static struct nvkm_oclass
-gk104_mspdec_cclass = {
-       .handle = NV_ENGCTX(MSPDEC, 0xe0),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-       },
-};
-
-/*******************************************************************************
- * PMSPDEC engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static int
 gk104_mspdec_init(struct nvkm_object *object)
@@ -73,6 +44,10 @@ gk104_mspdec_init(struct nvkm_object *object)
 
 static const struct nvkm_falcon_func
 gk104_mspdec_func = {
+       .sclass = {
+               { -1, -1, GK104_MSPDEC },
+               {}
+       }
 };
 
 static int
@@ -90,8 +65,6 @@ gk104_mspdec_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(falcon)->unit = 0x00020000;
-       nv_engine(falcon)->cclass = &gk104_mspdec_cclass;
-       nv_engine(falcon)->sclass = gk104_mspdec_sclass;
        return 0;
 }
 
index 9029ff0ea86d72aed9026d6cff070bc4ddd75484..314736d6aa5b99d381d4178094e4761ce8b439fd 100644 (file)
 #include <engine/msppp.h>
 #include <engine/falcon.h>
 
-/*******************************************************************************
- * MSPPP object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-g98_msppp_sclass[] = {
-       { 0x88b3, &nvkm_object_ofuncs },
-       { 0x85b3, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PMSPPP context
- ******************************************************************************/
-
-static struct nvkm_oclass
-g98_msppp_cclass = {
-       .handle = NV_ENGCTX(MSPPP, 0x98),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-       },
-};
-
-/*******************************************************************************
- * PMSPPP engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static int
 g98_msppp_init(struct nvkm_object *object)
@@ -74,6 +44,11 @@ g98_msppp_init(struct nvkm_object *object)
 
 static const struct nvkm_falcon_func
 g98_msppp_func = {
+       .sclass = {
+               { -1, -1, G98_MSPPP },
+               { -1, -1, GT212_MSPPP },
+               {}
+       }
 };
 
 static int
@@ -91,8 +66,6 @@ g98_msppp_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(msppp)->unit = 0x00400002;
-       nv_engine(msppp)->cclass = &g98_msppp_cclass;
-       nv_engine(msppp)->sclass = g98_msppp_sclass;
        return 0;
 }
 
index 2b21fe5dafdaec4d85f7ce5f4fbef02718eb55ad..f977c2adf9d2da4b336c3766f70516e828efdc5d 100644 (file)
 #include <engine/msppp.h>
 #include <engine/falcon.h>
 
-/*******************************************************************************
- * MSPPP object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-gf100_msppp_sclass[] = {
-       { 0x90b3, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PMSPPP context
- ******************************************************************************/
-
-static struct nvkm_oclass
-gf100_msppp_cclass = {
-       .handle = NV_ENGCTX(MSPPP, 0xc0),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-       },
-};
-
-/*******************************************************************************
- * PMSPPP engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static int
 gf100_msppp_init(struct nvkm_object *object)
@@ -73,6 +44,10 @@ gf100_msppp_init(struct nvkm_object *object)
 
 static const struct nvkm_falcon_func
 gf100_msppp_func = {
+       .sclass = {
+               { -1, -1, GF100_MSPPP },
+               {}
+       }
 };
 
 static int
@@ -90,8 +65,6 @@ gf100_msppp_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(msppp)->unit = 0x00000002;
-       nv_engine(msppp)->cclass = &gf100_msppp_cclass;
-       nv_engine(msppp)->sclass = gf100_msppp_sclass;
        return 0;
 }
 
index cdb7de5a73054d5b21117e5b3b9ecee256bb2ad3..0ee767373f7907618d5d659587c7e6411b0d9014 100644 (file)
 #include <engine/msvld.h>
 #include <engine/falcon.h>
 
-/*******************************************************************************
- * MSVLD object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-g98_msvld_sclass[] = {
-       { 0x88b1, &nvkm_object_ofuncs },
-       { 0x85b1, &nvkm_object_ofuncs },
-       { 0x86b1, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PMSVLD context
- ******************************************************************************/
-
-static struct nvkm_oclass
-g98_msvld_cclass = {
-       .handle = NV_ENGCTX(MSVLD, 0x98),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-       },
-};
-
-/*******************************************************************************
- * PMSVLD engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static int
 g98_msvld_init(struct nvkm_object *object)
@@ -75,6 +44,12 @@ g98_msvld_init(struct nvkm_object *object)
 
 static const struct nvkm_falcon_func
 g98_msvld_func = {
+       .sclass = {
+               { -1, -1, G98_MSVLD },
+               { -1, -1, GT212_MSVLD },
+               { -1, -1, IGT21A_MSVLD },
+               {}
+       }
 };
 
 static int
@@ -92,8 +67,6 @@ g98_msvld_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(msvld)->unit = 0x04008000;
-       nv_engine(msvld)->cclass = &g98_msvld_cclass;
-       nv_engine(msvld)->sclass = g98_msvld_sclass;
        return 0;
 }
 
index 1124373be92075e60c97a0a4f28fde3e0931e662..839d648dcfdfb8b2ad1114f7f3db789813851930 100644 (file)
 #include <engine/msvld.h>
 #include <engine/falcon.h>
 
-/*******************************************************************************
- * MSVLD object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-gf100_msvld_sclass[] = {
-       { 0x90b1, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PMSVLD context
- ******************************************************************************/
-
-static struct nvkm_oclass
-gf100_msvld_cclass = {
-       .handle = NV_ENGCTX(MSVLD, 0xc0),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-       },
-};
-
-/*******************************************************************************
- * PMSVLD engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static int
 gf100_msvld_init(struct nvkm_object *object)
@@ -73,6 +44,10 @@ gf100_msvld_init(struct nvkm_object *object)
 
 static const struct nvkm_falcon_func
 gf100_msvld_func = {
+       .sclass = {
+               { -1, -1, GF100_MSVLD },
+               {}
+       }
 };
 
 static int
@@ -90,8 +65,6 @@ gf100_msvld_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(msvld)->unit = 0x00008000;
-       nv_engine(msvld)->cclass = &gf100_msvld_cclass;
-       nv_engine(msvld)->sclass = gf100_msvld_sclass;
        return 0;
 }
 
index addef2bbfe76b2a0d02140ff3e2027854f825265..74bdca359d4add9da974193cc1dd00ddf9c043d7 100644 (file)
 #include <engine/msvld.h>
 #include <engine/falcon.h>
 
-/*******************************************************************************
- * MSVLD object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-gk104_msvld_sclass[] = {
-       { 0x95b1, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PMSVLD context
- ******************************************************************************/
-
-static struct nvkm_oclass
-gk104_msvld_cclass = {
-       .handle = NV_ENGCTX(MSVLD, 0xe0),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-       },
-};
-
-/*******************************************************************************
- * PMSVLD engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static int
 gk104_msvld_init(struct nvkm_object *object)
@@ -73,6 +44,10 @@ gk104_msvld_init(struct nvkm_object *object)
 
 static const struct nvkm_falcon_func
 gk104_msvld_func = {
+       .sclass = {
+               { -1, -1, GK104_MSVLD },
+               {}
+       }
 };
 
 static int
@@ -90,8 +65,6 @@ gk104_msvld_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(msvld)->unit = 0x00008000;
-       nv_engine(msvld)->cclass = &gk104_msvld_cclass;
-       nv_engine(msvld)->sclass = gk104_msvld_sclass;
        return 0;
 }
 
index c15934d7ff63a5ef4408399c2eeeedd070a1f04b..aae0e85b10752b925bb87a74798907b7ec8ff0a8 100644 (file)
 #include <core/client.h>
 #include <core/enum.h>
 
-/*******************************************************************************
- * Crypt object classes
- ******************************************************************************/
-
-static struct nvkm_oclass
-g98_sec_sclass[] = {
-       { 0x88b4, &nvkm_object_ofuncs },
-       {},
-};
-
-/*******************************************************************************
- * PSEC context
- ******************************************************************************/
-
-static struct nvkm_oclass
-g98_sec_cclass = {
-       .handle = NV_ENGCTX(SEC, 0x98),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = _nvkm_falcon_context_ctor,
-               .dtor = _nvkm_falcon_context_dtor,
-               .init = _nvkm_falcon_context_init,
-               .fini = _nvkm_falcon_context_fini,
-               .rd32 = _nvkm_falcon_context_rd32,
-               .wr32 = _nvkm_falcon_context_wr32,
-       },
-};
-
-/*******************************************************************************
- * PSEC engine/subdev functions
- ******************************************************************************/
+#include <nvif/class.h>
 
 static const struct nvkm_enum g98_sec_isr_error_name[] = {
        { 0x0000, "ILLEGAL_MTHD" },
@@ -92,6 +63,10 @@ g98_sec_intr(struct nvkm_falcon *sec, struct nvkm_fifo_chan *chan)
 static const struct nvkm_falcon_func
 g98_sec_func = {
        .intr = g98_sec_intr,
+       .sclass = {
+               { -1, -1, G98_SEC },
+               {}
+       }
 };
 
 static int
@@ -109,8 +84,6 @@ g98_sec_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
                return ret;
 
        nv_subdev(sec)->unit = 0x00004000;
-       nv_engine(sec)->cclass = &g98_sec_cclass;
-       nv_engine(sec)->sclass = g98_sec_sclass;
        nv_falcon(sec)->code.data = g98_sec_code;
        nv_falcon(sec)->code.size = sizeof(g98_sec_code);
        nv_falcon(sec)->data.data = g98_sec_data;