drm/nouveau/msenc: switch to instanced constructor
authorBen Skeggs <bskeggs@redhat.com>
Wed, 3 Feb 2021 22:37:29 +0000 (08:37 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 11 Feb 2021 01:49:58 +0000 (11:49 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/include/nvkm/core/layout.h
drivers/gpu/drm/nouveau/nvkm/core/subdev.c
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c

index 659388e..6530b4f 100644 (file)
@@ -60,7 +60,6 @@ struct nvkm_device {
                struct notifier_block nb;
        } acpi;
 
-       struct nvkm_engine *msenc;
        struct nvkm_engine *mspdec;
        struct nvkm_engine *msppp;
        struct nvkm_engine *msvld;
@@ -112,7 +111,6 @@ struct nvkm_device_chip {
 #undef NVKM_LAYOUT_INST
 #undef NVKM_LAYOUT_ONCE
 
-       int (*msenc   )(struct nvkm_device *, int idx, struct nvkm_engine **);
        int (*mspdec  )(struct nvkm_device *, int idx, struct nvkm_engine **);
        int (*msppp   )(struct nvkm_device *, int idx, struct nvkm_engine **);
        int (*msvld   )(struct nvkm_device *, int idx, struct nvkm_engine **);
index 4241048..d1ed1cf 100644 (file)
@@ -35,4 +35,5 @@ NVKM_LAYOUT_ONCE(NVKM_ENGINE_GR      , struct nvkm_gr      ,       gr)
 NVKM_LAYOUT_ONCE(NVKM_ENGINE_IFB     , struct nvkm_engine  ,      ifb)
 NVKM_LAYOUT_ONCE(NVKM_ENGINE_ME      , struct nvkm_engine  ,       me)
 NVKM_LAYOUT_ONCE(NVKM_ENGINE_MPEG    , struct nvkm_engine  ,     mpeg)
+NVKM_LAYOUT_ONCE(NVKM_ENGINE_MSENC   , struct nvkm_engine  ,    msenc)
 NVKM_LAYOUT_ONCE(NVKM_ENGINE_VP      , struct nvkm_engine  ,       vp)
index 517a35f..bfd366b 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_MSENC   ] = "msenc",
        [NVKM_ENGINE_MSPDEC  ] = "mspdec",
        [NVKM_ENGINE_MSPPP   ] = "msppp",
        [NVKM_ENGINE_MSVLD   ] = "msvld",
index e3417d1..e256869 100644 (file)
@@ -3174,7 +3174,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
 #include <core/layout.h>
 #undef NVKM_LAYOUT_INST
 #undef NVKM_LAYOUT_ONCE
-               _(NVKM_ENGINE_MSENC   ,    msenc);
                _(NVKM_ENGINE_MSPDEC  ,   mspdec);
                _(NVKM_ENGINE_MSPPP   ,    msppp);
                _(NVKM_ENGINE_MSVLD   ,    msvld);
index 023bfbf..275616f 100644 (file)
@@ -81,7 +81,7 @@ gf100_devinit_disable(struct nvkm_devinit *init)
        if (r022500 & 0x00000004)
                disable |= (1ULL << NVKM_ENGINE_MSVLD);
        if (r022500 & 0x00000008)
-               disable |= (1ULL << NVKM_ENGINE_MSENC);
+               nvkm_subdev_disable(device, NVKM_ENGINE_MSENC, 0);
        if (r022500 & 0x00000100)
                nvkm_subdev_disable(device, NVKM_ENGINE_CE, 0);
        if (r022500 & 0x00000200)