Commit a7f000ec authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/disp: switch to instanced constructor

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 0b26ca68
...@@ -60,7 +60,6 @@ struct nvkm_device { ...@@ -60,7 +60,6 @@ struct nvkm_device {
struct notifier_block nb; struct notifier_block nb;
} acpi; } acpi;
struct nvkm_disp *disp;
struct nvkm_dma *dma; struct nvkm_dma *dma;
struct nvkm_fifo *fifo; struct nvkm_fifo *fifo;
struct nvkm_gr *gr; struct nvkm_gr *gr;
...@@ -119,7 +118,6 @@ struct nvkm_device_chip { ...@@ -119,7 +118,6 @@ struct nvkm_device_chip {
#undef NVKM_LAYOUT_INST #undef NVKM_LAYOUT_INST
#undef NVKM_LAYOUT_ONCE #undef NVKM_LAYOUT_ONCE
int (*disp )(struct nvkm_device *, int idx, struct nvkm_disp **);
int (*dma )(struct nvkm_device *, int idx, struct nvkm_dma **); int (*dma )(struct nvkm_device *, int idx, struct nvkm_dma **);
int (*fifo )(struct nvkm_device *, int idx, struct nvkm_fifo **); int (*fifo )(struct nvkm_device *, int idx, struct nvkm_fifo **);
int (*gr )(struct nvkm_device *, int idx, struct nvkm_gr **); int (*gr )(struct nvkm_device *, int idx, struct nvkm_gr **);
......
...@@ -28,4 +28,5 @@ NVKM_LAYOUT_ONCE(NVKM_SUBDEV_GSP , struct nvkm_gsp , gsp) ...@@ -28,4 +28,5 @@ NVKM_LAYOUT_ONCE(NVKM_SUBDEV_GSP , struct nvkm_gsp , gsp)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_BSP , struct nvkm_engine , bsp) NVKM_LAYOUT_ONCE(NVKM_ENGINE_BSP , struct nvkm_engine , bsp)
NVKM_LAYOUT_INST(NVKM_ENGINE_CE , struct nvkm_engine , ce, 9) NVKM_LAYOUT_INST(NVKM_ENGINE_CE , struct nvkm_engine , ce, 9)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_CIPHER , struct nvkm_engine , cipher) NVKM_LAYOUT_ONCE(NVKM_ENGINE_CIPHER , struct nvkm_engine , cipher)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_DISP , struct nvkm_disp , disp)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_VP , struct nvkm_engine , vp) NVKM_LAYOUT_ONCE(NVKM_ENGINE_VP , struct nvkm_engine , vp)
...@@ -23,22 +23,22 @@ struct nvkm_disp { ...@@ -23,22 +23,22 @@ struct nvkm_disp {
} client; } client;
}; };
int nv04_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int nv04_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int nv50_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int nv50_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int g84_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int g84_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gt200_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gt200_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int g94_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int g94_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int mcp77_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int mcp77_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gt215_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gt215_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int mcp89_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int mcp89_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gf119_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gf119_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gk104_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gk104_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gk110_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gk110_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gm107_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gm107_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gm200_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gm200_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gp100_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gp100_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gp102_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gp102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int gv100_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int gv100_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int tu102_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int tu102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
int ga102_disp_new(struct nvkm_device *, int, struct nvkm_disp **); int ga102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
#endif #endif
...@@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = { ...@@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = {
#include <core/layout.h> #include <core/layout.h>
#undef NVKM_LAYOUT_ONCE #undef NVKM_LAYOUT_ONCE
#undef NVKM_LAYOUT_INST #undef NVKM_LAYOUT_INST
[NVKM_ENGINE_DISP ] = "disp",
[NVKM_ENGINE_DMAOBJ ] = "dma", [NVKM_ENGINE_DMAOBJ ] = "dma",
[NVKM_ENGINE_FIFO ] = "fifo", [NVKM_ENGINE_FIFO ] = "fifo",
[NVKM_ENGINE_GR ] = "gr", [NVKM_ENGINE_GR ] = "gr",
......
...@@ -473,7 +473,7 @@ nvkm_disp = { ...@@ -473,7 +473,7 @@ nvkm_disp = {
int int
nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device,
int index, struct nvkm_disp *disp) enum nvkm_subdev_type type, int inst, struct nvkm_disp *disp)
{ {
disp->func = func; disp->func = func;
INIT_LIST_HEAD(&disp->head); INIT_LIST_HEAD(&disp->head);
...@@ -481,14 +481,14 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device, ...@@ -481,14 +481,14 @@ nvkm_disp_ctor(const struct nvkm_disp_func *func, struct nvkm_device *device,
INIT_LIST_HEAD(&disp->outp); INIT_LIST_HEAD(&disp->outp);
INIT_LIST_HEAD(&disp->conn); INIT_LIST_HEAD(&disp->conn);
spin_lock_init(&disp->client.lock); spin_lock_init(&disp->client.lock);
return nvkm_engine_ctor(&nvkm_disp, device, index, true, &disp->engine); return nvkm_engine_ctor(&nvkm_disp, device, type, inst, true, &disp->engine);
} }
int int
nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device, nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device,
int index, struct nvkm_disp **pdisp) enum nvkm_subdev_type type, int inst, struct nvkm_disp **pdisp)
{ {
if (!(*pdisp = kzalloc(sizeof(**pdisp), GFP_KERNEL))) if (!(*pdisp = kzalloc(sizeof(**pdisp), GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
return nvkm_disp_ctor(func, device, index, *pdisp); return nvkm_disp_ctor(func, device, type, inst, *pdisp);
} }
...@@ -41,7 +41,8 @@ g84_disp = { ...@@ -41,7 +41,8 @@ g84_disp = {
}; };
int int
g84_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) g84_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&g84_disp, device, index, pdisp); return nv50_disp_new_(&g84_disp, device, type, inst, pdisp);
} }
...@@ -41,7 +41,8 @@ g94_disp = { ...@@ -41,7 +41,8 @@ g94_disp = {
}; };
int int
g94_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) g94_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&g94_disp, device, index, pdisp); return nv50_disp_new_(&g94_disp, device, type, inst, pdisp);
} }
...@@ -40,7 +40,8 @@ ga102_disp = { ...@@ -40,7 +40,8 @@ ga102_disp = {
}; };
int int
ga102_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) ga102_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&ga102_disp, device, index, pdisp); return nv50_disp_new_(&ga102_disp, device, type, inst, pdisp);
} }
...@@ -266,7 +266,8 @@ gf119_disp = { ...@@ -266,7 +266,8 @@ gf119_disp = {
}; };
int int
gf119_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gf119_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gf119_disp, device, index, pdisp); return nv50_disp_new_(&gf119_disp, device, type, inst, pdisp);
} }
...@@ -41,7 +41,8 @@ gk104_disp = { ...@@ -41,7 +41,8 @@ gk104_disp = {
}; };
int int
gk104_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gk104_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gk104_disp, device, index, pdisp); return nv50_disp_new_(&gk104_disp, device, type, inst, pdisp);
} }
...@@ -41,7 +41,8 @@ gk110_disp = { ...@@ -41,7 +41,8 @@ gk110_disp = {
}; };
int int
gk110_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gk110_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gk110_disp, device, index, pdisp); return nv50_disp_new_(&gk110_disp, device, type, inst, pdisp);
} }
...@@ -41,7 +41,8 @@ gm107_disp = { ...@@ -41,7 +41,8 @@ gm107_disp = {
}; };
int int
gm107_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gm107_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gm107_disp, device, index, pdisp); return nv50_disp_new_(&gm107_disp, device, type, inst, pdisp);
} }
...@@ -41,7 +41,8 @@ gm200_disp = { ...@@ -41,7 +41,8 @@ gm200_disp = {
}; };
int int
gm200_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gm200_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gm200_disp, device, index, pdisp); return nv50_disp_new_(&gm200_disp, device, type, inst, pdisp);
} }
...@@ -40,7 +40,8 @@ gp100_disp = { ...@@ -40,7 +40,8 @@ gp100_disp = {
}; };
int int
gp100_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gp100_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gp100_disp, device, index, pdisp); return nv50_disp_new_(&gp100_disp, device, type, inst, pdisp);
} }
...@@ -67,7 +67,8 @@ gp102_disp = { ...@@ -67,7 +67,8 @@ gp102_disp = {
}; };
int int
gp102_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gp102_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gp102_disp, device, index, pdisp); return nv50_disp_new_(&gp102_disp, device, type, inst, pdisp);
} }
...@@ -41,7 +41,8 @@ gt200_disp = { ...@@ -41,7 +41,8 @@ gt200_disp = {
}; };
int int
gt200_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gt200_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gt200_disp, device, index, pdisp); return nv50_disp_new_(&gt200_disp, device, type, inst, pdisp);
} }
...@@ -41,7 +41,8 @@ gt215_disp = { ...@@ -41,7 +41,8 @@ gt215_disp = {
}; };
int int
gt215_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gt215_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gt215_disp, device, index, pdisp); return nv50_disp_new_(&gt215_disp, device, type, inst, pdisp);
} }
...@@ -441,7 +441,8 @@ gv100_disp = { ...@@ -441,7 +441,8 @@ gv100_disp = {
}; };
int int
gv100_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) gv100_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&gv100_disp, device, index, pdisp); return nv50_disp_new_(&gv100_disp, device, type, inst, pdisp);
} }
...@@ -39,7 +39,8 @@ mcp77_disp = { ...@@ -39,7 +39,8 @@ mcp77_disp = {
}; };
int int
mcp77_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) mcp77_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&mcp77_disp, device, index, pdisp); return nv50_disp_new_(&mcp77_disp, device, type, inst, pdisp);
} }
...@@ -39,7 +39,8 @@ mcp89_disp = { ...@@ -39,7 +39,8 @@ mcp89_disp = {
}; };
int int
mcp89_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) mcp89_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&mcp89_disp, device, index, pdisp); return nv50_disp_new_(&mcp89_disp, device, type, inst, pdisp);
} }
...@@ -64,11 +64,12 @@ nv04_disp = { ...@@ -64,11 +64,12 @@ nv04_disp = {
}; };
int int
nv04_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) nv04_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
int ret, i; int ret, i;
ret = nvkm_disp_new_(&nv04_disp, device, index, pdisp); ret = nvkm_disp_new_(&nv04_disp, device, type, inst, pdisp);
if (ret) if (ret)
return ret; return ret;
......
...@@ -154,7 +154,7 @@ nv50_disp_ = { ...@@ -154,7 +154,7 @@ nv50_disp_ = {
int int
nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device, nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device,
int index, struct nvkm_disp **pdisp) enum nvkm_subdev_type type, int inst, struct nvkm_disp **pdisp)
{ {
struct nv50_disp *disp; struct nv50_disp *disp;
int ret; int ret;
...@@ -164,7 +164,7 @@ nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device, ...@@ -164,7 +164,7 @@ nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device,
disp->func = func; disp->func = func;
*pdisp = &disp->base; *pdisp = &disp->base;
ret = nvkm_disp_ctor(&nv50_disp_, device, index, &disp->base); ret = nvkm_disp_ctor(&nv50_disp_, device, type, inst, &disp->base);
if (ret) if (ret)
return ret; return ret;
...@@ -769,7 +769,8 @@ nv50_disp = { ...@@ -769,7 +769,8 @@ nv50_disp = {
}; };
int int
nv50_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) nv50_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&nv50_disp, device, index, pdisp); return nv50_disp_new_(&nv50_disp, device, type, inst, pdisp);
} }
...@@ -47,8 +47,8 @@ void nv50_disp_super_2_1(struct nv50_disp *, struct nvkm_head *); ...@@ -47,8 +47,8 @@ void nv50_disp_super_2_1(struct nv50_disp *, struct nvkm_head *);
void nv50_disp_super_2_2(struct nv50_disp *, struct nvkm_head *); void nv50_disp_super_2_2(struct nv50_disp *, struct nvkm_head *);
void nv50_disp_super_3_0(struct nv50_disp *, struct nvkm_head *); void nv50_disp_super_3_0(struct nv50_disp *, struct nvkm_head *);
int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *, int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
int index, struct nvkm_disp **); struct nvkm_disp **);
struct nv50_disp_func { struct nv50_disp_func {
int (*init)(struct nv50_disp *); int (*init)(struct nv50_disp *);
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
#include <engine/disp.h> #include <engine/disp.h>
#include "outp.h" #include "outp.h"
int nvkm_disp_ctor(const struct nvkm_disp_func *, struct nvkm_device *, int nvkm_disp_ctor(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
int index, struct nvkm_disp *); struct nvkm_disp *);
int nvkm_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, int nvkm_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
int index, struct nvkm_disp **); struct nvkm_disp **);
void nvkm_disp_vblank(struct nvkm_disp *, int head); void nvkm_disp_vblank(struct nvkm_disp *, int head);
struct nvkm_disp_func { struct nvkm_disp_func {
......
...@@ -146,7 +146,8 @@ tu102_disp = { ...@@ -146,7 +146,8 @@ tu102_disp = {
}; };
int int
tu102_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) tu102_disp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_disp **pdisp)
{ {
return nv50_disp_new_(&tu102_disp, device, index, pdisp); return nv50_disp_new_(&tu102_disp, device, type, inst, pdisp);
} }
...@@ -42,7 +42,7 @@ g84_devinit_disable(struct nvkm_devinit *init) ...@@ -42,7 +42,7 @@ g84_devinit_disable(struct nvkm_devinit *init)
} }
if (!(r00154c & 0x00000004)) if (!(r00154c & 0x00000004))
disable |= (1ULL << NVKM_ENGINE_DISP); nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);
if (!(r00154c & 0x00000020)) if (!(r00154c & 0x00000020))
nvkm_subdev_disable(device, NVKM_ENGINE_BSP, 0); nvkm_subdev_disable(device, NVKM_ENGINE_BSP, 0);
if (!(r00154c & 0x00000040)) if (!(r00154c & 0x00000040))
......
...@@ -41,7 +41,7 @@ g98_devinit_disable(struct nvkm_devinit *init) ...@@ -41,7 +41,7 @@ g98_devinit_disable(struct nvkm_devinit *init)
} }
if (!(r00154c & 0x00000004)) if (!(r00154c & 0x00000004))
disable |= (1ULL << NVKM_ENGINE_DISP); nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);
if (!(r00154c & 0x00000020)) if (!(r00154c & 0x00000020))
disable |= (1ULL << NVKM_ENGINE_MSVLD); disable |= (1ULL << NVKM_ENGINE_MSVLD);
if (!(r00154c & 0x00000040)) if (!(r00154c & 0x00000040))
......
...@@ -71,7 +71,7 @@ gf100_devinit_disable(struct nvkm_devinit *init) ...@@ -71,7 +71,7 @@ gf100_devinit_disable(struct nvkm_devinit *init)
u64 disable = 0ULL; u64 disable = 0ULL;
if (r022500 & 0x00000001) if (r022500 & 0x00000001)
disable |= (1ULL << NVKM_ENGINE_DISP); nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);
if (r022500 & 0x00000002) { if (r022500 & 0x00000002) {
disable |= (1ULL << NVKM_ENGINE_MSPDEC); disable |= (1ULL << NVKM_ENGINE_MSPDEC);
......
...@@ -39,7 +39,7 @@ gm107_devinit_disable(struct nvkm_devinit *init) ...@@ -39,7 +39,7 @@ gm107_devinit_disable(struct nvkm_devinit *init)
if (r021c00 & 0x00000004) if (r021c00 & 0x00000004)
nvkm_subdev_disable(device, NVKM_ENGINE_CE, 2); nvkm_subdev_disable(device, NVKM_ENGINE_CE, 2);
if (r021c04 & 0x00000001) if (r021c04 & 0x00000001)
disable |= (1ULL << NVKM_ENGINE_DISP); nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);
return disable; return disable;
} }
......
...@@ -76,7 +76,7 @@ gt215_devinit_disable(struct nvkm_devinit *init) ...@@ -76,7 +76,7 @@ gt215_devinit_disable(struct nvkm_devinit *init)
} }
if (!(r00154c & 0x00000004)) if (!(r00154c & 0x00000004))
disable |= (1ULL << NVKM_ENGINE_DISP); nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);
if (!(r00154c & 0x00000020)) if (!(r00154c & 0x00000020))
disable |= (1ULL << NVKM_ENGINE_MSVLD); disable |= (1ULL << NVKM_ENGINE_MSVLD);
if (!(r00154c & 0x00000200)) if (!(r00154c & 0x00000200))
......
...@@ -40,7 +40,7 @@ mcp89_devinit_disable(struct nvkm_devinit *init) ...@@ -40,7 +40,7 @@ mcp89_devinit_disable(struct nvkm_devinit *init)
} }
if (!(r00154c & 0x00000004)) if (!(r00154c & 0x00000004))
disable |= (1ULL << NVKM_ENGINE_DISP); nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);
if (!(r00154c & 0x00000020)) if (!(r00154c & 0x00000020))
disable |= (1ULL << NVKM_ENGINE_MSVLD); disable |= (1ULL << NVKM_ENGINE_MSVLD);
if (!(r00154c & 0x00000040)) if (!(r00154c & 0x00000040))
......
...@@ -101,8 +101,8 @@ nv50_devinit_preinit(struct nvkm_devinit *base) ...@@ -101,8 +101,8 @@ nv50_devinit_preinit(struct nvkm_devinit *base)
* missing, assume it's a secondary gpu which requires post * missing, assume it's a secondary gpu which requires post
*/ */
if (!base->post) { if (!base->post) {
u64 disable = nvkm_devinit_disable(base); nvkm_devinit_disable(base);
if (disable & (1ULL << NVKM_ENGINE_DISP)) if (!device->disp)
base->post = true; base->post = true;
} }
......
...@@ -260,7 +260,7 @@ gk104_ram_calc_gddr5(struct gk104_ram *ram, u32 freq) ...@@ -260,7 +260,7 @@ gk104_ram_calc_gddr5(struct gk104_ram *ram, u32 freq)
ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000);
ram_block(fuc); ram_block(fuc);
if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP, 0)) if (ram->base.fb->subdev.device->disp)
ram_wr32(fuc, 0x62c000, 0x0f0f0000); ram_wr32(fuc, 0x62c000, 0x0f0f0000);
/* MR1: turn termination on early, for some reason.. */ /* MR1: turn termination on early, for some reason.. */
...@@ -661,7 +661,7 @@ gk104_ram_calc_gddr5(struct gk104_ram *ram, u32 freq) ...@@ -661,7 +661,7 @@ gk104_ram_calc_gddr5(struct gk104_ram *ram, u32 freq)
ram_unblock(fuc); ram_unblock(fuc);
if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP, 0)) if (ram->base.fb->subdev.device->disp)
ram_wr32(fuc, 0x62c000, 0x0f0f0f00); ram_wr32(fuc, 0x62c000, 0x0f0f0f00);
if (next->bios.rammap_11_08_01) if (next->bios.rammap_11_08_01)
...@@ -711,7 +711,7 @@ gk104_ram_calc_sddr3(struct gk104_ram *ram, u32 freq) ...@@ -711,7 +711,7 @@ gk104_ram_calc_sddr3(struct gk104_ram *ram, u32 freq)
ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000);
ram_block(fuc); ram_block(fuc);
if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP, 0)) if (ram->base.fb->subdev.device->disp)
ram_wr32(fuc, 0x62c000, 0x0f0f0000); ram_wr32(fuc, 0x62c000, 0x0f0f0000);
if (vc == 1 && ram_have(fuc, gpio2E)) { if (vc == 1 && ram_have(fuc, gpio2E)) {
...@@ -943,7 +943,7 @@ gk104_ram_calc_sddr3(struct gk104_ram *ram, u32 freq) ...@@ -943,7 +943,7 @@ gk104_ram_calc_sddr3(struct gk104_ram *ram, u32 freq)
ram_unblock(fuc); ram_unblock(fuc);
if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP, 0)) if (ram->base.fb->subdev.device->disp)
ram_wr32(fuc, 0x62c000, 0x0f0f0f00); ram_wr32(fuc, 0x62c000, 0x0f0f0f00);
if (next->bios.rammap_11_08_01) if (next->bios.rammap_11_08_01)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment