Lines Matching refs:mstm

889 	struct nv50_mstm *mstm;  member
915 return msto->mstc->mstm->outp; in nv50_real_outp()
923 struct nv50_mstm *mstm = mstc->mstm; in nv50_msto_payload() local
926 WARN_ON(!mutex_is_locked(&mstm->mgr.payload_lock)); in nv50_msto_payload()
929 for (i = 0; i < mstm->mgr.max_payloads; i++) { in nv50_msto_payload()
930 struct drm_dp_payload *payload = &mstm->mgr.payloads[i]; in nv50_msto_payload()
932 mstm->outp->base.base.name, i, payload->vcpi, in nv50_msto_payload()
936 for (i = 0; i < mstm->mgr.max_payloads; i++) { in nv50_msto_payload()
937 struct drm_dp_payload *payload = &mstm->mgr.payloads[i]; in nv50_msto_payload()
950 struct nv50_mstm *mstm = mstc->mstm; in nv50_msto_cleanup() local
957 drm_dp_mst_deallocate_vcpi(&mstm->mgr, mstc->port); in nv50_msto_cleanup()
968 struct nv50_mstm *mstm = mstc->mstm; in nv50_msto_prepare() local
975 .base.hasht = mstm->outp->dcb->hasht, in nv50_msto_prepare()
976 .base.hashm = (0xf0ff & mstm->outp->dcb->hashm) | in nv50_msto_prepare()
980 mutex_lock(&mstm->mgr.payload_lock); in nv50_msto_prepare()
999 mutex_unlock(&mstm->mgr.payload_lock); in nv50_msto_prepare()
1010 struct nv50_mstm *mstm = mstc->mstm; in nv50_msto_atomic_check() local
1036 slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr, mstc->port, in nv50_msto_atomic_check()
1064 struct nv50_mstm *mstm = NULL; in nv50_msto_enable() local
1074 mstm = mstc->mstm; in nv50_msto_enable()
1083 r = drm_dp_mst_allocate_vcpi(&mstm->mgr, mstc->port, armh->dp.pbn, in nv50_msto_enable()
1088 if (!mstm->links++) in nv50_msto_enable()
1089 nv50_outp_acquire(mstm->outp, false /*XXX: MST audio.*/); in nv50_msto_enable()
1091 if (mstm->outp->link & 1) in nv50_msto_enable()
1096 mstm->outp->update(mstm->outp, head->base.index, armh, proto, in nv50_msto_enable()
1100 mstm->modified = true; in nv50_msto_enable()
1108 struct nv50_mstm *mstm = mstc->mstm; in nv50_msto_disable() local
1110 drm_dp_mst_reset_vcpi_slots(&mstm->mgr, mstc->port); in nv50_msto_disable()
1112 mstm->outp->update(mstm->outp, msto->head->base.index, NULL, 0, 0); in nv50_msto_disable()
1113 mstm->modified = true; in nv50_msto_disable()
1114 if (!--mstm->links) in nv50_msto_disable()
1115 mstm->disabled = true; in nv50_msto_disable()
1169 if (!(mstc->mstm->outp->dcb->heads & drm_crtc_mask(crtc))) in nv50_mstc_atomic_best_encoder()
1180 struct nouveau_encoder *outp = mstc->mstm->outp; in nv50_mstc_mode_valid()
1223 struct drm_dp_mst_topology_mgr *mgr = &mstc->mstm->mgr; in nv50_mstc_atomic_check()
1308 nv50_mstc_new(struct nv50_mstm *mstm, struct drm_dp_mst_port *port, in nv50_mstc_new() argument
1311 struct drm_device *dev = mstm->outp->base.base.dev; in nv50_mstc_new()
1318 mstc->mstm = mstm; in nv50_mstc_new()
1335 if (!(mstm->outp->dcb->heads & drm_crtc_mask(crtc))) in nv50_mstc_new()
1350 nv50_mstm_cleanup(struct nv50_mstm *mstm) in nv50_mstm_cleanup() argument
1352 struct nouveau_drm *drm = nouveau_drm(mstm->outp->base.base.dev); in nv50_mstm_cleanup()
1356 NV_ATOMIC(drm, "%s: mstm cleanup\n", mstm->outp->base.base.name); in nv50_mstm_cleanup()
1357 ret = drm_dp_check_act_status(&mstm->mgr); in nv50_mstm_cleanup()
1359 ret = drm_dp_update_payload_part2(&mstm->mgr); in nv50_mstm_cleanup()
1361 drm_for_each_encoder(encoder, mstm->outp->base.base.dev) { in nv50_mstm_cleanup()
1365 if (mstc && mstc->mstm == mstm) in nv50_mstm_cleanup()
1370 mstm->modified = false; in nv50_mstm_cleanup()
1374 nv50_mstm_prepare(struct nv50_mstm *mstm) in nv50_mstm_prepare() argument
1376 struct nouveau_drm *drm = nouveau_drm(mstm->outp->base.base.dev); in nv50_mstm_prepare()
1380 NV_ATOMIC(drm, "%s: mstm prepare\n", mstm->outp->base.base.name); in nv50_mstm_prepare()
1381 ret = drm_dp_update_payload_part1(&mstm->mgr); in nv50_mstm_prepare()
1383 drm_for_each_encoder(encoder, mstm->outp->base.base.dev) { in nv50_mstm_prepare()
1387 if (mstc && mstc->mstm == mstm) in nv50_mstm_prepare()
1392 if (mstm->disabled) { in nv50_mstm_prepare()
1393 if (!mstm->links) in nv50_mstm_prepare()
1394 nv50_outp_release(mstm->outp); in nv50_mstm_prepare()
1395 mstm->disabled = false; in nv50_mstm_prepare()
1403 struct nv50_mstm *mstm = nv50_mstm(mgr); in nv50_mstm_add_connector() local
1407 ret = nv50_mstc_new(mstm, port, path, &mstc); in nv50_mstm_add_connector()
1422 struct nv50_mstm *mstm) in nv50_mstm_service() argument
1436 drm_dp_mst_hpd_irq(&mstm->mgr, esi, &handled); in nv50_mstm_service()
1456 nv50_mstm_remove(struct nv50_mstm *mstm) in nv50_mstm_remove() argument
1458 mstm->is_mst = false; in nv50_mstm_remove()
1459 drm_dp_mst_topology_mgr_set_mst(&mstm->mgr, false); in nv50_mstm_remove()
1463 nv50_mstm_enable(struct nv50_mstm *mstm, int state) in nv50_mstm_enable() argument
1465 struct nouveau_encoder *outp = mstm->outp; in nv50_mstm_enable()
1485 struct nv50_mstm *mstm = outp->dp.mstm; in nv50_mstm_detect() local
1489 if (!mstm || !mstm->can_mst) in nv50_mstm_detect()
1492 aux = mstm->mgr.aux; in nv50_mstm_detect()
1502 ret = nv50_mstm_enable(mstm, true); in nv50_mstm_detect()
1506 ret = drm_dp_mst_topology_mgr_set_mst(&mstm->mgr, true); in nv50_mstm_detect()
1508 nv50_mstm_enable(mstm, false); in nv50_mstm_detect()
1512 mstm->is_mst = true; in nv50_mstm_detect()
1519 struct nv50_mstm *mstm = outp->dp.mstm; in nv50_mstm_fini() local
1521 if (!mstm) in nv50_mstm_fini()
1529 mstm->suspended = true; in nv50_mstm_fini()
1532 if (mstm->is_mst) in nv50_mstm_fini()
1533 drm_dp_mst_topology_mgr_suspend(&mstm->mgr); in nv50_mstm_fini()
1539 struct nv50_mstm *mstm = outp->dp.mstm; in nv50_mstm_init() local
1542 if (!mstm) in nv50_mstm_init()
1545 if (mstm->is_mst) { in nv50_mstm_init()
1546 ret = drm_dp_mst_topology_mgr_resume(&mstm->mgr, !runtime); in nv50_mstm_init()
1548 nv50_mstm_remove(mstm); in nv50_mstm_init()
1552 mstm->suspended = false; in nv50_mstm_init()
1556 drm_kms_helper_hotplug_event(mstm->mgr.dev); in nv50_mstm_init()
1562 struct nv50_mstm *mstm = *pmstm; in nv50_mstm_del() local
1563 if (mstm) { in nv50_mstm_del()
1564 drm_dp_mst_topology_mgr_destroy(&mstm->mgr); in nv50_mstm_del()
1576 struct nv50_mstm *mstm; in nv50_mstm_new() local
1579 if (!(mstm = *pmstm = kzalloc(sizeof(*mstm), GFP_KERNEL))) in nv50_mstm_new()
1581 mstm->outp = outp; in nv50_mstm_new()
1582 mstm->mgr.cbs = &nv50_mstm; in nv50_mstm_new()
1584 ret = drm_dp_mst_topology_mgr_init(&mstm->mgr, dev, aux, aux_max, in nv50_mstm_new()
1761 nv50_mstm_del(&nv_encoder->dp.mstm); in nv50_sor_destroy()
1845 &nv_encoder->dp.mstm); in nv50_sor_create()
2005 struct nv50_mstm *mstm; in nv50_disp_atomic_commit_core() local
2012 mstm = nouveau_encoder(encoder)->dp.mstm; in nv50_disp_atomic_commit_core()
2013 if (mstm && mstm->modified) in nv50_disp_atomic_commit_core()
2014 nv50_mstm_prepare(mstm); in nv50_disp_atomic_commit_core()
2026 mstm = nouveau_encoder(encoder)->dp.mstm; in nv50_disp_atomic_commit_core()
2027 if (mstm && mstm->modified) in nv50_disp_atomic_commit_core()
2028 nv50_mstm_cleanup(mstm); in nv50_disp_atomic_commit_core()