]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/nouveau/nvdec/gp102-: utilise engine PRI address from TOP
authorBen Skeggs <bskeggs@redhat.com>
Tue, 12 Feb 2019 12:28:13 +0000 (22:28 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 19 Feb 2019 22:59:58 +0000 (08:59 +1000)
Turing has its NVDEC instances in an alternate location.

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

index fe716859d4a92d7d5f88d47f4d0a60a364ed31e8..b72a4844c5f7b4ec9d24662d265d23d933dae534 100644 (file)
@@ -6,6 +6,8 @@
 
 struct nvkm_nvdec {
        struct nvkm_engine engine;
+       u32 addr;
+
        struct nvkm_falcon *falcon;
 };
 
index 4807021fd9906770efb29578187aea7e54f44c34..4a63581bdd5e174a575982a48335197bc1c1561c 100644 (file)
  */
 #include "priv.h"
 
+#include <subdev/top.h>
 #include <engine/falcon.h>
 
 static int
 nvkm_nvdec_oneinit(struct nvkm_engine *engine)
 {
        struct nvkm_nvdec *nvdec = nvkm_nvdec(engine);
-       return nvkm_falcon_v1_new(&nvdec->engine.subdev, "NVDEC", 0x84000,
+       struct nvkm_subdev *subdev = &nvdec->engine.subdev;
+
+       nvdec->addr = nvkm_top_addr(subdev->device, subdev->index);
+       if (!nvdec->addr)
+               return -EINVAL;
+
+       /*XXX: fix naming of this when adding support for multiple-NVDEC */
+       return nvkm_falcon_v1_new(subdev, "NVDEC", nvdec->addr,
                                  &nvdec->falcon);
 }