drm/nouveau/core: increase maximum number of nvdec instances to 3
authorBen Skeggs <bskeggs@redhat.com>
Tue, 11 Dec 2018 04:50:02 +0000 (14:50 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 11 Dec 2018 05:37:55 +0000 (15:37 +1000)
RTX2070 appears to have 3 copies of the engine.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/nvkm/core/subdev.c
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c

index 9457be12c522f5f2e03bf019c8b910b2b0c1dc23..72e4dc1f02360ff6856a671048328f325718f994 100644 (file)
@@ -63,7 +63,8 @@ enum nvkm_devidx {
 
        NVKM_ENGINE_NVDEC0,
        NVKM_ENGINE_NVDEC1,
-       NVKM_ENGINE_NVDEC_LAST = NVKM_ENGINE_NVDEC1,
+       NVKM_ENGINE_NVDEC2,
+       NVKM_ENGINE_NVDEC_LAST = NVKM_ENGINE_NVDEC2,
 
        NVKM_ENGINE_PM,
        NVKM_ENGINE_SEC,
@@ -167,7 +168,7 @@ struct nvkm_device {
        struct nvkm_engine *msppp;
        struct nvkm_engine *msvld;
        struct nvkm_engine *nvenc[3];
-       struct nvkm_nvdec *nvdec[2];
+       struct nvkm_nvdec *nvdec[3];
        struct nvkm_pm *pm;
        struct nvkm_engine *sec;
        struct nvkm_sec2 *sec2;
@@ -239,7 +240,7 @@ struct nvkm_device_chip {
        int (*msppp   )(struct nvkm_device *, int idx, struct nvkm_engine **);
        int (*msvld   )(struct nvkm_device *, int idx, struct nvkm_engine **);
        int (*nvenc[3])(struct nvkm_device *, int idx, struct nvkm_engine **);
-       int (*nvdec[2])(struct nvkm_device *, int idx, struct nvkm_nvdec **);
+       int (*nvdec[3])(struct nvkm_device *, int idx, struct nvkm_nvdec **);
        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 **);
index 775ab7d59533abbbec48f9c00f6c4b6ab2dace44..c61b467cf45e1c738dfc66670128d396f01fd4e3 100644 (file)
@@ -81,6 +81,7 @@ nvkm_subdev_name[NVKM_SUBDEV_NR] = {
        [NVKM_ENGINE_NVENC2  ] = "nvenc2",
        [NVKM_ENGINE_NVDEC0  ] = "nvdec0",
        [NVKM_ENGINE_NVDEC1  ] = "nvdec1",
+       [NVKM_ENGINE_NVDEC2  ] = "nvdec2",
        [NVKM_ENGINE_PM      ] = "pm",
        [NVKM_ENGINE_SEC     ] = "sec",
        [NVKM_ENGINE_SEC2    ] = "sec2",
index fbabdfb24ba91e7bc4a00ebe5c7846b8a6a51509..c5977cdcbe416ce712e2632a63b35c030a1168ae 100644 (file)
@@ -2563,6 +2563,7 @@ nvkm_device_engine(struct nvkm_device *device, int index)
        _(NVENC2 , device->nvenc[2],  device->nvenc[2]);
        _(NVDEC0 , device->nvdec[0], &device->nvdec[0]->engine);
        _(NVDEC1 , device->nvdec[1], &device->nvdec[1]->engine);
+       _(NVDEC2 , device->nvdec[2], &device->nvdec[2]->engine);
        _(PM     , device->pm      , &device->pm->engine);
        _(SEC    , device->sec     ,  device->sec);
        _(SEC2   , device->sec2    , &device->sec2->engine);
@@ -3025,6 +3026,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
                _(NVKM_ENGINE_NVENC2  , nvenc[2]);
                _(NVKM_ENGINE_NVDEC0  , nvdec[0]);
                _(NVKM_ENGINE_NVDEC1  , nvdec[1]);
+               _(NVKM_ENGINE_NVDEC2  , nvdec[2]);
                _(NVKM_ENGINE_PM      ,       pm);
                _(NVKM_ENGINE_SEC     ,      sec);
                _(NVKM_ENGINE_SEC2    ,     sec2);