Lines Matching full:ctrl

41 #include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl0073/ctrl0073dfp.h>
42 #include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl0073/ctrl0073dp.h>
43 #include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl0073/ctrl0073specific.h>
44 #include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl0073/ctrl0073system.h>
45 #include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080internal.h>
84 NV2080_CTRL_INTERNAL_DISPLAY_CHANNEL_PUSHBUFFER_PARAMS *ctrl; in r535_chan_push() local
86 ctrl = nvkm_gsp_rm_ctrl_get(&gsp->internal.device.subdevice, in r535_chan_push()
88 sizeof(*ctrl)); in r535_chan_push()
89 if (IS_ERR(ctrl)) in r535_chan_push()
90 return PTR_ERR(ctrl); in r535_chan_push()
95 ctrl->addressSpace = ADDR_SYSMEM; in r535_chan_push()
96 ctrl->cacheSnoop = 0; in r535_chan_push()
99 ctrl->addressSpace = ADDR_SYSMEM; in r535_chan_push()
100 ctrl->cacheSnoop = 1; in r535_chan_push()
103 ctrl->addressSpace = ADDR_FBMEM; in r535_chan_push()
110 ctrl->physicalAddr = nvkm_memory_addr(chan->memory); in r535_chan_push()
111 ctrl->limit = nvkm_memory_size(chan->memory) - 1; in r535_chan_push()
114 ctrl->hclass = chan->object.oclass; in r535_chan_push()
115 ctrl->channelInstance = chan->head; in r535_chan_push()
116 ctrl->valid = ((chan->object.oclass & 0xff) != 0x7a) ? 1 : 0; in r535_chan_push()
118 return nvkm_gsp_rm_ctrl_wr(&gsp->internal.device.subdevice, ctrl); in r535_chan_push()
266 NV0073_CTRL_SPECIFIC_BACKLIGHT_BRIGHTNESS_PARAMS *ctrl; in r535_sor_bl_set() local
268 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_bl_set()
270 sizeof(*ctrl)); in r535_sor_bl_set()
271 if (IS_ERR(ctrl)) in r535_sor_bl_set()
272 return PTR_ERR(ctrl); in r535_sor_bl_set()
274 ctrl->displayId = BIT(sor->asy.outp->index); in r535_sor_bl_set()
275 ctrl->brightness = lvl; in r535_sor_bl_set()
277 return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl); in r535_sor_bl_set()
284 NV0073_CTRL_SPECIFIC_BACKLIGHT_BRIGHTNESS_PARAMS *ctrl; in r535_sor_bl_get() local
287 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_bl_get()
289 sizeof(*ctrl)); in r535_sor_bl_get()
290 if (IS_ERR(ctrl)) in r535_sor_bl_get()
291 return PTR_ERR(ctrl); in r535_sor_bl_get()
293 ctrl->displayId = BIT(sor->asy.outp->index); in r535_sor_bl_get()
295 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_sor_bl_get()
297 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_sor_bl_get()
301 lvl = ctrl->brightness; in r535_sor_bl_get()
302 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_sor_bl_get()
316 NV0073_CTRL_DFP_SET_ELD_AUDIO_CAP_PARAMS *ctrl; in r535_sor_hda_eld() local
318 if (WARN_ON(size > sizeof(ctrl->bufferELD))) in r535_sor_hda_eld()
321 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_hda_eld()
322 NV0073_CTRL_CMD_DFP_SET_ELD_AUDIO_CAPS, sizeof(*ctrl)); in r535_sor_hda_eld()
323 if (WARN_ON(IS_ERR(ctrl))) in r535_sor_hda_eld()
326 ctrl->displayId = BIT(sor->asy.outp->index); in r535_sor_hda_eld()
327 ctrl->numELDSize = size; in r535_sor_hda_eld()
328 memcpy(ctrl->bufferELD, data, size); in r535_sor_hda_eld()
329 ctrl->maxFreqSupported = 0; //XXX in r535_sor_hda_eld()
330 ctrl->ctrl = NVDEF(NV0073, CTRL_DFP_ELD_AUDIO_CAPS_CTRL, PD, TRUE); in r535_sor_hda_eld()
331 ctrl->ctrl |= NVDEF(NV0073, CTRL_DFP_ELD_AUDIO_CAPS_CTRL, ELDV, TRUE); in r535_sor_hda_eld()
332 ctrl->deviceEntry = head; in r535_sor_hda_eld()
334 WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl)); in r535_sor_hda_eld()
341 NV0073_CTRL_DFP_SET_ELD_AUDIO_CAP_PARAMS *ctrl; in r535_sor_hda_hpd() local
346 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_hda_hpd()
347 NV0073_CTRL_CMD_DFP_SET_ELD_AUDIO_CAPS, sizeof(*ctrl)); in r535_sor_hda_hpd()
348 if (WARN_ON(IS_ERR(ctrl))) in r535_sor_hda_hpd()
351 ctrl->displayId = BIT(sor->asy.outp->index); in r535_sor_hda_hpd()
352 ctrl->deviceEntry = head; in r535_sor_hda_hpd()
354 WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl)); in r535_sor_hda_hpd()
367 NV0073_CTRL_DP_SET_AUDIO_MUTESTREAM_PARAMS *ctrl; in r535_sor_dp_audio_mute() local
369 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_dp_audio_mute()
370 NV0073_CTRL_CMD_DP_SET_AUDIO_MUTESTREAM, sizeof(*ctrl)); in r535_sor_dp_audio_mute()
371 if (WARN_ON(IS_ERR(ctrl))) in r535_sor_dp_audio_mute()
374 ctrl->displayId = BIT(sor->asy.outp->index); in r535_sor_dp_audio_mute()
375 ctrl->mute = mute; in r535_sor_dp_audio_mute()
376 WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl)); in r535_sor_dp_audio_mute()
383 NV0073_CTRL_DFP_SET_AUDIO_ENABLE_PARAMS *ctrl; in r535_sor_dp_audio() local
388 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_dp_audio()
389 NV0073_CTRL_CMD_DFP_SET_AUDIO_ENABLE, sizeof(*ctrl)); in r535_sor_dp_audio()
390 if (WARN_ON(IS_ERR(ctrl))) in r535_sor_dp_audio()
393 ctrl->displayId = BIT(sor->asy.outp->index); in r535_sor_dp_audio()
394 ctrl->enable = enable; in r535_sor_dp_audio()
395 WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl)); in r535_sor_dp_audio()
405 struct NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS *ctrl; in r535_sor_dp_vcpi() local
407 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_dp_vcpi()
408 NV0073_CTRL_CMD_DP_CONFIG_STREAM, sizeof(*ctrl)); in r535_sor_dp_vcpi()
409 if (WARN_ON(IS_ERR(ctrl))) in r535_sor_dp_vcpi()
412 ctrl->subDeviceInstance = 0; in r535_sor_dp_vcpi()
413 ctrl->head = head; in r535_sor_dp_vcpi()
414 ctrl->sorIndex = sor->id; in r535_sor_dp_vcpi()
415 ctrl->dpLink = sor->asy.link == 2; in r535_sor_dp_vcpi()
416 ctrl->bEnableOverride = 1; in r535_sor_dp_vcpi()
417 ctrl->bMST = 1; in r535_sor_dp_vcpi()
418 ctrl->hBlankSym = 0; in r535_sor_dp_vcpi()
419 ctrl->vBlankSym = 0; in r535_sor_dp_vcpi()
420 ctrl->colorFormat = 0; in r535_sor_dp_vcpi()
421 ctrl->bEnableTwoHeadOneOr = 0; in r535_sor_dp_vcpi()
422 ctrl->singleHeadMultistreamMode = 0; in r535_sor_dp_vcpi()
423 ctrl->MST.slotStart = slot; in r535_sor_dp_vcpi()
424 ctrl->MST.slotEnd = slot + slot_nr - 1; in r535_sor_dp_vcpi()
425 ctrl->MST.PBN = pbn; in r535_sor_dp_vcpi()
426 ctrl->MST.Timeslice = aligned_pbn; in r535_sor_dp_vcpi()
427 ctrl->MST.sendACT = 0; in r535_sor_dp_vcpi()
428 ctrl->MST.singleHeadMSTPipeline = 0; in r535_sor_dp_vcpi()
429 ctrl->MST.bEnableAudioOverRightPanel = 0; in r535_sor_dp_vcpi()
430 WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl)); in r535_sor_dp_vcpi()
438 struct NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS *ctrl; in r535_sor_dp_sst() local
440 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_dp_sst()
441 NV0073_CTRL_CMD_DP_CONFIG_STREAM, sizeof(*ctrl)); in r535_sor_dp_sst()
442 if (IS_ERR(ctrl)) in r535_sor_dp_sst()
443 return PTR_ERR(ctrl); in r535_sor_dp_sst()
445 ctrl->subDeviceInstance = 0; in r535_sor_dp_sst()
446 ctrl->head = head; in r535_sor_dp_sst()
447 ctrl->sorIndex = sor->id; in r535_sor_dp_sst()
448 ctrl->dpLink = sor->asy.link == 2; in r535_sor_dp_sst()
449 ctrl->bEnableOverride = 1; in r535_sor_dp_sst()
450 ctrl->bMST = 0; in r535_sor_dp_sst()
451 ctrl->hBlankSym = hblanksym; in r535_sor_dp_sst()
452 ctrl->vBlankSym = vblanksym; in r535_sor_dp_sst()
453 ctrl->colorFormat = 0; in r535_sor_dp_sst()
454 ctrl->bEnableTwoHeadOneOr = 0; in r535_sor_dp_sst()
455 ctrl->SST.bEnhancedFraming = ef; in r535_sor_dp_sst()
456 ctrl->SST.tuSize = 64; in r535_sor_dp_sst()
457 ctrl->SST.waterMark = watermark; in r535_sor_dp_sst()
458 ctrl->SST.bEnableAudioOverRightPanel = 0; in r535_sor_dp_sst()
459 return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl); in r535_sor_dp_sst()
475 NV0073_CTRL_SPECIFIC_SET_HDMI_SINK_CAPS_PARAMS *ctrl; in r535_sor_hdmi_scdc() local
477 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_hdmi_scdc()
478 NV0073_CTRL_CMD_SPECIFIC_SET_HDMI_SINK_CAPS, sizeof(*ctrl)); in r535_sor_hdmi_scdc()
479 if (WARN_ON(IS_ERR(ctrl))) in r535_sor_hdmi_scdc()
482 ctrl->displayId = BIT(outp->index); in r535_sor_hdmi_scdc()
483 ctrl->caps = 0; in r535_sor_hdmi_scdc()
485 ctrl->caps |= NVDEF(NV0073_CTRL_CMD_SPECIFIC, SET_HDMI_SINK_CAPS, SCDC_SUPPORTED, TRUE); in r535_sor_hdmi_scdc()
487ctrl->caps |= NVDEF(NV0073_CTRL_CMD_SPECIFIC, SET_HDMI_SINK_CAPS, GT_340MHZ_CLOCK_SUPPORTED, TRUE); in r535_sor_hdmi_scdc()
489ctrl->caps |= NVDEF(NV0073_CTRL_CMD_SPECIFIC, SET_HDMI_SINK_CAPS, LTE_340MHZ_SCRAMBLING_SUPPORTED,… in r535_sor_hdmi_scdc()
491 WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl)); in r535_sor_hdmi_scdc()
498 NV0073_CTRL_CMD_SPECIFIC_SET_HDMI_AUDIO_MUTESTREAM_PARAMS *ctrl; in r535_sor_hdmi_ctrl_audio_mute() local
500 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_hdmi_ctrl_audio_mute()
501 NV0073_CTRL_CMD_SPECIFIC_SET_HDMI_AUDIO_MUTESTREAM, sizeof(*ctrl)); in r535_sor_hdmi_ctrl_audio_mute()
502 if (WARN_ON(IS_ERR(ctrl))) in r535_sor_hdmi_ctrl_audio_mute()
505 ctrl->displayId = BIT(outp->index); in r535_sor_hdmi_ctrl_audio_mute()
506 ctrl->mute = mute; in r535_sor_hdmi_ctrl_audio_mute()
507 WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl)); in r535_sor_hdmi_ctrl_audio_mute()
514 NV0073_CTRL_SPECIFIC_SET_OD_PACKET_PARAMS *ctrl; in r535_sor_hdmi_ctrl_audio() local
516 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_hdmi_ctrl_audio()
517 NV0073_CTRL_CMD_SPECIFIC_SET_OD_PACKET, sizeof(*ctrl)); in r535_sor_hdmi_ctrl_audio()
518 if (WARN_ON(IS_ERR(ctrl))) in r535_sor_hdmi_ctrl_audio()
521 ctrl->displayId = BIT(outp->index); in r535_sor_hdmi_ctrl_audio()
522 ctrl->transmitControl = in r535_sor_hdmi_ctrl_audio()
529 ctrl->packetSize = 10; in r535_sor_hdmi_ctrl_audio()
530 ctrl->aPacket[0] = 0x03; in r535_sor_hdmi_ctrl_audio()
531 ctrl->aPacket[1] = 0x00; in r535_sor_hdmi_ctrl_audio()
532 ctrl->aPacket[2] = 0x00; in r535_sor_hdmi_ctrl_audio()
533 ctrl->aPacket[3] = enable ? 0x10 : 0x01; in r535_sor_hdmi_ctrl_audio()
534 ctrl->aPacket[4] = 0x00; in r535_sor_hdmi_ctrl_audio()
535 ctrl->aPacket[5] = 0x00; in r535_sor_hdmi_ctrl_audio()
536 ctrl->aPacket[6] = 0x00; in r535_sor_hdmi_ctrl_audio()
537 ctrl->aPacket[7] = 0x00; in r535_sor_hdmi_ctrl_audio()
538 ctrl->aPacket[8] = 0x00; in r535_sor_hdmi_ctrl_audio()
539 ctrl->aPacket[9] = 0x00; in r535_sor_hdmi_ctrl_audio()
540 WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl)); in r535_sor_hdmi_ctrl_audio()
562 NV0073_CTRL_SPECIFIC_SET_HDMI_ENABLE_PARAMS *ctrl; in r535_sor_hdmi_ctrl() local
567 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_sor_hdmi_ctrl()
568 NV0073_CTRL_CMD_SPECIFIC_SET_HDMI_ENABLE, sizeof(*ctrl)); in r535_sor_hdmi_ctrl()
569 if (WARN_ON(IS_ERR(ctrl))) in r535_sor_hdmi_ctrl()
572 ctrl->displayId = BIT(sor->asy.outp->index); in r535_sor_hdmi_ctrl()
573 ctrl->enable = enable; in r535_sor_hdmi_ctrl()
575 WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl)); in r535_sor_hdmi_ctrl()
580 .ctrl = r535_sor_hdmi_ctrl,
641 NV0073_CTRL_SPECIFIC_GET_CONNECTOR_DATA_PARAMS *ctrl; in r535_conn_new() local
646 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_conn_new()
647 NV0073_CTRL_CMD_SPECIFIC_GET_CONNECTOR_DATA, sizeof(*ctrl)); in r535_conn_new()
648 if (IS_ERR(ctrl)) in r535_conn_new()
649 return (void *)ctrl; in r535_conn_new()
651 ctrl->subDeviceInstance = 0; in r535_conn_new()
652 ctrl->displayId = BIT(id); in r535_conn_new()
654 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_conn_new()
656 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_conn_new()
661 if (conn->index == ctrl->data[0].index) { in r535_conn_new()
662 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_conn_new()
667 dcbE.type = ctrl->data[0].type; in r535_conn_new()
668 index = ctrl->data[0].index; in r535_conn_new()
669 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_conn_new()
692 NV0073_CTRL_DFP_ASSIGN_SOR_PARAMS *ctrl; in r535_outp_acquire() local
695 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_outp_acquire()
696 NV0073_CTRL_CMD_DFP_ASSIGN_SOR, sizeof(*ctrl)); in r535_outp_acquire()
697 if (IS_ERR(ctrl)) in r535_outp_acquire()
698 return PTR_ERR(ctrl); in r535_outp_acquire()
700 ctrl->subDeviceInstance = 0; in r535_outp_acquire()
701 ctrl->displayId = BIT(outp->index); in r535_outp_acquire()
702 ctrl->sorExcludeMask = disp->rm.assigned_sors; in r535_outp_acquire()
704 ctrl->flags |= NVDEF(NV0073_CTRL, DFP_ASSIGN_SOR_FLAGS, AUDIO, OPTIMAL); in r535_outp_acquire()
706 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_outp_acquire()
708 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_acquire()
712 for (or = 0; or < ARRAY_SIZE(ctrl->sorAssignListWithTag); or++) { in r535_outp_acquire()
713 if (ctrl->sorAssignListWithTag[or].displayMask & BIT(outp->index)) { in r535_outp_acquire()
719 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_acquire()
721 if (WARN_ON(or == ARRAY_SIZE(ctrl->sorAssignListWithTag))) in r535_outp_acquire()
735 NV0073_CTRL_SYSTEM_GET_ACTIVE_PARAMS *ctrl; in r535_disp_head_displayid() local
738 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_disp_head_displayid()
739 NV0073_CTRL_CMD_SYSTEM_GET_ACTIVE, sizeof(*ctrl)); in r535_disp_head_displayid()
740 if (IS_ERR(ctrl)) in r535_disp_head_displayid()
741 return PTR_ERR(ctrl); in r535_disp_head_displayid()
743 ctrl->subDeviceInstance = 0; in r535_disp_head_displayid()
744 ctrl->head = head; in r535_disp_head_displayid()
746 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_disp_head_displayid()
748 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_disp_head_displayid()
752 *displayid = ctrl->displayId; in r535_disp_head_displayid()
753 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_disp_head_displayid()
771 NV0073_CTRL_SPECIFIC_OR_GET_INFO_PARAMS *ctrl; in r535_outp_inherit() local
775 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_outp_inherit()
777 sizeof(*ctrl)); in r535_outp_inherit()
778 if (IS_ERR(ctrl)) in r535_outp_inherit()
781 ctrl->subDeviceInstance = 0; in r535_outp_inherit()
782 ctrl->displayId = displayid; in r535_outp_inherit()
784 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_outp_inherit()
786 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_inherit()
790 id = ctrl->index; in r535_outp_inherit()
791 proto = ctrl->protocol; in r535_outp_inherit()
792 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_inherit()
837 NV0073_CTRL_DFP_GET_INFO_PARAMS *ctrl; in r535_outp_dfp_get_info() local
841 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, NV0073_CTRL_CMD_DFP_GET_INFO, sizeof(*ctrl)); in r535_outp_dfp_get_info()
842 if (IS_ERR(ctrl)) in r535_outp_dfp_get_info()
843 return PTR_ERR(ctrl); in r535_outp_dfp_get_info()
845 ctrl->displayId = BIT(outp->index); in r535_outp_dfp_get_info()
847 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_outp_dfp_get_info()
849 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_dfp_get_info()
854 ctrl->displayId, ctrl->flags, ctrl->flags2); in r535_outp_dfp_get_info()
856 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_dfp_get_info()
863 NV0073_CTRL_SYSTEM_GET_CONNECT_STATE_PARAMS *ctrl; in r535_outp_detect() local
867 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_outp_detect()
868 NV0073_CTRL_CMD_SYSTEM_GET_CONNECT_STATE, sizeof(*ctrl)); in r535_outp_detect()
869 if (IS_ERR(ctrl)) in r535_outp_detect()
870 return PTR_ERR(ctrl); in r535_outp_detect()
872 ctrl->subDeviceInstance = 0; in r535_outp_detect()
873 ctrl->displayMask = BIT(outp->index); in r535_outp_detect()
875 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_outp_detect()
877 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_detect()
881 if (ctrl->displayMask & BIT(outp->index)) { in r535_outp_detect()
889 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_detect()
896 NV0073_CTRL_CMD_DP_TOPOLOGY_FREE_DISPLAYID_PARAMS *ctrl; in r535_dp_mst_id_put() local
899 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_dp_mst_id_put()
900 NV0073_CTRL_CMD_DP_TOPOLOGY_FREE_DISPLAYID, sizeof(*ctrl)); in r535_dp_mst_id_put()
901 if (IS_ERR(ctrl)) in r535_dp_mst_id_put()
902 return PTR_ERR(ctrl); in r535_dp_mst_id_put()
904 ctrl->subDeviceInstance = 0; in r535_dp_mst_id_put()
905 ctrl->displayId = id; in r535_dp_mst_id_put()
906 return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl); in r535_dp_mst_id_put()
912 NV0073_CTRL_CMD_DP_TOPOLOGY_ALLOCATE_DISPLAYID_PARAMS *ctrl; in r535_dp_mst_id_get() local
916 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_dp_mst_id_get()
918 sizeof(*ctrl)); in r535_dp_mst_id_get()
919 if (IS_ERR(ctrl)) in r535_dp_mst_id_get()
920 return PTR_ERR(ctrl); in r535_dp_mst_id_get()
922 ctrl->subDeviceInstance = 0; in r535_dp_mst_id_get()
923 ctrl->displayId = BIT(outp->index); in r535_dp_mst_id_get()
924 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_dp_mst_id_get()
926 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_dp_mst_id_get()
930 *pid = ctrl->displayIdAssigned; in r535_dp_mst_id_get()
931 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_dp_mst_id_get()
938 NV0073_CTRL_DP_LANE_DATA_PARAMS *ctrl; in r535_dp_drive() local
941 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_dp_drive()
942 NV0073_CTRL_CMD_DP_SET_LANE_DATA, sizeof(*ctrl)); in r535_dp_drive()
943 if (IS_ERR(ctrl)) in r535_dp_drive()
944 return PTR_ERR(ctrl); in r535_dp_drive()
946 ctrl->displayId = BIT(outp->index); in r535_dp_drive()
947 ctrl->numLanes = lanes; in r535_dp_drive()
949 ctrl->data[i] = NVVAL(NV0073_CTRL, DP_LANE_DATA, PREEMPHASIS, pe[i]) | in r535_dp_drive()
952 return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl); in r535_dp_drive()
959 NV0073_CTRL_DP_CTRL_PARAMS *ctrl; in r535_dp_train_target() local
983 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, NV0073_CTRL_CMD_DP_CTRL, in r535_dp_train_target()
984 sizeof(*ctrl)); in r535_dp_train_target()
985 if (IS_ERR(ctrl)) in r535_dp_train_target()
986 return PTR_ERR(ctrl); in r535_dp_train_target()
988 ctrl->subDeviceInstance = 0; in r535_dp_train_target()
989 ctrl->displayId = BIT(outp->index); in r535_dp_train_target()
990 ctrl->retryTimeMs = 0; in r535_dp_train_target()
991 ctrl->cmd = cmd; in r535_dp_train_target()
992 ctrl->data = data; in r535_dp_train_target()
994 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_dp_train_target()
995 if ((ret == -EAGAIN || ret == -EBUSY) && ctrl->retryTimeMs) { in r535_dp_train_target()
1002 ctrl->retryTimeMs); in r535_dp_train_target()
1003 msleep(ctrl->retryTimeMs); in r535_dp_train_target()
1004 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_dp_train_target()
1007 if (ctrl->err) in r535_dp_train_target()
1009 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_dp_train_target()
1034 NV0073_CTRL_CMD_DP_CONFIG_INDEXED_LINK_RATES_PARAMS *ctrl; in r535_dp_rates() local
1041 if (WARN_ON(outp->dp.rates > ARRAY_SIZE(ctrl->linkRateTbl))) in r535_dp_rates()
1044 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_dp_rates()
1045 NV0073_CTRL_CMD_DP_CONFIG_INDEXED_LINK_RATES, sizeof(*ctrl)); in r535_dp_rates()
1046 if (IS_ERR(ctrl)) in r535_dp_rates()
1047 return PTR_ERR(ctrl); in r535_dp_rates()
1049 ctrl->displayId = BIT(outp->index); in r535_dp_rates()
1051 ctrl->linkRateTbl[outp->dp.rate[i].dpcd] = outp->dp.rate[i].rate * 10 / 200; in r535_dp_rates()
1053 return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl); in r535_dp_rates()
1060 NV0073_CTRL_DP_AUXCH_CTRL_PARAMS *ctrl; in r535_dp_aux_xfer() local
1066 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, NV0073_CTRL_CMD_DP_AUXCH_CTRL, sizeof(*ctrl)); in r535_dp_aux_xfer()
1067 if (IS_ERR(ctrl)) in r535_dp_aux_xfer()
1068 return PTR_ERR(ctrl); in r535_dp_aux_xfer()
1070 ctrl->subDeviceInstance = 0; in r535_dp_aux_xfer()
1071 ctrl->displayId = BIT(outp->index); in r535_dp_aux_xfer()
1072 ctrl->bAddrOnly = !size; in r535_dp_aux_xfer()
1073 ctrl->cmd = type; in r535_dp_aux_xfer()
1074 if (ctrl->bAddrOnly) { in r535_dp_aux_xfer()
1075 ctrl->cmd = NVDEF_SET(ctrl->cmd, NV0073_CTRL, DP_AUXCH_CMD, REQ_TYPE, WRITE); in r535_dp_aux_xfer()
1076 ctrl->cmd = NVDEF_SET(ctrl->cmd, NV0073_CTRL, DP_AUXCH_CMD, I2C_MOT, FALSE); in r535_dp_aux_xfer()
1078 ctrl->addr = addr; in r535_dp_aux_xfer()
1079 ctrl->size = !ctrl->bAddrOnly ? (size - 1) : 0; in r535_dp_aux_xfer()
1080 memcpy(ctrl->data, data, size); in r535_dp_aux_xfer()
1082 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_dp_aux_xfer()
1083 if ((ret == -EAGAIN || ret == -EBUSY) && ctrl->retryTimeMs) { in r535_dp_aux_xfer()
1090 ctrl->retryTimeMs); in r535_dp_aux_xfer()
1091 msleep(ctrl->retryTimeMs); in r535_dp_aux_xfer()
1092 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_dp_aux_xfer()
1094 memcpy(data, ctrl->data, size); in r535_dp_aux_xfer()
1095 *psize = ctrl->size; in r535_dp_aux_xfer()
1096 ret = ctrl->replyType; in r535_dp_aux_xfer()
1097 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_dp_aux_xfer()
1156 NV0073_CTRL_SPECIFIC_GET_EDID_V2_PARAMS *ctrl; in r535_tmds_edid_get() local
1160 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_tmds_edid_get()
1161 NV0073_CTRL_CMD_SPECIFIC_GET_EDID_V2, sizeof(*ctrl)); in r535_tmds_edid_get()
1162 if (IS_ERR(ctrl)) in r535_tmds_edid_get()
1163 return PTR_ERR(ctrl); in r535_tmds_edid_get()
1165 ctrl->subDeviceInstance = 0; in r535_tmds_edid_get()
1166 ctrl->displayId = BIT(outp->index); in r535_tmds_edid_get()
1168 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_tmds_edid_get()
1170 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_tmds_edid_get()
1175 if (ctrl->bufferSize <= *psize) { in r535_tmds_edid_get()
1176 memcpy(data, ctrl->edidBuffer, ctrl->bufferSize); in r535_tmds_edid_get()
1177 *psize = ctrl->bufferSize; in r535_tmds_edid_get()
1181 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_tmds_edid_get()
1197 NV0073_CTRL_SPECIFIC_OR_GET_INFO_PARAMS *ctrl; in r535_outp_new() local
1205 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_outp_new()
1206 NV0073_CTRL_CMD_SPECIFIC_OR_GET_INFO, sizeof(*ctrl)); in r535_outp_new()
1207 if (IS_ERR(ctrl)) in r535_outp_new()
1208 return PTR_ERR(ctrl); in r535_outp_new()
1210 ctrl->subDeviceInstance = 0; in r535_outp_new()
1211 ctrl->displayId = BIT(id); in r535_outp_new()
1213 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_outp_new()
1215 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_new()
1219 switch (ctrl->type) { in r535_outp_new()
1223 switch (ctrl->protocol) { in r535_outp_new()
1255 locn = ctrl->location; in r535_outp_new()
1256 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_new()
1281 NV0073_CTRL_CMD_DP_GET_CAPS_PARAMS *ctrl; in r535_outp_new() local
1284 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_outp_new()
1285 NV0073_CTRL_CMD_DP_GET_CAPS, sizeof(*ctrl)); in r535_outp_new()
1286 if (IS_ERR(ctrl)) in r535_outp_new()
1287 return PTR_ERR(ctrl); in r535_outp_new()
1289 ctrl->sorIndex = ~0; in r535_outp_new()
1291 ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl)); in r535_outp_new()
1293 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_new()
1297 switch (NVVAL_GET(ctrl->maxLinkRate, NV0073_CTRL_CMD, DP_GET_CAPS, MAX_LINK_RATE)) { in r535_outp_new()
1315 mst = ctrl->bIsMultistreamSupported; in r535_outp_new()
1316 wm = ctrl->bHasIncreasedWatermarkLimits; in r535_outp_new()
1317 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_outp_new()
1448 NV2080_CTRL_INTERNAL_DISPLAY_WRITE_INST_MEM_PARAMS *ctrl; in r535_disp_oneinit() local
1459 ctrl = nvkm_gsp_rm_ctrl_get(&gsp->internal.device.subdevice, in r535_disp_oneinit()
1461 sizeof(*ctrl)); in r535_disp_oneinit()
1462 if (IS_ERR(ctrl)) in r535_disp_oneinit()
1463 return PTR_ERR(ctrl); in r535_disp_oneinit()
1465 ctrl->instMemPhysAddr = nvkm_memory_addr(disp->inst->memory); in r535_disp_oneinit()
1466 ctrl->instMemSize = nvkm_memory_size(disp->inst->memory); in r535_disp_oneinit()
1467 ctrl->instMemAddrSpace = ADDR_FBMEM; in r535_disp_oneinit()
1468 ctrl->instMemCpuCacheAttr = NV_MEMORY_WRITECOMBINED; in r535_disp_oneinit()
1470 ret = nvkm_gsp_rm_ctrl_wr(&gsp->internal.device.subdevice, ctrl); in r535_disp_oneinit()
1485 NV2080_CTRL_INTERNAL_DISPLAY_GET_STATIC_INFO_PARAMS *ctrl; in r535_disp_oneinit() local
1487 ctrl = nvkm_gsp_rm_ctrl_rd(&gsp->internal.device.subdevice, in r535_disp_oneinit()
1489 sizeof(*ctrl)); in r535_disp_oneinit()
1490 if (IS_ERR(ctrl)) in r535_disp_oneinit()
1491 return PTR_ERR(ctrl); in r535_disp_oneinit()
1493 disp->wndw.mask = ctrl->windowPresentMask; in r535_disp_oneinit()
1495 nvkm_gsp_rm_ctrl_done(&gsp->internal.device.subdevice, ctrl); in r535_disp_oneinit()
1501 NV2080_CTRL_INTERNAL_INIT_BRIGHTC_STATE_LOAD_PARAMS *ctrl; in r535_disp_oneinit() local
1504 ctrl = nvkm_gsp_rm_ctrl_get(subdevice, in r535_disp_oneinit()
1506 sizeof(*ctrl)); in r535_disp_oneinit()
1507 if (IS_ERR(ctrl)) in r535_disp_oneinit()
1508 return PTR_ERR(ctrl); in r535_disp_oneinit()
1510 ctrl->status = 0x56; /* NV_ERR_NOT_SUPPORTED */ in r535_disp_oneinit()
1532 .buffer.length = sizeof(ctrl->backLightData), in r535_disp_oneinit()
1550 memcpy(&ctrl->backLightData[ctrl->backLightDataSize], &elt->integer.value, size); in r535_disp_oneinit()
1551 ctrl->backLightDataSize += size; in r535_disp_oneinit()
1554 ctrl->status = 0; in r535_disp_oneinit()
1563 ret = nvkm_gsp_rm_ctrl_wr(subdevice, ctrl); in r535_disp_oneinit()
1571 NV0073_CTRL_CMD_DP_SET_MANUAL_DISPLAYPORT_PARAMS *ctrl; in r535_disp_oneinit() local
1573 ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom, in r535_disp_oneinit()
1575 sizeof(*ctrl)); in r535_disp_oneinit()
1576 if (IS_ERR(ctrl)) in r535_disp_oneinit()
1577 return PTR_ERR(ctrl); in r535_disp_oneinit()
1579 ret = nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl); in r535_disp_oneinit()
1586 NV0073_CTRL_SYSTEM_GET_NUM_HEADS_PARAMS *ctrl; in r535_disp_oneinit() local
1588 ctrl = nvkm_gsp_rm_ctrl_rd(&disp->rm.objcom, in r535_disp_oneinit()
1589 NV0073_CTRL_CMD_SYSTEM_GET_NUM_HEADS, sizeof(*ctrl)); in r535_disp_oneinit()
1590 if (IS_ERR(ctrl)) in r535_disp_oneinit()
1591 return PTR_ERR(ctrl); in r535_disp_oneinit()
1593 disp->head.nr = ctrl->numHeads; in r535_disp_oneinit()
1594 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_disp_oneinit()
1599 NV0073_CTRL_SPECIFIC_GET_ALL_HEAD_MASK_PARAMS *ctrl; in r535_disp_oneinit() local
1601 ctrl = nvkm_gsp_rm_ctrl_rd(&disp->rm.objcom, in r535_disp_oneinit()
1603 sizeof(*ctrl)); in r535_disp_oneinit()
1604 if (IS_ERR(ctrl)) in r535_disp_oneinit()
1605 return PTR_ERR(ctrl); in r535_disp_oneinit()
1607 disp->head.mask = ctrl->headMask; in r535_disp_oneinit()
1608 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_disp_oneinit()
1627 NV0073_CTRL_SYSTEM_GET_SUPPORTED_PARAMS *ctrl; in r535_disp_oneinit() local
1631 ctrl = nvkm_gsp_rm_ctrl_rd(&disp->rm.objcom, in r535_disp_oneinit()
1632 NV0073_CTRL_CMD_SYSTEM_GET_SUPPORTED, sizeof(*ctrl)); in r535_disp_oneinit()
1633 if (IS_ERR(ctrl)) in r535_disp_oneinit()
1634 return PTR_ERR(ctrl); in r535_disp_oneinit()
1636 mask = ctrl->displayMask; in r535_disp_oneinit()
1637 nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl); in r535_disp_oneinit()