/* Failing that, a completely unused OR is the next best thing. */
list_for_each_entry(ior, &outp->disp->iors, head) { if (!ior->identity && ior->hda == hda &&
!ior->asy.outp && ior->type == type && !ior->arm.outp &&
(ior->func->route.set || ior->id == __ffs(outp->info.or))) return nvkm_outp_acquire_ior(outp, user, ior);
}
/* Last resort is to assign an OR that's already active on HW, *butwillbereleasedduringthenextmodeset.
*/
list_for_each_entry(ior, &outp->disp->iors, head) { if (!ior->identity && ior->hda == hda &&
!ior->asy.outp && ior->type == type &&
(ior->func->route.set || ior->id == __ffs(outp->info.or))) return nvkm_outp_acquire_ior(outp, user, ior);
}
/* Lookup a compatible, and unused, OR to assign to the device. */
proto = nvkm_outp_xlat(outp, &type); if (proto == UNKNOWN) return -ENOSYS;
/* Deal with panels requiring identity-mapped SOR assignment. */ if (outp->identity) {
ior = nvkm_ior_find(outp->disp, SOR, ffs(outp->info.or) - 1); if (WARN_ON(!ior)) return -ENOSPC; return nvkm_outp_acquire_ior(outp, user, ior);
}
/* First preference is to reuse the OR that is currently armed *onHW,ifany,inordertopreventunnecessaryswitching.
*/
list_for_each_entry(ior, &outp->disp->iors, head) { if (!ior->identity && !ior->asy.outp && ior->arm.outp == outp) { /*XXX: For various complicated reasons, we can't outright switch *theboot-timeORonthefirstmodesetwithoutsomefairly *invasivechanges. * *ThesystemsthatwerefixedbymodifyingtheORselection *codetoaccountforHDAsupportshouldn'tregresshereas *theHDA-enabledORsmatchtherelevantoutput'spadmacro *index,andthefirmwareseemstoselectanORthisway. * *Thiswarningistomakeitobviousifthatproveswrong.
*/
WARN_ON(hda && !ior->hda); return nvkm_outp_acquire_ior(outp, user, ior);
}
}
/* If we don't need HDA, first try to acquire an OR that doesn't *supportittoleavefreetheonesthatdo.
*/ if (!hda) { if (!nvkm_outp_acquire_hda(outp, type, user, false)) return0;
/* Use a HDA-supporting SOR anyway. */ return nvkm_outp_acquire_hda(outp, type, user, true);
}
/* We want HDA, try to acquire an OR that supports it. */ if (!nvkm_outp_acquire_hda(outp, type, user, true)) return0;
/* There weren't any free ORs that support HDA, grab one that *doesn'tandatleastallowdisplaytoworkstill.
*/ return nvkm_outp_acquire_hda(outp, type, user, false);
}
int
nvkm_outp_bl_set(struct nvkm_outp *outp, int level)
{ int ret;
ret = nvkm_outp_acquire_or(outp, NVKM_OUTP_PRIV, false); if (ret) return ret;
if (outp->ior->func->bl)
ret = outp->ior->func->bl->set(outp->ior, level); else
ret = -EINVAL;
int
nvkm_outp_detect(struct nvkm_outp *outp)
{ struct nvkm_gpio *gpio = outp->disp->engine.subdev.device->gpio; int ret = -EINVAL;
if (outp->conn->info.hpd != DCB_GPIO_UNUSED) {
ret = nvkm_gpio_get(gpio, 0, DCB_GPIO_UNUSED, outp->conn->info.hpd); if (ret < 0) return ret; if (ret) return1;
/*TODO: Look into returning NOT_PRESENT if !HPD on DVI/HDMI. * *It'suncertainwhetherthisisaccurateforallolderchipsets, *sowe'rereturningUNKNOWN,andtheDRMwillprobeDDCinstead.
*/ if (outp->info.type == DCB_OUTPUT_DP) return0;
}
/* Find any OR from the class that is able to support this device. */
proto = nvkm_outp_xlat(outp, &type); if (proto == UNKNOWN) return NULL;
ior = nvkm_ior_find(disp, type, -1); if (WARN_ON(!ior)) return NULL;
/* Determine the specific OR, if any, this device is attached to. */ if (ior->func->route.get) {
id = ior->func->route.get(outp, &link); if (id < 0) {
OUTP_DBG(outp, "no route"); return NULL;
}
} else { /* Prior to DCB 4.1, this is hardwired like so. */
id = ffs(outp->info.or) - 1;
link = (ior->type == SOR) ? outp->info.sorconf.link : 0;
}
ior = nvkm_ior_find(disp, type, id); if (WARN_ON(!ior)) return NULL;
/* Find any OR from the class that is able to support this device. */
proto = nvkm_outp_xlat(outp, &type);
ior = outp->func->inherit(outp); if (!ior) return;
/* Determine if the OR is already configured for this device. */
ior->func->state(ior, &ior->arm); if (!ior->arm.head || ior->arm.proto != proto) {
OUTP_DBG(outp, "no heads (%x %d %d)", ior->arm.head,
ior->arm.proto, proto);
/* The EFI GOP driver on Ampere can leave unused DP links routed, *whichwedon'texpect.TheDisableLTIEDscript*should*get *usbacktowhereweneedtobe.
*/ if (ior->func->route.get && !ior->arm.head && outp->info.type == DCB_OUTPUT_DP)
nvkm_dp_disable(outp, ior);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.