diff options
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h index ad5d993f7805..84d9e588af4d 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h @@ -7,6 +7,8 @@ struct nvbios_init { u32 offset; struct dcb_output *outp; + int or; + int link; union { int head; int crtc; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c index 249d018ee32c..b1256aba2fdb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c @@ -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); |