Lines Matching full:outp

23 #include "outp.h"
33 nvkm_uoutp_mthd_dp_mst_vcpi(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_dp_mst_vcpi() argument
35 struct nvkm_ior *ior = outp->ior; in nvkm_uoutp_mthd_dp_mst_vcpi()
40 if (!ior->func->dp || !ior->func->dp->vcpi || !nvkm_head_find(outp->disp, args->v0.head)) in nvkm_uoutp_mthd_dp_mst_vcpi()
49 nvkm_uoutp_mthd_dp_mst_id_put(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_dp_mst_id_put() argument
55 if (!outp->func->dp.mst_id_put) in nvkm_uoutp_mthd_dp_mst_id_put()
58 return outp->func->dp.mst_id_put(outp, args->v0.id); in nvkm_uoutp_mthd_dp_mst_id_put()
62 nvkm_uoutp_mthd_dp_mst_id_get(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_dp_mst_id_get() argument
68 if (!outp->func->dp.mst_id_get) in nvkm_uoutp_mthd_dp_mst_id_get()
71 return outp->func->dp.mst_id_get(outp, &args->v0.id); in nvkm_uoutp_mthd_dp_mst_id_get()
75 nvkm_uoutp_mthd_dp_sst(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_dp_sst() argument
78 struct nvkm_disp *disp = outp->disp; in nvkm_uoutp_mthd_dp_sst()
79 struct nvkm_ior *ior = outp->ior; in nvkm_uoutp_mthd_dp_sst()
90 outp->dp.dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP, in nvkm_uoutp_mthd_dp_sst()
95 nvkm_uoutp_mthd_dp_drive(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_dp_drive() argument
101 if (!outp->func->dp.drive) in nvkm_uoutp_mthd_dp_drive()
104 return outp->func->dp.drive(outp, args->v0.lanes, args->v0.pe, args->v0.vs); in nvkm_uoutp_mthd_dp_drive()
108 nvkm_uoutp_mthd_dp_train(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_dp_train() argument
114 if (!outp->func->dp.train) in nvkm_uoutp_mthd_dp_train()
118 memcpy(outp->dp.dpcd, args->v0.dpcd, sizeof(outp->dp.dpcd)); in nvkm_uoutp_mthd_dp_train()
119 outp->dp.lttprs = args->v0.lttprs; in nvkm_uoutp_mthd_dp_train()
120 outp->dp.lt.nr = args->v0.link_nr; in nvkm_uoutp_mthd_dp_train()
121 outp->dp.lt.bw = args->v0.link_bw / 27000; in nvkm_uoutp_mthd_dp_train()
122 outp->dp.lt.mst = args->v0.mst; in nvkm_uoutp_mthd_dp_train()
123 outp->dp.lt.post_adj = args->v0.post_lt_adj; in nvkm_uoutp_mthd_dp_train()
126 return outp->func->dp.train(outp, args->v0.retrain); in nvkm_uoutp_mthd_dp_train()
130 nvkm_uoutp_mthd_dp_rates(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_dp_rates() argument
136 if (args->v0.rates > ARRAY_SIZE(outp->dp.rate)) in nvkm_uoutp_mthd_dp_rates()
140 outp->dp.rate[i].dpcd = args->v0.rate[i].dpcd; in nvkm_uoutp_mthd_dp_rates()
141 outp->dp.rate[i].rate = args->v0.rate[i].rate; in nvkm_uoutp_mthd_dp_rates()
144 outp->dp.rates = args->v0.rates; in nvkm_uoutp_mthd_dp_rates()
146 if (outp->func->dp.rates) in nvkm_uoutp_mthd_dp_rates()
147 outp->func->dp.rates(outp); in nvkm_uoutp_mthd_dp_rates()
153 nvkm_uoutp_mthd_dp_aux_xfer(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_dp_aux_xfer() argument
159 if (!outp->func->dp.aux_xfer) in nvkm_uoutp_mthd_dp_aux_xfer()
162 return outp->func->dp.aux_xfer(outp, args->v0.type, args->v0.addr, in nvkm_uoutp_mthd_dp_aux_xfer()
167 nvkm_uoutp_mthd_dp_aux_pwr(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_dp_aux_pwr() argument
173 if (!outp->func->dp.aux_pwr) in nvkm_uoutp_mthd_dp_aux_pwr()
176 return outp->func->dp.aux_pwr(outp, !!args->v0.state); in nvkm_uoutp_mthd_dp_aux_pwr()
180 nvkm_uoutp_mthd_hda_eld(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_hda_eld() argument
182 struct nvkm_ior *ior = outp->ior; in nvkm_uoutp_mthd_hda_eld()
189 if (!ior->hda || !nvkm_head_find(outp->disp, args->v0.head)) in nvkm_uoutp_mthd_hda_eld()
195 if (outp->info.type == DCB_OUTPUT_DP) in nvkm_uoutp_mthd_hda_eld()
206 if (outp->info.type == DCB_OUTPUT_DP) in nvkm_uoutp_mthd_hda_eld()
217 nvkm_uoutp_mthd_infoframe(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_infoframe() argument
219 struct nvkm_ior *ior = outp->ior; in nvkm_uoutp_mthd_infoframe()
225 if (!nvkm_head_find(outp->disp, args->v0.head)) in nvkm_uoutp_mthd_infoframe()
243 nvkm_uoutp_mthd_hdmi(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_hdmi() argument
246 struct nvkm_ior *ior = outp->ior; in nvkm_uoutp_mthd_hdmi()
251 if (!(outp->asy.head = nvkm_head_find(outp->disp, args->v0.head))) in nvkm_uoutp_mthd_hdmi()
277 nvkm_uoutp_mthd_lvds(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_lvds() argument
283 if (outp->info.type != DCB_OUTPUT_LVDS) in nvkm_uoutp_mthd_lvds()
286 outp->lvds.dual = !!args->v0.dual; in nvkm_uoutp_mthd_lvds()
287 outp->lvds.bpc8 = !!args->v0.bpc8; in nvkm_uoutp_mthd_lvds()
292 nvkm_uoutp_mthd_bl_set(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_bl_set() argument
300 if (outp->func->bl.set) in nvkm_uoutp_mthd_bl_set()
301 ret = outp->func->bl.set(outp, args->v0.level); in nvkm_uoutp_mthd_bl_set()
309 nvkm_uoutp_mthd_bl_get(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_bl_get() argument
317 if (outp->func->bl.get) { in nvkm_uoutp_mthd_bl_get()
318 ret = outp->func->bl.get(outp); in nvkm_uoutp_mthd_bl_get()
331 nvkm_uoutp_mthd_release(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_release() argument
337 if (!outp->ior) in nvkm_uoutp_mthd_release()
340 outp->func->release(outp); in nvkm_uoutp_mthd_release()
345 nvkm_uoutp_mthd_acquire(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_acquire() argument
352 if (outp->ior && args->v0.type <= NVIF_OUTP_ACQUIRE_V0_PIOR) in nvkm_uoutp_mthd_acquire()
358 ret = outp->func->acquire(outp, false); in nvkm_uoutp_mthd_acquire()
361 ret = outp->func->acquire(outp, args->v0.sor.hda); in nvkm_uoutp_mthd_acquire()
371 args->v0.or = outp->ior->id; in nvkm_uoutp_mthd_acquire()
372 args->v0.link = outp->ior->asy.link; in nvkm_uoutp_mthd_acquire()
377 nvkm_uoutp_mthd_inherit(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_inherit() argument
386 /* Ensure an ior is hooked up to this outp already */ in nvkm_uoutp_mthd_inherit()
387 ior = outp->func->inherit(outp); in nvkm_uoutp_mthd_inherit()
422 if (outp->acquired) { in nvkm_uoutp_mthd_inherit()
423 OUTP_ERR(outp, "cannot inherit an already acquired (%02x) outp", outp->acquired); in nvkm_uoutp_mthd_inherit()
427 /* Mark the outp acquired by userspace now that we've confirmed it's already active */ in nvkm_uoutp_mthd_inherit()
428 OUTP_TRACE(outp, "inherit %02x |= %02x %p", outp->acquired, NVKM_OUTP_USER, ior); in nvkm_uoutp_mthd_inherit()
429 nvkm_outp_acquire_ior(outp, NVKM_OUTP_USER, ior); in nvkm_uoutp_mthd_inherit()
440 nvkm_uoutp_mthd_load_detect(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_load_detect() argument
448 ret = nvkm_outp_acquire_or(outp, NVKM_OUTP_PRIV, false); in nvkm_uoutp_mthd_load_detect()
450 if (outp->ior->func->sense) { in nvkm_uoutp_mthd_load_detect()
451 ret = outp->ior->func->sense(outp->ior, args->v0.data); in nvkm_uoutp_mthd_load_detect()
456 nvkm_outp_release_or(outp, NVKM_OUTP_PRIV); in nvkm_uoutp_mthd_load_detect()
463 nvkm_uoutp_mthd_edid_get(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_edid_get() argument
469 if (!outp->func->edid_get) in nvkm_uoutp_mthd_edid_get()
473 return outp->func->edid_get(outp, args->v0.data, &args->v0.size); in nvkm_uoutp_mthd_edid_get()
477 nvkm_uoutp_mthd_detect(struct nvkm_outp *outp, void *argv, u32 argc) in nvkm_uoutp_mthd_detect() argument
484 if (!outp->func->detect) in nvkm_uoutp_mthd_detect()
487 ret = outp->func->detect(outp); in nvkm_uoutp_mthd_detect()
500 nvkm_uoutp_mthd_acquired(struct nvkm_outp *outp, u32 mthd, void *argv, u32 argc) in nvkm_uoutp_mthd_acquired() argument
503 case NVIF_OUTP_V0_RELEASE : return nvkm_uoutp_mthd_release (outp, argv, argc); in nvkm_uoutp_mthd_acquired()
504 case NVIF_OUTP_V0_LVDS : return nvkm_uoutp_mthd_lvds (outp, argv, argc); in nvkm_uoutp_mthd_acquired()
505 case NVIF_OUTP_V0_HDMI : return nvkm_uoutp_mthd_hdmi (outp, argv, argc); in nvkm_uoutp_mthd_acquired()
506 case NVIF_OUTP_V0_INFOFRAME : return nvkm_uoutp_mthd_infoframe (outp, argv, argc); in nvkm_uoutp_mthd_acquired()
507 case NVIF_OUTP_V0_HDA_ELD : return nvkm_uoutp_mthd_hda_eld (outp, argv, argc); in nvkm_uoutp_mthd_acquired()
508 case NVIF_OUTP_V0_DP_TRAIN : return nvkm_uoutp_mthd_dp_train (outp, argv, argc); in nvkm_uoutp_mthd_acquired()
509 case NVIF_OUTP_V0_DP_DRIVE : return nvkm_uoutp_mthd_dp_drive (outp, argv, argc); in nvkm_uoutp_mthd_acquired()
510 case NVIF_OUTP_V0_DP_SST : return nvkm_uoutp_mthd_dp_sst (outp, argv, argc); in nvkm_uoutp_mthd_acquired()
511 case NVIF_OUTP_V0_DP_MST_ID_GET: return nvkm_uoutp_mthd_dp_mst_id_get(outp, argv, argc); in nvkm_uoutp_mthd_acquired()
512 case NVIF_OUTP_V0_DP_MST_ID_PUT: return nvkm_uoutp_mthd_dp_mst_id_put(outp, argv, argc); in nvkm_uoutp_mthd_acquired()
513 case NVIF_OUTP_V0_DP_MST_VCPI : return nvkm_uoutp_mthd_dp_mst_vcpi (outp, argv, argc); in nvkm_uoutp_mthd_acquired()
522 nvkm_uoutp_mthd_noacquire(struct nvkm_outp *outp, u32 mthd, void *argv, u32 argc, bool *invalid) in nvkm_uoutp_mthd_noacquire() argument
525 case NVIF_OUTP_V0_DETECT : return nvkm_uoutp_mthd_detect (outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
526 case NVIF_OUTP_V0_EDID_GET : return nvkm_uoutp_mthd_edid_get (outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
527 case NVIF_OUTP_V0_INHERIT : return nvkm_uoutp_mthd_inherit (outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
528 case NVIF_OUTP_V0_ACQUIRE : return nvkm_uoutp_mthd_acquire (outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
529 case NVIF_OUTP_V0_LOAD_DETECT: return nvkm_uoutp_mthd_load_detect(outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
530 case NVIF_OUTP_V0_BL_GET : return nvkm_uoutp_mthd_bl_get (outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
531 case NVIF_OUTP_V0_BL_SET : return nvkm_uoutp_mthd_bl_set (outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
532 case NVIF_OUTP_V0_DP_AUX_PWR : return nvkm_uoutp_mthd_dp_aux_pwr (outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
533 case NVIF_OUTP_V0_DP_AUX_XFER: return nvkm_uoutp_mthd_dp_aux_xfer(outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
534 case NVIF_OUTP_V0_DP_RATES : return nvkm_uoutp_mthd_dp_rates (outp, argv, argc); in nvkm_uoutp_mthd_noacquire()
546 struct nvkm_outp *outp = nvkm_uoutp(object); in nvkm_uoutp_mthd() local
547 struct nvkm_disp *disp = outp->disp; in nvkm_uoutp_mthd()
553 ret = nvkm_uoutp_mthd_noacquire(outp, mthd, argv, argc, &invalid); in nvkm_uoutp_mthd()
557 if (outp->ior) in nvkm_uoutp_mthd()
558 ret = nvkm_uoutp_mthd_acquired(outp, mthd, argv, argc); in nvkm_uoutp_mthd()
570 struct nvkm_outp *outp = nvkm_uoutp(object); in nvkm_uoutp_dtor() local
571 struct nvkm_disp *disp = outp->disp; in nvkm_uoutp_dtor()
574 outp->object.func = NULL; in nvkm_uoutp_dtor()
589 struct nvkm_outp *outt, *outp = NULL; in nvkm_uoutp_new() local
598 outp = outt; in nvkm_uoutp_new()
603 if (!outp) in nvkm_uoutp_new()
608 if (!outp->object.func) { in nvkm_uoutp_new()
609 switch (outp->info.type) { in nvkm_uoutp_new()
613 args->v0.rgb_crt.freq_max = outp->info.crtconf.maxfreq; in nvkm_uoutp_new()
616 if (!outp->info.location) { in nvkm_uoutp_new()
618 args->v0.tmds.dual = (outp->info.tmdsconf.sor.link == 3); in nvkm_uoutp_new()
628 args->v0.lvds.acpi_edid = outp->info.lvdsconf.use_acpi_for_edid; in nvkm_uoutp_new()
631 if (!outp->info.location) { in nvkm_uoutp_new()
633 args->v0.dp.aux = outp->info.i2c_index; in nvkm_uoutp_new()
636 args->v0.dp.aux = NVKM_I2C_AUX_EXT(outp->info.extdev); in nvkm_uoutp_new()
639 args->v0.dp.mst = outp->dp.mst; in nvkm_uoutp_new()
640 args->v0.dp.increased_wm = outp->dp.increased_wm; in nvkm_uoutp_new()
641 args->v0.dp.link_nr = outp->info.dpconf.link_nr; in nvkm_uoutp_new()
642 args->v0.dp.link_bw = outp->info.dpconf.link_bw * 27000; in nvkm_uoutp_new()
650 if (outp->info.location) in nvkm_uoutp_new()
651 args->v0.ddc = NVKM_I2C_BUS_EXT(outp->info.extdev); in nvkm_uoutp_new()
653 args->v0.ddc = outp->info.i2c_index; in nvkm_uoutp_new()
654 args->v0.heads = outp->info.heads; in nvkm_uoutp_new()
655 args->v0.conn = outp->info.connector; in nvkm_uoutp_new()
657 nvkm_object_ctor(&nvkm_uoutp, oclass, &outp->object); in nvkm_uoutp_new()
658 *pobject = &outp->object; in nvkm_uoutp_new()