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 9457be1..72e4dc1 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 775ab7d..c61b467 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 fbabdfb..c5977cd 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);