MCPcopy Create free account
hub / github.com/F-Stack/f-stack / a10fb_hdmi_event

Function a10fb_hdmi_event

freebsd/arm/allwinner/a10_fb.c:528–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528static void
529a10fb_hdmi_event(void *arg, device_t hdmi_dev)
530{
531 const struct videomode *mode;
532 struct videomode hdmi_mode;
533 struct a10fb_softc *sc;
534 struct edid_info ei;
535 uint8_t *edid;
536 uint32_t edid_len;
537 int error;
538
539 sc = arg;
540 edid = NULL;
541 edid_len = 0;
542 mode = NULL;
543
544 error = HDMI_GET_EDID(hdmi_dev, &edid, &edid_len);
545 if (error != 0) {
546 device_printf(sc->dev, "failed to get EDID: %d\n", error);
547 } else {
548 error = edid_parse(edid, &ei);
549 if (error != 0) {
550 device_printf(sc->dev, "failed to parse EDID: %d\n",
551 error);
552 } else {
553 if (bootverbose)
554 edid_print(&ei);
555 mode = ei.edid_preferred_mode;
556 }
557 }
558
559 /* If the preferred mode could not be determined, use the default */
560 if (mode == NULL)
561 mode = pick_mode_by_ref(FB_DEFAULT_W, FB_DEFAULT_H,
562 FB_DEFAULT_REF);
563
564 if (mode == NULL) {
565 device_printf(sc->dev, "failed to find usable video mode\n");
566 return;
567 }
568
569 if (bootverbose)
570 device_printf(sc->dev, "using %dx%d\n",
571 mode->hdisplay, mode->vdisplay);
572
573 /* Disable HDMI */
574 HDMI_ENABLE(hdmi_dev, 0);
575
576 /* Disable timing controller */
577 a10fb_enable_tcon(sc, 0);
578
579 /* Configure DEBE and TCON */
580 error = a10fb_configure(sc, mode);
581 if (error != 0) {
582 device_printf(sc->dev, "failed to configure FB: %d\n", error);
583 return;
584 }
585

Callers

nothing calls this directly

Calls 4

device_printfFunction · 0.85
a10fb_enable_tconFunction · 0.85
a10fb_configureFunction · 0.85
DELAYFunction · 0.50

Tested by

no test coverage detected