Lines Matching +full:hdmi +full:- +full:switch

35 	struct nvkm_ior *ior = outp->ior;  in nvkm_uoutp_mthd_dp_mst_vcpi()
38 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_dp_mst_vcpi()
39 return -ENOSYS; 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()
41 return -EINVAL; in nvkm_uoutp_mthd_dp_mst_vcpi()
43 ior->func->dp->vcpi(ior, args->v0.head, args->v0.start_slot, args->v0.num_slots, in nvkm_uoutp_mthd_dp_mst_vcpi()
44 args->v0.pbn, args->v0.aligned_pbn); in nvkm_uoutp_mthd_dp_mst_vcpi()
53 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_dp_mst_id_put()
54 return -ENOSYS; in nvkm_uoutp_mthd_dp_mst_id_put()
55 if (!outp->func->dp.mst_id_put) in nvkm_uoutp_mthd_dp_mst_id_put()
56 return -EINVAL; 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()
66 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_dp_mst_id_get()
67 return -ENOSYS; in nvkm_uoutp_mthd_dp_mst_id_get()
68 if (!outp->func->dp.mst_id_get) in nvkm_uoutp_mthd_dp_mst_id_get()
69 return -EINVAL; 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()
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()
81 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_dp_sst()
82 return -ENOSYS; in nvkm_uoutp_mthd_dp_sst()
84 if (!ior->func->dp || !nvkm_head_find(disp, args->v0.head)) in nvkm_uoutp_mthd_dp_sst()
85 return -EINVAL; in nvkm_uoutp_mthd_dp_sst()
86 if (!ior->func->dp->sst) in nvkm_uoutp_mthd_dp_sst()
89 return ior->func->dp->sst(ior, args->v0.head, in nvkm_uoutp_mthd_dp_sst()
90 outp->dp.dpcd[DPCD_RC02] & DPCD_RC02_ENHANCED_FRAME_CAP, in nvkm_uoutp_mthd_dp_sst()
91 args->v0.watermark, args->v0.hblanksym, args->v0.vblanksym); in nvkm_uoutp_mthd_dp_sst()
99 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_dp_drive()
100 return -ENOSYS; in nvkm_uoutp_mthd_dp_drive()
101 if (!outp->func->dp.drive) in nvkm_uoutp_mthd_dp_drive()
102 return -EINVAL; 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()
112 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_dp_train()
113 return -ENOSYS; in nvkm_uoutp_mthd_dp_train()
114 if (!outp->func->dp.train) in nvkm_uoutp_mthd_dp_train()
115 return -EINVAL; in nvkm_uoutp_mthd_dp_train()
117 if (!args->v0.retrain) { 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()
134 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_dp_rates()
135 return -ENOSYS; in nvkm_uoutp_mthd_dp_rates()
136 if (args->v0.rates > ARRAY_SIZE(outp->dp.rate)) in nvkm_uoutp_mthd_dp_rates()
137 return -EINVAL; in nvkm_uoutp_mthd_dp_rates()
139 for (int i = 0; i < args->v0.rates; i++) { 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()
157 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_dp_aux_xfer()
158 return -ENOSYS; in nvkm_uoutp_mthd_dp_aux_xfer()
159 if (!outp->func->dp.aux_xfer) in nvkm_uoutp_mthd_dp_aux_xfer()
160 return -EINVAL; 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()
163 args->v0.data, &args->v0.size); in nvkm_uoutp_mthd_dp_aux_xfer()
171 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_dp_aux_pwr()
172 return -ENOSYS; in nvkm_uoutp_mthd_dp_aux_pwr()
173 if (!outp->func->dp.aux_pwr) in nvkm_uoutp_mthd_dp_aux_pwr()
174 return -EINVAL; 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()
182 struct nvkm_ior *ior = outp->ior; in nvkm_uoutp_mthd_hda_eld()
185 if (argc < sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_hda_eld()
186 return -ENOSYS; in nvkm_uoutp_mthd_hda_eld()
187 argc -= sizeof(args->v0); in nvkm_uoutp_mthd_hda_eld()
189 if (!ior->hda || !nvkm_head_find(outp->disp, args->v0.head)) in nvkm_uoutp_mthd_hda_eld()
190 return -EINVAL; in nvkm_uoutp_mthd_hda_eld()
192 return -E2BIG; in nvkm_uoutp_mthd_hda_eld()
194 if (argc && args->v0.data[0]) { in nvkm_uoutp_mthd_hda_eld()
195 if (outp->info.type == DCB_OUTPUT_DP) in nvkm_uoutp_mthd_hda_eld()
196 ior->func->dp->audio(ior, args->v0.head, true); in nvkm_uoutp_mthd_hda_eld()
198 if (ior->func->hdmi->audio) in nvkm_uoutp_mthd_hda_eld()
199 ior->func->hdmi->audio(ior, args->v0.head, true); in nvkm_uoutp_mthd_hda_eld()
201 ior->func->hda->hpd(ior, args->v0.head, true); in nvkm_uoutp_mthd_hda_eld()
202 ior->func->hda->eld(ior, args->v0.head, args->v0.data, argc); in nvkm_uoutp_mthd_hda_eld()
204 ior->func->hda->hpd(ior, args->v0.head, false); in nvkm_uoutp_mthd_hda_eld()
206 if (outp->info.type == DCB_OUTPUT_DP) in nvkm_uoutp_mthd_hda_eld()
207 ior->func->dp->audio(ior, args->v0.head, false); in nvkm_uoutp_mthd_hda_eld()
209 if (ior->func->hdmi->audio) in nvkm_uoutp_mthd_hda_eld()
210 ior->func->hdmi->audio(ior, args->v0.head, false); in nvkm_uoutp_mthd_hda_eld()
219 struct nvkm_ior *ior = outp->ior; in nvkm_uoutp_mthd_infoframe()
221 ssize_t size = argc - sizeof(*args); in nvkm_uoutp_mthd_infoframe()
223 if (argc < sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_infoframe()
224 return -ENOSYS; in nvkm_uoutp_mthd_infoframe()
225 if (!nvkm_head_find(outp->disp, args->v0.head)) in nvkm_uoutp_mthd_infoframe()
226 return -EINVAL; in nvkm_uoutp_mthd_infoframe()
228 switch (ior->func->hdmi ? args->v0.type : 0xff) { in nvkm_uoutp_mthd_infoframe()
230 ior->func->hdmi->infoframe_avi(ior, args->v0.head, &args->v0.data, size); in nvkm_uoutp_mthd_infoframe()
233 ior->func->hdmi->infoframe_vsi(ior, args->v0.head, &args->v0.data, size); in nvkm_uoutp_mthd_infoframe()
239 return -EINVAL; in nvkm_uoutp_mthd_infoframe()
246 struct nvkm_ior *ior = outp->ior; in nvkm_uoutp_mthd_hdmi()
248 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_hdmi()
249 return -ENOSYS; in nvkm_uoutp_mthd_hdmi()
251 if (!(outp->asy.head = nvkm_head_find(outp->disp, args->v0.head))) in nvkm_uoutp_mthd_hdmi()
252 return -EINVAL; in nvkm_uoutp_mthd_hdmi()
254 if (!ior->func->hdmi || in nvkm_uoutp_mthd_hdmi()
255 args->v0.max_ac_packet > 0x1f || in nvkm_uoutp_mthd_hdmi()
256 args->v0.rekey > 0x7f || in nvkm_uoutp_mthd_hdmi()
257 (args->v0.scdc && !ior->func->hdmi->scdc)) in nvkm_uoutp_mthd_hdmi()
258 return -EINVAL; in nvkm_uoutp_mthd_hdmi()
260 if (!args->v0.enable) { in nvkm_uoutp_mthd_hdmi()
261 ior->func->hdmi->infoframe_avi(ior, args->v0.head, NULL, 0); in nvkm_uoutp_mthd_hdmi()
262 ior->func->hdmi->infoframe_vsi(ior, args->v0.head, NULL, 0); in nvkm_uoutp_mthd_hdmi()
263 ior->func->hdmi->ctrl(ior, args->v0.head, false, 0, 0); in nvkm_uoutp_mthd_hdmi()
267 ior->func->hdmi->ctrl(ior, args->v0.head, args->v0.enable, in nvkm_uoutp_mthd_hdmi()
268 args->v0.max_ac_packet, args->v0.rekey); in nvkm_uoutp_mthd_hdmi()
269 if (ior->func->hdmi->scdc) in nvkm_uoutp_mthd_hdmi()
270 ior->func->hdmi->scdc(ior, args->v0.khz, args->v0.scdc, args->v0.scdc_scrambling, in nvkm_uoutp_mthd_hdmi()
271 args->v0.scdc_low_rates); in nvkm_uoutp_mthd_hdmi()
281 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_lvds()
282 return -ENOSYS; in nvkm_uoutp_mthd_lvds()
283 if (outp->info.type != DCB_OUTPUT_LVDS) in nvkm_uoutp_mthd_lvds()
284 return -EINVAL; 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()
297 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_bl_set()
298 return -ENOSYS; in nvkm_uoutp_mthd_bl_set()
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()
303 ret = -EINVAL; in nvkm_uoutp_mthd_bl_set()
314 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_bl_get()
315 return -ENOSYS; in nvkm_uoutp_mthd_bl_get()
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()
320 args->v0.level = ret; in nvkm_uoutp_mthd_bl_get()
324 ret = -EINVAL; in nvkm_uoutp_mthd_bl_get()
335 if (argc != sizeof(args->vn)) in nvkm_uoutp_mthd_release()
336 return -ENOSYS; in nvkm_uoutp_mthd_release()
337 if (!outp->ior) in nvkm_uoutp_mthd_release()
338 return -EINVAL; in nvkm_uoutp_mthd_release()
340 outp->func->release(outp); in nvkm_uoutp_mthd_release()
350 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_acquire()
351 return -ENOSYS; in nvkm_uoutp_mthd_acquire()
352 if (outp->ior && args->v0.type <= NVIF_OUTP_ACQUIRE_V0_PIOR) in nvkm_uoutp_mthd_acquire()
353 return -EBUSY; in nvkm_uoutp_mthd_acquire()
355 switch (args->v0.type) { 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()
364 ret = -EINVAL; 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()
383 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_inherit()
384 return -ENOSYS; in nvkm_uoutp_mthd_inherit()
387 ior = outp->func->inherit(outp); in nvkm_uoutp_mthd_inherit()
388 if (!ior || !ior->arm.head) in nvkm_uoutp_mthd_inherit()
389 return -ENODEV; in nvkm_uoutp_mthd_inherit()
391 /* With iors, there will be a separate output path for each type of connector - and all of in nvkm_uoutp_mthd_inherit()
395 switch (args->v0.proto) { in nvkm_uoutp_mthd_inherit()
397 if (ior->arm.proto != TMDS) in nvkm_uoutp_mthd_inherit()
398 return -ENODEV; in nvkm_uoutp_mthd_inherit()
401 if (ior->arm.proto != DP) in nvkm_uoutp_mthd_inherit()
402 return -ENODEV; in nvkm_uoutp_mthd_inherit()
405 if (ior->arm.proto != LVDS) in nvkm_uoutp_mthd_inherit()
406 return -ENODEV; in nvkm_uoutp_mthd_inherit()
409 if (ior->arm.proto != TV) in nvkm_uoutp_mthd_inherit()
410 return -ENODEV; in nvkm_uoutp_mthd_inherit()
413 if (ior->arm.proto != CRT) in nvkm_uoutp_mthd_inherit()
414 return -ENODEV; in nvkm_uoutp_mthd_inherit()
417 ret = -EINVAL; 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()
424 return -EBUSY; in nvkm_uoutp_mthd_inherit()
428 OUTP_TRACE(outp, "inherit %02x |= %02x %p", outp->acquired, NVKM_OUTP_USER, ior); in nvkm_uoutp_mthd_inherit()
431 args->v0.or = ior->id; in nvkm_uoutp_mthd_inherit()
432 args->v0.link = ior->arm.link; in nvkm_uoutp_mthd_inherit()
433 args->v0.head = ffs(ior->arm.head) - 1; in nvkm_uoutp_mthd_inherit()
434 args->v0.proto = ior->arm.proto_evo; in nvkm_uoutp_mthd_inherit()
445 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_load_detect()
446 return -ENOSYS; 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()
452 args->v0.load = ret < 0 ? 0 : ret; in nvkm_uoutp_mthd_load_detect()
454 ret = -EINVAL; in nvkm_uoutp_mthd_load_detect()
467 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_edid_get()
468 return -ENOSYS; in nvkm_uoutp_mthd_edid_get()
469 if (!outp->func->edid_get) in nvkm_uoutp_mthd_edid_get()
470 return -EINVAL; in nvkm_uoutp_mthd_edid_get()
472 args->v0.size = ARRAY_SIZE(args->v0.data); 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()
482 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_mthd_detect()
483 return -ENOSYS; in nvkm_uoutp_mthd_detect()
484 if (!outp->func->detect) in nvkm_uoutp_mthd_detect()
485 return -EINVAL; in nvkm_uoutp_mthd_detect()
487 ret = outp->func->detect(outp); in nvkm_uoutp_mthd_detect()
488 switch (ret) { in nvkm_uoutp_mthd_detect()
489 case 0: args->v0.status = NVIF_OUTP_DETECT_V0_NOT_PRESENT; break; in nvkm_uoutp_mthd_detect()
490 case 1: args->v0.status = NVIF_OUTP_DETECT_V0_PRESENT; break; in nvkm_uoutp_mthd_detect()
492 args->v0.status = NVIF_OUTP_DETECT_V0_UNKNOWN; in nvkm_uoutp_mthd_detect()
502 switch (mthd) { in nvkm_uoutp_mthd_acquired()
518 return -EINVAL; in nvkm_uoutp_mthd_acquired()
524 switch (mthd) { in nvkm_uoutp_mthd_noacquire()
547 struct nvkm_disp *disp = outp->disp; in nvkm_uoutp_mthd()
551 mutex_lock(&disp->super.mutex); in nvkm_uoutp_mthd()
557 if (outp->ior) in nvkm_uoutp_mthd()
560 ret = -EIO; in nvkm_uoutp_mthd()
563 mutex_unlock(&disp->super.mutex); in nvkm_uoutp_mthd()
571 struct nvkm_disp *disp = outp->disp; in nvkm_uoutp_dtor()
573 spin_lock(&disp->client.lock); in nvkm_uoutp_dtor()
574 outp->object.func = NULL; in nvkm_uoutp_dtor()
575 spin_unlock(&disp->client.lock); in nvkm_uoutp_dtor()
588 struct nvkm_disp *disp = nvkm_udisp(oclass->parent); in nvkm_uoutp_new()
593 if (argc != sizeof(args->v0) || args->v0.version != 0) in nvkm_uoutp_new()
594 return -ENOSYS; in nvkm_uoutp_new()
596 list_for_each_entry(outt, &disp->outps, head) { in nvkm_uoutp_new()
597 if (outt->index == args->v0.id) { in nvkm_uoutp_new()
604 return -EINVAL; in nvkm_uoutp_new()
606 ret = -EBUSY; in nvkm_uoutp_new()
607 spin_lock(&disp->client.lock); in nvkm_uoutp_new()
608 if (!outp->object.func) { in nvkm_uoutp_new()
609 switch (outp->info.type) { in nvkm_uoutp_new()
611 args->v0.type = NVIF_OUTP_V0_TYPE_DAC; in nvkm_uoutp_new()
612 args->v0.proto = NVIF_OUTP_V0_PROTO_RGB_CRT; 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()
617 args->v0.type = NVIF_OUTP_V0_TYPE_SOR; in nvkm_uoutp_new()
618 args->v0.tmds.dual = (outp->info.tmdsconf.sor.link == 3); in nvkm_uoutp_new()
620 args->v0.type = NVIF_OUTP_V0_TYPE_PIOR; in nvkm_uoutp_new()
621 args->v0.tmds.dual = 0; in nvkm_uoutp_new()
623 args->v0.proto = NVIF_OUTP_V0_PROTO_TMDS; in nvkm_uoutp_new()
626 args->v0.type = NVIF_OUTP_V0_TYPE_SOR; in nvkm_uoutp_new()
627 args->v0.proto = NVIF_OUTP_V0_PROTO_LVDS; 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()
632 args->v0.type = NVIF_OUTP_V0_TYPE_SOR; in nvkm_uoutp_new()
633 args->v0.dp.aux = outp->info.i2c_index; in nvkm_uoutp_new()
635 args->v0.type = NVIF_OUTP_V0_TYPE_PIOR; in nvkm_uoutp_new()
636 args->v0.dp.aux = NVKM_I2C_AUX_EXT(outp->info.extdev); in nvkm_uoutp_new()
638 args->v0.proto = NVIF_OUTP_V0_PROTO_DP; 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()
646 ret = -EINVAL; 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()
663 spin_unlock(&disp->client.lock); in nvkm_uoutp_new()