diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c | 73 |
1 files changed, 23 insertions, 50 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c index c699c5f70b8d..6bc3bf096001 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c @@ -24,59 +24,32 @@ #include "nv50.h" #include "rootnv50.h" -static const struct nvkm_disp_func +static const struct nv50_disp_func gt200_disp = { + .intr = nv50_disp_intr, + .uevent = &nv50_disp_chan_uevent, + .super = nv50_disp_intr_supervisor, .root = >200_disp_root_oclass, + .head.vblank_init = nv50_disp_vblank_init, + .head.vblank_fini = nv50_disp_vblank_fini, + .head.scanoutpos = nv50_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.external.tmds = nv50_pior_output_new, + .outp.external.dp = nv50_pior_dp_new, + .dac.nr = 3, + .dac.power = nv50_dac_power, + .dac.sense = nv50_dac_sense, + .sor.nr = 2, + .sor.power = nv50_sor_power, + .sor.hdmi = g84_hdmi_ctrl, + .pior.nr = 3, + .pior.power = nv50_pior_power, }; -static int -gt200_disp_ctor(struct nvkm_object *parent, struct nvkm_object *engine, - struct nvkm_oclass *oclass, void *data, u32 size, - struct nvkm_object **pobject) +int +gt200_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) { - struct nv50_disp *disp; - int ret; - - ret = nvkm_disp_create(parent, engine, oclass, 2, "PDISP", - "display", &disp); - *pobject = nv_object(disp); - if (ret) - return ret; - - disp->base.func = >200_disp; - - ret = nvkm_event_init(&nv50_disp_chan_uevent, 1, 9, &disp->uevent); - if (ret) - return ret; - - nv_subdev(disp)->intr = nv50_disp_intr; - INIT_WORK(&disp->supervisor, nv50_disp_intr_supervisor); - disp->head.nr = 2; - disp->dac.nr = 3; - disp->sor.nr = 2; - disp->pior.nr = 3; - disp->dac.power = nv50_dac_power; - disp->dac.sense = nv50_dac_sense; - disp->sor.power = nv50_sor_power; - disp->sor.hdmi = g84_hdmi_ctrl; - disp->pior.power = nv50_pior_power; - return 0; + return nv50_disp_new_(>200_disp, device, index, 2, pdisp); } - -struct nvkm_oclass * -gt200_disp_oclass = &(struct nv50_disp_impl) { - .base.base.handle = NV_ENGINE(DISP, 0x83), - .base.base.ofuncs = &(struct nvkm_ofuncs) { - .ctor = gt200_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.external.tmds = nv50_pior_output_new, - .base.outp.external.dp = nv50_pior_dp_new, - .base.vblank = &nv50_disp_vblank_func, - .head.scanoutpos = nv50_disp_root_scanoutpos, -}.base.base; |