summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm204.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/disp/gm204.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/gm204.c73
1 files changed, 22 insertions, 51 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm204.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm204.c
index 363e939376e9..30f1987b5b40 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm204.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm204.c
@@ -24,60 +24,31 @@
#include "nv50.h"
#include "rootnv50.h"
-static const struct nvkm_disp_func
+static const struct nv50_disp_func
gm204_disp = {
+ .intr = gf119_disp_intr,
+ .uevent = &gf119_disp_chan_uevent,
+ .super = gf119_disp_intr_supervisor,
.root = &gm204_disp_root_oclass,
+ .head.vblank_init = gf119_disp_vblank_init,
+ .head.vblank_fini = gf119_disp_vblank_fini,
+ .head.scanoutpos = gf119_disp_root_scanoutpos,
+ .outp.internal.crt = nv50_dac_output_new,
+ .outp.internal.tmds = nv50_sor_output_new,
+ .outp.internal.lvds = nv50_sor_output_new,
+ .outp.internal.dp = gm204_sor_dp_new,
+ .dac.nr = 3,
+ .dac.power = nv50_dac_power,
+ .dac.sense = nv50_dac_sense,
+ .sor.nr = 4,
+ .sor.power = nv50_sor_power,
+ .sor.hda_eld = gf119_hda_eld,
+ .sor.hdmi = gk104_hdmi_ctrl,
+ .sor.magic = gm204_sor_magic,
};
-static int
-gm204_disp_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
- struct nvkm_oclass *oclass, void *data, u32 size,
- struct nvkm_object **pobject)
+int
+gm204_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp)
{
- struct nvkm_device *device = (void *)parent;
- struct nv50_disp *disp;
- int heads = nvkm_rd32(device, 0x022448);
- int ret;
-
- ret = nvkm_disp_create(parent, engine, oclass, heads,
- "PDISP", "display", &disp);
- *pobject = nv_object(disp);
- if (ret)
- return ret;
-
- disp->base.func = &gm204_disp;
-
- ret = nvkm_event_init(&gf119_disp_chan_uevent, 1, 17, &disp->uevent);
- if (ret)
- return ret;
-
- nv_subdev(disp)->intr = gf119_disp_intr;
- INIT_WORK(&disp->supervisor, gf119_disp_intr_supervisor);
- disp->head.nr = heads;
- disp->dac.nr = 3;
- disp->sor.nr = 4;
- disp->dac.power = nv50_dac_power;
- disp->dac.sense = nv50_dac_sense;
- disp->sor.power = nv50_sor_power;
- disp->sor.hda_eld = gf119_hda_eld;
- disp->sor.hdmi = gf119_hdmi_ctrl;
- disp->sor.magic = gm204_sor_magic;
- return 0;
+ return gf119_disp_new_(&gm204_disp, device, index, pdisp);
}
-
-struct nvkm_oclass *
-gm204_disp_oclass = &(struct nv50_disp_impl) {
- .base.base.handle = NV_ENGINE(DISP, 0x07),
- .base.base.ofuncs = &(struct nvkm_ofuncs) {
- .ctor = gm204_disp_ctor,
- .dtor = _nvkm_disp_dtor,
- .init = _nvkm_disp_init,
- .fini = _nvkm_disp_fini,
- },
- .base.outp.internal.crt = nv50_dac_output_new,
- .base.outp.internal.tmds = nv50_sor_output_new,
- .base.outp.internal.lvds = nv50_sor_output_new,
- .base.outp.internal.dp = gm204_sor_dp_new,
- .base.vblank = &gf119_disp_vblank_func,
- .head.scanoutpos = gf119_disp_root_scanoutpos,
-}.base.base;