drm/nouveau/bios/init: add or/link args separate from output path
authorBen Skeggs <bskeggs@redhat.com>
Fri, 19 May 2017 13:59:34 +0000 (23:59 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 16 Jun 2017 04:04:44 +0000 (14:04 +1000)
As of DCB 4.1, these are not the same thing.

Compatibility temporarily in place until callers have been updated.

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

index ad5d993f780529b820fdec6ee037e1f58215ac30..84d9e588af4d55820a07e03f5ad112ae8faf57c3 100644 (file)
@@ -7,6 +7,8 @@ struct nvbios_init {
        u32 offset;
 
        struct dcb_output *outp;
+       int or;
+       int link;
        union {
                int head;
                int crtc;
index 249d018ee32ce469092afc50593a8f8c2abd6b9b..b1256aba2fdbe4c6270be9a86a7d481e9c211027 100644 (file)
@@ -87,8 +87,8 @@ static inline int
 init_or(struct nvbios_init *init)
 {
        if (init_exec(init)) {
-               if (init->outp)
-                       return ffs(init->outp->or) - 1;
+               if (init->or >= 0)
+                       return init->or;
                error("script needs OR!!\n");
        }
        return 0;
@@ -98,8 +98,8 @@ static inline int
 init_link(struct nvbios_init *init)
 {
        if (init_exec(init)) {
-               if (init->outp)
-                       return !(init->outp->sorconf.link & 1);
+               if (init->link)
+                       return init->link == 2;
                error("script needs OR link\n");
        }
        return 0;
@@ -2277,6 +2277,12 @@ int
 nvbios_exec(struct nvbios_init *init)
 {
        struct nvkm_bios *bios = init->subdev->device->bios;
+
+       if (init->bios) {
+               init->or = init->outp ? ffs(init->outp->or) - 1 : -1;
+               init->link = init->outp ? init->outp->sorconf.link : 0;
+       }
+
        init->nested++;
        while (init->offset) {
                u8 opcode = nvbios_rd08(bios, init->offset);