4848#include <nvif/class.h>
4949#include <nvif/cl0002.h>
5050#include <nvif/cl5070.h>
51- #include <nvif/cl507d.h>
5251#include <nvif/event.h>
52+ #include <nvif/if0014.h>
5353#include <nvif/timer.h>
5454
5555#include <nvhw/class/cl507c.h>
@@ -231,7 +231,7 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
231231 struct nv50_dmac * dmac )
232232{
233233 struct nouveau_cli * cli = (void * )device -> object .client ;
234- struct nv50_disp_core_channel_dma_v0 * args = data ;
234+ struct nvif_disp_chan_v0 * args = data ;
235235 u8 type = NVIF_MEM_COHERENT ;
236236 int ret ;
237237
@@ -529,24 +529,15 @@ static enum drm_connector_status
529529nv50_dac_detect (struct drm_encoder * encoder , struct drm_connector * connector )
530530{
531531 struct nouveau_encoder * nv_encoder = nouveau_encoder (encoder );
532- struct nv50_disp * disp = nv50_disp (encoder -> dev );
533- struct {
534- struct nv50_disp_mthd_v1 base ;
535- struct nv50_disp_dac_load_v0 load ;
536- } args = {
537- .base .version = 1 ,
538- .base .method = NV50_DISP_MTHD_V1_DAC_LOAD ,
539- .base .hasht = nv_encoder -> dcb -> hasht ,
540- .base .hashm = nv_encoder -> dcb -> hashm ,
541- };
532+ u32 loadval ;
542533 int ret ;
543534
544- args . load . data = nouveau_drm (encoder -> dev )-> vbios .dactestval ;
545- if (args . load . data == 0 )
546- args . load . data = 340 ;
535+ loadval = nouveau_drm (encoder -> dev )-> vbios .dactestval ;
536+ if (loadval == 0 )
537+ loadval = 340 ;
547538
548- ret = nvif_mthd ( & disp -> disp -> object , 0 , & args , sizeof ( args ) );
549- if (ret || ! args . load . load )
539+ ret = nvif_outp_load_detect ( & nv_encoder -> outp , loadval );
540+ if (ret <= 0 )
550541 return connector_status_disconnected ;
551542
552543 return connector_status_connected ;
@@ -563,6 +554,10 @@ nv50_dac_help = {
563554static void
564555nv50_dac_destroy (struct drm_encoder * encoder )
565556{
557+ struct nouveau_encoder * nv_encoder = nouveau_encoder (encoder );
558+
559+ nvif_outp_dtor (& nv_encoder -> outp );
560+
566561 drm_encoder_cleanup (encoder );
567562 kfree (encoder );
568563}
@@ -576,6 +571,7 @@ static int
576571nv50_dac_create (struct drm_connector * connector , struct dcb_output * dcbe )
577572{
578573 struct nouveau_drm * drm = nouveau_drm (connector -> dev );
574+ struct nv50_disp * disp = nv50_disp (connector -> dev );
579575 struct nvkm_i2c * i2c = nvxx_i2c (& drm -> client .device );
580576 struct nvkm_i2c_bus * bus ;
581577 struct nouveau_encoder * nv_encoder ;
@@ -599,7 +595,7 @@ nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe)
599595 drm_encoder_helper_add (encoder , & nv50_dac_help );
600596
601597 drm_connector_attach_encoder (connector , encoder );
602- return 0 ;
598+ return nvif_outp_ctor ( disp -> disp , nv_encoder -> base . base . name , dcbe -> id , & nv_encoder -> outp ) ;
603599}
604600
605601/*
@@ -1822,6 +1818,9 @@ static void
18221818nv50_sor_destroy (struct drm_encoder * encoder )
18231819{
18241820 struct nouveau_encoder * nv_encoder = nouveau_encoder (encoder );
1821+
1822+ nvif_outp_dtor (& nv_encoder -> outp );
1823+
18251824 nv50_mstm_del (& nv_encoder -> dp .mstm );
18261825 drm_encoder_cleanup (encoder );
18271826
@@ -1918,7 +1917,7 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
19181917 nv_encoder -> i2c = & bus -> i2c ;
19191918 }
19201919
1921- return 0 ;
1920+ return nvif_outp_ctor ( disp -> disp , nv_encoder -> base . base . name , dcbe -> id , & nv_encoder -> outp ) ;
19221921}
19231922
19241923/******************************************************************************
@@ -1999,6 +1998,10 @@ nv50_pior_help = {
19991998static void
20001999nv50_pior_destroy (struct drm_encoder * encoder )
20012000{
2001+ struct nouveau_encoder * nv_encoder = nouveau_encoder (encoder );
2002+
2003+ nvif_outp_dtor (& nv_encoder -> outp );
2004+
20022005 drm_encoder_cleanup (encoder );
20032006 kfree (encoder );
20042007}
@@ -2056,7 +2059,7 @@ nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe)
20562059 disp -> core -> func -> pior -> get_caps (disp , nv_encoder , ffs (dcbe -> or ) - 1 );
20572060 nv50_outp_dump_caps (drm , nv_encoder );
20582061
2059- return 0 ;
2062+ return nvif_outp_ctor ( disp -> disp , nv_encoder -> base . base . name , dcbe -> id , & nv_encoder -> outp ) ;
20602063}
20612064
20622065/******************************************************************************
0 commit comments